Add cn/dvr: Distance Vector Routing simulator with count-to-infinity demos and captured output

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6V3xQR5XUmTbjaYAK
This commit is contained in:
Claude
2026-11-12 20:56:48 +05:30
parent abaf3840f2
commit f784f9b6ee
23 changed files with 1436 additions and 0 deletions
+87
View File
@@ -0,0 +1,87 @@
routers: 4, infinity = 16, poison reverse = off
links: A-B=1 B-C=1 C-D=1
== initial convergence ==
round 0 | to D: A=INF B=INF C=1(D)
round 1 | to D: A=INF B=2(C) C=1(D)
round 2 | to D: A=3(B) B=2(C) C=1(D)
converged: round 3 changed nothing
rounds that changed something: 2
check vs Floyd-Warshall: match
A Routing Table
Dest Dist Next hop
A 0 -
B 1 B
C 2 B
D 3 B
B Routing Table
Dest Dist Next hop
A 1 A
B 0 -
C 1 C
D 2 C
C Routing Table
Dest Dist Next hop
A 2 B
B 1 B
C 0 -
D 1 D
D Routing Table
Dest Dist Next hop
A 3 C
B 2 C
C 1 C
D 0 -
== link B-C fails ==
round 0 | to D: A=3(B) B=2(C) C=1(D)
round 1 | to D: A=3(B) B=4(A) C=1(D)
round 2 | to D: A=5(B) B=4(A) C=1(D)
round 3 | to D: A=5(B) B=6(A) C=1(D)
round 4 | to D: A=7(B) B=6(A) C=1(D)
round 5 | to D: A=7(B) B=8(A) C=1(D)
round 6 | to D: A=9(B) B=8(A) C=1(D)
round 7 | to D: A=9(B) B=10(A) C=1(D)
round 8 | to D: A=11(B) B=10(A) C=1(D)
round 9 | to D: A=11(B) B=12(A) C=1(D)
round 10 | to D: A=13(B) B=12(A) C=1(D)
round 11 | to D: A=13(B) B=14(A) C=1(D)
round 12 | to D: A=15(B) B=14(A) C=1(D)
round 13 | to D: A=15(B) B=INF C=1(D)
round 14 | to D: A=INF B=INF C=1(D)
round 15 | to D: A=INF B=INF C=1(D)
converged: round 16 changed nothing
rounds that changed something: 15
check vs Floyd-Warshall: match
A Routing Table
Dest Dist Next hop
A 0 -
B 1 B
C INF -
D INF -
B Routing Table
Dest Dist Next hop
A 1 A
B 0 -
C INF -
D INF -
C Routing Table
Dest Dist Next hop
A INF -
B INF -
C 0 -
D 1 D
D Routing Table
Dest Dist Next hop
A INF -
B INF -
C 1 C
D 0 -