Re: Possible bug in NAT64 Implementation - STUN IPv4 resolution fails causing 70 sec delay in starting a call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have Thoroughly investigated this issue and it is a serious bug in PJSIP in IPv6 only networks and the Fix #1962 is contributing to it.

Problem: Second call and after takes 64 sec to start (send the INVITE to the other party). The first call after startup starts normally.

Procedure:

- Make the first call in a IPv6 only env. PJSIP will try IPv4 resolve which will fail, it then tries IPv6 which works and the resolved IP address is Cached.
- Make a second call, PJSIP calls resolve_stun_entry to try IPv4 resolution which will PICK UP the cached IP (SYNC resolution).  Since the IP is cached the callback and STUN Binding message is synchronously tried (and fails). It then calls test_stun_on_status with error and with the fix 1962 it will return without calling  resolve_stun_entry again for IPv6.
- The first call resolve_stun_entry will return successfully to  pjsua_resolve_stun_servers.
- pjsua_resolve_stun_servers loops for 64 sec waiting for resolve_stun_entry before Timeout and returns with TIMEOUT Error (Since the test_stun_on_status didn't try IPv6). This is not practical to wait 64 sec to start a call.
- The method that called pjsua_resolve_stun_servers method ignores the failure (by setting) and tries a  A/AAAA resolution for the STUN server and continue the call.


Solution:
- For now I am using the stun_try_ipv6 flag to skip IPv4 resolution which always fails in an IPv6 env. (I believe the code needs bigger refactoring).


Please let me know what you think?

Thanks,
Imad



On Thursday, July 5, 2018, 8:33:15 PM PDT, Imad Khazali <ikhazali@xxxxxxxxx> wrote:


Hi,

I am using PJSIP in an IPV6 only network and noticed that when initiating a call most of the time it takes around 70 seconds for the INVITE to be sent. After debugging the issue I noticed that the method "resolve_stun_entry" , pjsua_core. file, tries IPv4 STUN resolution fails with "Network Unavailable". I put a small hack just to disable the IPv4 resolution and only use IPv6 if the network is NAT64.

Could please verify if this a bug? why do PJSIP always try IPv4 on a NAT64 network ... it always failing and either gets into a deadlock or a timeout?

Thanks,
Imad


_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux