No audio with iOS client on pure ipv6 network

We have a voip app that uses RN JsSip and thus RN WebRTC. The SIP and STUN servers we are trying to connect to are set up to be ipv4 only.

This all works fine on the Android clients no matter what network they are connected to - presumably because of the 464XLAT built into Android.On iOS it works on an ipv4 network.

But on an ipv6 only network - for example an ipv6 only mobile network - there is no audio when the call connects. I can reproduce this using the OSX NAT64 wifi network sharing test setup.

I do have a full log for this but unfortuately as a new user it says I am posting more than two links when I add bit of the log in.

What I think is happening is:

WebRTC seems to gather a set of ipv4 and ipv6 ICE candidates fine on both udp and tcp - here is the log for the udp ones:

(basic_port_allocator.cc:907): Port[6010c00:audio:1:0:local:Net[en0:2001:2:0:x:x:x:x:x/64:Wifi:id=11]]: Added port to allocator
(basic_port_allocator.cc:925): Port[6010c00:audio:1:0:local:Net[en0:2001:2:0:x:x:x:x:x/64:Wifi:id=11]]: Gathered candidate: Cand[:2292354713:1:udp:2122262783:[2001:2:0:x:x:x:x:x]:56000:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:11:10:0]
(basic_port_allocator.cc:958): Port[6010c00:audio:1:0:local:Net[en0:2001:2:0:x:x:x:x:x/64:Wifi:id=11]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[6010c00:audio:1:0:local:Net[en0:2001:2:0:x:x:x:x:x/64:Wifi:id=11]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[en0:169.254.0.x/16:Wifi:id=10]: Allocation Phase=Udp
(port.cc:187): Port[6818c00::1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: Port created with network cost 10
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[6818c00:audio:1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: Added port to allocator
(basic_port_allocator.cc:925): Port[6818c00:audio:1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: Gathered candidate: Cand[:136466133:1:udp:2122194687:169.254.37.x:58462:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:10:10:0]
(basic_port_allocator.cc:958): Port[6818c00:audio:1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[6818c00:audio:1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[en2:169.254.0.x/16:Wifi:id=2]: Allocation Phase=Udp
(port.cc:187): Port[18418800::1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: Port created with network cost 10
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[18418800:audio:1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: Added port to allocator
(basic_port_allocator.cc:925): Port[18418800:audio:1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: Gathered candidate: Cand[:1007514039:1:udp:2122129151:169.254.159.x:62452:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:2:10:0]
(basic_port_allocator.cc:958): Port[18418800:audio:1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[18418800:audio:1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]: Allocation Phase=Udp
(port.cc:187): Port[6086000::1:0:local:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]]: Port created with network cost 900
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[6086000:audio:1:0:local:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]]: Added port to allocator
(basic_port_allocator.cc:925): Port[6086000:audio:1:0:local:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]]: Gathered candidate: Cand[:1573866894:1:udp:2122063615:10.150.47.x:51925:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:9:900:0]
(basic_port_allocator.cc:958): Port[6086000:audio:1:0:local:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[6086000:audio:1:0:local:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]: Allocation Phase=Udp
(port.cc:187): Port[18b74c00::1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]]: Port created with network cost 50
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[18b74c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]]: Added port to allocator
(basic_port_allocator.cc:925): Port[18b74c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]]: Gathered candidate: Cand[:2829406670:1:udp:2122003199:[fd74:6572:6d6e:x:x:x:x:x]:57621:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:3:50:0]
(basic_port_allocator.cc:958): Port[18b74c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[18b74c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=3]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]: Allocation Phase=Udp
(port.cc:187): Port[6087c00::1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]]: Port created with network cost 50
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[6087c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]]: Added port to allocator
(basic_port_allocator.cc:925): Port[6087c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]]: Gathered candidate: Cand[:3801864837:1:udp:2121937663:[fd74:6572:6d6e:x:x:x:x:x]:59822:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:4:50:0]
(basic_port_allocator.cc:958): Port[6087c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]]: Port ready.
(basic_ice_controller.cc:541): Sorting 0 available connections
(basic_port_allocator.cc:1069): Port[6087c00:audio:1:0:local:Net[ipsec0:fd74:6572:6d6e:x:x:x:x:x/128:VPN/Unknown:id=4]]: Port completed gathering candidates.
(basic_port_allocator.cc:1361): Net[ipsec2:fd74:6572:6d6e:x:x:x:x:x/64:VPN/Unknown:id=6]: Allocation Phase=Udp
(port.cc:187): Port[18bb4800::1:0:local:Net[ipsec2:fd74:6572:6d6e:x:x:x:x:x/64:VPN/Unknown:id=6]]: Port created with network cost 50
(basic_port_allocator.cc:885): Adding allocated port for audio
(basic_port_allocator.cc:907): Port[18bb4800:audio:1:0:local:Net[ipsec2:fd74:6572:6d6e:x:x:x:x:x/64:VPN/Unknown:id=6]]: Added port to allocator
(basic_port_allocator.cc:925): Port[18bb4800:audio:1:0:local:Net[ipsec2:fd74:6572:6d6e:x:x:x:x:x/64:VPN/Unknown:id=6]]: Gathered candidate: Cand[:2829406670:1:udp:2121872127:[fd74:6572:6d6e:x:x:x:x:x]:61856:local::0:o7g6:zJ3M638GnQ1yDOiiNNTgaGA0:6:50:0]
(basic_port_allocator.cc:958): Port[18bb4800:audio:1:0:local:Net[ipsec2:fd74:6572:6d6e:x:x:x:x:x/64:VPN/Unknown:id=6]]: Port ready.

Those are then sent to the SIP server over SDP:

a=candidate:2292354713 1 udp 2122262783 2001:2:0:aab1:d94e:3c0e:739e:ca69 56000 typ host generation 0 network-id 11 network-cost 10
a=candidate:136466133 1 udp 2122194687 169.254.37.4 58462 typ host generation 0 network-id 10 network-cost 10
a=candidate:1007514039 1 udp 2122129151 169.254.159.187 62452 typ host generation 0 network-id 2 network-cost 10
a=candidate:1573866894 1 udp 2122063615 10.150.47.255 51925 typ host generation 0 network-id 9 network-cost 900
a=candidate:2829406670 1 udp 2122003199 fd74:6572:6d6e:7573:c:6f39:503d:43b9 57621 typ host generation 0 network-id 3 network-cost 50
a=candidate:3801864837 1 udp 2121937663 fd74:6572:6d6e:7573:d:6f39:503d:43b9 59822 typ host generation 0 network-id 4 network-cost 50
a=candidate:2829406670 1 udp 2121872127 fd74:6572:6d6e:7573:c:6f39:503d:43b9 61856 typ host generation 0 network-id 6 network-cost 50
a=candidate:2486661909 1 udp 2121801471 10.254.254.254 51341 typ host generation 0 network-id 5 network-cost 50
a=candidate:3324080745 1 tcp 1518283007 2001:2:0:aab1:d94e:3c0e:739e:ca69 50731 typ host tcptype passive generation 0 network-id 11 network-cost 10
a=candidate:1185002021 1 tcp 1518214911 169.254.37.4 50732 typ host tcptype passive generation 0 network-id 10 network-cost 10
a=candidate:1921944903 1 tcp 1518149375 169.254.159.187 50733 typ host tcptype passive generation 0 network-id 2 network-cost 10
a=candidate:323793278 1 tcp 1518083839 10.150.47.255 50734 typ host tcptype passive generation 0 network-id 9 network-cost 900
a=candidate:3861294398 1 tcp 1518023423 fd74:6572:6d6e:7573:c:6f39:503d:43b9 50735 typ host tcptype passive generation 0 network-id 3 network-cost 50
a=candidate:2887263861 1 tcp 1517957887 fd74:6572:6d6e:7573:d:6f39:503d:43b9 50736 typ host tcptype passive generation 0 network-id 4 network-cost 50
a=candidate:3861294398 1 tcp 1517892351 fd74:6572:6d6e:7573:c:6f39:503d:43b9 50737 typ host tcptype passive generation 0 network-id 6 network-cost 50
a=candidate:3669266405 1 tcp 1517821695 10.254.254.254 50738 typ host tcptype passive generation 0 network-id 5 network-cost 50

The server sends back a SDP message with a single ipv4 udp host to connect to:

v=0
o=aculab-0341CC01 1791857504 866470158 IN IP4 185.28.212.x
s=-
t=0 0
m=audio 36692 RTP/SAVP 111 110
c=IN IP4 185.28.212.x
a=mid:audio
a=rtpmap:111 OPUS/48000/2
a=rtpmap:110 telephone-event/48000
a=fmtp:111 minptime=20; maxplaybackrate=8000; maxaveragebitrate=24000; useinbandfec=1
a=sendrecv
a=rtcp:36692
a=rtcp-mux
a=setup:active
a=fingerprint:sha-1 B6:13:2B:EB:B8:5B:5A:E0:72:53:D5:16:4D:AB:82:8B:21:95:4C:0C
a=ice-ufrag:6uNHmoiH
a=ice-pwd:y0bZ6hl7uLyhnQQczOQ4ROgjSc
a=ice-options:trickle
a=candidate:tEf1eYdh55lQpEB9 1 UDP 2130706431 185.28.212.x 36692 typ host
a=end-of-candidates

WebRTC then seems to try to send pings to the ipv4 STUN host address over the ipv4 interfaces it collected earlier, but not over any ipv6 interfaces:

(connection.cc:852): Conn[c81fc00:audio:Net[en0:169.254.0.x/16:Wifi:id=10]:qHiDldP9:1:0:local:udp:169.254.37.x:58462->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114756780671369214|-]: Sending STUN ping, id=396a4133706d2b5545775567, nomination=0
(stun_port.cc:308): Port[6818c00:audio:1:0:local:Net[en0:169.254.0.x/16:Wifi:id=10]]: UDP send of 104 bytes to host 185.28.212.x:36692 (185.28.212.x:36692) failed with error 65
(connection.cc:445): Conn[c81fc00:audio:Net[en0:169.254.0.x/16:Wifi:id=10]:qHiDldP9:1:0:local:udp:169.254.37.x:58462->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114756780671369214|-]: Failed to send STUN ping err=-1 id=396a4133706d2b5545775567
(connection.cc:1167): Conn[c81fc00:audio:Net[en0:169.254.0.x/16:Wifi:id=10]:qHiDldP9:1:0:local:udp:169.254.37.x:58462->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114756780671369214|-]: Sent STUN BINDING request, id=396a4133706d2b5545775567, use_candidate=1, nomination=0
(connection.cc:790): Conn[c81fc00:audio:Net[en0:169.254.0.x/16:Wifi:id=10]:qHiDldP9:1:0:local:udp:169.254.37.x:58462->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114756780671369214|-]: UpdateState(), ms since last received response=664358494, ms since last received data=664358494, rtt=6000, pings_since_last_response=494b73686b464f47356d3830 396a4133706d2b5545775567
(connection.cc:790): Conn[b87aa00:audio:Net[en2:169.254.0.x/16:Wifi:id=2]:57gbue1d:1:0:local:udp:169.254.159.x:62452->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114475305694658558|-]: UpdateState(), ms since last received response=664358494, ms since last received data=664358494, rtt=6000, pings_since_last_response=765866383658523042556772
(connection.cc:790): Conn[b860000:audio:Net[ipsec2:10.254.254.x/32:VPN/Unknown:id=5]:9g/JYV3A:1:0:local:udp:10.254.254.x:51341->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9113067930811105278|-]: UpdateState(), ms since last received response=664358494, ms since last received data=664358494, rtt=6000, pings_since_last_response=593030516674666368507876
(connection.cc:790): Conn[b893200:audio:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]:ZugAm0Cd:1:0:local:udp:10.150.47.x:51925->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114193830717947902|-]: UpdateState(), ms since last received response=664358494, ms since last received data=664358494, rtt=6000, pings_since_last_response=776366754f6d503663317632
(connection.cc:852): Conn[b87aa00:audio:Net[en2:169.254.0.x/16:Wifi:id=2]:57gbue1d:1:0:local:udp:169.254.159.x:62452->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114475305694658558|-]: Sending STUN ping, id=7a7062517152652b7a577163, nomination=0
(stun_port.cc:308): Port[18418800:audio:1:0:local:Net[en2:169.254.0.x/16:Wifi:id=2]]: UDP send of 104 bytes to host 185.28.212.x:36692 (185.28.212.x:36692) failed with error 65
(connection.cc:445): Conn[b87aa00:audio:Net[en2:169.254.0.x/16:Wifi:id=2]:57gbue1d:1:0:local:udp:169.254.159.x:62452->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114475305694658558|-]: Failed to send STUN ping err=-1 id=7a7062517152652b7a577163
(connection.cc:1167): Conn[b87aa00:audio:Net[en2:169.254.0.x/16:Wifi:id=2]:57gbue1d:1:0:local:udp:169.254.159.x:62452->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114475305694658558|-]: Sent STUN BINDING request, id=7a7062517152652b7a577163, use_candidate=1, nomination=0
(connection.cc:790): Conn[c81fc00:audio:Net[en0:169.254.0.x/16:Wifi:id=10]:qHiDldP9:1:0:local:udp:169.254.37.x:58462->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114756780671369214|-]: UpdateState(), ms since last received response=664358548, ms since last received data=664358548, rtt=6000, pings_since_last_response=494b73686b464f47356d3830 396a4133706d2b5545775567
(connection.cc:790): Conn[b87aa00:audio:Net[en2:169.254.0.x/16:Wifi:id=2]:57gbue1d:1:0:local:udp:169.254.159.x:62452->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114475305694658558|-]: UpdateState(), ms since last received response=664358548, ms since last received data=664358548, rtt=6000, pings_since_last_response=765866383658523042556772 7a7062517152652b7a577163
(connection.cc:790): Conn[b860000:audio:Net[ipsec2:10.254.254.x/32:VPN/Unknown:id=5]:9g/JYV3A:1:0:local:udp:10.254.254.x:51341->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9113067930811105278|-]: UpdateState(), ms since last received response=664358548, ms since last received data=664358548, rtt=6000, pings_since_last_response=593030516674666368507876
(connection.cc:790): Conn[b893200:audio:Net[pdp_ip0:10.150.47.x/32:Cellular:id=9]:ZugAm0Cd:1:0:local:udp:10.150.47.x:51925->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9114193830717947902|-]: UpdateState(), ms since last received response=664358548, ms since last received data=664358548, rtt=6000, pings_since_last_response=776366754f6d503663317632
(connection.cc:852): Conn[b860000:audio:Net[ipsec2:10.254.254.x/32:VPN/Unknown:id=5]:9g/JYV3A:1:0:local:udp:10.254.254.x:51341->wiVPsF5F:1:2130706431:local:udp:185.28.212.x:36692|C–I|-|0|0|9113067930811105278|-]: Sending STUN ping, id=75594d6f6278393352653478, nomination=0
(stun_port.cc:308): Port[18b91200:audio:1:0:local:Net[ipsec2:10.254.254.x/32:VPN/Unknown:id=5]]: UDP send of 104 bytes to host 185.28.212.x:36692 (185.28.212.x:36692) failed with error 65

These pings naturally fail with error 65 since there is no route for them to complete successfully given they are trying to send on a ipv4 interface when there is only a ipv6 connection from the device. It never tires to send the pings on any ipv6 interfaces.

Hopefully someone can give me some pointers on:

  • Why is WebRTC not trying to use the ipv6 interfaces to send the STUN pings? It clearly can access these as it gathered them during the candidate phase.

  • Why is WebRTC not trying to synthesise an ipV6 address for the STUN server from the ipv4 address so that the message will traverse the NAT64 gateway?

  • Is there perhaps something in the SDP response that is causing WebRTC to ignore ipv6?

  • Is there some extra WebRTC config that is needed on iOS to make it work with ipv6?

I hope someone can point me in the right direction.

Thanks, Simon.