You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/dualtor/active_active_hld.md
+24-2Lines changed: 24 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ This document provides the high level design of SONiC dual toR solution, support
42
42
-[3.4 Orchagent](#34-orchagent)
43
43
-[3.4.1 IPinIP tunnel](#341-ipinip-tunnel)
44
44
-[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)
45
46
-[3.5 Transceiver Daemon](#35-transceiver-daemon)
46
47
-[3.5.1 Cable Control through gRPC](#351-cable-control-through-grpc)
47
48
-[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
426
427
427
428
1. MuxOrch
428
429
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`
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.
0 commit comments