Support for exporting (possibly-versioned) `ActionDesc`

Aperta
#1,076 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
18/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
82
Fork
16
Merge medio
3g 6h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/opte

Tutte le issue di oxidecomputer/opte

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.