In the LoRaWAN frame, 1
The Frame Payload is the encrypted user data. 2
So, for example, if the device sends a one-byte temperature, then the Frame Payload is also on one 3
byte, but encrypted with the Application Session Key. 4
Of course, the only way to decrypt the payload is to use the same Application Session Key that the 5
one used during encryption. 6
This is the role of the application server. And it also works the other way around: 7
So when the user wants to send the data from the application, just before passing it to the LoRa MAC layer, 8
the LoRaWAN protocol encrypts the data to be transmitted. 9
When the device receives the frame payload, it will decrypt it with the same Application Session Key. 10
Okay. 11
Now that we have the overall LoRaWAN frame, let's check how many bytes are in there. 12
Of course, for that, we need to dive into the LoRaWAN specification. 13
But I will do it for you for this little example. 14
The MAC Header is an 1 byte, plus 4byte for the Device Address, plus 1 byte for the Frame Control, 15
plus 2 for the frame counter. 16
We'll consider a frame without options, plus 1 byte for the frame port, 1 byte for a Frame Payload, 17
which in our case is the temperature. 18
And finally, 4 bytes for the Message Integrity Control. 19
That gives it a total of 14 bytes. 20
Okay. 21
That's the theory. 22
Now, I would like to show you that it can be verified with demonstration because it's exactly what 23
happens in reality. 24
So I'll show you a very small demonstration of a LoRaWAN transmission of 1 bite of temperature. 25
This demonstration uses a TTN version 2 Network Server that is no longer available on the Web. 26
But the logs were so clear that I would like to use it for the sake of clarity. 27
Of course, this demonstration can be done with any other Network Server. 28
For this demonstration, I've got on the left 29
a window with the gateway traffic. 30
And on the right, the decrypted frame when they arrived on the Application Server. 31
So I start my end device. 32
And right after the first transmitted frame, I pause the live data event on the Gateway. 33
And I also stop it on the Application Server. 34
What do we see ? On the gateway, 35
the payload size is 14 bytes. 36
Yes, that's exactly what we've calculated before. 37
14 byte is what we call the raw payload of physical payload. 38
There are many things in there: the devadrr, the Message Integrity Control, the Frame Counter 39
and so on... 40
But there is also the encrypted user payload. 41
Great. 42
Now, what do we see on the right on the application server side? 43
There is only one byte. 44
That's my temperature data. 45
I don't see here the 14 bytes, because among these 14 bytes, only one corresponded to the user payload. 46
It was the frame payload. 47
It's been decrypted and reported here in the console. 48
Right. 49
So we've seen here in details the content of the LoRa modulation and the LoRaWAN frame. 50
Now let's have a look at the transmission between the gateway and the network server.