oxidecomputer / oxidecomputer/p4

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

Open
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
137
Forks
12
Avg merge
4d 22h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing vlan-switch.rs and hello-world.rs examples, then compare their setup with the BMv2 simple_switch_grpc port-mapping syntax shown in the issue. Define the supported veth or TAP interface mapping and command-line shape; done means a sample Rust program instantiates a P4 program and connects mapped Linux interfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
cli, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.