Wrap router addresses within addressable space.#2539
Merged
Conversation
Contributor
There was a problem hiding this comment.
Is it worth also/instead having a simple test that calls getRouterNumber directly? This can make it easier to understand exactly what getRouterNumber is doing (i.e. I can grep for it and see usages in tests). Perhaps unnecessary if this is just a short term solution.
Contributor
|
lgtm |
islemaster
added a commit
that referenced
this pull request
May 27, 2015
Wrap router addresses within addressable space.
deploy-code-org
added a commit
that referenced
this pull request
May 27, 2015
commit 9e3421a Merge: 57a9f8e c5b734d Author: Brad Buchanan <bradley.c.buchanan@gmail.com> Date: Wed May 27 13:23:02 2015 -0700 Merge pull request #2539 from code-dot-org/netsim_router_address_wrap Wrap router addresses within addressable space. commit c5b734d Author: Brad Buchanan <brad@code.org> Date: Wed May 27 13:22:41 2015 -0700 Test getRouterNumber() directly commit 57a9f8e Author: Continuous Integration <dev@code.org> Date: Wed May 27 20:13:44 2015 +0000 Automatically built. commit 817bc2c Merge: abb6ca9 aef144d Author: Chris Pirich <chris@code.org> Date: Wed May 27 13:12:59 2015 -0700 Merge pull request #2513 from code-dot-org/fix_project_level_sharing Fix project level sharing commit abb6ca9 Author: Continuous Integration <dev@code.org> Date: Wed May 27 20:10:17 2015 +0000 Automatically built. commit 1d7991e Author: Josh Lory <josh.lory@code.org> Date: Wed May 27 13:01:53 2015 -0700 Only include color scss in applab, not common scss commit 1d7991e Author: Josh Lory <josh.lory@code.org> Date: Wed May 27 13:01:53 2015 -0700 Only include color scss in applab, not common scss commit 6761a91 Author: CaptainStack <CaptainStack@outlook.com> Date: Wed May 27 12:34:11 2015 -0700 Accommodating multiple cohorts on workshops page. commit 0cfeed2 Author: Continuous Integration <dev@code.org> Date: Wed May 27 19:30:15 2015 +0000 Automatically built. commit e271b91 Merge: c7db2db 5d20db3 Author: Brad Buchanan <bradley.c.buchanan@gmail.com> Date: Wed May 27 12:22:45 2015 -0700 Merge pull request #2534 from code-dot-org/netsim_interrouter_messaging NetSim: Interrouter messaging commit c7db2db Author: CaptainStack <CaptainStack@outlook.com> Date: Wed May 27 12:13:38 2015 -0700 Switching links to use ng-href commit 5b6ba92 Author: Continuous Integration <dev@code.org> Date: Wed May 27 18:46:19 2015 +0000 Automatically built. commit 6974e9c Author: cpirich <chris@code.org> Date: Wed May 27 11:37:12 2015 -0700 fix expansion block bug due to block/function scope commit 6974e9c Author: cpirich <chris@code.org> Date: Wed May 27 11:37:12 2015 -0700 fix expansion block bug due to block/function scope commit f9f249b Author: Continuous Integration <dev@code.org> Date: Wed May 27 18:28:19 2015 +0000 Automatically built. commit e592e8a Author: Brad Buchanan <brad@code.org> Date: Wed May 27 11:20:06 2015 -0700 Fail more gracefully when unable to create client node. commit a3201ee Author: Brad Buchanan <brad@code.org> Date: Wed May 27 11:19:40 2015 -0700 Fix NetSim UI Tests running on localhost; select correct channels API public key under localhost-studio.code.org rewrite commit e592e8a Author: Brad Buchanan <brad@code.org> Date: Wed May 27 11:20:06 2015 -0700 Fail more gracefully when unable to create client node. commit e271b91 Merge: c7db2db 5d20db3 Author: Brad Buchanan <bradley.c.buchanan@gmail.com> Date: Wed May 27 12:22:45 2015 -0700 Merge pull request #2534 from code-dot-org/netsim_interrouter_messaging NetSim: Interrouter messaging commit c7db2db Author: CaptainStack <CaptainStack@outlook.com> Date: Wed May 27 12:13:38 2015 -0700 Switching links to use ng-href commit 5b6ba92 Author: Continuous Integration <dev@code.org> Date: Wed May 27 18:46:19 2015 +0000 Automatically built. commit 6974e9c Author: cpirich <chris@code.org> Date: Wed May 27 11:37:12 2015 -0700 fix expansion block bug due to block/function scope commit 6974e9c Author: cpirich <chris@code.org> Date: Wed May 27 11:37:12 2015 -0700 fix expansion block bug due to block/function scope
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem: When you've got four-bit addresses but routers addressed by their entity ID, it's pretty easy to end up with unaddressable routers.
Example: Hosts on Router 17 receive addresses like 17.1, 17.2, etc. Using a "4.4" address format the 17 overflows and turns into 1.1, 1.2, etc. Routing breaks down completely, even within Router 17's subnet, because all addresses being sent appear to be leaving the network.
This PR, the short-term solution: Router number and address are calculated as router entityID modulo the addressable space. Router 17 becomes Router 1, Router 18 becomes Router 2, etc. Collisions are still possible, but routing within the subnet will always work and problems will only become apparent with a relatively large number of routers in a full-class-routing scenario.
Long-term it would be better to detach router addresses from their entityIDs entirely, but this is significantly more work.