<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160</link><description>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</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jul 2022 21:44:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160" /><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/378592?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 21:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba5111d6-a06c-4c30-be29-755b06ff094e</guid><dc:creator>StefanHri</dc:creator><description>&lt;p&gt;An alternative solution is to exchange DTLS with &lt;a href="https://datatracker.ietf.org/doc/html/draft-ietf-lake-edhoc-15"&gt;EDHOC&lt;/a&gt; and &lt;a href="https://datatracker.ietf.org/doc/html/rfc8613"&gt;OSCORE&lt;/a&gt; which are new standards from IETF. You can find a free open source implementation of EDHOC and OSCORE suitable for constrained devices under &lt;a href="https://github.com/eriptic/uoscore-uedhoc"&gt;uoscore-uedhoc&lt;/a&gt; and more background in our &lt;a href="https://arxiv.org/pdf/2103.13832.pdf"&gt;paper.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/378577?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 16:04:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba57cb60-ccd4-4e5d-b96c-bdee83d4bab6</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;In difference to one year ago, DTLS 1.2 Connection ID is published as &lt;a href="https://www.rfc-editor.org/rfc/rfc9146.html"&gt;RFC9146&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I spent some time last year in implementing the feature as well for &lt;a href="https://github.com/eclipse/tinydtls/tree/feature/connection_id"&gt;Eclipse/tinyDtls - feature branch Connection ID&lt;/a&gt;. And since June this year (2022), I also published a simple demonstration client for zephyr and the Thingy:91 see &lt;a href="https://github.com/boaks/zephyr-coaps-client"&gt;zephyr-coaps-client&lt;/a&gt;. It also considers the &amp;quot;RRC connection&amp;quot; delays (mainly happens with NB-IoT) for the DTLS and CoAP timeouts. All together very efficient and reliable.&lt;/p&gt;
&lt;p&gt;It still only works, if the device initiates the communication. And it&amp;#39;s not LwM2M, only CoAP. &lt;/p&gt;
&lt;p&gt;Anyway, if you&amp;#39;re interested in a preview of DTLS 1.2 CID, try it out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/378575?ContentTypeID=1</link><pubDate>Mon, 25 Jul 2022 15:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:712a63e4-a04f-472e-a4b6-00c0bfd8dbb9</guid><dc:creator>MehdiChelouah</dc:creator><description>&lt;p&gt;Hello &lt;span&gt;Bj&amp;ouml;rn,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Did you find a way to make it work ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m facing exactly the same issue 2 years later.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310991?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 10:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c18293e7-1561-4787-bd7c-5fcfb60af16b</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Yes, if that&amp;#39;s the requirement, your device will never sleep :-).&lt;/p&gt;
&lt;p&gt;(AFAIK, some providers offers &amp;quot;private network setups&amp;quot;, where the addresses are more sticky/static. But that depends on your provider and your contracts.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310986?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 10:16:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ab1cf54-b01e-4ef8-88ca-2dd757f02959</guid><dc:creator>Tiago Costa</dc:creator><description>&lt;p&gt;Thanks for clarifying. Yes, that is the issue I&amp;#39;m facing, as the server initiates communication after the quiet period.&amp;nbsp;I&amp;#39;ve wrongly interpreted that the connection id could&amp;nbsp;be implemented at the NAT infrastructure somehow and overcome this limitation. But since that&amp;#39;s not the case and because&amp;nbsp;I need my clients to be always reachable by the server at all times, I&amp;#39;ll need to keep sending packets to prevent the NAT timeout unfortunately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310984?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 10:08:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38a2b3f1-0291-4ae3-a7ba-319d38e17d1e</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Using CID &amp;quot;replaces the resumptions&amp;quot;. 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 &amp;quot;update the client&amp;#39;s ip-address&amp;quot; and send messages back.&lt;/p&gt;
&lt;p&gt;Only, if the server initiates the communication after the quiet period, that doesn&amp;#39;t work. That seems to be a general issue for IP, even for TCP. Once the &amp;quot;route/connection&amp;quot; is gone, you can&amp;#39;t reestablish it from the server, if the client has no known reachable address.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310976?ContentTypeID=1</link><pubDate>Fri, 21 May 2021 09:52:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:640ad589-0cd5-416f-a8cb-3f1263a87210</guid><dc:creator>Tiago Costa</dc:creator><description>&lt;p&gt;Thanks for pointing that out!&amp;nbsp;I&amp;#39;m not sure if &lt;em&gt;connection ids&lt;/em&gt;&amp;nbsp;also apply to server-to-client interactions as I could only find examples of client-to-server session resumption.&lt;/p&gt;
&lt;p&gt;In case&amp;nbsp;&lt;em&gt;connection ids&lt;/em&gt; should&amp;nbsp;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 &lt;em&gt;connection ids&lt;/em&gt;, so after the NAT timeout period my nrf9160 client can no longer receive requests from the LwM2M server until the next registration update.&lt;br /&gt;&lt;br /&gt; I believe DTLS session resumption&amp;nbsp;is enabled in the nrf9160 SDK 1.4.2 that I&amp;#39;m currently using for testing, although I&amp;#39;m not entirely sure, and I have enabled connection ids in my Leshan test server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310852?ContentTypeID=1</link><pubDate>Thu, 20 May 2021 18:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:397f8d89-a1b2-44fd-a0fc-41d4edd86305</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Just as outlook:&lt;/p&gt;
&lt;p&gt;Once &lt;a title="DTLS 1.2 Connection ID" href="https://datatracker.ietf.org/doc/draft-ietf-tls-dtls-connection-id/"&gt;draft-ietf-tls-dtls-connection-id&lt;/a&gt; may get more adopted, many DTLS/CoAP problems caused by NATs will disappear. Using &lt;a title="Eclipse/Californium" href="https://github.com/eclipse/californium"&gt;Eclipse/Californium&lt;/a&gt; you may have a preview of that (if you use &lt;a title="Eclipse/Leshan" href="https://github.com/eclipse/leshan"&gt;Eclipse/Leshan&lt;/a&gt; its a question to configure it). The downside of today is, that this requires to use an application level client and the modem just for UDP transfer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/310724?ContentTypeID=1</link><pubDate>Thu, 20 May 2021 12:04:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b5957e-7d94-4fa9-a036-c7995950e7a0</guid><dc:creator>Tiago Costa</dc:creator><description>&lt;p&gt;I&amp;#39;ve have recently ran into the same issue: since the mobile network operator is implementing a timeout for UDP NAT rules, I could not extend the LwM2M register update beyond 120 seconds in my case. However, this would mean the nrf9160 would consume a significant amount of overhead data just to keep the connection alive.&lt;/p&gt;
&lt;p&gt;The best solution, as far as I&amp;#39;m aware at the moment, is to increase the LwM2M register update period to save mobile data and periodically send UDP packets (with no&amp;nbsp;payload) to the socket&amp;nbsp;less than 120 seconds apart (or whatever the UDP NAT timeout period is for a given operator). This seems to be enough to keep the socket alive at the operator side and avoid the NAT timeout issue, while minimizing the overhead data usage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/243703?ContentTypeID=1</link><pubDate>Mon, 06 Apr 2020 14:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58a3c61f-a307-4249-91f3-cc040b2e4a3e</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;According to the modem team, the modem team makes no assumptions about the validity of the session.&lt;/p&gt;
&lt;p&gt;It is up to the server to check if the session is still valid. If it is not, the server will respond with an error. However, that error might get lost due to the NAT timeout I have already mentioned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/243362?ContentTypeID=1</link><pubDate>Fri, 03 Apr 2020 10:17:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c623f277-10ff-41e8-9a99-0113bdfb7929</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;First of all, I am sincerely sorry for the long wait (again).&lt;/p&gt;
&lt;p&gt;As the modem is delivered as a compiled application, only runtime configuration is possible. FOr the LTE stack, this is done through AT commands, while for the IP stack it is done through socket options. You are therefore limited to the socket options that can be set through bsdlib.&lt;/p&gt;
&lt;p&gt;When it comes to the application level protocols, those run on the application core and can be configured by Kconfig or replaced/rewritten partially or fully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/240626?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 12:30:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a1d3968-c6cf-4b6a-8d36-73e44a0ea897</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Didrik,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160/240623"]I have not gotten any answers to your questions from our developers yet.[/quote]
&lt;p&gt;Ok, let me know when you hear something. I am interested in 1) what are the default timeouts in the modem and 2) can they be changed&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160/240623"]At the end of the last reply, I suggest a method that &lt;em&gt;might&lt;/em&gt; let you use a non-offloaded IP stack. Note that we have not tested that, so I can not guarantee that it works.[/quote]
&lt;p&gt;Sorry, this is not an option for us. We dont have enough flash.&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160/240623"]Did you get a reply from your network operator?[/quote]
&lt;p&gt;No&lt;/p&gt;
[quote userid="81181" url="~/f/nordic-q-a/58730/how-to-configure-dtls-and-coap-idle-timeout-in-nrf9160/240623"]While they might have different timeouts, the timeouts we have seen are typical &amp;lt;1 minute. SO I would not dismiss the possibility that the problem is caused by the networks NAT policy[/quote]
&lt;p&gt;Yes, you are right. I will approach them to rule out the possibility.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/240623?ContentTypeID=1</link><pubDate>Thu, 19 Mar 2020 12:09:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b9f7fa7-a44f-43fd-acb8-af82d4a2f7b6</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and sorry for the long wait.&lt;/p&gt;
&lt;p&gt;I have not gotten any answers to your questions from our developers yet.&lt;/p&gt;
&lt;p&gt;However, you might be interested in this ticket: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/58817/nrf9160-lwm2m-with-mbedtls"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/58817/nrf9160-lwm2m-with-mbedtls&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At the end of the last reply, I suggest a method that &lt;em&gt;might&lt;/em&gt; let you use a non-offloaded IP stack. Note that we have not tested that, so I can not guarantee that it works.&lt;/p&gt;
&lt;p&gt;But, if it does work, you should then be able to use the Kconfig options that you have found.&lt;/p&gt;
&lt;p&gt;Did you get a reply from your network operator?&lt;/p&gt;
&lt;p&gt;While they might have different timeouts, the timeouts we have seen are typical &amp;lt;1 minute. SO I would not dismiss the possibility that the problem is caused by the networks NAT policy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/238521?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 12:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e53732-d433-4537-9cc5-35cc64ab3410</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll have to talk to the R&amp;amp;D team to be able to answer you properly.&lt;/p&gt;
&lt;p&gt;However, I can confirm that CONFIG_NET_SOCKETS_DTLS_TIMEOUT will not affect anything when socket offloading is enabled.&lt;/p&gt;
&lt;p&gt;I am not able to find any references to CONFIG_NET_APP_DTLS_TIMEOUT, so I can not comment on that.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d also appreciate a modem trace, so that we can rule out any network related problems.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/238445?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 08:41:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e80655cb-3644-49df-8386-ed1edd8af571</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tested another operator with LTE-M and I see the same behavior. That indicates it&amp;#39;s not an operator problem...of course, both operators could have the same problem, but less likely.&lt;/p&gt;
&lt;p&gt;I hope Nordic can guide me how to configure the session idle timeout.&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/238347?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 15:03:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51131502-ed81-4bd0-9234-357156bc9bd5</guid><dc:creator>Bjorn191023</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;No, I haven&amp;#39;t. I will do that.&lt;/p&gt;
&lt;p&gt;But still I would like to understand if&amp;nbsp;idle timeout can be configured in Zephyr. I have found a config&amp;nbsp;CONFIG_NET_APP_DTLS_TIMEOUT that looks promising, but I&amp;#39;m not sure it is applicable to the offloaded DTLS&amp;nbsp;implementation. There is also&amp;nbsp;CONFIG_NET_SOCKETS_DTLS_TIMEOUT, which has a different description.&lt;/p&gt;
&lt;p&gt;BR / Bj&amp;ouml;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure DTLS and CoAP idle timeout in nRF9160?</title><link>https://devzone.nordicsemi.com/thread/238295?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 12:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5295bdaa-fd44-4e5f-8cd1-1d20ca8a494f</guid><dc:creator>Markus Tacker (he/him)</dc:creator><description>&lt;p&gt;Have you confirmed with your network provider that they actually support the idle timeout times that you are looking to achieve?&lt;/p&gt;
&lt;p&gt;Networks will keep the UDP NAT rules for bidirectional communication up only for a limited time and what you describe does actually look more like you are hitting these limitations.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>