Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum COAP message resending buffer size limited to 255 bytes. #4374

Closed
Apocalyt opened this issue May 23, 2017 · 6 comments
Closed

Maximum COAP message resending buffer size limited to 255 bytes. #4374

Apocalyt opened this issue May 23, 2017 · 6 comments

Comments

@Apocalyt
Copy link

Description

  • Type: Enhancement
  • Priority: Minor

Enhancement

In the existing solution it is impossible for the maximum size of the COAP retransmission buffer to be bigger than 255 bytes. If you try to define YOTTA_CFG_COAP_RESENDING_QUEUE_SIZE_BYTES to be larger than 255 in application the value gets truncated to a uint8_t. This is probably because the sn_coap_resending_queue_bytes -variable is defined as uint8_t in:
mbed-os/features/FEATURE_COMMON_PAL/mbed-coap/source/include/sn_coap_protocol_internal.h

The maximum size of 255 bytes for the whole retransmission buffer can be too small for many applications especially when using COAP over WIFI or cellular network where multiple messages may require retransmission simultaneously. Even a single packet with a big payload (~512 bytes) can fill the whole buffer. The RAM available on many microcontrollers can easily handle a bigger buffer, so it should be possible to set the maximum size of the retransmission buffer to be bigger atleast using yotta config.

Suggested enhancement
Change the type of the sn_coap_resending_queue_bytes to be bigger to allow a bigger retransmission buffer if the programmer using the library so chooses. uint16_t or maybe even uint32_t should work better. The related unit test may also need to be changed.

Pros

  • Allows bigger coap retransmission buffer size if the user so chooses
  • Makes coap retransmission feature relevant in applications which require big amounts of data to be sent over unreliable network.

Cons

  • Few (~1-3) extra bytes of ram usage when using COAP to store the bigger variable
@0xc0170
Copy link
Contributor

0xc0170 commented May 25, 2017

cc @SeppoTakalo @JanneKiiskila

@Apocalyt
Copy link
Author

Hello, what is the situation regarding this change request?
Has someone started to implement it yet?
I can try to provide some additional info if needed.

@anttiylitokola
Copy link
Contributor

Hi,

Thanks for you report. We haven't yet started to implementing this change but it will be part of upcoming releases.

Thanks,
Antti

adbridge pushed a commit that referenced this issue Aug 25, 2017
@anttiylitokola
Copy link
Contributor

This fix is now part of mbed-os 5.5.6 release.

@ciarmcom
Copy link
Member

ciarmcom commented Jun 1, 2018

ARM Internal Ref: MBOTRIAGE-334

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 15, 2018

This fix is now part of mbed-os 5.5.6 release.

Resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants