-
Notifications
You must be signed in to change notification settings - Fork 3k
Adding QOS in response to LinkADRReq and fixing class C bugs #8183
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
Conversation
@kivaisan @AnttiKauppila @kjbracey-arm Please review. |
Tests added here |
ab24d37
to
2b2bef3
Compare
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.
LGTM. Just few cosmetics.
features/lorawan/LoRaWANStack.cpp
Outdated
if (_device_current_state == DEVICE_STATE_JOINING) { | ||
_device_current_state = DEVICE_STATE_AWAITING_JOIN_ACCEPT; | ||
} | ||
|
||
if (_device_current_state == DEVICE_STATE_SENDING) { | ||
if (_loramac.get_mcps_confirmation()->req_type == MCPS_CONFIRMED) { | ||
_ctrl_flags |= TX_ONGOING_FLAG; | ||
_ctrl_flags &= ~TX_DONE_FLAG; | ||
//_ctrl_flags &= ~TX_DONE_FLAG; |
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.
Remove dead code
features/lorawan/LoRaWANStack.cpp
Outdated
// application when RX2 windows is elapsed, i.e., in process_reception_timeout() | ||
_ctrl_flags &= ~TX_ONGOING_FLAG; | ||
} else { | ||
//_ctrl_flags |= TX_DONE_FLAG; |
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.
Dead code here too
2b2bef3
to
6e2bf48
Compare
Dead code removed, rebased. |
6e2bf48
to
64768fd
Compare
@kivaisan @AnttiKauppila @kjbracey-arm Please review again. Added a few commits for stability improvement and rebased after few PRs went in. |
@@ -889,6 +889,8 @@ void LoRaMac::on_backoff_timer_expiry(void) | |||
|
|||
void LoRaMac::open_rx1_window(void) | |||
{ | |||
tr_debug("Opening RX1 Window"); |
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. Opening RX windows is quite time critical so let's not print until the window has been opened.
} | ||
|
||
void LoRaMac::open_rx2_window() | ||
{ | ||
tr_debug("Opening RX2 Window, Frequency = %lu", _params.rx_window2_config.frequency); |
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 same issue here.
LinkADRReq parameters and certain parameters used camel case which is not the recommended style.
Before going after an automatic uplink, we should check if there was an automatic uplink already ongoing, i.e., the ack for the previous automatic uplink cycle has not been received. If there is we shouldn't queue the new automatic uplink and wait for the previous Ack cycle to complete.
LinkADRReq mac command can be used by the network server to set a certain level of QOS using NbTrans field which is applicable to Unconfirmed traffic only for 1.0.2 spec. This commit introduces mechanisms to facilitate this QOS. It means to repeat an outgoing unconfirmed message NbTrans times without changing its frame counter. For class C, we have retired the ack_expiry_timer_for_class_c and have replaced it with another timer which mimics the RX2 closure as in Class A but doesn't actually close RX2 window. It's just a mechanism by which the state machine is informed that the you can proceed forward, we have not received anything in RX2 window either. This is needed as RX2 doesn't timeout in class C (i.e., the radio remains in continuous mode). In addition to that we need to close any pending timers for Receive windows after the MIC has passed and the Duplicate counter check has also been passed.
After transmission we should change the state before invoking opening of slots as we may start receiving in the rx slots and the state would suddenly change from SENDING to RECEIVING without going through the ACK_WAIT state (in case of CONFIRMED messages). Tests show that after this slight adjustment, our number of ack retries have significantly reduced.
The idea behind the method post_process_no_reception() is to post process any outgoing TX but we shouldn't do that if a CONFIRMED message is outgoing and there are still some retries left.
Previously, we weren't filling in RX1 frequecny in rx_window1_config structure. However, everything worked as in LoRaPHY::rx_config() API there was a check which filled in correct RX1 frequency. Now we are filling in RX1 freq. properly while we are computing parameters for RX1 window.
A couple of the coverity analysis findings are being treated here. For the rest there will be a separate PR.
64768fd
to
bc976c6
Compare
@kivaisan @kjbracey-arm @AnttiKauppila @0xc0170 Please review again. Tests updated as well in their respective PRs. Some corner cases are covered and improvements in stability. |
@0xc0170 Canthis be built? |
/morph build |
Build : SUCCESSBuild number : 3275 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2900 |
Test : SUCCESSBuild number : 3083 |
/morph mbed2-build |
Revert "Merge pull request #8183 from hasnainvirk/QOS_impl"
Description
Adds QOS mechanism for unconfirmed messages as per 1.0.2 spec in response to LinkADRReq mac command. In addition to that it fixes various bugs potentially hindering class C operation.
Pull request type