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

Are the max packet sizes correct? #130

Open
marianofino opened this issue Jan 12, 2023 · 1 comment
Open

Are the max packet sizes correct? #130

marianofino opened this issue Jan 12, 2023 · 1 comment

Comments

@marianofino
Copy link

marianofino commented Jan 12, 2023

Hi,

The max packet sizes allowed to be sent for each DR in EU region don't seem to match the ones defined in the official docs. For example, DR0 has a max payload of 51 plus the minimum 13 bytes header. In total it's a max packet size of 64 bytes. However in this module, the maximum packet size for DR0 is 59 bytes. In fact, every DR packet size seems to be 5 bytes less that the correct ones.

This is the line of code that defines the max packet sizes:

std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});

And here, in the first table of this docs, it is defined the maximum payload size for EU region (it's missing the 13 bytes header): https://lora-developers.semtech.com/documentation/tech-papers-and-guides/the-book/packet-size-considerations/

Is there a reason why the sizes are 5 bytes less?

@non-det-alle
Copy link
Collaborator

non-det-alle commented Jun 19, 2023

The max packet sizes in lorawan-mac-helper.cc are the ones for the MACPayload as defined in regional parameter specs (section 2.4.6). These are the ones that must be respected, payload + MAC header. The 51B at DR0 that you mention is "The maximum application payload length in the absence of the OPTIONAL FOpts control field (N) is also given for information only". I agree that the naming is deceiving (maxAPPpayload), but the check in end-device-lorawan-mac.cc is after the addition of the frame header so it should be correct.

Edit: I noticed you are referring to an old commit. This has been corrected as I described above in more recent versions.

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

No branches or pull requests

2 participants