Skip to content
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

Nice to include a sample Rust program that instantiates a P4 program, and connects to Linux interfaces like veth or TAP #64

Open
jafingerhut opened this issue Dec 10, 2024 · 0 comments

Comments

@jafingerhut
Copy link

The example programs like vlan-switch.rs and hello-world.rs are nice when you want to write Rust code to generate packets to be processed, and expect packets out, but if there was an example Rust program that could take some kind of command line arguments like BMv2 simple_switch does for mapping port numbers to Linux interface names, e.g.

simple_switch_grpc -i 0@veth0 -i 1@veth2 -i 2@veth4 -i 3@veth6 -i 4@veth8 -i 5@veth10 -i 6@veth12 -i 7@veth14

That means to make the P4 program port number 0 map to Linux interface veth0, port number 1 to veth4, etc. The syntax doesn't have to be precisely that, of course.

I don't know if it is the same system calls to connect to a veth vs. a TAP interface, but if supporting only one of those is easier than supporting both, I don't have a strong preference, but I know that veth can be used to create multi-switch virtual networks in a single Linux host. I'm not sure whether that is easy to do with TAP interfaces.

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

No branches or pull requests

1 participant