<?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>Max RX Receive Buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82942/max-rx-receive-buffer</link><description>Hi, 
 I&amp;#39;ve been reading that the nrf9160 can only receive up to ~2KB of data at a time. It seems that the connection terminates if I send too much to the nrf9160. I tried changing the CONFIG_NET_RX_STACK_SIZE to 8192 but that didn&amp;#39;t do anything. 
 I am</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Dec 2021 11:57:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82942/max-rx-receive-buffer" /><item><title>RE: Max RX Receive Buffer</title><link>https://devzone.nordicsemi.com/thread/344341?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 11:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f43081ef-418d-4530-a0f9-2920b2f474a8</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Aziz,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. Does this limitation exist? And if so is there a plan to increase the limit?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes, it is for the TLS packet&amp;nbsp;as specified by &lt;a href="https://www.nordicsemi.com/-/media/Software-and-other-downloads/Dev-Kits/nRF9160-DK/release_notes_modemfirmware/mfw_nrf9160_1.3.1_release_notes.txt?la=en&amp;amp;hash=7E8286E42FB69A32F2F56CFE3AD3481905584DE0"&gt;the MFW release note&lt;/a&gt; &amp;quot;2kB secure socket buffer size.&amp;quot;, this limitation always exists. It is a limitation caused by ram size restriction, so we do not have a plan or could increase it in the future.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. What parameters can I change (CONFIG_XXX) to maximize the limit?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The solution will vary depending on your applications:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;For a case similar to&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/79376/asset_tracker_v2-disconnect-from-aws-when-shadow-data-is-more-than-2k"&gt;Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;, you need to&amp;nbsp;think about optimizing your data traffic.&lt;/li&gt;
&lt;li&gt;For an HTTPS application. The general solution is if you can set TCP window size smaller than 2KB on your HTTP/HTTPS server, then the recv function can receive several packets and assembly them together as a big HTTP response above 2KB. For HTTPS, benefit from&amp;nbsp;&lt;a href="https://datatracker.ietf.org/doc/html/rfc7233"&gt;Content-Range requests (IETF RFC 7233)&lt;/a&gt;, you can request a&amp;nbsp;&lt;span&gt;fragment size under 2KB every time. W&lt;/span&gt;e have created a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.7.0/nrf/libraries/networking/download_client.html#http-and-https-tls-1-2"&gt;download library&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;that you can use directly.&lt;/li&gt;
&lt;li&gt;The third solution is u&lt;span&gt;sing&amp;nbsp;mbedTLS&amp;nbsp;&lt;/span&gt;&lt;span&gt;on the application side instead of the one inside the modem, note that this will use more space in flash.&amp;nbsp;&lt;/span&gt;There is a native TLS usage with SLM, you can build SLM with &amp;quot;-DOVERLAY_CONFIG=overlay-native_tls.conf&amp;quot;&amp;nbsp; and&lt;span&gt;&lt;span dir="ltr"&gt;&amp;nbsp;you can find detailed settings in nrf/applications/serial_lte_modem/overlay-native_tls.conf.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;If you set a large content length, then a larger TLS record can be achieved. For example:&lt;br /&gt;&lt;span&gt;CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096&lt;br /&gt;CONFIG_MBEDTLS_HEAP_SIZE=32768&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Just a reminder for your development. MFW 1.1.4 is an quite old firmware version. According to&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf9160/COMP/nrf9160/nrf9160_comp_matrix.html"&gt;Compatibility Matrix&lt;/a&gt;, it is only&amp;nbsp;compatible with some versions before NCS v1.5.2. If you check the latest MFW and NCS release notes, they have massive features and bug fixes introduced. We are targeting to have MFW1.3.x verified for the carries in your region at the beginning of next year. Please keep a close connection with our local team to get the latest state update.&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>