Skip to content

Add SONiC VPP IPinIP tunnel HLD - #222

Merged
yue-fred-gao merged 5 commits into
sonic-net:masterfrom
lolyu:add_vpp_ipip_hld
May 5, 2026
Merged

Add SONiC VPP IPinIP tunnel HLD#222
yue-fred-gao merged 5 commits into
sonic-net:masterfrom
lolyu:add_vpp_ipip_hld

Conversation

@lolyu

@lolyu lolyu commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Add IPinIP tunnel encap/decap support to SONiC VPP.

  • Microsoft ADO (number only): 37902558
Repo PR state
sinic-platform-vpp Add patch to support mp2p ipip tunnel GitHub issue/pull request detail
sonic-sairedis [vpp] add ipinip tunnel encap/decap support GitHub issue/pull request detail

Signed-off-by: Longxiang Lyu lolv@microsoft.com

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lolyu
lolyu force-pushed the add_vpp_ipip_hld branch from 45ffba7 to ba73eff Compare April 15, 2026 14:43
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lolyu lolyu left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review — Thorough HLD

Excellent coverage of both decap (P2MP/P2P) and encap (P2P) paths. The SAI↔VPP semantic mismatch analysis (Section 7) is particularly valuable — clearly explains why VPP's TEIB-based allowlist doesn't match SAI's permissive P2MP model, and the adaptation (P2MP wildcard fallback patch) is well-justified.

Minor:

  • Section numbering gap: 6.2 → 6.5 (missing 6.3, 6.4)
  • Consider noting IPv6 scope (in/out for this phase)
  • The P2MP permissive decap security trade-off could use a one-liner about underlay ACL/routing being the security boundary

LGTM 🚀

@lolyu
lolyu force-pushed the add_vpp_ipip_hld branch from ba73eff to d522b68 Compare April 16, 2026 03:07
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lolyu
lolyu marked this pull request as ready for review April 16, 2026 09:55
@lolyu
lolyu force-pushed the add_vpp_ipip_hld branch from d522b68 to 1353081 Compare April 16, 2026 11:50
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown

/azp run

@lolyu
lolyu requested review from yue-fred-gao and yxieca April 16, 2026 11:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lolyu
lolyu force-pushed the add_vpp_ipip_hld branch from 25c8289 to ce1ca91 Compare April 16, 2026 11:54
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@lolyu
lolyu force-pushed the add_vpp_ipip_hld branch from ce1ca91 to 46bec7b Compare April 16, 2026 11:55
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Comment thread docs/HLD/vpp-ipiptunnel.md Outdated
Comment thread docs/HLD/vpp-ipiptunnel.md Outdated
IPIP->>VPP: 3. vpp_ipip_tunnel_add(&req)
VPP-->>IPIP: sw_if_index (e.g. ipip1)

IPIP->>VPP: 4. refresh_interfaces_list()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vpp_ipip_tunnel_add already returns sw_if_index. Do we still need refresh_interfaces_list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we need to refresh the interface list to get intf name to used by interface_set_state

Comment thread docs/HLD/vpp-ipiptunnel.md
2. Iterating each interface individually, sending `IP_ADDRESS_DUMP` per interface.
3. The reply handler (`vl_api_ip_address_details_t_handler`) compares the dumped address against the search target; on match it records the `sw_if_index`.

---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add ipinip tunnel config in CONFIG_DB/APP_DB. It is also helpful to list vpp binary APIs for ipinip tunnel so we know from top to down how sonic maps to vpp

@lolyu lolyu Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will add the APPL_DB section

Comment thread docs/HLD/vpp-ipiptunnel.md
ok["Decap → deliver inner pkt to ipip0"]

subgraph patch["SONiC-VPP patch"]
p2mp["Lookup: {P2MP, src=outer_dst, dst=0.0.0.0}"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not reuse existing P2MP entry and adds P2MP lookup. This breaks existing P2MP + TEIB design, which wants to drop the packet if it doesn't match TEIB entries. Instead, I think we should introduce a new mode, for example, MP2P. It can be created the same way: create ipip tunnel src 10.0.0.1 mode mp2p. This creates a new entry for ipip tunnel lookup. You can then insert the lookup action after p2p or 6rd. If it is existing p2mp+teib, it won't hit the mp2p lookup because the entry is not there. I think this can be upstream to fd.io because it is a useful feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea, we sure can add a new tunnel type for our purpose. But naming it MP2P is pretty misleading here as P2MP means local is single-point and remote is multi-point, MP2P should means local is multi-point and remote is single-point.

How about name it P2ANY?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked gemini.

The difference between MP2P (Multipoint-to-Point) and P2MP (Point-to-Multipoint) comes down to the direction of the traffic flow and how the network handles the duplication or aggregation of packets.
 
In short:
 
MP2P is Many-to-One (N:1). It is used for traffic aggregation.
P2MP is One-to-Many (1:N). It is used for traffic distribution or replication.
 
Here is a detailed comparison of the two concepts in the context of networking and tunneling:
 
 
1. MP2P (Multipoint-to-Point)
 
Traffic Flow: Many senders $\rightarrow$ One receiver.
How it works: Multiple remote endpoints send tunneled traffic to a single, centralized destination. The receiving node uses a single interface to accept and decapsulate traffic from all of these different sources.
Key Characteristic: Aggregation. The network paths merge as they get closer to the destination. The receiver does not need to maintain strict state for every sender; it just processes the incoming packets.
Common Use Cases:
Standard Unicast Routing: In MPLS or Segment Routing, traffic from all over the network destined for a specific router naturally merges into an MP2P flow.
Hub-and-Spoke VPNs: Spoke routers sending their internet or corporate traffic to a central Hub router (e.g., DMVPN Spokes sending to the Hub).
 
2. P2MP (Point-to-Multipoint)
 
Traffic Flow: One sender $\rightarrow$ Many receivers.
How it works: A single source sends a packet, and the network is responsible for delivering that exact same packet to multiple destinations. To do this efficiently, the network performs packet replication—copying the packet only when the path splits, rather than the sender transmitting individual copies to every receiver.
Key Characteristic: Replication (Multicast). The sender or the network fabric must maintain state about who the receivers are so it knows where to replicate and forward the packets.
Common Use Cases:
Multicast Traffic: Live video streaming, IPTV, or financial stock ticker feeds where one server broadcasts to thousands of viewers.
Routing Protocol Updates: A Hub router sending OSPF or EIGRP hello packets/updates to all of its Spoke routers simultaneously.
MPLS Traffic Engineering (RSVP-TE P2MP): Used to build a strict, engineered path from a single headend router to multiple tail-end routers, specifically to carry Multicast VPN (mVPN) traffic.

I think our use case fits MP2P. It describes sender->receiver relationship, not local->remote.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yue-fred-gao, for decap, the receiver is local, the sender is remote; as p2mp means the sender is mp while the receiver is p, mp2p means the sender is p and the receiver is mp. This is not our situation, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lolyu , from explanation from gemini, "2" is the direction of traffic ("2" is to). The role before "2" is sender and after is receiver. so p2mp means one sender to multiple receiver. mp2p means multiple sender to one receiver. Having said that, I am not particularly clinging to any term.

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lolyu

lolyu commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yue-fred-gao, could you please help review again?

Few updates:

  1. APPL_DB schema is added
  2. dedup process is added to solve the VPP tunnel duplication due to SONiC programs encap/decap tunnels with the same src/dst IP.
  3. add section to describe the solution to fix the tunnel unnumber failure due to rif not ready.

As for this PR: #221, can we do this in two step, first let's unblock the SONiC decap with this hacky solution, and add a new ipip tunnel flag to support this afterwards?

@yue-fred-gao

Copy link
Copy Markdown
Contributor

Hi @yue-fred-gao, could you please help review again?

Few updates:

  1. APPL_DB schema is added
  2. dedup process is added to solve the VPP tunnel duplication due to SONiC programs encap/decap tunnels with the same src/dst IP.
  3. add section to describe the solution to fix the tunnel unnumber failure due to rif not ready.

As for this PR: #221, can we do this in two step, first let's unblock the SONiC decap with this hacky solution, and add a new ipip tunnel flag to support this afterwards?

Thanks for the update. I think new ipip tunnel flag is not very complicated so I prefer you use the same commit to complete it. The reason is that for each new update to vpp (new patch or new version), we need to upload the prebuilt debs to buildkite so they are not rebuilt again. We want to minimize the versions in buildkite to limit the space usage.

@lolyu

lolyu commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yue-fred-gao, could you please help review again?
Few updates:

  1. APPL_DB schema is added
  2. dedup process is added to solve the VPP tunnel duplication due to SONiC programs encap/decap tunnels with the same src/dst IP.
  3. add section to describe the solution to fix the tunnel unnumber failure due to rif not ready.

As for this PR: #221, can we do this in two step, first let's unblock the SONiC decap with this hacky solution, and add a new ipip tunnel flag to support this afterwards?

Thanks for the update. I think new ipip tunnel flag is not very complicated so I prefer you use the same commit to complete it. The reason is that for each new update to vpp (new patch or new version), we need to upload the prebuilt debs to buildkite so they are not rebuilt again. We want to minimize the versions in buildkite to limit the space usage.

Hi @yue-fred-gao, thanks, one question: we only patches the downstream version, right? why do we need to upload debs to buildkite?

@yue-fred-gao

Copy link
Copy Markdown
Contributor

Hi @yue-fred-gao, could you please help review again?
Few updates:

  1. APPL_DB schema is added
  2. dedup process is added to solve the VPP tunnel duplication due to SONiC programs encap/decap tunnels with the same src/dst IP.
  3. add section to describe the solution to fix the tunnel unnumber failure due to rif not ready.

As for this PR: #221, can we do this in two step, first let's unblock the SONiC decap with this hacky solution, and add a new ipip tunnel flag to support this afterwards?

Thanks for the update. I think new ipip tunnel flag is not very complicated so I prefer you use the same commit to complete it. The reason is that for each new update to vpp (new patch or new version), we need to upload the prebuilt debs to buildkite so they are not rebuilt again. We want to minimize the versions in buildkite to limit the space usage.

Hi @yue-fred-gao, thanks, one question: we only patches the downstream version, right? why do we need to upload debs to buildkite?
@lolyu , we upload debs to buildkite to avoid building vpp from source every time. It saves CPU resources and make the sonic-vpp build more stable.

Comment thread docs/HLD/vpp-ipiptunnel.md
Comment thread docs/HLD/vpp-ipiptunnel.md
Comment thread docs/HLD/vpp-ipiptunnel.md
@yue-fred-gao
yue-fred-gao merged commit 6563036 into sonic-net:master May 5, 2026
3 checks passed
lolyu added a commit to sonic-net/sonic-sairedis that referenced this pull request Jun 2, 2026
Add VPP ipinip tunnel encap/decap support.
Please refer to HLD to design details: sonic-net/sonic-platform-vpp#222.

```
 tests/decap/test_decap.py::test_decap ✓                                                                                                                                                                         100%
```

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
lunyue-ms pushed a commit to lunyue-ms/sonic-platform-vpp that referenced this pull request Jun 2, 2026
* Add SONiC VPP IPinIP tunnel HLD

Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
lolyu added a commit to sonic-net/sonic-mgmt that referenced this pull request Jun 17, 2026
Approach
What is the motivation for this PR?
Work item tracking

Microsoft ADO (number only): 38423472
As the subject.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How did you do it?
Please refer to the HLD: sonic-net/sonic-platform-vpp#222

How did you verify/test it?
Run test_decap on vpp testbed and pass.

Any platform specific information?
Supported testbed topology if it's a new test case?
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Jun 25, 2026
Approach
What is the motivation for this PR?
Work item tracking

Microsoft ADO (number only): 38423472
As the subject.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How did you do it?
Please refer to the HLD: sonic-net/sonic-platform-vpp#222

How did you verify/test it?
Run test_decap on vpp testbed and pass.

Any platform specific information?
Supported testbed topology if it's a new test case?

Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Jul 16, 2026
Approach
What is the motivation for this PR?
Work item tracking

Microsoft ADO (number only): 38423472
As the subject.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How did you do it?
Please refer to the HLD: sonic-net/sonic-platform-vpp#222

How did you verify/test it?
Run test_decap on vpp testbed and pass.

Any platform specific information?
Supported testbed topology if it's a new test case?

Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
ssithaia-ebay pushed a commit to ssithaia-ebay/sflow-yang-sonic-mgmt that referenced this pull request Jul 21, 2026
Approach
What is the motivation for this PR?
Work item tracking

Microsoft ADO (number only): 38423472
As the subject.

Signed-off-by: Longxiang Lyu lolv@microsoft.com

How did you do it?
Please refer to the HLD: sonic-net/sonic-platform-vpp#222

How did you verify/test it?
Run test_decap on vpp testbed and pass.

Any platform specific information?
Supported testbed topology if it's a new test case?

Signed-off-by: ssithaia-ebay <ssithaian@ebay.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants