Skip to content

Dualtor FRR support with hw NH Protection group - #2251

Open
manamand2020 wants to merge 7 commits into
sonic-net:masterfrom
manamand2020:mux_hardware_switching
Open

Dualtor FRR support with hw NH Protection group#2251
manamand2020 wants to merge 7 commits into
sonic-net:masterfrom
manamand2020:mux_hardware_switching

Conversation

@manamand2020

@manamand2020 manamand2020 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Support for FRR(Fast ReRoute) in DualToR architecture using Hardware based protection nexthop group. This feature allows failover protection of MUX neighbors in hardware without the NOS involvement.

elated PRs and specs:

Repo PR title State
sonic-swss Protection Nexthop Group Support GitHub issue/pull request detail
sonic-buildimage MUX cable failover_mode Yang Model GitHub issue/pull request detail

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@manamand2020
manamand2020 force-pushed the mux_hardware_switching branch from 69dec45 to 9e57f3f Compare March 3, 2026 00:09
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

* Backward compatible with existing software based switching. When **switching_mode** is set to **hardware** but the ASIC does not support nexthop protection groups, SONiC will fall back to normal software based switching transparently.
* Create nexthop protection group for FRR switchover based on the config.
* Maintain mapping of mux cable and ICMP echo session object id.
* The existing **state** field in App-DB MUX_CABLE_TBL is extended with two new values: **admin_active** and **admin_standby**. LinkMgrd will use these values for admin-initiated switching in both **normal** and **hardware** modes. Existing **active**/**standby** values continue to be used for link-state-driven switching, preserving backward compatibility with older LinkMgrd versions.

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.

In hw switching mode, will linkmgrd initiated toggling take effect if it's not from admin state?

Meaning if linkmgrd writes "active", what will happen?

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.

active and standby states are typically no-op for hardware based protection. Only admin state changes will acted upon by muxorch.

Comment thread doc/dualtor/mux_hw_protection_switching_hld.md Outdated
## 10. Future Enhancements

### 10.1 Protection NHG Switchover Counters
Per-port counters are not applicable for switchover observability because hardware protection switching monitors the ICMP offloaded session, not the physical port state. A new SAI specification will be proposed to define switchover counters scoped to the **SAI_NEXT_HOP_GROUP_TYPE_HW_PROTECTION** object, tracking successful switchover events per NHG. Note that a session state notification from the hardware does not imply a successful switchover; the counter will be incremented only on confirmed switchovers.

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.

Will it be counters only or timestamp as well?

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.

As of now switchover counters alone. We will have platform command to show timestamps. We need to see what we can propose for SAI wrt timestamps.

### 10.1 Protection NHG Switchover Counters
Per-port counters are not applicable for switchover observability because hardware protection switching monitors the ICMP offloaded session, not the physical port state. A new SAI specification will be proposed to define switchover counters scoped to the **SAI_NEXT_HOP_GROUP_TYPE_HW_PROTECTION** object, tracking successful switchover events per NHG. Note that a session state notification from the hardware does not imply a successful switchover; the counter will be incremented only on confirmed switchovers.

A `show mux switchover status` CLI will present these counters in a per-NHG summary, and a platform CLI will be added to show switchover timestamps for each event.

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.

platform CL - switchover history is a bit important in livesite troubleshooting, we need have some more generic solution.

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.

Understood, we will investigate how we can improve stats for troubleshooting.

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.

Is it nexhop group or nh protection group?

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.

It is nexthop protection group.

Comment thread doc/dualtor/mux_hw_protection_switching_hld.md

> **Why not a separate ProtNhgOrch?** Protection NHGs for dual-ToR are tightly coupled to the mux neighbor lifecycle and don't need an independent APP_DB table. If a future non-mux use case arises, a ProtNhgOrch can inherit from NhgOrch without changing the protection NHG implementation itself.

#### 7.1.2 MuxOrch

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.

@Ndancejic - please help review 7.1.2 - 7.1.4

#### 7.1.5 IcmpOrch
IcmpOrch will notify MuxOrch on ICMP session creation and deletion. On session creation, MuxOrch uses the session object id to program **SAI_NEXT_HOP_GROUP_MEMBER_ATTR_MONITORED_OBJECT** on the nexthop protection group member. On session deletion, MuxOrch clears the monitored object attribute so that the protection group member does not reference a stale session.

#### 7.1.6 Debounce Handling

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.

Take it as we don't backoff when there are continuous flaps, which does match today's linkmgrd behavior too. But with linkmgrd (software probing), we got a lot of false alarms and triggers mux flaps, perhaps it won't happen with hw probe that much, but something to think about.

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.

It will currently behave the same way. However we can plan some enhancements to avoid this kind of flaps.

Comment thread doc/dualtor/mux_hw_protection_switching_hld.md Outdated
Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@manamand2020
manamand2020 force-pushed the mux_hardware_switching branch from 2d1d3af to 86be6f6 Compare March 13, 2026 19:17
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@manamand2020
manamand2020 force-pushed the mux_hardware_switching branch from 90a6e14 to 4491237 Compare March 13, 2026 20:08
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Signed-off-by: Manas Kumar Mandal <manamand@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

- **Monitored ICMP session deletion:** If the monitored ICMP session is deleted while the nexthop protection group is active, the nexthop protection group member's monitored object attribute will become stale. MuxOrch should handle session deletion notifications from IcmpOrch and update or remove the monitored object attribute accordingly.
- **Hardware protection switchover failure:** When a hardware-initiated switchover fails for one or more nexthop protection groups, SAI sends a bulk error notification identifying the failed NHGs. ProtNhgOrch processes this bulk notification and forwards the failure information to MuxOrch. MuxOrch then retries the switchover for the failed NHGs by setting **SAI_NEXT_HOP_GROUP_ATTR_ADMIN_ROLE** to force the transition via admin mode. If the admin-mode retry also fails, MuxOrch marks the switchover as failed and the neighbor state as inconsistent. This keeps the failure handling behavior consistent with software-based failover switching mode, where a failed switchover similarly results in an inconsistent neighbor state that requires operator intervention or a subsequent recovery event.

## 13. Testing

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 elaborate on this section for all scenarios

@manamand2020
manamand2020 marked this pull request as ready for review June 2, 2026 18:11
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.

4 participants