Hello all!
I'm developing webrtc gateway and facing with problem during ICE negotiation - chrome chooses different candidate pair than my gateway.
Connection is made from my gateway to Chrome, Gateway is located at public network and has public IP 2.2.2.2 (anonymized) and works on port 5074.
Chrome works on machine (windows 7) located in private network with public IP 1.1.1.1 and this machine has 2 nic connected to internet (private ip 172.17.0.1 and 192.168.225.133)
Connectivity checks completed successfully, but chrome chooses candidate pair (1.1.1.1 53303; 2.2.2.2 5074), which priority should be lower than priority of other pair (1.1.1.1 48874; 2.2.2.2 5074).
My assumption is based on following things
Chrome candidates
a=candidate:3885250869 1 udp 2122260223 172.17.0.1 48874 typ host generation 0
a=candidate:1153304712 1 udp 2122129151 192.168.225.133 53303 typ host generation 0
a=candidate:79019993 1 udp 1686052607 1.1.1.1 48874 typ srflx raddr 172.17.0.1 rport 48874 generation 0
a=candidate:762595145 1 udp 1685921535 1.1.1.1 53303 typ srflx raddr 192.168.225.133 rport 53303 generation 0 So, candidate 1.1.1.1 48874 has higher priority
My Gateway candidates
a=candidate:711375391 1 udp 2130706431 2.2.2.2 5074 typ host
a=candidate:711375391 2 udp 2130706430 2.2.2.2 5074 typ host
According to rfc
"Let G be the priority for the candidate provided by the controlling
agent. Let D be the priority for the candidate provided by the
controlled agent.
pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0)"
In this case G is my gateway, D is chrome
So, according to the formula should be used 1.1.1.1 48874, but chrome chooses 1.1.1.1 53303 and send DTLS to it, therefore overal connection fails.
Please help me to determine cause of this wrong behaviour. I'm highly appreciate any help!
SDP from chrome, SDP from gateway, and STUN dialogs provided in attached files