-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FCntUp and FCntDown size #74
Comments
The end device must rejoin the network on a counter rollover to prevent reuse of the key/counter combination. Using a 16 bit only counter means that the device would have to rejoin every 65535 frames. Note: this behavior must be negotiated out-of-band with the network provider today. -Dave Kjendal, Senet, Inc. |
Ok, when you say "rejoin", it's like a stack reset with ABP or a new join request with OTAA? Currently, the downLinkCounter in the stack is a 65535, whereas the provider sends a downLinkCounter bigger. My exemple is a endNode sending a ConfirmedFrame, with a very short period to check the behavior of 16-bit counter. I understand of the loramac.c file ,l.1043, that the roll over is automatically, when the difference between the stack counter value and the provider counter value is bigger than 1<<15 This part of the stack has been checked? Thanks a lot. |
Hi all, When we look at the code in loramac.c:1043:
There is a check of the difference between the two downlink FCnt. Then when the difference is bigger than 32768, it's using the actual downlink counter + 65536 + the difference. in other words it's using the new received downlink counter (old + diff = old + (new - old) = new) + 65536. That means if at the first message we receive a downlink which specify a FCnt which is bigger than 32768, the actual downlink used to decrypt the payload will be the new FCnt + 65536 which has no sens. Or am I wrong? |
Hi, |
Hi all, @Smarco10 First Test case: Second Test case: Third Test case:
Fourth Test case: Result: Node accepts the frame. New downlink counter of the node:
I think the implementation is ok as it is. However, as you can see, the validation for a counter difference of @mpt8153 |
*@djaeckle * Ok but at this moment if I want to develop a standard End-Node that it would be interoperable with differents networks including ones working with ABP I will have to store counters in persistent way (like EEPROM)? |
@mpt8153 |
Hi all, According to the LoRaWAN_1.0.1/1.0.2, it is not clear about the Fcnt value management : I am agree with the last statement, for security reasons. Thus, I am also agree with @mpt8153 about storing Fcnt in a persistant way. But, if my End-Node has an FcntUp greater than 0x10000, and that the NetworkServer ignore this (due to a new declaration on the NS, or a due to a new NS for example [Fcnt=0x00000 on the NS] ), my End-Node will never never be accepted by the NetworkServer (MIC failed), and there is no way to get out of this situation... What is the good behavior ? |
LoRaWAN™ 1.1 Specification still have no clarification |
Hi,
The specification says FcntUp and Down can be 16-bit or 32-bit variables , but only the 16-bit LSB are used.
In the FW, 32-bit counters are uased.
What is the benefit?
Is not simpler if end node and server use 16-bit counter?
Thanks a lot.
The text was updated successfully, but these errors were encountered: