Document Name | Link |
---|---|
BGP Suppress FIB Pending HLD | [https://github.com/stepanblyschak/SONiC/blob/bgp-suppress-fib-pending/doc/BGP/BGP-supress-fib-pending.md] |
As of today, SONiC BGP advertises learnt prefixes regardless of whether these prefixes were successfully programmed into ASIC. While route programming failure is followed by orchagent crash and all services restart, even for successfully created routes there is a short period of time when the peer will be black holing traffic. Also, in the following scenario, a credit loop occurs:
The problem with BGP programming occurs after the T1 switch is rebooted:
- First, the T1 FRR learns a default route from at least 1 T2
- The T0 advertises it’s prefixes to T1
- FRR advertises the prefixes to T2 without waiting for them to be programmed in the ASIC
- T2 starts forwarding traffic for prefixes not yet programmed, according to T1’s routing table, T1 sends it back to a default route – same T2
To avoid that, the route programming has to be synchronous down to the ASIC to avoid credit loops.
The test is to verify the mechanism that allows BGP not to advertise routes that haven't been installed into ASIC yet.
No scale/performance test involved in this test plan
Command to enable the feature:
admin@sonic:~$ sudo config suppress-fib-pending enabled
Command to disable the feature:
admin@sonic:~$ sudo config suppress-fib-pending disabled
The tests will be supported on t1 topo.
- Enable BGP suppress-fib-pending function at DUT
- Save configuration and execute one action randomly choosen from(reboot/config reload/fast-reboot/warm-reboot)
- Suspend orchagent process to simulate a delay
kill -SIGSTOP $(pidof orchagent)
- Announce BGP ipv4 prefixes to DUT from T0 VM by exabgp
- Make sure announced BGP routes are in queued state in the DUT routing table
- Verify the routes are not announced to T2 VM peer
- Send traffic matching the prefixes and verify packets are not forwarded to T0 VM
- Restore orchagent process
kill -SIGCONT $(pidof orchagent)
- Make sure announced BGP routes are not in queued state in the DUT routing table
- Make sure the routes are programmed in FIB by checking offloaded flag in the DUT routing table
show ip route 1.1.1.0/24 json
{
"1.1.1.0/24": [
{
"destSelected": true,
"distance": 20,
"installed": true,
"installedNexthopGroupId": 277,
"internalFlags": 264,
"internalNextHopActiveNum": 1,
"internalNextHopNum": 1,
"internalStatus": 80,
"metric": 0,
"nexthopGroupId": 277,
"nexthops": [
{
"active": true,
"afi": "ipv4",
"fib": true,
"flags": 3,
"interfaceIndex": 17,
"interfaceName": "PortChannel1021",
"ip": "10.0.0.65",
"weight": 1
}
],
"offloaded": true,
"prefix": "1.1.1.0/24",
"prefixLen": 24,
"protocol": "bgp",
"selected": true,
"table": 254,
"uptime": "00:08:08",
"vrfId": 0,
"vrfName": "default"
}
]
}
- Verify the routes are announced to T2 peer
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- This test should cover default and user defined vrf
- Enable BGP suppress-fib-pending function at DUT
- Save configuration and execute one action randomly choosen from(reboot/config reload/fast-reboot/warm-reboot)
- Suspend orchagent process to simulate a delay
- Announce BGP ipv6 prefixes to DUT from T0 VM by exabgp
- Make sure announced BGP routes are in queued state in the DUT routing table
- Verify the routes are not announced to T2 VM peer
- Send traffic matching the prefixes and verify packets are not forwarded to T0 VM
- Restore orchagent process
- Make sure announced BGP routes are not in queued state in the DUT routing table
- Make sure the routes are programmed in FIB by checking offloaded flag in the DUT routing table
- Verify the routes are announced to T2 peer
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- This test should cover default and user defined vrf
- No BGP suppress-fib-pending function configured at DUT
- Suspend orchagent process to simulate a delay
- Announce BGP prefixes to DUT from T0 VM by exabgp
- Make sure announced BGP routes are not in queued state in the DUT routing table
- Verify the BGP routes are announced to T2 peer
- Restore orchagent process
- Make sure the routes are programmed in FIB by checking offloaded flag in the DUT routing table
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- No BGP suppress-fib-pending function configured at DUT
- Run BGP test suite
- Make sure BGP tests are not affected
- Enable BGP suppress-fib-pending function at DUT
- Run BGP test suite
- Make sure BGP tests are not affected
- Enable BGP suppress-fib-pending function at DUT
- Suspend orchagent process to simulate a delay
- Announce BGP prefixes to DUT from T0 VM by exabgp
- Execute BGP session restart
- Verify BGP neighborships are established
- Make sure announced BGP routes are in queued state in the DUT routing table
- Configure static routes then redistribute to BGP
- Verify the redistributed routes are in the DUT routing table
- Verify the routes are announced to T2 VM peer
- Send traffic matching the prefixes and verify packets are not forwarded to T0 VM
- Restore orchagent process
- Make sure announced BGP routes are not in queued state in the DUT routing table
- Make sure the routes are programmed in FIB by checking offloaded flag in the DUT routing table
- Verify the BGP routes are announced to T2 peer
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- No BGP suppress-fib-pending function configured at DUT
- Suspend orchagent process to simulate a delay
- Announce a default route to DUT from T2 VM
- Announce BGP prefixes to DUT from T0 VM by exabgp
- Verify the BGP routes are announced to T2 VM peer
- Send traffic matching the prefixes and verify packets are forwarded back to T2 VM
- Enable BGP suppress-fib-pending function at DUT
- Restore orchagent process
- Make sure the routes are programmed in FIB by checking offloaded flag in the DUT routing table
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- Do BGP route flap 5 times
- Disable BGP suppress-fib-pending function
- Send traffic matching the prefixes in the BGP route flap and verify packets are forwarded back to T2 VM
- Suspend orchagent process to simulate a delay
- Announce 1K BGP prefixes to DUT from T0 VM by exabgp
- Verify the BGP routes are announced to T2 VM peer
- Send traffic matching the prefixes in the BGP route flap and verify packets are forwarded back to T2 VM
- Enable BGP suppress-fib-pending function at DUT
- Restore orchagent process
- Verify the routes are programmed in FIB by checking offloaded flag in the DUT routing table
- Send traffic matching the prefixes and verify packets are forwarded to T0 VM
- Enable BGP suppress-fib-pending function at DUT
- Start tcpdump capture at the ingress and egress port at DUT
- Announce 1K BGP prefixes to DUT from T0 VM by exabgp
- Verify the BGP routes are announced to T2 VM peer by DUT
- Withdraw 1K BGP prefixes
- Verify the BGP routes are withdraw from T2 VM peer by DUT
- Stop tcpdump cature
- Verify the average as well as middle route process time is under threshold