<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[encoding - Earth Data Labs]]></title><description><![CDATA[Sensing our World in real-time]]></description><link>https://eadalabs.com/</link><image><url>https://eadalabs.com/favicon.png</url><title>encoding - Earth Data Labs</title><link>https://eadalabs.com/</link></image><generator>Ghost 3.41</generator><lastBuildDate>Sun, 15 Feb 2026 15:57:46 GMT</lastBuildDate><atom:link href="https://eadalabs.com/tag/encoding/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[The cost of LoRaWAN: frame encoding efficiency]]></title><description><![CDATA[<p>This is a quick post to document one of the question I had about LoRaWAN, namely what is the overhead for sending 1 byte of useful application payload when using LoRaWAN, versus using LoRa directly.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://eadalabs.com/content/images/2024/10/image-1.png" class="kg-image" alt srcset="https://eadalabs.com/content/images/size/w600/2024/10/image-1.png 600w, https://eadalabs.com/content/images/size/w1000/2024/10/image-1.png 1000w, https://eadalabs.com/content/images/size/w1600/2024/10/image-1.png 1600w, https://eadalabs.com/content/images/2024/10/image-1.png 1790w" sizes="(min-width: 720px) 720px"><figcaption>LoRaWAN frame payload format</figcaption></figure><p>In the above diagram "8b" refers to 8 bits, while "8B"</p>]]></description><link>https://eadalabs.com/lorawan-overhead/</link><guid isPermaLink="false">66fe474512a59c7602285860</guid><category><![CDATA[lora]]></category><category><![CDATA[lorawan]]></category><category><![CDATA[payload]]></category><category><![CDATA[frame format]]></category><category><![CDATA[encoding]]></category><category><![CDATA[overhead]]></category><dc:creator><![CDATA[Ron J]]></dc:creator><pubDate>Thu, 03 Oct 2024 10:20:50 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1566217558289-2bc2fb1641cd?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDEyfHxhbnRlbm5hfGVufDB8fHx8MTcyNzk0NDA0OHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1566217558289-2bc2fb1641cd?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8c2VhcmNofDEyfHxhbnRlbm5hfGVufDB8fHx8MTcyNzk0NDA0OHww&ixlib=rb-4.0.3&q=80&w=2000" alt="The cost of LoRaWAN: frame encoding efficiency"><p>This is a quick post to document one of the question I had about LoRaWAN, namely what is the overhead for sending 1 byte of useful application payload when using LoRaWAN, versus using LoRa directly.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://eadalabs.com/content/images/2024/10/image-1.png" class="kg-image" alt="The cost of LoRaWAN: frame encoding efficiency" srcset="https://eadalabs.com/content/images/size/w600/2024/10/image-1.png 600w, https://eadalabs.com/content/images/size/w1000/2024/10/image-1.png 1000w, https://eadalabs.com/content/images/size/w1600/2024/10/image-1.png 1600w, https://eadalabs.com/content/images/2024/10/image-1.png 1790w" sizes="(min-width: 720px) 720px"><figcaption>LoRaWAN frame payload format</figcaption></figure><p>In the above diagram "8b" refers to 8 bits, while "8B" refers to 8 bytes. </p><h1 id="lorawan-encoding">LoRaWAN encoding</h1><p>Assuming that the "App Layer" is 1 byte, the amount of extra bits needed for encoding the frame from the LoRaWAN device to the LoRaWAN gateway consists of the following items:</p><p>LoRaWAN layer:</p><ul><li>4 bytes for the device address  (inside the header) - used for the cloud to identify the emitting device.</li><li>2 bytes for the frame counter (inside the header) - used for packet loss detection (and rejoin with OTTA), as well as to prevent replay attacks.</li><li>1 byte of control bits (inside the header), used for adaptive data rate (ADR) and acknowledge request control.</li><li>1 byte for the  port - which can be any value from 1 to 223; the other values beeing reserved for protocol payload handling. </li></ul><p>Medium  Access control (<a href="https://en.wikipedia.org/wiki/Medium_access_control">MAC</a>) layer:</p><ul><li>1 byte for the header - which includes the frame type, and a version number known as the major. The most basic header is defined as an uplink data message, with a major equal to zero.</li><li>4 bytes for the message integrity code, aka "MIC". The MIC is not a <a href="https://www.thethingsnetwork.org/forum/t/mic-vs-checksum/25806">CRC</a> (which instead, sits at the physical layer level). Instead the MIC is used for <a href="https://en.wikipedia.org/wiki/Message_authentication_code">authentication</a>. It is the computed as the  <a href="https://www.rfc-editor.org/rfc/rfc4493.html">AES-CMAC</a> crypto based on the network session key (<em><em>NwkSKey</em><strong>) </strong></em> over the <a href="https://learn.semtech.com/mod/book/view.php?id=173&amp;chapterid=131">MAC header and payload</a>.</li></ul><p>So, this is 13 bytes overhead needed to transmit a single 1 byte useful payload.  And considering that out of those 13 bytes, 10 are used for addressing, authentication, and sequence control, this is actually a pretty efficient  protocol encoding implementation.</p><h1 id="lora-encoding">LoRa encoding</h1><p>Let's continue the analysis of with the LoRa physical frame. </p><p>The overhead when using the LoRa physical frame encoding consists of those additional bits:</p><ul><li>8 bytes for the preamble. The preamble, which is needed for the LoRa receive to start detecting a frame, can vary in length.  For LoRaWAN, it is 8 bytes. Other modulation, such as <a href="https://essay.utwente.nl/96205/1/Lopez_BA_EEMCS.pdf">GSFK</a>, uses 5 bytes. </li><li>2.5 bytes for the header - I could not find any explicit description for this header payload, expect from this fascinating <a href="https://dl.acm.org/doi/pdf/10.1145/3546869">reverse engineering</a> <a href="https://dl.acm.org/doi/pdf/10.1145/3546869">(</a>section 4.6)</li><li>2 bytes for the CRC.</li></ul><p>Actually, there are two transmitions modes for the physical layer: Explicit and Implicit. The later implicit mode assumes that the payload length, CR, and CRC are known in advance by both the sender and receiver, in which case the CRC and header are not transmitted, thus saving 4.5 bytes. However, while the implicit mode can work for specific frames with known length, it is not suitable to generic frames when ADR is used, since the coding rate can vary dynamically. </p><p>So, assuming an explicit physical frame, it takes 25.5 bytes overhead to transfer one byte of useful application data.</p><h1 id="conclusion">Conclusion</h1><p>The graph below shows the actual encoding efficiency, measured for the 3 different encoding. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://eadalabs.com/content/images/2024/10/image-5.png" class="kg-image" alt="The cost of LoRaWAN: frame encoding efficiency" srcset="https://eadalabs.com/content/images/size/w600/2024/10/image-5.png 600w, https://eadalabs.com/content/images/2024/10/image-5.png 841w" sizes="(min-width: 720px) 720px"><figcaption>LoRaWAN frame encoding efficiency</figcaption></figure><p>The efficiency is defined as PL/(O+PL), where PL = is the useful application payload, and O the Overhead.</p><p>As a conclusion, sending 1 byte of useful application data has an efficiency of 3.8% when using LoRaWAN. And to achieve 80% encoding efficiency (eg overhead length smaller than one fifth of the application payload), LoRaWAN application need to send at least 100 bytes.</p>]]></content:encoded></item></channel></rss>