Skip to content

Commit 92276a1

Browse files
authored
Added section on prefix based mux neighbors (#2055)
* [Dualtors] Added section on prefix based mux neighbors * Added details about mux neighbors using prefix based route pointing to neighbor nexthop.
1 parent 4ae78fc commit 92276a1

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

doc/dualtor/active_active_hld.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ This document provides the high level design of SONiC dual toR solution, support
4242
- [3.4 Orchagent](#34-orchagent)
4343
- [3.4.1 IPinIP tunnel](#341-ipinip-tunnel)
4444
- [3.4.2 Flow Diagram and Orch Components](#342-flow-diagram-and-orch-components)
45+
- [3.4.3 Prefix Based Neighbor Architecture](#343-prefix-based-neighbor-architecture)
4546
- [3.5 Transceiver Daemon](#35-transceiver-daemon)
4647
- [3.5.1 Cable Control through gRPC](#351-cable-control-through-grpc)
4748
- [3.6 State Transition Flow](#36-state-transition-flow)
@@ -426,8 +427,29 @@ TunnelOrch will subscribe to `MUX_TUNNEL` table and create tunnel, tunnel termin
426427
427428
1. MuxOrch
428429
MuxOrch will listen to state changes from linkmgrd and does the following at a high-level:
429-
* Enable / disable neighbor entry.
430-
* Add / remove tunnel routes.
430+
* Update neighbor prefix routes with neighbor nexthop or tunnel nexthop.
431+
432+
#### 3.4.3 Prefix Based Neighbor Architecture
433+
In the traditional approach, adding a neighbor involved creating a SAI neighbor and a nexthop, which implicitly creates a host route (/32 for IPv4, /128 for IPv6) in the SDK that points directly to the neighbor nexthop. With prefix-based neighbors:
434+
435+
* **Neighbor Entry**: The neighbor entry is created with `SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE=true`, which prevents automatic host route creation.
436+
* **Separate Prefix Route**: A separate /32 (IPv4) or /128 (IPv6) prefix route is explicitly created that points to the neighbor as its nexthop.
437+
* **Nexthop Flexibility**: The prefix route's nexthop can be dynamically updated between:
438+
- **Direct neighbor nexthop**: Points directly to the neighbor entry (active state)
439+
- **Tunnel nexthop**: Points to the IPinIP tunnel nexthop (standby state)
440+
441+
**Implementation Details:**
442+
* When a mux port neighbor is created, the `SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE` attribute is set to prevent automatic host route creation.
443+
* A corresponding prefix route (server_ip/32 or server_ipv6/128) is created separately with the neighbor as the initial nexthop.
444+
* **During active to standby transition**: The prefix route's nexthop is updated from the direct neighbor nexthop to the tunnel nexthop, redirecting traffic through the IPinIP tunnel to the peer ToR.
445+
* **During standby to active transition**: The prefix route's nexthop is updated from the tunnel nexthop back to the direct neighbor nexthop, allowing direct traffic forwarding to the server.
446+
* The neighbor entry itself remains persistent throughout state transitions, improving stability and performance.
447+
448+
**Traffic Forwarding Behavior:**
449+
* **Active State**: Server traffic flows: `Incoming packet → Prefix route lookup → Direct neighbor nexthop → Server`
450+
* **Standby State**: Server traffic flows: `Incoming packet → Prefix route lookup → Tunnel nexthop → IPinIP tunnel → Peer ToR → Server`
451+
452+
This optimization maintains the same traffic forwarding behavior while significantly reducing the complexity and overhead of mux state transitions by eliminating the need for neighbor entry add/remove operations.
431453
432454
### 3.5 Transceiver Daemon
433455
#### 3.5.1 Cable Control through gRPC

doc/dualtor/image/orchagent.png

44.3 KB
Loading

0 commit comments

Comments
 (0)