This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Max RX Receive Buffer

Hi,

I'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't do anything.

I am using MFW 1.1.4 since it's certified with my likely carrier of choice.

1. Does this limitation exist? And if so is there a plan to increase the limit?

2. What parameters can I change (CONFIG_XXX) to maximize the limit?

Thanks

  • Hi Aziz,

    1. Does this limitation exist? And if so is there a plan to increase the limit?

    Yes, it is for the TLS packet as specified by the MFW release note "2kB secure socket buffer size.", 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.

    2. What parameters can I change (CONFIG_XXX) to maximize the limit?

    The solution will vary depending on your applications:

    • For a case similar to Asset_tracker_v2 disconnect from AWS when shadow data is more than 2k - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com), you need to think about optimizing your data traffic.
    • 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 Content-Range requests (IETF RFC 7233), you can request a fragment size under 2KB every time. We have created a download library that you can use directly.
    • The third solution is using mbedTLS on the application side instead of the one inside the modem, note that this will use more space in flash. There is a native TLS usage with SLM, you can build SLM with "-DOVERLAY_CONFIG=overlay-native_tls.conf"  and you can find detailed settings in nrf/applications/serial_lte_modem/overlay-native_tls.conf. If you set a large content length, then a larger TLS record can be achieved. For example:
      CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=4096
      CONFIG_MBEDTLS_HEAP_SIZE=32768

    Just a reminder for your development. MFW 1.1.4 is an quite old firmware version. According to Compatibility Matrix, it is only 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.

    Best regards,

    Charlie

Related