-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add virtual network switch component #177
Draft
alexandermbrown
wants to merge
14
commits into
main
Choose a base branch
from
alexbr/vswitch
base: main
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.
Draft
Conversation
This file contains 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
alexandermbrown
force-pushed
the
alexbr/vswitch
branch
4 times, most recently
from
August 6, 2024 03:08
0fdbf03
to
090fc3d
Compare
Signed-off-by: Jingyao Zhou <[email protected]>
Signed-off-by: Jingyao Zhou <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
Signed-off-by: Alex Brown <[email protected]>
alexandermbrown
force-pushed
the
alexbr/vswitch
branch
from
August 6, 2024 05:03
090fc3d
to
c6689d7
Compare
Signed-off-by: Alex Brown <[email protected]>
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.
VSwitch
A virtual network switch (vswitch) forwards Ethernet frames between components similar to a physical network switch.
Current Design
A vswitch contains a number of ports, each consisting of a set of sDDF network queues (TX active & free, RX active & free). These ports correspond to Ethernet ports on a physical switch.
The vswitch forwards frames similar to a normal switch. It doesn't know mac addresses at compile time, it generates a forwarding table at runtime based on the broadcasts and responses it receives.
There is a many-to-one relationship between mac addresses and ports. Several mac addresses may be associated with a single port if that port connects to another vswitch or virtualiser.
Filtering
Filtering is done at the port level. Each port$P$ has an associated $P$ may send to. This is enough to, for example, only allow some clients in a system to access the outside world (i.e., the network card). A future design could add filtering on the mac address level however this is more complex to implement. Another option is to allow the user to supply a
allow_list
bitmap specifying which destination portsbool vswitch_can_send(src, dest)
function to make this policy interchangeable.Copying
The vswitch currently copies packets when forwarding as otherwise free buffers could all accumulate on a single (destination) client. It may be possible to move the copying into copy components situated between the vswitch and a client's RX port, however, care needs to be taken to return free buffers back to their original sender.
Example System
Testing is currently being done on libvmm alexbr/vswitch
Tasks
memcpy
instead ofsddf_memcpy
vswitch_config.h
andethernet_config.h
format (see Open Question below)Open Question: who should multiplex?
@wom-bat @Courtney3141 @Ivan-Velickovic the following is a design question I think you guys should be aware of.
Currently both the vswitch and the virtualiser multiplex packets - they have overlapping responsibilities. The net virtualiser implements a one to one mapping of MAC addresses to clients. In a system with a vswitch or a firewall, there may be a many to one mapping between MACs to clients. To get around this issue, I had to turn off the multiplexing part of the virtualiser as follows:
Since this is a general issue regarding component behaviour, I thought it would be good to discuss solutions to this issue (from easy workarounds to more principled approaches). If performance weren't an issue, I'd say it would be natural to make the only job of the virtualiser to convert offsets and perform cache operations, and leave multiplexing to a separate component (vswitch or otherwise). In the case that this results in significant performance loss, I think there are a few options:
Another approach would be to improve how we implement composability in the system. Currently systems are composable by swapping out components. This has the downside that at every point of composability you need extra IPCs between PDs. On the other end of the spectrum, traditional systems use software libraries (with common APIs) to do this. I propose we implement these components as single-file libraries to allow the system designer to decide how much isolation or performance they desire. A critical system would include the vswitch / multiplexing library in a separate component to the cache ops / address translation while a more performant system could merge these into one PD (similar to Hong-Meng). This would also reduce code duplication making code less error-prone. Eventually, the a user could specify during the build process which components they want to combine for performance reasons.