Support for exporting (possibly-versioned) `ActionDesc`

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

メンテナーはふだん 2 日以内に返信

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
18/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
rust
領域
networking

調査の方向性

Start with the ActionDesc trait and ActionDescEntry in the layer flow table code, then the StatefulAction implementors (SNat, InboundNat, OutboundNat) and SNatDesc's FiniteHandle, to see what state each descriptor holds. Read RFD 580 and the linked WIP commit for the intended schema. Done means a versioned export format for each ActionDesc is agreed and implemented, with the NoOp entries and the import side tracked separately.

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

説明

live-migration

Each layer's LFT contains ActionDesc trait objects, which are "action descriptors" that describe what actions to take on a matching packet. To support live migration, we need a way to serialize each ActionDesc in a flow table, likely along with versioning information. This is laid out in RFD 580 and sketched a bit in this WIP branch that constructs schema for actions (along with a lot of other state).

This issue tracks only the serialization of the ActionDesc objects. Note that LFT entries can also be ActionDescEntry::NoOps, which are used for things like stateful firewalls, where an outbound flow creates a corresponding entry on the inbound flow table that has no data -- its existence is used to signal we should allow the packet, but do nothing else at that layer. Handling these no-ops will be tracked elsewhere too.

Some notes and background

I'm getting up to speed on migration in general. The notes below are relevant to this specific issue, but have become a little more of a brain-dump for myself and others than I intended. It's also possible that I'm either incorrect about a lot of this, or that we want to change things here to make this simpler or more symmetric. I'm not sure yet.

Note that this issue only tracks exporting the ActionDesc information. Deserializing the ActionDesc data will likely be done by the StatefulAction trait implementors (SNat, InboundNat, and OutboundNat). That work will be tracked separately. The asymmetry here is a little confusing, but I think we need to do something like this.

Why? The LFTs store only type-erased dyn ActionDescs. These include the plain-old-data like port numbers that are used to implement the actual transformations on a packet. As an example impl ActionDesc for SNatDesc generates a HdrTransform that rewrites the public and private IPs and port numbers on packets that it sees. Contrast that with 1-1 NAT, which just rewrites the IPs and leaves the ports unmodified.

This PoD has to be exported by the ActionDesc, because this is the only thing the LFT has, and the transformation often relies on private data fields. In the case of SNAT, that ActionDesc is SNatDesc. That has an internal smart handle type, called FiniteHandle, that releases the ports back to the shared pool when the handle is dropped. That obviously makes no sense to export, since it's an Arc pointing at some in-memory pool in one instance of the OPTE driver.

So, given those private data fields in the ActionDesc, we need a way to rebuild them on the destination side during import or restoration. That has to happen at the level of the StatefulAction, which is where we hand out new ActionDescs, which contain that smart handle pointing to the internal SNAT pool.

In other words, StatefulAction is where we decide which pool to take a claim from, and ActionDesc is the claim (along with the smart pointer for releasing the claim). We need to export "the claim", and then use that to make a new claim on the import side, which only happens at StatefulActions.

主要言語
Rust
スター
82
フォーク
16
平均マージ
3日 6時間
マージ済み PR(30日)
11

環境構築

はじめの一歩

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

oxidecomputer/opte のほかの issue

oxidecomputer/opte の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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