Skip to content

Commit 589aca6

Browse files
Merge pull request #1860 from BYGX-wcr/srv6_static_config_hld
Add Srv6 static config HLD
2 parents 103967f + c5b1b06 commit 589aca6

File tree

2 files changed

+204
-0
lines changed

2 files changed

+204
-0
lines changed

doc/srv6/images/SRv6_bgpcfgd.png

34.9 KB
Loading

doc/srv6/srv6_static_config_hld.md

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# Static Configuration of SRv6 in SONiC HLD
2+
3+
# Table of Contents
4+
5+
- [Revision](#revision)
6+
- [Definition/Abbreviation](#definitionabbreviation)
7+
- [About This Manual](#about-this-manual)
8+
- [1 Introuduction and Scope](#1-introuduction-and-scope)
9+
- [2 Feature Requirements](#2-feature-requirements)
10+
- [2.1 Functional Requirements](#21-functional-requirements)
11+
- [2.2 Configuration and Managment Requirements](#22-configuration-and-management-requirements)
12+
- [2.3 Warm Boot Requirements](#23-warm-boot-requirements)
13+
- [3 Feature Design](#3-feature-design)
14+
- [3.1 New Table in ConfigDB](#31-new-table-in-configdb)
15+
- [3.2 Bgpcfgd Changes](#32-bgpcfgd-changes)
16+
- [3.3 YANG Model](#33-yang-model)
17+
- [4 Unit Test](#4-unit-test)
18+
- [5 References ](#5-references)
19+
20+
# Revision
21+
22+
| Rev | Date | Author | Change Description |
23+
| :--: | :-------: | :------------------------: | :---------------------: |
24+
| 0.1 | 12/5/2024 | Changrong Wu | Initial version |
25+
| 0.2 | 12/20/2024 | Changrong Wu | Update to use two tables per SONiC Routing WG discussion |
26+
27+
28+
# Definition/Abbreviation
29+
30+
### Table 1: Abbreviations
31+
32+
| ****Term**** | ****Meaning**** |
33+
| -------- | ----------------------------------------- |
34+
| BGP | Border Gateway Protocol |
35+
| SID | Segment Identifier |
36+
| SRv6 | Segment Routing IPv6 |
37+
| SDN | Software Defined Network |
38+
| uSID | Micro Segment |
39+
| VRF | Virtual Routing and Forwarding |
40+
41+
# About this Manual
42+
43+
This document provides general information about the design of the enhancements in SONiC to support static configuration of Segment Routing over IPv6 protocol, which is crucial for SRv6 SDN deployment (without usage of BGP).
44+
45+
# 1 Introuduction and Scope
46+
47+
This document describes the high-level design of the new features in SONiC to support SRv6 SDN.
48+
The new features include the addtion of a new table in CONFIG_DB to enable configuration of SRv6 and the enhancement of bgpcfgd to program FRR with input from CONFIG_DB.
49+
Besides, this document also define new YANG model specification and unit-test cases used to validate the aforementioned features.
50+
51+
Note: frrcfgd in SONiC is also able to program SRv6 configurations to FRR but it is designed for scenarios where BGP is used to propagate SRv6 SIDs. SONiC users can choose either bgpcfgd or frrcfgd to program FRR configurations according to their own use cases freely.
52+
53+
54+
# 2 Feature Requirements
55+
56+
## 2.1 Functional Requirements
57+
58+
Provide ability to statically configure SRv6 SIDs for block IDs, locators and local functions from CONFIG_DB.
59+
60+
## 2.2 Configuration and Management Requirements
61+
62+
1. User should be able to statically configure block length, locator length and function length for SRv6.
63+
64+
2. User should be able to statically configure a number of SIDs/uSIDs for the local functions of the switch.
65+
66+
## 2.3 Warm Boot Requirements
67+
68+
Warm reboot is intended to be supported for planned system warm reboot.
69+
70+
71+
72+
# 3 Feature Design
73+
74+
At the time of writing this document, FRR has been able to program the SRv6 related tables in APPL_DB through fpmsyncd.
75+
However, there is still one gap preventing SONiC being utilized for SRv6 SDN deployment.
76+
Specifically, there is no mechamism in SONiC allowing SDN controllers or users to directly add configuration for SRv6 without involving BGP.
77+
78+
In this document, we define two new tables in CONFIG_DB, i.e. **SRV6_MY_LOCATORS** and **SRV6_MY_SIDS**, which serves as the configuration source of SRv6 in SONiC.
79+
Then, we design a new SRv6 Manager module in bgpcfgd to subscribe to the two tables and compile changes in CONFIG_DB to changes in the configurations of FRR (Note: the new SRv6 Manager relies on the new configuration CLI brought in by [FRR PR#16894](https://github.com/FRRouting/frr/pull/16894)).
80+
To verify the correctness of the aforementioned flow, we also define the corresponding YANG model specification.
81+
The workflow of the new mechanism is shown in the following diagram.
82+
83+
![Static SRv6 Config flow](images/SRv6_bgpcfgd.png)
84+
85+
The design details of each step is described in the following subsections.
86+
87+
## 3.1 New Table in ConfigDB
88+
89+
**SRV6_MY_LOCATORS**
90+
91+
Description: New table to hold the locators configured to the node.
92+
93+
Schema:
94+
95+
```
96+
; New table
97+
; holds SRv6 locators configured to the local node.
98+
99+
key = SRV6_MY_LOCATORS|locator_name
100+
; field = value
101+
prefix = locator_prefix ; ipv6 address that represents the locator, which is also the IPv6 prefix for all SIDs under the locator
102+
block_len = blen ; bit length of block portion in address, default 32
103+
node_len = nlen ; bit length of node ID portion in address, default 16
104+
func_len = flen ; bit length of function portion in address, default 16
105+
arg_len = alen ; bit length of argument portion in address, default 0
106+
vrf = VRF_TABLE.key ; the VRF that the locator belongs to, default "default"
107+
108+
For example:
109+
"SRV6_MY_LOCATORS" : {
110+
"loc1" : {
111+
"prefix" : "FCBB:BBBB:20::"
112+
},
113+
"loc2" : {
114+
"prefix" : "FCBB:BBBB:21::"
115+
}
116+
}
117+
```
118+
119+
120+
**SRV6_MY_SIDS**
121+
122+
Description: New table to hold local SID definition and SID to behavior mapping.
123+
124+
Schema:
125+
126+
```
127+
; New table
128+
; holds local SID to behavior mapping, the keys are the locator name plus the full IPv6 addresses of the SIDs
129+
130+
key = SRV6_MY_SIDS|locator|ip_address
131+
; field = value
132+
action = behavior ; behaviors defined for the SID, default uN
133+
decap_vrf = VRF_TABLE.key ; Optional, VRF name for decapsulation actions, default "default", only applicable to uDT4/uDT46/uDT6 actions
134+
decap_dscp_mode = decap_dscp_mode ; Optional, the parameter that specifies how the node should handle DSCP bits when it performs decapsulation, default "uniform", only applicable to uDT4/uDT46/uDT6 actions
135+
136+
For example:
137+
"SRV6_MY_SIDS" : {
138+
"loc1|FCBB:BBBB:20::" : {
139+
"action": "uN"
140+
},
141+
"loc1|FCBB:BBBB:20:F1::" : {
142+
"action": "uDT46",
143+
"decap_dscp_mode": "pipe"
144+
},
145+
"loc2|FCBB:BBBB:21::" : {
146+
"action": "uN"
147+
},
148+
}
149+
```
150+
151+
We plan to support the staic configurations of the SRv6 behaviors in the system gradually.
152+
The current list of supported SRv6 behaviors allowed to be define in CONFIG_DB is as follows:
153+
154+
| Alias | SRv6 Behaviors |
155+
| :------ | :----- |
156+
| uN | End with NEXT-CSID |
157+
| uDT46 | End.DT46 with CSID |
158+
159+
## 3.2 Bgpcfgd changes
160+
161+
To enable automatic programming SRv6 configurations from CONFIG_DB to FRR, we need to add a new module in bgpcfgd to watch changes in **SRV6_MY_LOCATORS** and **SRV6_MY_SIDS** and compile the corresponding changes in FRR's configurations.
162+
Following the naming convention of modules in bgpcfgd, we call this new module SRv6 Manager.
163+
The new SRv6 Manager are supposed to verify the validity of the configuration entries coming from the CONFIG_DB.
164+
If it gets an invalid configuration input, it should log the event in the syslog and not compile the configuration into FRR.
165+
166+
## 3.3 YANG Model
167+
The simplified version of the YANG model is defined below.
168+
```
169+
module: sonic-srv6
170+
+--rw sonic-srv6
171+
+--rw SRV6_MY_LOCATORS
172+
| +--rw SRV6_MY_LOCATORS_LIST* [locator_name]
173+
| +--rw locator_name string
174+
| +--rw prefix inet:ipv6-address
175+
| +--rw block_len? uint8
176+
| +--rw node_len? uint8
177+
| +--rw func_len? uint8
178+
| +--rw arg_len? uint8
179+
| +--rw vrf? union
180+
+--rw SRV6_MY_SIDS
181+
+--rw SRV6_MY_SIDS_LIST* [locator ip_address]
182+
+--rw ip_address inet:ipv6-address
183+
+--rw locator -> /sonic-srv6/SRV6_MY_LOCATORS/SRV6_MY_LOCATORS_LIST/locator_name
184+
+--rw action? enumeration
185+
+--rw decap_vrf? union
186+
+--rw decap_dscp_mode? enumeration
187+
```
188+
Refer to [sonic-yang-models](https://github.com/sonic-net/sonic-buildimage/tree/master/src/sonic-yang-models) for the YANG model defined with standard IETF syntax.
189+
190+
## 4 Unit Test
191+
192+
|Test Cases | Test Result |
193+
| :------ | :----- |
194+
|add config for a SID with uN action in CONFIG_DB | verify the locator config entry is created in FRR config|
195+
|add config for a SID with uDT46 action in CONFIG_DB | verify the opcode config entry is created in FRR config with default VRF|
196+
|(Negative case) add config for a SID without action in CONFIG_DB | verify that the configuration did not get into FRR config |
197+
|(Negative case) add config for a SID with an unsupported action in CONFIG_DB | verify that the configuration did not get into FRR config |
198+
|delete config for a SID with uN action in CONFIG_DB | verify the locator config entry is deleted in FRR config|
199+
|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|
200+
201+
202+
## 5 References
203+
204+

0 commit comments

Comments
 (0)