Skip to content

Commit 4a2fa65

Browse files
committed
Route Consistency Checker high level requirements
1 parent a852266 commit 4a2fa65

File tree

1 file changed

+311
-0
lines changed

1 file changed

+311
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
# Route Consistency Checker
2+
3+
#### Rev 0.1
4+
5+
6+
7+
8+
9+
# List of Tables
10+
11+
[Table 1: Abbreviations](#table-1-abbreviations)
12+
13+
# Revision
14+
| Rev | Date | Author | Change Description |
15+
|:--:|:--------:|:-----------------:|:------------------------------------------------------------:|
16+
| 0.1 | 04/27/2021 | Vijay Kumar Vasantha | Initial version |
17+
| | | | |
18+
19+
# Definition/Abbreviation
20+
21+
### Table 1: Abbreviations
22+
23+
| **Term** | **Meaning** |
24+
| -------- | ------------------------------ |
25+
| ARP | Address Resolution Protocol |
26+
| CLI | Command Line Interface |
27+
| IP | Internet Protocol |
28+
| LAG | Link Aggregation Group |
29+
| LAN | Local Area Network |
30+
| MAC | Media Access Control addresses |
31+
| VLAN | Virtual Local Area Network |
32+
| VRF | Virtual Routing and Forwarding |
33+
34+
# About this Manual
35+
36+
This document provides general overview of Route Consistency Checker (RCC). Route checker aims at checking the consistency of routes & nexthops between the source RIB and the destinations kernel & hardware.
37+
38+
39+
40+
# 1 Introduction and Scope
41+
42+
This document describes the Functionality and High level design of the Route Consistency Checker(RCC).
43+
44+
In SONiC the routing module, which is the source of routes, resides in BGP docker. BGP docker in turn runs FRR daemon to compute & update routes & nexthops. FRR generated routes passes through multiple modules before it is being programmed in kernel & hardware. The routes & nexthops are stored in each of these intermediate module and passed to next module in pipeline through various redis DB tables. Below flow depicts the stages in route propagation from software to hardware.
45+
46+
47+
48+
```mermaid
49+
sequenceDiagram
50+
participant Zebra
51+
participant Kernel
52+
participant APP_DB
53+
participant ASIC_DB
54+
participant SDK
55+
56+
57+
Zebra->>Kernel: Update/Del Routes & Nexthops
58+
Kernel->>APP_DB: via routesyncd
59+
APP_DB->>ASIC_DB: Routes & Nexthop ID
60+
APP_DB->>ASIC_DB: Nexthop Id & Nexthops
61+
ASIC_DB->>SDK: Routes & Nexthop ID
62+
ASIC_DB->>SDK: Nexthop Id & Nexthops
63+
SDK->>H/W: Routes & Nexthop ID
64+
SDK->>H/W: Nexthop Id & Nexthops
65+
66+
```
67+
68+
69+
70+
The RCC is designed to detect & rectify in-consistency of the routes & nexthop between the following source and destination pairs,
71+
72+
- Zebra to Kernel
73+
- Zebra to H/W
74+
75+
Note that RCC does not try to detect & rectify any inconsistency between the intermediate modules/databases.
76+
77+
# 2 Feature Requirements
78+
79+
The Route Consistency Checker feature enables the user to check the consistency of routes & nexthop between Zebra & Hardware and Zebra & Kernel. Any discrepancy in the routes & nexthop will be detected and action to rectify the inconsistency will be taken. User will be given option to start & stop the route consistency checker. Once route consistency checker is started it will check & rectify discrepancy.
80+
81+
For Route Consistency Checker the source of truth will be Zebra routing table. It would try to find & rectify any discrepancy between Zebra's route & nexthop and Hardware route & nexthop and between Zebra's route & nexthop and Kernel's route & nexthop.
82+
83+
Route Consistency Checker will,
84+
85+
- Route consistency will enable user to check route consistency for a given VRF
86+
- Route consistency will enable user to check route consistency for a address-family
87+
- Route consistency will validate NextHops. It will check the associated egress interface and ARP/neighbor entries
88+
- Route consistency will validate ECMP NextHops. It will check the associated egress interface and ARP/neighbor entries
89+
- Route consistency will validate Tunnel NextHops. It will check the associated egress interface and ARP/neighbor entries for the overlay.
90+
- Route consistency checker can be started by user and it will run in background
91+
- Route consistency checker will dump inconsistent routes into a file that can be viewed by an user CLI
92+
- User will be given an option to correct the inconsistent routes across HW and SW (remedy)
93+
- As the route consistency checker is a CPU intensive operation, only one instance of checker can be active at any moment
94+
95+
## 2.1 Functional Requirements
96+
97+
The following are the types of consistency checking run
98+
99+
### **Route discrepancy**
100+
101+
- **Data: Routes**
102+
103+
- **Source/Destination: Zebra/Hardware**
104+
105+
- **Detection:**
106+
- Scan the routes in hardware by redirecting ''l3 defip show"
107+
- Scan the routes in FRR by redirecting the output of "show ip route"
108+
- Compare the files generated to see any discrepancy in routes alone
109+
110+
- **In-consistency:**
111+
- **Zebra has more routes**
112+
- **Action:**
113+
- The inconsistency is logged into a file/database.
114+
- To resolve the inconsistency routes has to be deleted from FRR and re-added. *Is it needed to be rectified?*
115+
- FRR should provide API/command to delete and re-add protocol routes, note that 'clear ip route' might not be effective as del & add happens fast and del might not be propagated till h/w.
116+
- One time route del/add might not result in rectification of route programming issue. Either it needs to be checked at each of the intermediate DB level or it needs to be del/add as many times as there are discrepancy in the programming chain (Zebra->RouteSync->APP-DB->RouteOrch->ASIC-DB->SDK)
117+
- Action: del and add one time - clear ip route in FRR, Have a socket to FRR like bgpcfgd. show ip route filename
118+
- **Hardware has more routes**
119+
- **Action:**
120+
- The inconsistency is logged into a file/database.
121+
- To resolve the inconsistency routes has to be deleted from hardware. *Is it needed to be rectified?*
122+
- Using 'l3 defip destory <ip>' deletes the route from H/W but SAI/SDK will have inconsistency.
123+
- Should the dangling route be traced back to ASIC_DB, RouteOrch, APP_DB? RouteOrch should have provide a mechanism to receive the del action either though debugsh command or a DB table. RouteOrch should react to either debugsh command or DB new table update.
124+
- Action: add and del static route with null nexthop
125+
126+
127+
128+
Note:
129+
130+
- Routes missing from hardware in hardware route limit hit case will **not** be considered as discrepancy
131+
- Newly added routes will be skipped from scanned output and it is determined from the 'uptime' of routes in zebra.
132+
- Newly deleted routes will be skipped from scanned output and it is determined by RouteSyncd temporarily storing deleted routes in APP-DB.
133+
- Action: Revisit, maintain watch list
134+
135+
##
136+
137+
138+
139+
- **Data: Routes**, **Nexthop**
140+
141+
- **Source/Destination: Zebra/Kernel**
142+
143+
- **Detection:**
144+
- Scan the routes in FRR by redirecting the output of "show ip route"
145+
- Scan the routes in kernel by redirecting the output of "ip route show" or use netlink socket to get route dump
146+
- Compare the files generated to see any discrepancy in routes alone
147+
148+
- **In-consistency:**
149+
- **Zebra has more routes**
150+
- **Action:**
151+
- The inconsistency is logged into a file/database.
152+
- To resolve the inconsistency routes has to be added in kernel. *Is it needed to be rectified?*
153+
- FRR should provide mechanism to del/add routes or FRR should provide API to inject routes into kernel.
154+
- Is there a need to check APP-DB, ASIC-DB for consistency of missed routes in kernel.
155+
- Action: del and add using clear command in frr
156+
- **Kernel has more routes**
157+
- **Action:**
158+
- The inconsistency is logged into a file/database.
159+
- To resolve the inconsistency routes has to be deleted from kernel. *Is it needed to be rectified?*
160+
- FRR should provide API to delete routes from kernel.
161+
- Action: add and del routes with source as static/sharpd (ip route del)
162+
163+
164+
165+
### **Route, Number of nexthops discrepancy because of limit **
166+
167+
Routes or number of nexthops hitting the limit in hardware/kernel will not be treated as an issue and will be ignored.
168+
169+
Action: Get route limit from bcmsh command, user should know what routes are missed to be programed in h/w. Check error db.
170+
171+
### **Route's nexthop discrepancy**
172+
173+
- **Data: Routes and Nexthops**''
174+
175+
- **Source/Destination: Zebra, ASIC-DB/Hardware**
176+
177+
- **Detection:**
178+
- Scan the routes in hardware by redirecting below output to file, by doing so for each route Route: <RIF, Nexthop IP, Dest MAC> could be mapped.
179+
- ''l3 defip show" - (Route: NexthopGroupID)
180+
- "l3 egress show" - (NexthopId: RIF, Dest Mac)
181+
- "l3 l3table show" - (NexthopId: NexthopIP)
182+
- "l3 ecmp egress show" - (NexthopGroupId: NexthopId)
183+
- Scan the routes in FRR by redirecting the output of "show ip route" and scan the below table in ASIC-DB, by doing so for each routeRoute: <RIF, Nexthop IP, Dest MAC> could be mapped.
184+
- Route Table
185+
- Nexthop Table
186+
- ECMP Group Mapping Index
187+
- Neighbor Table
188+
- Compare each route reachability information,
189+
- Log the discrepancy into a file or DB. *Is it needed to be rectified?*
190+
- If there is any discrepancy in rif, nexthop IP then indicate FRR to del & add the route information.
191+
- If there is any discrepancy in dest MAC then indicate OrchAgent (through debugsh or APP_DB) to del & add the entry in neighbor table
192+
- Action: issue arp clear command or arp clear in nbrsyncd
193+
194+
Note:
195+
196+
- This handles the case of inconsistent reachability information for both ECMP and non-ECMP case between S/W & H/W and missing reachability information in H/W.
197+
198+
199+
200+
### Non-ECMP nexthops discrepancy
201+
202+
The below diagram depicts the usage of non-ecmp nexthops in hardware
203+
204+
![]()https://docs.google.com/document/d/1O10j_YP9vn-MD46wP78dC_aqD34E_N7yi9O59d-98-s/edit
205+
206+
As depicted in the non-ecmp nexthops consists of below types of nexthops,
207+
208+
- Routes non-ecmp nexthops - Software aware
209+
210+
- ECMP members nexthops - Software aware
211+
212+
- Tunnel members level-2 underlay nexthops - Not software aware
213+
214+
- Internal nexthops & other module created nexthops - Not software aware
215+
216+
217+
218+
The software not aware tunnel underlay nexthops and internal nexthops will not have reference count associated with it. So it is not feasible to detect and remove the additional nexthop entries in H/W.
219+
220+
The case of nexthop present in orch agent but nexthop not present in H/W will be handled in Route's nexthop discrepancy sec.
221+
222+
### ECMP nexthops discrepancy
223+
224+
The below diagram depicts the usage of ecmp nexthops in hardware
225+
226+
![](https://docs.google.com/drawings/d/1ZlKhfzzSRfE2ZhKGJZk5-wfVLsG-EFKHnlix9icgmJI/edit)
227+
228+
As depicted in the ecmp nexthops consists of below types of nexthops,
229+
230+
- Tunnel overlay ECMP group - Software aware
231+
- ECMP members nexthops - Software aware
232+
- Tunnel underlay ECMP group and other internal ECMP group - Not software aware
233+
234+
235+
236+
The software not aware tunnel underlay ECMP nexthops will not have reference count associated with it. So it is not feasible to detect and remove the additional ECMP nexthop entries in H/W..
237+
238+
The case of ECMP nexthop present in orch agent but nexthop not present in H/W will be handled in Route's nexthop discrepancy sec.
239+
240+
241+
242+
Below table describes the summary of discrepancy and its action
243+
244+
245+
246+
| Src | Dst | Action |
247+
| -------------------------------- | --------------------------------- | ------------------------------------------------------------ |
248+
| Route in s/w | Route **not** in h/w | Readd to APPDB, ASIC, SDK, HW |
249+
| Route **not** in s/w | Route in h/w | Remove from APPDB, ASIC, SDK, H/W |
250+
| Route & nexthop in s/w | Route & nexthop **not** in kernel | Readd to kernel |
251+
| Route & nexthop **not** in s/w | Route & nexthop in kernel | Remove from kernel |
252+
| Nexthop in s/w | Nexthop **not** in h/w | Readd to ASIC, SDK, HW |
253+
| Nexthop **not** in s/w | Nexthop in h/w | No action. Other modules can be owner or can be SAI internal. Ref count can be zero. |
254+
| ECMP in s/w | ECMP **not** in h/w | Readd to ASIC, SDK, HW |
255+
| ECMP **not** in s/w | ECMP in h/w | No action. Other modules can be owner or can be SAI internal. Ref count can be zero. |
256+
| Routes nexthop is not consistent | Routes nexthop is not consistent | Readd to APPDB, ASIC, SDK, HW |
257+
258+
259+
260+
## 2.2 Configuration and Management Requirements
261+
262+
263+
264+
265+
266+
## 2.3 Scalability Requirements
267+
268+
269+
270+
## 2.4 Warm Boot Requirements
271+
272+
TBD
273+
274+
275+
## 5 CLI
276+
277+
route-consistency-checker [start | stop] //vrf, afi
278+
279+
show route-consistency-checker
280+
281+
282+
### 5.1 Configuration Commands
283+
284+
```
285+
286+
```
287+
288+
### 5.2 Show Commands
289+
290+
```
291+
292+
```
293+
294+
295+
## 6 Serviceability and Debug
296+
297+
The existing logging mechanisms shall be used. Proposed debug framework shall be used for internal state dump.
298+
299+
300+
301+
## 7 Unit Test cases
302+
303+
| | | |
304+
| ---- | ---- | ---- |
305+
| | | |
306+
| | | |
307+
| | | |
308+
| | | |
309+
| | | |
310+
| | | |
311+
| | | |

0 commit comments

Comments
 (0)