# Spreadsheet for LoRa airtime calculation

**URL:** <https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190>\
**Category:** Uncategorized\
**Created:** [February 4, 2016, 2:45pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190 "2016-02-04T14:45:50Z")\
**Posts on this page:** 13\
**Page:** 3

<div class="post-metadata">

**Author:** ![ben\_dg](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/ben_dg/32/20484_2.png) [@ben\_dg](https://www.thethingsnetwork.org/forum/u/ben_dg)\
**Post date:** [February 9, 2018, 11:08am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/42 "2018-02-09T11:08:58Z")

</div>

Thanks for this spreadsheet!  
I have a question about downlink Toa…  
The only difference between uplink and downlink is the CRC field, right?

_"Downlink messages use the radio packet explicit mode in which the LoRa physical header 377 (PHDR) and a header CRC (PHDR\_CRC) are included\*._

_\*No payload integrity check is done at this level to keep messages as short as possible with minimum impact on any duty-cycle limitations of the ISM bands used."_ [lorawan specification]

If yes, I can use this spreadsheet for the Toa Downlink computation but I have to subtract 16 bit of CRC. I’m right?

Thanks in advance for replies and for your help.

---

<div class="post-metadata">

**Author:** ![haowong](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/haowong/32/36740_2.png) [@haowong](https://www.thethingsnetwork.org/forum/u/haowong)\
**Post date:** [February 18, 2021, 11:26am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/43 "2021-02-18T11:26:58Z")

</div>

If there is at least 13 bytes in a packet, I often see in the papers that the data packets of physical payload size such as 9 bytes and 10 bytes are launched. How do they do it?

---

<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:** [February 18, 2021, 12:12pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/44 "2021-02-18T12:12:17Z")

</div>

A LoRaWAN\TTN packet has a length of 13 bytes plus payload.

Are ‘the papers’ referring to plain LoRa packets ?

---

<div class="post-metadata">

**Author:** ![haowong](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/haowong/32/36740_2.png) [@haowong](https://www.thethingsnetwork.org/forum/u/haowong)\
**Post date:** [February 18, 2021, 12:43pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/45 "2021-02-18T12:43:03Z")

</div>

I think So.

Only LoRaWAN will add extra data.

Thanks.

---

<div class="post-metadata">

**Author:** ![clv](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/clv/32/46568_2.png) [@clv](https://www.thethingsnetwork.org/forum/u/clv)\
**Post date:** [February 18, 2021, 7:56pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/46 "2021-02-18T19:56:56Z")

</div>

> [@haowong](#):
>
> I often see in the papers that the data packets of physical payload size such as 9 bytes and 10 bytes are launched. How do they do it?

I think it’s explicit vs implicit header. Academic, not relevant to TTN.

---

<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:** [February 18, 2021, 8:52pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/47 "2021-02-18T20:52:57Z")

</div>

> [@clv](#):
>
> I think it’s explicit vs implicit header. Academic, not relevant to TTN.

I dont see how the type of header would affect the payload size ?

---

<div class="post-metadata">

**Author:** ![haowong](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/haowong/32/36740_2.png) [@haowong](https://www.thethingsnetwork.org/forum/u/haowong)\
**Post date:** [February 19, 2021, 8:48am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/48 "2021-02-19T08:48:35Z")

</div>

I’m sorry to disturb you again.

Can’t the gateway receive plain LoRa packets? After a round of asking, I found that the gateway can only accept LoRaWAN packets

---

<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:** [February 19, 2021, 9:29am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/49 "2021-02-19T09:29:50Z")

</div>

> [@haowong](#):
>
> Can’t the gateway receive plain LoRa packets?

Why would you want it to ?

---

<div class="post-metadata">

**Author:** ![haowong](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/haowong/32/36740_2.png) [@haowong](https://www.thethingsnetwork.org/forum/u/haowong)\
**Post date:** [February 19, 2021, 10:36am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/50 "2021-02-19T10:36:55Z")

</div>

Just to collect data.

The P2P communication provided by some nodes can only communicate between two nodes.

---

<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:** [February 19, 2021, 10:56am UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/51 "2021-02-19T10:56:04Z")

</div>

This forum is focussed on TTN and by extension LoRaWAN implementations. LoRa only/LoRaP2P is out of scope. There are LoRa ‘Gateways’ which you may be thinking of - effectively single channel or dual channel LoRa packet forwarders…there are disruptive to LoRaWAN networks and should not be connected to them and should NOT be conneceted to TTN. You should look to other forums and othe LoRa RF Library instances for support on these. A LoRaWAN GW will ‘hear’ LoRa only transmissions but will not action or handle the traffic and it will be ignored/dropped at the GW.

---

<div class="post-metadata">

**Author:** ![clv](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/clv/32/46568_2.png) [@clv](https://www.thethingsnetwork.org/forum/u/clv)\
**Post date:** [February 19, 2021, 1:42pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/52 "2021-02-19T13:42:41Z")

</div>

> [@LoRaTracker](#):
>
> I dont see how the type of header would affect the payload size ?

I thought the question from @haowong was bad expressed. Of course the payload is something else. It can be also zero. In that context the question is meaningless to me.

---

<div class="post-metadata">

**Author:** ![areej](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@areej](https://www.thethingsnetwork.org/forum/u/areej)\
**Post date:** [August 31, 2024, 1:03pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/53 "2024-08-31T13:03:40Z")

</div>

Hello,

can you please tell me what is the meaning of these equations that I found them in a code and where is the reference for these equations?. I only found the equation of the number of symbols in a packet but it doesn’t contain +5 like in the code

message\_chr = convertStringsToChars(message) ;  
message\_dbl = uint8(message\_chr) ;  
N\_pld = (SF == 7).\*1 + (SF == 8).\*2 + (SF == 9).\*3 + (SF == 10).\*4 + (SF == 11).\*5 + (SF == 12)._6 ;  
n\_packet = 8 + max([ceil((8_(length(message\_dbl) + 5) - 4.\*SF + 28 + 16._CRC\_pld - 20.imp)/(4.(SF - 2.opt))).(CR + 4) 0]) ;  
n\_wht = SF ._ floor((n\_packet-8)/(4 + CR)) + N\_pld - 1 ;  
n\_pld = ceil((n\_wht + (SF == 7).\*0 + (SF == 8).\*1 + (SF == 9).\*2 + (SF == 10).\*3 + (SF == 11).\*4 + (SF == 12).\*5)/2) ;  
n\_pad = n\_pld - 5 - length(message\_dbl) - CRC\_pld._2 ;  
%% Create payload message  
CRC\_dbl = CRC\_pld._[1 1] ; % CRC is not working atm  
pad\_dbl = zeros(1,n\_pad + N\_pld - 1) ; % padding  
pld\_dbl = [255 255 0 0 message\_dbl 0 CRC\_dbl pad\_dbl] ; % LoRa payload

---

<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:** [August 31, 2024, 4:01pm UTC](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/54 "2024-08-31T16:01:16Z")

</div>

1. Not sure if you should expect a reply - as far as I can tell @assia_b has not been seen on the forum for\>7 years! And was only active for \<2 months ☹

2. Dont expect others to go searching in ancient code and posts; please be explicit where you are looking for this illusive “+5” and why you think it should be there - epsicially with something that is so old…otherwise suspect you are on your own to go digging into historic forensics…you might get lucky with a response but 🤷‍♂️

[Previous page](https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190.md?page=2)
