-
Notifications
You must be signed in to change notification settings - Fork 529
ipv6: send one Router Advertisement when solicitations overlap #1162
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
Open
adamgeorge309
wants to merge
1
commit into
master
Choose a base branch
from
topic/gy/ipv6-ra-cancel-superseded
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| %description: | ||
| Tests that consecutive multicast Router Advertisements (RA) sent by an IPv6 router to | ||
| the all-nodes address are never closer than MIN_DELAY_BETWEEN_RAS (3 s), even when | ||
| several Router Solicitations (RS) arrive while a solicited advertisement is already | ||
| pending (RFC 4861 Section 6.2.6). | ||
|
|
||
| Six hosts boot at the same time on one link, so their solicitations reach router R | ||
| within a fraction of a second of each other, while the advertisement scheduled for the | ||
| first of them has not been sent yet. Each solicitation computes its own send time from | ||
| a random delay in [0, MAX_RA_DELAY_TIME], so a later solicitation can land earlier than | ||
| the pending advertisement. When it does, the router must let that one advertisement | ||
| serve them all, not send both. | ||
|
|
||
| The scenario depends on the random delays the run draws, so the test also asserts that | ||
| the superseding case really occurred. Without that, a change elsewhere that shifts the | ||
| random number stream could leave the run with no overlapping solicitations at all, and | ||
| the rate-limit assertion would then pass without exercising anything. | ||
|
|
||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %file: test.ned | ||
| import inet.networklayer.configurator.ipv6.Ipv6FlatNetworkConfigurator; | ||
| import inet.node.ethernet.EthernetSwitch; | ||
| import inet.node.ipv6.Router6; | ||
| import inet.node.ipv6.StandardHost6; | ||
| import ned.DatarateChannel; | ||
|
|
||
| network RaRateLimit | ||
| { | ||
| types: | ||
| channel ethline extends DatarateChannel | ||
| { | ||
| delay = 0.1us; | ||
| datarate = 10Mbps; | ||
| } | ||
| submodules: | ||
| configurator: Ipv6FlatNetworkConfigurator; | ||
| switch: EthernetSwitch; | ||
| R: Router6; | ||
| host[6]: StandardHost6; | ||
| connections: | ||
| R.ethg++ <--> ethline <--> switch.ethg++; | ||
| for i=0..5 { | ||
| host[i].ethg++ <--> ethline <--> switch.ethg++; | ||
| } | ||
| } | ||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %inifile: omnetpp.ini | ||
| [General] | ||
| record-vector-results = false | ||
| ned-path = ../../../../src | ||
| network = RaRateLimit | ||
| sim-time-limit = 30s | ||
| cmdenv-express-mode = false | ||
| **.cmdenv-log-level = detail | ||
| cmdenv-log-prefix = "%t %C: " | ||
|
|
||
| # RFC 4861 defaults, and also INET's own NED defaults: no periodic advertisement is due | ||
| # within the run, so every advertisement seen here is a solicited one | ||
| **.R.ipv6.neighbourDiscovery.minIntervalBetweenRAs = 200s | ||
| **.R.ipv6.neighbourDiscovery.maxIntervalBetweenRAs = 600s | ||
|
|
||
| # all hosts boot together, as after a power failure | ||
| **.host[*].ipv6.neighbourDiscovery.hostBootupTime = 0.4s | ||
|
|
||
| # Ethernet NIC configuration | ||
| **.eth[*].queue.typename = "EthernetQosQueue" | ||
| **.eth[*].queue.dataQueue.typename = "DropTailQueue" | ||
| **.eth[*].queue.dataQueue.packetCapacity = 10 | ||
|
|
||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %subst: /omnetpp::// | ||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %postrun-command: awk '/R\.ipv6\.neighbourDiscovery: Create and send RA invoked/ { if (prev != "" && $1 - prev < 3) printf "VIOLATION: two multicast RAs %.6f s apart, at %s and %s\n", $1 - prev, prev, $1; prev = $1 }' test.out > ra_gaps.out | ||
| %not-contains: ra_gaps.out | ||
| VIOLATION | ||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %contains: stdout | ||
| RaRateLimit.host[5].ipv6.neighbourDiscovery: Assigning new address to: eth0 | ||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %contains: stdout | ||
| R.ipv6.neighbourDiscovery: Cancelling the solicited RA scheduled at | ||
| %#-------------------------------------------------------------------------------------------------------------- | ||
| %postrun-command: grep "undisposed object:" test.out > test_undisposed.out || true | ||
| %not-contains: test_undisposed.out | ||
| undisposed object: ( |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Later solicitations lose timely replies
After a solicited advertisement fires,
sendSolicitedRaleaves the next-advertisement time in the past. Later solicitations get no reply until the periodic advertisement.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.