[sr-dev] [kamailio/kamailio] Sending OPTIONS using uac module fails after first attempt in a NATed scenario (#2231)

Supreeth Herle notifications at github.com
Wed Feb 26 13:27:36 CET 2020


### Setup Description + Problem Description

I am running a open5gs (4G Core network) in an OpenStack VM with internal IP 10.4.128.6 and Floating IP 172.24.15.10 and entire (Kamailio IMS + FoHSS) system in another OpenStack VM with internal IP 10.4.128.21 and Floating IP 172.24.15.30. 
eNB (srslte) is running on a physical machine with IP 192.168.49.125.

Kamailio is built from the sources using the forked repo in this [link](https://github.com/herlesupreeth/kamailio/tree/5.3). This forked repo has a fix for handling IMS registration when 4G Core Network is behind a NAT among other fixes.

IMS config files - 
[Kamailio_IMS_Config.zip](https://github.com/kamailio/kamailio/files/4255538/Kamailio_IMS_Config.zip)

PCSCF, SCSCF, ICSCF are run as separate systemctl process

LTE UEs are configured with two APNs
- "internet" APN for best effort traffic - IP range 192.168.100.0/24
- "ims" APN for IMS - IP range 192.168.101.0/24.

Upon performing the IMS registration, uac module is being used to achieve NATPING by sending OPTIONS message as per the PCSCF script. However, I observe a strange behaviour where the first OPTIONS message sent by the PCSCF is replied with 200 OK and the subsequent message times out with 408 (most of the times even the first OPTIONS message does'nt gets a 200 OK)

!!! IMPORTANT NOTE !!
This behaviour is not seen if I run the 4G Core Network and Kamailio IMS + FoHSS is run in a single VM i.e. CN not behind a NAT

#### Reproduction

Upon performing the IMS registration, uac module is being used to achieve NATPING by sending OPTIONS message as per the PCSCF script. However, I observe a strange behaviour where the first OPTIONS message sent by the PCSCF is replied with 200 OK and the subsequent message times out with 408 (most of the times even the first OPTIONS message does'nt gets a 200 OK)

#### Debugging Data

PCAP at eNB machine and VM running (Kamailio IMS + FoHSS) attached below - 
[pcaps.zip](https://github.com/kamailio/kamailio/files/4255628/pcaps.zip)

#### Log Messages

Since the log message from PCSCF, SCSCF and ICSCF is too long I am attaching it as file below.
Following is the log from journalctl for PCSCF, SCSCF and ICSCF combined
[kamailio_log.txt](https://github.com/kamailio/kamailio/files/4255561/kamailio_log.txt)


### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.3.2 (x86_64/linux) 842fef
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 842fef 
compiled on 11:43:39 Feb 26 2020 with gcc 7.4.0
```

* **Operating System**:

```
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
```

I am not sure where to start looking for debugging this strange behaviour, any hints or pointer would be really helpful. Many thanks in advance.

Regards,
Supreeth


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2231
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200226/f0ebdbdb/attachment.html>


More information about the sr-dev mailing list