Gateways are between the end device and the network server. 1
On the end-device and on the server side I've represented 2
the message as layers. 3
When we use this representation, we consider that each layer add a service to the one below. 4
So let's take the example of our temperature sensor with one byte user payload. 5
This temperature belongs to the application layer and is encrypted with a key called AppSKey. 6
Then, the layer below will add the LoRaWAN header. In the Lorawan header, 7
the main service is the authentication process and this is done thanks to another key call network session key. 8
And finally, this lorawan message will be modulated in Lora and a message sent as a radio frequency 9
packet. 10
I remind you that the transmitted message is not sent towards a specific gateway. All gateways in the 11
coverage area will receive this packet and demodulate it. 12
On this diagram I've drawn one gateway and we can see that its job is simply to demodulate the message. 13
Once it has recovered the PHY payload, 14
so the exact content of the lora frame, then it sends it on an IP network (over internet). 15
A gateway doesn't analyze the lora frame, so it doesn't authenticate the packet, 16
neither decrypts it. 17
Anyway, they don't have the network session keys and the application session keys, so there is no way they 18
can manage it. 19
So we need to consider the gateway as a simple Lora entity with emission and reception capabilities. They 20
receive the radio frequency message on one side and transmitted to Internet on the other side. 21
The IP network is usually called the backhaul, and it's often Ethernet, Wi-Fi or 4G connection. 22
And finally on the right, it would be up to the network server to authentic the packet. 23
Then the final user payload will end up to the application, server ready to be decrypted. 24
If everything goes right, the temperature value should obviously be the one sent by the end device.