Garbage-Collection
Test to verify RIPng garbage collection timer for removing stale IPv6 routes.
This validates the two-stage removal process: After routes are marked invalid by the
timeout timer (metric 16), the garbage collection timer completely removes them
from the routing table. This test simulates neighbor loss by removing RIPng configuration.
Test RIPng Garbage Collection Timer
Description
Verify RIPng garbage collection timer completely removes invalid IPv6 routes.
DUT0 advertises the route 2001:db8:10::/64 to DUT1. Then RIPng is deleted from
DUT0 to simulate a neighbor loss. After 5 seconds, the route is marked
as invalid with metric 16. After an additional 5 seconds, the route
is completely removed from the routing table. This demonstrates the two-stage process
that prevents stale routes from persisting indefinitely.
Scenario
Note
Two-stage route removal process:
When DUT0 stops sending RIPng updates, DUT1 follows a controlled removal process:
Stage 1 - Invalidation (Timeout Timer):
T=0s: DUT0 stops advertising
2001:db8:10::/64T=5s:
timeout timerexpiresResult: Route marked invalid with
metric 16(unreachable)Status: Route still visible but not used for forwarding
Stage 2 - Removal (Garbage Collection Timer):
T=5+5s:
garbage collection timerexpiresResult: Route completely removed from routing table
Status: Route no longer visible
This two-stage process prevents immediate route removal (avoiding flapping) while
ensuring stale IPv6 routes don’t persist indefinitely. The invalid state (metric 16)
allows the router to inform neighbors that the route is unreachable before final removal.
Step 1: Set the following configuration in DUT0 :
set interfaces dummy dum0 address '2001:db8:10::1/64' set interfaces ethernet eth0 address '2001:db8:1::100/64' set protocols ripng network '2001:db8:1::/64' set protocols ripng redistribute connected set protocols ripng timers update 5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Set the following configuration in DUT1 :
set interfaces ethernet eth0 address '2001:db8:1::50/64' set protocols ripng network '2001:db8:1::/64' set protocols ripng timers garbage-collection 5 set protocols ripng timers timeout 5 set protocols ripng timers update 5 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Attention
Verify that DUT1 learns the route 2001:db8:10::/64 from DUT0
Step 3: Run command protocols ripng show at DUT1 and check if output matches the following regular expressions:
2001:db8:10::/64Show output
Codes: K - kernel route, C - connected, L - local, S - static, R - RIPng, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, t - Table-Direct Sub-codes: (n) - normal, (s) - static, (d) - default, (r) - redistribute, (i) - interface, (a/S) - aggregated/Suppressed Network Next Hop Via Metric Tag Time C(i) 2001:db8:1::/64 :: self 1 0 R(n) 2001:db8:10::/64 fe80::dcad:beff:feef:6c00 eth0 2 0 00:03
Step 4: Run command protocols ipv6 show route at DUT1 and check if output matches the following regular expressions:
2001:db8:10::/64Show output
Codes: K - kernel route, C - connected, L - local, S - static, R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, t - Table-Direct, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure IPv6 unicast VRF default: C>* 2001:db8:1::/64 is directly connected, eth0, weight 1, 00:00:03 K * 2001:db8:1::/64 [0/256] is directly connected, eth0, weight 1, 00:00:05 L>* 2001:db8:1::50/128 is directly connected, eth0, weight 1, 00:00:03 R>* 2001:db8:10::/64 [120/2] via fe80::dcad:beff:feef:6c00, eth0, weight 1, 00:00:02 C>* fe80::/64 is directly connected, eth0, weight 1, 00:00:04
Note
Delete RIPng from DUT0 to simulate loss of neighbor - this stops update advertisements
Step 5: Modify the following configuration lines in DUT0 :
delete protocols
Note
Wait for timeout + garbage collection + margin (15 seconds)
Attention
Verify that the route 2001:db8:10::/64 has been completely removed from DUT1
Step 6: Run command protocols ripng show at DUT1 and expect this output:
Show output
Codes: K - kernel route, C - connected, L - local, S - static, R - RIPng, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, t - Table-Direct Sub-codes: (n) - normal, (s) - static, (d) - default, (r) - redistribute, (i) - interface, (a/S) - aggregated/Suppressed Network Next Hop Via Metric Tag Time C(i) 2001:db8:1::/64 :: self 1 0
Step 7: Run command protocols ipv6 show route at DUT1 and expect this output:
Show output
Codes: K - kernel route, C - connected, L - local, S - static, R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR, f - OpenFabric, t - Table-Direct, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure IPv6 unicast VRF default: C>* 2001:db8:1::/64 is directly connected, eth0, weight 1, 00:00:19 K * 2001:db8:1::/64 [0/256] is directly connected, eth0, weight 1, 00:00:21 L>* 2001:db8:1::50/128 is directly connected, eth0, weight 1, 00:00:19 C>* fe80::/64 is directly connected, eth0, weight 1, 00:00:20