This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UDP not receiving packets after a while

Hello

I'm having problem with UDP reception. I'm using nrf9160 with modem firmware 1.2.3, nRF Connect SDK v1.4.0, LTE-M.

I can receive UDP packets in the device as long as I keep them coming. If I don't send any packets to the device (nRF9160) from my PC for a while (~50-60s), when I start sending packets again they are not received by the application in the device. I can get it working again by sending a packet from the device (nRF9160) to the PC.

The device is not on the internet, so NAT is not a problem. I can see that the device is receiving the packet since it is logging that it goes into RRC connected state as soon as I send it (and after a while back into RRC idle state). I also monitor the current/power profile and see that the device wakes up to receive the packet. 

However, the application is not notified of the packets. No matter how many I send. The application will not receive any packets until the application send a packet itself. After sending an UDP packet it can receive packets again.

Surely this must be a bug (probably in the IP stack, in the modem?)?

Thanks for your help.

Best regards
Mattias Eriksson

Parents
  • Sorry about this, it's not a bug.

    It was a NAT at our end in the "other" direction. I used connected UDP sockets (I have called connect() on the socket), so datagrams are only received from a specific address. As long as the NAT had a session the packets from my PC got the same source address as the device destination address. But when the session expired the packets from my PC got a generic source address and the device (nRF9160) received them but since I have connected the UDP socket to a specific address the packets was not forwarded to the application.

    Sorry about posting this issue!

    Best regards
    Mattias Eriksson

Reply
  • Sorry about this, it's not a bug.

    It was a NAT at our end in the "other" direction. I used connected UDP sockets (I have called connect() on the socket), so datagrams are only received from a specific address. As long as the NAT had a session the packets from my PC got the same source address as the device destination address. But when the session expired the packets from my PC got a generic source address and the device (nRF9160) received them but since I have connected the UDP socket to a specific address the packets was not forwarded to the application.

    Sorry about posting this issue!

    Best regards
    Mattias Eriksson

Children
No Data
Related