Tech Papers and Guides
Packet Size Considerations
The LoRaWAN specification1 provides for a maximum data payload (FRMPayload) size (called “N”) that is defined for each worldwide region in the LoRaWAN Regional Parameters2 document. This maximum payload size varies by DataRate (DR) because of the maximum on-air transmission time allowed for each regional specification.
Note: DataRate=0 is abbreviated as DR0, DataRate=1 as DR1 and so on.
Table 1. Example packet sizes (N) vs DataRate for EU863-870
Table 1 shows an example of a maximum payload size (N) for the different DRs.
Note: A given packet design with a payload of 100 bytes fits in a single payload at DR3 through DR7. If the transmitting device is at DR0 through DR2, it will not fit in the allowed maximum payload size. If a system designer can restrict DR limits (for example, never below DR3), the payload specification is more flexible. This choice creates limitations on signal transmission range because the lower the DR, the more processing gain there is to boost receiver sensitivity for uplink packets. Limiting DR to only higher values also limits how far away signals can be received. Consider this when you choose a packet length. Also note that a device designer cannot choose the final DR.
While 51 bytes in a payload in Europe may not be very restrictive, in the U.S. and other regions that operate in the 900MHz ISM band, the lowest DR is restricted to 11 bytes. These limits are chosen to meet the requirements of the regulatory agencies of the region; exceeding them will cause issues with device certifications with the local regulatory body. Table 2 shows the maximum payload length for the US902-928 band. For all DRs other than DR0, the available maximum packet size is equal to or greater than the Eu863-870 region. Therefore, if you want to use the same packet format in the U.S. and the EU, and you want to support DR0 in both regions, the maximum payload length for any packet would be 11 bytes (the U.S. limit for DR0). If you restrict your device to operate above the DR0 DataRate, the maximum payload becomes 51 bytes (the EU limit for DR1). However, you give up the maximum range that the device can achieve between the gateway and device (given that lower DR typically means longer range).
Table 2. Example packet sizes (N) vs DataRate for US902-9282
Expanding on the concept of the minimum packet length for each region’s maximum, if you look at all regions and take the smallest (N) across the entire specification, you will get the results shown in Table 3.
Note: Not all regions support every DR. For those regions that support a specific DR, the N in Table 3 is the smallest number of bytes that can be safely transmitted for each DR across all region definitions. Additionally, a given DR will not map to the same parameters in the LoRa modulation (bandwidth and spreading factor) among all regions. However, it will work the same in all regions where a lower DR provides better transmission performance and improved receiver sensitivity in the uplink. For example, DR0 for EU863-870 is 125kHz bandwidth, using spreading factor 12, whereas in the U.S. DR0 for US902-928 is 125kHz bandwidth and therefore must use spreading factor 10.
|DataRate||N (if defined)|
Table 3. Maximum safe packet sizes (N) vs the DataRate for aggregated for all regions2
If you are designing a protocol that you expect will be used worldwide, and you need more than the “global minimum” of 11 bytes but less than the next-highest value of 33 for a given payload, issue a note in your application to exclude DR0 from the available DRs. Or, fix the minimum DR in your firmware as DR1 and do not allow network commands for changes below that. This will limit your device’s range. It will also ensure that you stay within the required data limits for a given jurisdiction.
To overcome the limitations of encountering a maximum packet size, even when constraining yourself to 11 bytes worldwide:
- Use multiple message types by specifying Port field information as a type identifier
- Use Bit packing data
- Avoid sending redundant information in every packet
A lot of data can be sent in a few well-timed bits. The following sections will provide some useful tips and tricks to help you maximize the transfer of useful information in the minimum number of bytes.
1. In LoRaWAN Specification 1.0 and 1.0.1, the region parameters were included directly in the specification. As of LoRaWAN Specification 1.0.2 and onwards the LoRaWAN Regional Parameters are in their own document of the same name.
2. LoRaWAN 1.1 Regional Parameters, October 11, 2017