Skip to content

Wrap router addresses within addressable space.#2539

Merged
islemaster merged 2 commits into
stagingfrom
netsim_router_address_wrap
May 27, 2015
Merged

Wrap router addresses within addressable space.#2539
islemaster merged 2 commits into
stagingfrom
netsim_router_address_wrap

Conversation

@islemaster

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@Bjvanminnen

Copy link
Copy Markdown
Contributor

lgtm

islemaster added a commit that referenced this pull request May 27, 2015
Wrap router addresses within addressable space.
@islemaster islemaster merged commit 9e3421a into staging May 27, 2015
@islemaster islemaster deleted the netsim_router_address_wrap branch May 27, 2015 20:23
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
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.

2 participants