I’m running MediaSoup on AWS ECS with both ipv4 and ipv6 listening address. My listenIps looks like this:
[
{ "ip":"2406:da12:f97:b302:e5de:b9ff:627d:d412" },
{ "ip":"172.31.2.28", "announcedIp":"13.124.39.172" }
]
I’m not using a STUN or TURN server.
I have a user that is coming from an ISP which gives him an IPv6 IP. However, he appears as an IPv4 IP to the rest of the Internet, and he is only able to connect to other IPv4 IPs. So he’s behind some kind of IPv6 NAT. He’s on a wired connection and using react-native-webrtc on iOS.
This user is able to create WebRTCTransports with my server but only in the receive direction.
When he creates a transport, both send and receive try to select IPv6 tuples first. The receive transport then falls back to the (correct) IPv4 tuple. The send transport seems stuck on the IPv6 tuple.
Log for the recv transport that worked:
2021-04-16T16:47:44.669000+00:00 [WebRtcTransport created] direction=recv
2021-04-16T16:47:45.081000+00:00 [consumer created] consumerId=70253e88-8ea7-4344-9302-5ff328e9ba90
2021-04-16T16:47:46.280000+00:00 [iceselectedtuplechange - transport] tuple=[2406:da12:f97:b302:e5de:b9ff:627d:d412]:45819 <--> [2804:499c:1010:5900:f9d6:d37f:79f8:205e]:50070 (udp)
2021-04-16T16:47:46.280000+00:00 [iceState - transport] iceState=connected
2021-04-16T16:47:46.280000+00:00 [dtlsState - transport] dtlsState=connecting
2021-04-16T16:47:46.655000+00:00 [iceselectedtuplechange - transport] tuple=172.31.2.28:45703 <--> 45.229.212.158:2224 (udp)
2021-04-16T16:47:46.946000+00:00 [dtlsState - transport] dtlsState=connected
2021-04-16T16:47:47.549000+00:00 [iceState - transport] iceState=completed
2021-04-16T16:48:08.419000+00:00 [socket-io closes]
Mediasoup log while created send transport (Gets stuck):
2021-04-16T16:47:49.486000+00:00 [WebRtcTransport created] direction=send
2021-04-16T16:47:50.176000+00:00 [producer created] producerId=fbec1fa0-4c5b-470d-9ac2-463f6566bc68
2021-04-16T16:47:50.198000+00:00 [iceselectedtuplechange - transport] tuple=[2406:da12:f97:b302:e5de:b9ff:627d:d412]:42634 <--> [2804:499c:1010:5900:f9d6:d37f:79f8:205e]:54058 (udp)
2021-04-16T16:47:50.198000+00:00 [iceState - transport] iceState=connected
2021-04-16T16:47:50.198000+00:00 [dtlsState - transport] dtlsState=connecting
2021-04-16T16:48:08.420000+00:00 [socket-io close]
Interestingly, on the client side I can look at getStats() for the send transport. It looks like the client side has already moved onto the correct IPv4 tuple, but I haven’t gotten the corresponding iceselectedtuplechange on mediasoup.
// stats for the correct ipv4 tuple
"RTCIceCandidatePair_JMS4xwQ6_CE13iTBU": {
"id": "RTCIceCandidatePair_JMS4xwQ6_CE13iTBU",
"type": "candidate-pair",
"state": "succeeded",
"priority": "4623671794094325247",
"writable": "1",
"bytesSent": "0",
"nominated": "1",
"timestamp": 1618591684453.631,
"transportId": "RTCTransport_audio_1",
"requestsSent": "2",
"bytesReceived": "0",
"responsesSent": "0",
"localCandidateId": "RTCIceCandidate_JMS4xwQ6",
"requestsReceived": "0",
"remoteCandidateId": "RTCIceCandidate_CE13iTBU",
"responsesReceived": "10",
"totalRoundTripTime": "3.037",
"consentRequestsSent": "8",
"currentRoundTripTime": "0.286"
},
// stats for the failed ipv6 tuple
"RTCIceCandidatePair_R3mjjoRD_rpvkPlCQ": {
"id": "RTCIceCandidatePair_R3mjjoRD_rpvkPlCQ",
"type": "candidate-pair",
"state": "in-progress",
"priority": "4623781745794109951",
"writable": "0",
"bytesSent": "0",
"nominated": "0",
"timestamp": 1618591684453.631,
"transportId": "RTCTransport_audio_1",
"requestsSent": "141",
"bytesReceived": "0",
"responsesSent": "0",
"localCandidateId": "RTCIceCandidate_R3mjjoRD",
"requestsReceived": "0",
"remoteCandidateId": "RTCIceCandidate_rpvkPlCQ",
"responsesReceived": "0",
"totalRoundTripTime": "0",
"consentRequestsSent": "0"
},
My questions:
What is the difference between the ice handshake on send transports and receive transports? I had thought they were pretty much the same, but this user seems to be consistently able to create recv transports, but not sends. Anyone have a good tip on where to look next?
Thank you!