Routing Protocol Simulator
Link-state and distance-vector routing side by side, on a network you can break. Watch Dijkstra recover instantly and Bellman-Ford count to infinity.
01 · Try it
Route A → F
–
A’s forwarding table
| to | next hop | cost |
|---|
A — B — C, every link cost 1. Break B–C and watch A and B each believe the other can still reach C.
Both run in your browser. The full simulator does the same in Python, with a hand-built binary heap, YAML topologies and packet tracing between any two routers.
02 · The problem
On a stable network, link-state and distance-vector routing produce identical tables. They solve the same problem. The differences only appear in how they converge and how they fail, and that is hard to see on a whiteboard.
I taught networking fundamentals to CCNA students for two years. This is the tool I wished I had for the lesson on routing loops.
03 · How it works
Scroll the steps. The scene follows.
A · 0
B · 2
C · 3
E · 6
D · 6
F · 9
to C: 2
via B
to C: 1
via C
to C: 0
via –
each router only knows what its neighbours tell it
D–F fails · every table recomputes · packets take A → B → C → E → F
Illustrated from the project’s README and code. Values shown are examples.
- 01
Link-state
Each router holds the full topology and runs Dijkstra from itself, using a custom binary min-heap with an O(log n) decrease_key backed by a hash map. Predecessors become next-hop forwarding tables.
- 02
Distance-vector
A distributed Bellman-Ford where each router only knows its neighbours’ vectors and converges by exchanging them, with a split-horizon toggle to show the fix for routing loops.
- 03
Break it on purpose
Fail a link or change a cost and every table is recomputed, with packet paths traced hop by hop. Invalid input, like negative costs or failures that would disconnect the network, is rejected.
- 04
The engine stands alone
The routing engine is pure Python with no web dependencies, so the algorithms are tested in isolation. FastAPI serves the API and the frontend from one container.
04 · Architecture
The whole system, running.
Built with