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.
Description
WIP: send outbound packets using one of N bound source ports
Motivation
The goal of this work is to send packets between two hosts using more than one 5-tuple. When running on networks like AWS where the underlying network driver and overlay fabric makes routing, load balancing, and failover decisions based on the flow hash, this enables more than one flow between pairs of hosts.
Proposal
With this change, Nebula will optionally bind to multiple additional UDP sockets that are only used for sending, not for receiving.
Add a new optional configuration "send.ports" which specifies how many ports to use per thread for sending (default is 1). Notably, the destination port is always fixed for a given host.
If this is set to a value > 1, then nebula binds to additional sockets and then picks the one to send based on a "hash" of source of the src and dst ports. This is deliberately just a random scrambling of the bits, I'm sure there's something better we could do.
After some internal testing revealed that the original commit triggered the roaming behavior, I also added a modification tohostDidRoam
so that it ignores the ports and only pays attention to the IP addresses.After some more discussion I thought of a different approach: Tag packets sent from the "non-canonical" interface, i.e. using a source port that the sender is not listening on, with a subtype that indicates to the receiver that it should ignore packet for roaming detection.
Caveats
This PR is the first time I've ever touched the nebula code, I have only a cursory understanding of the implications of this change on the handshaking / roaming / etc.
In particular, I have absolutely 0 understanding of roaming or what my change does or would do.I now kinda maybe get this a bit.