Skip to content

Commit

Permalink
Adding encap preservation section.
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f committed Oct 11, 2023
1 parent a71a354 commit 133dad6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions documentation/general/dash-sai-pipeline-packet-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
2. [5.4.2. Encap fields handling](#542-encap-fields-handling)
1. [5.4.2.1. Handling DSCP](#5421-handling-dscp)
2. [5.4.2.2. Handling TTL](#5422-handling-ttl)
3. [5.4.3. Encap preservation](#543-encap-preservation)
5. [5.5. Conntrack Lookup and Update](#55-conntrack-lookup-and-update)
1. [5.5.1. Flow lookup](#551-flow-lookup)
2. [5.5.2. Flow creation](#552-flow-creation)
Expand Down Expand Up @@ -255,6 +256,14 @@ TTL behavior for encap shall be "pipe" model (similar to SAI_TUNNEL_TTL_MODE_PIP
- When adding encaps, TTL value shall be default set to 64.
- DASH pipeline shall not modify the TTL values in the overlay packet (customer packet).

#### 5.4.3. Encap preservation

Sometimes, depends on the scenario to implement, the customer might want to preserve certain original encaps in the outgoing traffic. For example, say we receive a packet with structure: overlay -> underlay -> tunnel1 -> tunnel2. And we want to remove or update underlay, preserve tunnel1 and remove tunnel2. This gives us the problem of handling all the CRUD combinations of all encaps, including structure changes: after removing underlay, should tunnel0 becomes underlay or should we keep it as tunnel0? All these things affects the encap related routing actions and final packet we create.

Since all the encap information is preserved in the metadata bus for flow creation anyway, to solve this problem, we can simply recreate them in anyway we want with routing action: `tunnel_from_encap`. It allows the source and target encap and their override value being set, which allows us to preserve the encaps in anyway we want and also ensures the clarity of final transformation that we are doing in the end.

Please note that: Encap preservation will not affect the reverse tunnel creation as "Stateless decap vs stateful decap" section described above. A encap can be preserved as well as used in reverse tunnel creation at the same time, since they are essentially 2 different things.

### 5.5. Conntrack Lookup and Update

After entering a specific pipeline, the first stage will be the Conntrack Lookup stage, which does the flow lookup. If any flow is matched, the saved actions will be applied, the metering counters will be updated, and the rest of pipeline will be skipped.
Expand Down

0 comments on commit 133dad6

Please sign in to comment.