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

US channel randomization not compatible with compliance test #515

Closed
terrillmoore opened this issue Dec 31, 2019 · 1 comment
Closed

US channel randomization not compatible with compliance test #515

terrillmoore opened this issue Dec 31, 2019 · 1 comment
Assignees

Comments

@terrillmoore
Copy link
Member

The latest US compliance test looks for all 8 channels to be covered in 16 steps. The LMIC uses random selection without replacement (and without repetition). When I calculate a Markov chain on 8 channels with this kind of probability, I find that the expected ("average") number of tries to get 8 channels is 19 steps. So you can "expect" to fail the test. You can, of course, re-run. Here's the transition probability matrix.

image

So... we need to instead use a shuffling algorthm, or expect to have to run the test several times to get a pass. The easiest way to do this is to keep a bit matrix that's a copy of the active channel mask, and clear bits as we use them. Choosing at random requires a search; but the alternative is an n-entry array, where n is the total number of channels. Also, by using a bit map, we can easily implement the join-by-randomly-poking in groups-of-eight scheme recommended by the regional spec. For the US, a map takes 80 bit; for one of the Chinese plans, it takes 96 bits. Even if supporting only 8 channels in practice, you'd still have 64 bits, and much less flexibility for the join hunt. If we always start at the bit of the current channel (rather than starting at bit zero of the map), we'll "usually" find a bit without having to search a lot; and we can remember the max and min channels to further accelerate the search (if needed).

@terrillmoore
Copy link
Member Author

With the changes at fac837d, the US (and AU) regions now correctly shuffle, and the US now passes the section 3.1 tests for channel usage. There will be more tests of this later in the test (which takes several hours to run), but it seems promising. I'll post the test report on forum.mcci.io or a discussion and link from there to where I post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant