Skip to content

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

Merged
merged 7 commits into from
Oct 11, 2018

Conversation

hasnainvirk
Copy link
Contributor

@hasnainvirk hasnainvirk commented Sep 19, 2018

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

[X] Fix
[] Refactor
[ ] Target update
[] Functionality change
[ ] Breaking change

@hasnainvirk
Copy link
Contributor Author

@kivaisan @AnttiKauppila @kjbracey-arm Please review.

@hasnainvirk
Copy link
Contributor Author

Copy link
Contributor

@kivaisan kivaisan left a 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.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

// application when RX2 windows is elapsed, i.e., in process_reception_timeout()
_ctrl_flags &= ~TX_ONGOING_FLAG;
} else {
//_ctrl_flags |= TX_DONE_FLAG;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code here too

@hasnainvirk
Copy link
Contributor Author

Dead code removed, rebased.

@hasnainvirk
Copy link
Contributor Author

@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");
Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same issue here.

Hasnain Virk added 7 commits September 21, 2018 15:55
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.
@hasnainvirk
Copy link
Contributor Author

@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.

@AnttiKauppila
Copy link

@0xc0170 Canthis be built?

@NirSonnenschein
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 7, 2018

Build : SUCCESS

Build number : 3275
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8183/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 7, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 8, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 10, 2018

/morph mbed2-build

@cmonr cmonr merged commit 5c675d3 into ARMmbed:master Oct 11, 2018
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Oct 11, 2018
This reverts commit 5c675d3, reversing
changes made to 2b04a02.
adbridge added a commit that referenced this pull request Oct 12, 2018
Revert "Merge pull request #8183 from hasnainvirk/QOS_impl"
adbridge pushed a commit that referenced this pull request Oct 19, 2018
This reverts commit 5c675d3, reversing
changes made to 2b04a02.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants