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

How to configure DTLS and CoAP idle timeout in nRF9160?

Hi,

We have a working LwM2M device based on nRF9160 and NRF Connect SDK 1.1. When we run with a short register-update period (30 seconds) on a NB-IoT network it works. When we increase the register-update period to 5 minutes it times out every time and the L2M2M client reconnects the DTLS session and LwM2M session. This is not acceptable.

I guess there is an idle timeout on lower level, e.g. CoAP or DTLS!? I have offloaded the IP stack incl DTLS to the modem. How can I configure the DTLS idle timeout (if any)? How can I configure the CoAP idel timeout (if any)?

BR / Björn

Parents Reply Children
  • Thanks for pointing that out! I'm not sure if connection ids also apply to server-to-client interactions as I could only find examples of client-to-server session resumption.

    In case connection ids should work for server-to-client interactions, after some tests, it seems that my current Mobile Network Operator NAT does not seem to support handling of connection ids, so after the NAT timeout period my nrf9160 client can no longer receive requests from the LwM2M server until the next registration update.

    I believe DTLS session resumption is enabled in the nrf9160 SDK 1.4.2 that I'm currently using for testing, although I'm not entirely sure, and I have enabled connection ids in my Leshan test server.

  • Using CID "replaces the resumptions". Nothing in the middle must support it, only the clients and servers. As long, as the client starts the communication after a quiet period, the server will be able to "update the client's ip-address" and send messages back.

    Only, if the server initiates the communication after the quiet period, that doesn't work. That seems to be a general issue for IP, even for TCP. Once the "route/connection" is gone, you can't reestablish it from the server, if the client has no known reachable address.

  • Thanks for clarifying. Yes, that is the issue I'm facing, as the server initiates communication after the quiet period. I've wrongly interpreted that the connection id could be implemented at the NAT infrastructure somehow and overcome this limitation. But since that's not the case and because I need my clients to be always reachable by the server at all times, I'll need to keep sending packets to prevent the NAT timeout unfortunately.

  • Yes, if that's the requirement, your device will never sleep :-).

    (AFAIK, some providers offers "private network setups", where the addresses are more sticky/static. But that depends on your provider and your contracts.)

Related