-
Notifications
You must be signed in to change notification settings - Fork 2k
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
net/gnrc_lorawan: implement unconfirmed uplink redundancy #15946
Conversation
@akshaim might be interested in this feature |
0d8f3a8
to
430b87c
Compare
* not affect confirmed uplinks. By default, uplinks | ||
* are sent without retransmissions (this means, the | ||
* device sends only one uplink packet) | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ This value is usually configured by the network to control the redundancy of the node uplinks to achieve a given Quality of Service.
Maybe one more line to give a bit more context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used by ADR, but it's not directly related. Therefore I don't think these lines add to much for the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise this would be also for DR, TX Power, channels, etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundancy is only used when ADR is enabled right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it is not :). You can also configure the node to do redundancy, as described in the "help" section.
In fact, if the ADRReq command sets the redundancy to 0, the standard specifies that the redundancy should be the device's default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively we can avoid using redundancy when ADR is off. In fact, this is a gray zone in the standard IMO (it doesn't specifies what to do with the default value or when the redundancy is on)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, lets try to avoid the grey area :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted it to indicate it's for ADR
not affect confirmed uplinks. By default, uplinks | ||
are sent without retransmissions (this means, the | ||
device sends only one uplink packet) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you correct the formatting here ?
sys/include/net/loramac.h
Outdated
/** | ||
* @brief Maximum unconfirmed uplink redundancy | ||
*/ | ||
#define LORAMAC_REDUNDANCY_MAX (14U) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The valid range in LoRaMAC 1.0.3 spec is 1:15 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the number of transmissions, However, here these numbers are defined as "retransmissions" (therefore 15 maps to 14)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Maybe it makes sense to rename macro to LORAMAC_REDUNDANCY_MAX_RETRANSMISSIONS
or something similar ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discuess offline, I can add the explanation of where the 14 comes from
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. Thanks @jia200x :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it. I realized it's not needed because ADR already limits this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Makes sense
@jia200x Looks good to me. Please squash. |
1502ad8
to
3463e5a
Compare
Can you rebase to current master ? |
3463e5a
to
a63ce18
Compare
rebased! |
Great, I shall test it tomorrow :) |
a63ce18
to
ac94f36
Compare
rebased on top of #16640 |
Test results:
I configured the redundancy to 2. With that, every uplink is sent 3 times. Here's the output of the network server. As expected, the Unconfirmed uplinks are sent 3 times.
|
As described in the test results, a downlink stops the retransmission procedure:
The node only send one message (the downlink is the result of the Link Check command):
The retransmission procedure of confirmable message also works:
And the retransmission value is not affect by the redundancy (retrans is set to 5 -> 6 uplinks):
|
Last but not least: the proposed patch for testing doesn't make sense any more because the proposed function is now void. I added an assertion to make sure
NS (redundancy configured to 14):
I also dropped 9948072 since it's not used anymore after the request changes by @akshaim |
@jia200x I think we can proceed ahead :) |
@jia200x Can you squash ? |
This needs rebasing and squashing |
Tested with Chirspstack and it seems to fail. Here are the results.
![no_retries](https://user-images.githubusercontent.com/5170658/126322896-9426b046-e246-4247-a4c7-745f0446a176.png
The device sends uplinks on the same channel
The device continues to retry uplinks on the same channel ? |
Please note the tests above were using the same Chirpstack instance and hardware.
This standard "frequency hopping" is described here:
The implementation is doing that. Just picking a pseudo-random number. The only exceptions are bands that require to implement FHSS, such as US915. In this case the channel must not repeat. In fact, this is the Semtech LoRaMAC implementation for EU868.
Therefore, this is not against the standard. Since there are only 3 channels in ABP, there are high chances you will see the same channel on retransmissions.
Of course, since redundancy is not applied to confirmed uplinks. |
This commit implements uplink redundancy in GNRC LoRaWAN. Uplink redundancy is used to retransmit unconfirmed uplink frames. The retransmission stops when either a downlink message is received or the number of uplink retransmissions is reached. This functionality doesn't affect confirmed uplinks.
2762998
to
df97f34
Compare
squashed! |
Is there anything left here to do? |
I don't think so. This PR should be ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and I trust your testing
Last build was a bit stale, so let's do one more before merging. |
Contribution description
This PR implements uplink redundancy for GNRC LoRaWAN.
Uplink redundancy is used to retransmit unconfirmed uplink frames. The retransmission stops when either a downlink message is received or the number of uplink retransmissions is reached. This functionality doesn't affect confirmed uplinks.
Although this functionality is intended to be used by the upcoming implementation of ADR, this can be also set at compile time by the user.
Testing procedure
Check if this features still works with the following patch:(see net/gnrc_lorawan: implement unconfirmed uplink redundancy #15946 (comment))Issues/PRs references
None so far, but required for implementing ADR