Processing the Downlink Packet

Verify and Update the Frame Counter (FCnt)

The frame counter is used to ensure that the end device does not process the same message twice, as well as to avoid being attacked by an adversary replaying old messages which could be used to manipulate an end device.

The frame counter is found in the two-octet FCnt field, located inside the Frame Header within the MAC Payload, as shown in Figure 1.

downlink-packet-fcnt

Figure 1: FCnt field highlighted in the LoRaWAN® downlink packet structure

The end device must keep track of a downlink specific frame counter (FCntDown) in memory. The value of FCntDown is set to 0 when the device is first activated, explained in the End Device Activation Book.

If the FCnt value in the downlink is lower than or equal to the current value stored in FCntDown, this message must be ignored.

If the FCnt value in the downlink is greater than the current value of FCntDown, the end device must update the value of FCntDown to the FCnt value and then continue to process the message.