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

オープン
#64 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
linux, rust
領域
cli, networking

調査の方向性

まず既存の vlan-switch.rs と hello-world.rs の例を読み、次に、それらのセットアップを issue に示されている BMv2 simple_switch_grpc のポートマッピング構文と比較します。サポートする veth または TAP インターフェースのマッピングとコマンドラインの形式を定義します。サンプルの Rust プログラムが P4 プログラムをインスタンス化し、マッピングされた Linux インターフェースに接続できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
140
フォーク
14
平均マージ
3日 18時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

oxidecomputer/p4 のほかの issue

oxidecomputer/p4 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。