|
| 1 | +# BGP Suppress FIB Pending Test Plan |
| 2 | + |
| 3 | +## Related documents |
| 4 | + |
| 5 | +| **Document Name** | **Link** | |
| 6 | +|-------------------|----------| |
| 7 | +| BGP Suppress FIB Pending HLD | [https://github.com/stepanblyschak/SONiC/blob/bgp-suppress-fib-pending/doc/BGP/BGP-supress-fib-pending.md]| |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +As of today, SONiC BGP advertises learnt prefixes regardless of whether these prefixes were successfully programmed into ASIC. |
| 12 | +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. |
| 13 | +Also, in the following scenario, a credit loop occurs: |
| 14 | +###### Figure 1. Use case scenario |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +The problem with BGP programming occurs after the T1 switch is rebooted: |
| 19 | +1. First, the T1 FRR learns a default route from at least 1 T2 |
| 20 | +2. The T0 advertises it’s prefixes to T1 |
| 21 | +3. FRR advertises the prefixes to T2 without waiting for them to be programmed in the ASIC |
| 22 | +4. 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 |
| 23 | + |
| 24 | +To avoid that, the route programming has to be synchronous down to the ASIC to avoid credit loops. |
| 25 | + |
| 26 | +### Scope |
| 27 | + |
| 28 | +The test is to verify the mechanism that allows BGP not to advertise routes that haven't been installed into ASIC yet. |
| 29 | + |
| 30 | +### Scale / Performance |
| 31 | + |
| 32 | +No scale/performance test involved in this test plan |
| 33 | + |
| 34 | +### Related **DUT** CLI commands |
| 35 | +Command to enable the feature: |
| 36 | +``` |
| 37 | +admin@sonic:~$ sudo config suppress-fib-pending enabled |
| 38 | +``` |
| 39 | +Command to disable the feature: |
| 40 | +``` |
| 41 | +admin@sonic:~$ sudo config suppress-fib-pending disabled |
| 42 | +``` |
| 43 | + |
| 44 | +### Supported Topology |
| 45 | +The tests will be supported on t1 topo. |
| 46 | + |
| 47 | +###### Figure 2. Logic Topology |
| 48 | + |
| 49 | + |
| 50 | +## Test cases |
| 51 | +### Test case # 1 - BGPv4 route suppress test |
| 52 | +1. Enable BGP suppress-fib-pending function at DUT |
| 53 | +2. Save configuration and execute one action randomly choosen from(__reboot__/__config reload__/__fast-reboot__/__warm-reboot__) |
| 54 | +3. Suspend orchagent process to simulate a delay |
| 55 | +``` |
| 56 | +kill -SIGSTOP $(pidof orchagent) |
| 57 | +``` |
| 58 | +4. Announce BGP ipv4 prefixes to DUT from T0 VM by exabgp |
| 59 | +5. Make sure announced BGP routes are in __queued__ state in the DUT routing table |
| 60 | +6. Verify the routes are not announced to T2 VM peer |
| 61 | +7. Send traffic matching the prefixes and verify packets are not forwarded to T0 VM |
| 62 | +8. Restore orchagent process |
| 63 | +``` |
| 64 | +kill -SIGCONT $(pidof orchagent) |
| 65 | +``` |
| 66 | +9. Make sure announced BGP routes are not in __queued__ state in the DUT routing table |
| 67 | +10. Make sure the routes are programmed in FIB by checking __offloaded__ flag in the DUT routing table |
| 68 | +``` |
| 69 | +show ip route 1.1.1.0/24 json |
| 70 | +
|
| 71 | +{ |
| 72 | + "1.1.1.0/24": [ |
| 73 | + { |
| 74 | + "destSelected": true, |
| 75 | + "distance": 20, |
| 76 | + "installed": true, |
| 77 | + "installedNexthopGroupId": 277, |
| 78 | + "internalFlags": 264, |
| 79 | + "internalNextHopActiveNum": 1, |
| 80 | + "internalNextHopNum": 1, |
| 81 | + "internalStatus": 80, |
| 82 | + "metric": 0, |
| 83 | + "nexthopGroupId": 277, |
| 84 | + "nexthops": [ |
| 85 | + { |
| 86 | + "active": true, |
| 87 | + "afi": "ipv4", |
| 88 | + "fib": true, |
| 89 | + "flags": 3, |
| 90 | + "interfaceIndex": 17, |
| 91 | + "interfaceName": "PortChannel1021", |
| 92 | + "ip": "10.0.0.65", |
| 93 | + "weight": 1 |
| 94 | + } |
| 95 | + ], |
| 96 | + "offloaded": true, |
| 97 | + "prefix": "1.1.1.0/24", |
| 98 | + "prefixLen": 24, |
| 99 | + "protocol": "bgp", |
| 100 | + "selected": true, |
| 101 | + "table": 254, |
| 102 | + "uptime": "00:08:08", |
| 103 | + "vrfId": 0, |
| 104 | + "vrfName": "default" |
| 105 | + } |
| 106 | + ] |
| 107 | +} |
| 108 | +``` |
| 109 | +11. Verify the routes are announced to T2 peer |
| 110 | +12. Send traffic matching the prefixes and verify packets are forwarded to T0 VM |
| 111 | +13. This test should cover __default__ and __user defined vrf__ |
| 112 | + |
| 113 | +### Test case # 2 - BGPv6 route suppress test |
| 114 | +1. Enable BGP suppress-fib-pending function at DUT |
| 115 | +2. Save configuration and execute one action randomly choosen from(__reboot__/__config reload__/__fast-reboot__/__warm-reboot__) |
| 116 | +3. Suspend orchagent process to simulate a delay |
| 117 | +4. Announce BGP ipv6 prefixes to DUT from T0 VM by exabgp |
| 118 | +5. Make sure announced BGP routes are in __queued__ state in the DUT routing table |
| 119 | +6. Verify the routes are not announced to T2 VM peer |
| 120 | +7. Send traffic matching the prefixes and verify packets are not forwarded to T0 VM |
| 121 | +8. Restore orchagent process |
| 122 | +9. Make sure announced BGP routes are not in __queued__ state in the DUT routing table |
| 123 | +10. Make sure the routes are programmed in FIB by checking __offloaded__ flag in the DUT routing table |
| 124 | +11. Verify the routes are announced to T2 peer |
| 125 | +12. Send traffic matching the prefixes and verify packets are forwarded to T0 VM |
| 126 | +13. This test should cover __default__ and __user defined vrf__ |
| 127 | + |
| 128 | +### Test case # 3 - Test BGP route without suppress |
| 129 | +1. No BGP suppress-fib-pending function configured at DUT |
| 130 | +2. Suspend orchagent process to simulate a delay |
| 131 | +3. Announce BGP prefixes to DUT from T0 VM by exabgp |
| 132 | +4. Make sure announced BGP routes are not in __queued__ state in the DUT routing table |
| 133 | +5. Verify the BGP routes are announced to T2 peer |
| 134 | +6. Restore orchagent process |
| 135 | +7. Make sure the routes are programmed in FIB by checking __offloaded__ flag in the DUT routing table |
| 136 | +8. Send traffic matching the prefixes and verify packets are forwarded to T0 VM |
| 137 | + |
| 138 | +### Test case # 4 - Test BGP test work with suppress |
| 139 | +1. No BGP suppress-fib-pending function configured at DUT |
| 140 | +2. Run BGP test suite |
| 141 | +3. Make sure BGP tests are not affected |
| 142 | +4. Enable BGP suppress-fib-pending function at DUT |
| 143 | +5. Run BGP test suite |
| 144 | +6. Make sure BGP tests are not affected |
| 145 | + |
| 146 | +### Test case # 5 - Test BGP route suppress under negative operation |
| 147 | +1. Enable BGP suppress-fib-pending function at DUT |
| 148 | +2. Suspend orchagent process to simulate a delay |
| 149 | +3. Announce BGP prefixes to DUT from T0 VM by exabgp |
| 150 | +4. Execute __BGP session restart__ |
| 151 | +5. Verify BGP neighborships are established |
| 152 | +6. Make sure announced BGP routes are in __queued__ state in the DUT routing table |
| 153 | +7. Configure __static routes__ then redistribute to BGP |
| 154 | +8. Verify the __redistributed routes__ are in the DUT routing table |
| 155 | +9. Verify the routes are announced to T2 VM peer |
| 156 | +10. Send traffic matching the prefixes and verify packets are not forwarded to T0 VM |
| 157 | +11. Restore orchagent process |
| 158 | +12. Make sure announced BGP routes are not in queued state in the DUT routing table |
| 159 | +13. Make sure the routes are programmed in FIB by checking __offloaded__ flag in the DUT routing table |
| 160 | +14. Verify the BGP routes are announced to T2 peer |
| 161 | +15. Send traffic matching the prefixes and verify packets are forwarded to T0 VM |
| 162 | + |
| 163 | +### Test case # 6 - Test BGP route suppress in credit loops scenario |
| 164 | +1. No BGP suppress-fib-pending function configured at DUT |
| 165 | +2. Suspend orchagent process to simulate a delay |
| 166 | +3. Announce a default route to DUT from T2 VM |
| 167 | +4. Announce BGP prefixes to DUT from T0 VM by exabgp |
| 168 | +5. Verify the BGP routes are announced to T2 VM peer |
| 169 | +6. Send traffic matching the prefixes and verify packets are forwarded __back to T2 VM__ |
| 170 | +7. Enable BGP suppress-fib-pending function at DUT |
| 171 | +8. Restore orchagent process |
| 172 | +9. Make sure the routes are programmed in FIB by checking __offloaded__ flag in the DUT routing table |
| 173 | +10. Send traffic matching the prefixes and verify packets are forwarded to __T0 VM__ |
0 commit comments