Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Srv6 static config HLD #1860

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

BYGX-wcr
Copy link

@BYGX-wcr BYGX-wcr commented Dec 4, 2024

This PR proposes to add a High-level Design document for changes in SONiC to support static configuration of Segment-routing over IPv6. Besides, a YANG model specification for the new table in CONFIG_DB is also defined.

Implementation PRs:

Module PR link
sonic-bgpcfgd sonic-net/sonic-buildimage#21156
FRR FRRouting/frr#16894
sonic-yang-models sonic-net/sonic-buildimage#21175

func_len = flen ; bit length of function portion in address, default 16
arg_len = alen ; bit length of argument portion in address, default 0
action = behavior ; behaviors defined for the SID
vrf = VRF_TABLE.key ; Optional, VRF name for decapsulation actions
Copy link
Contributor

@abdosi abdosi Dec 5, 2024

Choose a reason for hiding this comment

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

Let add comment applicable only for UDT46. If not define default VRF will be used.

Copy link
Author

Choose a reason for hiding this comment

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

added

arg_len = alen ; bit length of argument portion in address, default 0
action = behavior ; behaviors defined for the SID
vrf = VRF_TABLE.key ; Optional, VRF name for decapsulation actions
adj = address, ; Optional, list of adjacencies for cross-connect actions
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove this as we are not planning to test it anyways. This can be extended. in future as needed.

Copy link
Author

Choose a reason for hiding this comment

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

removed

}

leaf action {
type enumeration {
Copy link
Contributor

Choose a reason for hiding this comment

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

This might restrict the static configuration only for the 3 types below. Is the plan to support only these 3 types for now and later extend it?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, currently we only plan to support these 3 types of action.



## 3.2 Bgpcfgd changes

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please capture the FRR configuration sample. It would be good if you can provide sonic field to FRR configuration mapping.

Copy link
Author

Choose a reason for hiding this comment

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

There is still some ongoing discussion on the details of the new FRR configuration CLI. We'd better add the config sample and mapping later.

Specifically, there is no mechamism in SONiC allowing SDN controllers or users to directly add configuration for SRv6 without involving BGP.

In this document, we first define a new **SRV6_MY_SID_TABLE** table in CONFIG_DB that serves as the configuration source of SRv6 in SONiC.
Then, we design a new SRv6 Manager module in bgpcfgd to subscribe to the **SRV6_MY_SID_TABLE** table and compile changes in CONFIG_DB to changes in the configurations of FRR.
Copy link
Contributor

@dgsudharsan dgsudharsan Dec 10, 2024

Choose a reason for hiding this comment

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

Need to mention about the sonic specific patch to support action field in FRR as by default FRR doesn't support it.

Copy link
Author

Choose a reason for hiding this comment

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

I added a note

@abdosi
Copy link
Contributor

abdosi commented Dec 11, 2024

@dgsudharsan : Regarding supporting below requirement for DT46 End behavior do we need something like this in Config DB schema for MY_SID_TABLE ? We need OA to read this to create tunnel with the correct attribute. What do you suggest ?

                        TTL/DSCP/ECN Decap tunnel mode(pipe, uniform). 

```


## 3.2 Bgpcfgd changes
Copy link
Collaborator

@venkatmahalingam venkatmahalingam Dec 11, 2024

Choose a reason for hiding this comment

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

We're already using frrcfgd for SRv6, I would suggest to use frrcfgd for static SRv6 also for consistency, if there is any reason to use bpgcfgd, please state here.

Copy link
Author

Choose a reason for hiding this comment

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

Hi Venkatsen,

The primary reason is that we don't use frrcfgd in our daily operations. Since bgpcfgd has been leveraged to do static route configuration, we think it is not inappropriate to use bgpcfgd for static SRv6 configuration.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we discuss it in Routing WG? @BYGX-wcr @venkatmahalingam @lguohan

Copy link
Collaborator

@venkatmahalingam venkatmahalingam Dec 11, 2024

Choose a reason for hiding this comment

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

Yes, it would be helpful for the WG to understand/aware the new changes coming in for static SRv6.

Copy link
Author

Choose a reason for hiding this comment

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

Azure Networking has an event tonight starting at 6pm so I am unable to join this week's routing WG meeting. May we discuss this in next week's routing WG meeting? I can start an email thread about this topic. @venkatmahalingam, may you share your email address with me?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+--rw sonic-srv6
+--rw SRV6_MY_SID
| +--rw SRV6_MY_SID_LIST* [ip-address]
| +--rw ip-address inet:ipv6-address
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we have same ipv6 address exist across VRFs? should use VRF as a key instead of field in the table?

Copy link
Author

Choose a reason for hiding this comment

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

This table defines the MY_SID_LIST which should only have one instance in the current system. The VRF field is used to specify which VRF should be used for look up after the SRv6 functions decapsulates the packet. It is not used to specify which VRF the SID belongs to.


# About this Manual

This document provides general information about the design of the enhancements in SONiC to support static configuration of Segmentation Routing over IPv6 protocol, which is crucial for SRv6 SDN deployment (without usage of BGP).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we adding support only for end-point behaviors? how about steering the traffic to SRv6 at the head-end?

Copy link
Author

Choose a reason for hiding this comment

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

Yes. Right now, we only intend to add support for end-point behaviors because the traffic steering is done on the NICs in our use scenarios.


leaf action {
type enumeration {
enum uN;
Copy link
Collaborator

@venkatmahalingam venkatmahalingam Dec 11, 2024

Choose a reason for hiding this comment

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

This means that you support only uSID not regular end.dt6, end.dt46..etc, correct?, we should mention clearly in the HLD that static SRv6 supports only uSID based handling now.

Copy link
Author

Choose a reason for hiding this comment

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

I added a table for the current list of supported behaviors. Feel free to extend the list after you add the necessary support and tests.

# 1 Introuduction and Scope

This document describes the high-level design of the new features in SONiC to support SRv6 SDN.
The new features include the addtion of a new table in CONFIG_DB to allow static configuration of SRv6 and the enhancement of bgpcfgd to program FRR with input from CONFIG_DB.
Copy link

Choose a reason for hiding this comment

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

Hi @BYGX-wcr, thanks for the HLD to support SRv6 uSID static configuration.

The static SRv6 uSID configuration model in FRR as follows:

  • Configure an SRv6 locator and identify its parameters (name, prefix, block-len, node-len, func-bits). The CLI for this is already in FRR mainline.
  • Configure a static SRv6 SID under the SRv6 locator and identify its parameters (behavior, vrf, etc.). The CLI for this is being added in this FRR PR (Add CLI about locator and related funcs FRRouting/frr#16894)

In the current HLD, the configuration model is different and hence can’t be mapped to the current SRv6 uSID configuration model in FRR.

To resolve this, I would propose the following:

  • Create a new table (SRV6_MY_LOCATOR) for the SRv6 locator config and its parameters (name, prefix, block-len, node-len, func-bits).
  • In the SRV6_MY_SID_TABLE, you add the locator as new parameter for the SID. The locator parameter points to one of the locators in SRV6_MY_LOCATOR via the locator’s name. This way you can map the config to FRR config.

FRR inherits the (block-len, node-len, func-bits) of the locator and install the static SID into SONiC APPL_DB via fpm-sonic-dplane. This is already mainline in FRR and SONiC.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@abdosi abdosi Dec 12, 2024

Choose a reason for hiding this comment

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

@ahsalam: I understand the logic being used by SRV6_MY_LOCATOR. However our current config db schema is good enough to program FRR. We do not want indirection logic using 2 different config tables. If you see in below example we have all the information to program frr. We will parse ipv6 address and extract the opcode prefix to FRR. Keeping one table in synch with APP_DB format is easier for us.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ahsalam / @eddieruan-alibaba : We also planning to remove vrf from config db schema as our current use case is to use SAI_MY_SID_ENTRY_ATTR_TUNNEL_ID for uDT46 usecase. Currently Tunnel Decap Schema

### TUNNEL_DECAP_TERM_TABLE
does not support vrf for overlay interface so their is no point of specifying VRF as needed by SAI_MY_SID_ENTRY_ATTR_VRF.

Copy link
Contributor

Choose a reason for hiding this comment

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

DT46 will use default VRF. Our use case is not a typical L3VPN use case.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

Copy link

@ahsalam ahsalam left a comment

Choose a reason for hiding this comment

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

LGTM. Discussed the PR offline with @abdosi and @BYGX-wcr

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

|(Negative case) add config for a SID with an unsupported action in CONFIG_DB | verify that the configuration did not get into FRR config |
|delete config for a SID with uN action in CONFIG_DB | verify the locator config entry is deleted in FRR config|
|delete config for a SID with uDT46 action in CONFIG_DB | verify the opcode config entry for the uDT46 action is deleted in FRR config|

Copy link
Contributor

Choose a reason for hiding this comment

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

@BYGX-wcr : can we add some failure UT case also. What will happen if bgpcfgd gets exception and exited ? I assume bgp/swss/syncd docker restart and everything should get reprommed but lets add the test case to confirm.

Copy link
Author

Choose a reason for hiding this comment

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

Do you mean when bgpcfgd restarts, the SRv6 manager should retrieve all existing MY_SID config from CONFIG_DB and program them to FRR?

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@BYGX-wcr
Copy link
Author

@abdosi @eddieruan-alibaba @venkatmahalingam @dgsudharsan @ahsalam @cscarpitta , I have updated the HLD per Routing WG's discussion

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.


# About this Manual

This document provides general information about the design of the enhancements in SONiC to support static configuration of Segmentation Routing over IPv6 protocol, which is crucial for SRv6 SDN deployment (without usage of BGP).
Copy link

Choose a reason for hiding this comment

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

Nit:
s/Segmentation Routing/Segment Routing

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

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.

8 participants