# LoRaWAN: Equal time-on-air for different sized payloads

**URL:** <https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905>\
**Category:** Uncategorized\
**Created:** [May 21, 2021, 3:44pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905 "2021-05-21T15:44:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trymjb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trymjb/32/35697_2.png) [@trymjb](https://www.thethingsnetwork.org/forum/u/trymjb)\
**Post date:** [May 21, 2021, 3:44pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905/1 "2021-05-21T15:44:25Z")

</div>

Hi!

I noticed that many of the airtime calculators available over the internet (including the one offered by TTN) gives the same time-on-air for packets with slight variations in payload size.

Is there any good explanation to this? Maybe someone has a good source about it (I am writing about it in my masters thesis 😃 )

---

<div class="post-metadata">

**Author:** ![Jeff-UK](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jeff-uk/32/35697_2.png) [@Jeff-UK](https://www.thethingsnetwork.org/forum/u/Jeff-UK)\
**Post date:** [May 21, 2021, 5:15pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905/2 "2021-05-21T17:15:46Z")

</div>

> [@trymjb](#):
>
> I am writing about it in my masters thesis 😃

🤔 In which case maybe we should leave you to work this out for yourself from the LoRaWAN specs and 1st principles vs telling you the secrets (also GIYF!) spoilers: LoRaWAN Headers, Payload format and structures, Forward error correct/CRC check/Coding scheme etc. yields a SF specific staircase/quantised increase in total payload/on airtime 😉

---

<div class="post-metadata">

**Author:** ![LoRaTracker](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/loratracker/32/48502_2.png) [@LoRaTracker](https://www.thethingsnetwork.org/forum/u/LoRaTracker)\
**Post date:** [May 21, 2021, 6:03pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905/3 "2021-05-21T18:03:32Z")

</div>

> [@trymjb](#):
>
> Is there any good explanation to this?

Yes, thats how LoRa behaves.

Its due to the way the low level LoRa encoding is carried out, nothing to do with LoRaWAN\TTN really.

---

<div class="post-metadata">

**Author:** ![trymjb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/trymjb/32/35697_2.png) [@trymjb](https://www.thethingsnetwork.org/forum/u/trymjb)\
**Post date:** [May 21, 2021, 7:09pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905/4 "2021-05-21T19:09:00Z")

</div>

I guess I have to answer my own question 🙃

Time-of-air is calculated from the duration of the preamble and the transmitted packet

![Screenshot 2021-05-21 at 20.58.30](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/2/f/2fa39886bcc12f01a5063677bea817f7c8b29a76.png)

Both of these durations are based on the symbol period, which is derived from the following equations:

![Screenshot 2021-05-21 at 21.01.27](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/5/1/518c86c8652e9f27ccaa62ff96dea94bd750c13b.png)

![Screenshot 2021-05-21 at 21.01.46](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/a/6a1884dd95e9473e9d5c90be89c4791d4c720e3a.png)

First, the preamble duration is calculated from  
 ![Screenshot 2021-05-21 at 21.02.33](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/0/a/0ac082d0bb15f35518f3704e5fc3acbff7d76ed9.png)  
where n is the programmed preamble length (8 for EU868)

Next, the payload duration is calculated:

![Screenshot 2021-05-21 at 21.04.23](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/f/6/f6cdd7d997972867aa64c7f1a531ff881e525347.png)

The equation for number of payload symbols creates the staircase increase in total payload/on airtime.

For those who were wondering, these equations are drawn from the SX1276 datasheet (not the lorawan specification document)

---

<div class="post-metadata">

**Author:** ![bertrik](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/bertrik/32/35697_2.png) [@bertrik](https://www.thethingsnetwork.org/forum/u/bertrik)\
**Post date:** [May 21, 2021, 8:12pm UTC](https://www.thethingsnetwork.org/forum/t/lorawan-equal-time-on-air-for-different-sized-payloads/47905/5 "2021-05-21T20:12:59Z")

</div>

At the lowest level of LoRa modulation, data is transferred in symbols, which may consist of between 6 to 12 bits (corresponding to the spreading factor). This is after channel coding, like bit shuffling, whitening, 4/5 error coding. So the 6…12 bits that are encoded on the air for each symbol do not align with a 8-bit input byte. It might happen that the last symbol only contains only one “useful” bit, but still a full symbol needs to be transmitted.
