<?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>Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115927/managing-tcp-retransmission-timeout</link><description>During our evaluation of MQTT, we observed that if we send data every five minutes, the server stops receiving it. We currently believe this is related to CG-NAT, which drops the tunnel due to inactivity, preventing the packet from being routed. This</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Nov 2024 09:07:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115927/managing-tcp-retransmission-timeout" /><item><title>RE: Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/thread/509388?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 09:07:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0115e73-e6f4-4774-8f3f-2c2206c86993</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The retransmission count feature is built on top of the basic TCP/IP socket and is not inherently part of the core TCP stack. Due to the limited resources on the modem running on the nRF9151, this feature is not supported.&lt;/p&gt;
&lt;p&gt;As I mentioned, I would recommend referring to the Zephyr TCP stack. Zephyr&amp;#39;s implementation provides enhanced capabilities, including retransmission counting. If resource constraints are a concern, you might consider porting only the specific parts of the code relevant to your needs to minimize size increases&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/thread/509126?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 13:50:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:668cf1fb-4ef7-41b9-bd54-69eb2745759a</guid><dc:creator>vytautas</dc:creator><description>&lt;p&gt;Using the native Zephyr TCP/IP stack isn&amp;#39;t an option due to the increased size of the firmware.&lt;/p&gt;
&lt;p&gt;Is there no alternative way to control the timeout mechanism for the modem TCP/IP stack?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/thread/509108?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2024 12:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d211c4c-4eef-4b4c-ac76-2de0da357fd3</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;nRF91 modem only proivde socket for straight forward TCP connection, and it does not have an comprehensive TCP stack like Zephyr network libary.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/cellular/modem_shell/README.html#nrf91_series_dk_with_zephyr_native_tcpip_stack"&gt;Cellular: Modem Shell&lt;/a&gt;&amp;nbsp;sample has an implementiaon that demostrates run&amp;nbsp;&lt;span&gt;nRF91 Series DK with Zephyr native TCP/IP stack. You can refer to it or adding you own implmentaion for TCP retry count based funtion on current TCP socket simple usage.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/thread/508942?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2024 12:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50b4cd61-c372-470c-aa61-b02711945465</guid><dc:creator>vytautas</dc:creator><description>[quote userid="93921" url="~/f/nordic-q-a/115927/managing-tcp-retransmission-timeout/508482"]THanks for checking with us. Looks&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/kconfig/index.html#CONFIG_NET_TCP_RETRY_COUNT"&gt;https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/kconfig/index.html#CONFIG_NET_TCP_RETRY_COUNT&lt;/a&gt;&amp;nbsp;is what you need, it has default 9.[/quote]
&lt;p&gt;The CONFIG_NET_TCP_RETRY_COUNT is only applicable to Zephyr&amp;#39;s native networking stack. It is not used in Nordic&amp;#39;s offloaded sockets. While SO_SNDTIMEO doesn&amp;#39;t seem to do anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Managing TCP Retransmission Timeout</title><link>https://devzone.nordicsemi.com/thread/508482?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2024 09:57:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1affa4d3-e7e9-4295-9920-bad1dba1aa76</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;THanks for checking with us. Looks&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/kconfig/index.html#CONFIG_NET_TCP_RETRY_COUNT"&gt;https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/kconfig/index.html#CONFIG_NET_TCP_RETRY_COUNT&lt;/a&gt;&amp;nbsp;is what you need, it has default 9.&lt;/p&gt;
&lt;p&gt;The following two configuration may also help to avoide retransimisson.&lt;/p&gt;
&lt;p&gt;MQTT Keep-Alive: &lt;span&gt;CONFIG_MQTT_KEEPALIVE&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;Socket Timeout: You can also set a timeout on the socket to prevent indefinite waiting. For example:&lt;/div&gt;
&lt;div&gt;
&lt;div dir="ltr"&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;err &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;setsockopt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;client&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;transport&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;tls&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;sock&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; SOL_SOCKET &lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; SO_SNDTIMEO&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;timeout_mqtt&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;sizeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;timeout_mqtt&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>