Skip to content
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

Orchestra: optimize channel offsets of unicast slotframes #1673

Merged
merged 3 commits into from Jul 7, 2022

Conversation

atiselsts
Copy link
Member

The problem: there is an intention to logically separate the channel offsets that are used for EB packets, for broadcast packets, and for unicast packets. However, the max unicast channel offset is set to 255. The real channel is calculated as offset % hopping_sequence_size. As typical hopping sequences are much shorter than 256 elements, in many cases unicast packet are going to use the same physical channels as EB and broadcast packets, leading to potential collisions between these types of packets.

The solution: the PR makes the range of channel offsets dependent on the hopping sequence size. This will not work as intended if the hopping sequence is changed at the runtime to have a smaller number of channels. However, this is not typical for most networks.

Of course, keeping the three groups of packets is separate channels is not possible if the number of channels is less than 3. In that special case we set ORCHESTRA_UNICAST_MIN_CHANNEL_OFFSET to 0 and allow the ranges to overlap.

The practical impact of this is very small for most networks, however, it makes it easier to reason about the causes of the collisions in the networks.

This is based on work done with Cysca Technologies.

@atiselsts
Copy link
Member Author

I have updated the PR with a change that also makes EB output to use multiple channel offsets by default.

@arurke arurke self-assigned this May 15, 2022
@arurke arurke added this to the Version 4.8 milestone May 30, 2022
os/services/orchestra/orchestra-rule-eb-per-time-source.c Outdated Show resolved Hide resolved
os/services/orchestra/orchestra-conf.h Outdated Show resolved Hide resolved
os/services/orchestra/orchestra-rule-eb-per-time-source.c Outdated Show resolved Hide resolved
os/services/orchestra/orchestra-conf.h Outdated Show resolved Hide resolved
@atiselsts atiselsts force-pushed the optimize/orchstra-multichannel branch from b5bc6e1 to 88da0a5 Compare June 7, 2022 18:47
@atiselsts
Copy link
Member Author

Updated the code style here.

@atiselsts atiselsts force-pushed the optimize/orchstra-multichannel branch from 88da0a5 to 90b2436 Compare June 7, 2022 19:58
@atiselsts atiselsts force-pushed the optimize/orchstra-multichannel branch from 90b2436 to 517f9e8 Compare June 19, 2022 18:22
@atiselsts atiselsts force-pushed the optimize/orchstra-multichannel branch from 517f9e8 to 5d63354 Compare July 1, 2022 12:36
@arurke arurke modified the milestones: Version 4.8, Version 4.9 Jul 1, 2022
@atiselsts atiselsts force-pushed the optimize/orchstra-multichannel branch from 5d63354 to 2cfd7f4 Compare July 2, 2022 07:36
@arurke
Copy link
Member

arurke commented Jul 6, 2022

A note for future reference:

This PR changes the default channel offsets for Orchestra. An overview for cases when there are more than 2 channels in the hopping sequence (HS):

  • Was:
    • EB: 0, Common: 1, Unicast: 2 - 255.
  • After this PR:
    • EB: 1, Common: 0, Unicast: 2 - <sizeof(HS) - 1>

Mixed deployment will thus not work (or work poorly depending on HS) and adjustments to the different ORCHESTRA_*_CHANNEL_OFFSET defines in orchestra-conf.h might be needed.

@arurke
Copy link
Member

arurke commented Jul 7, 2022

I did a quick test on FIT IoT-lab, it showed a slight improvement in PRR as expected.

@arurke arurke merged commit 7fad7ae into contiki-ng:develop Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants