4.3.14 · D3Computer Networks

Worked examples — Static routing vs dynamic routing

2,535 words12 min readBack to topic

The scenario matrix

Every routing problem you will meet falls into one of these cells. We enumerate them once, then hit each one with a worked example.

# Cell (case class) What makes it tricky Example
A Basic two-router static, both directions forgetting the return route Ex 1
B Default route 0.0.0.0/0 (shortest prefix) catch-all vs specific Ex 2
C Longest-prefix tie-break (overlapping routes) two rows both match Ex 3
D Bellman–Ford pick with a cheap link but expensive path link cost ≠ path cost Ex 4
E Degenerate input: destination = a directly connected network do we even need a static route? Ex 5
F Zero / limiting case: a link fails (cost → ∞) how each style reacts Ex 6
G Convergence-time / counting-to-infinity limiting behaviour why loops form Ex 7
H Real-world word problem (which style to choose + why) trade-off judgement Ex 8
I Exam twist: "ping works one way" debugging asymmetric routing bug Ex 9

Terms used below — all built in the parent — link back: Routing table, Longest prefix match, Default gateway, Bellman-Ford algorithm, Dijkstra's algorithm, Network convergence, RIP protocol, OSPF protocol, BGP.


Cell A — Basic two-router static (both directions)


Cell B — The default route (shortest possible prefix)


Cell C — Longest-prefix tie-break

Figure — Static routing vs dynamic routing

Figure — Static routing vs dynamic routing

Cell E — Degenerate: destination is directly connected


Figure — Static routing vs dynamic routing

Cell G — Counting-to-infinity (limiting/degenerate loop)


Cell H — Real-world word problem (choose the style)


Cell I — Exam twist: "ping works one way"


Recall Quick self-test

Two routes 10.0.0.0/8 and 10.1.0.0/16 both match a packet — which wins? ::: The /16 (longest prefix). Link cost 1 to A (A advertises 9) vs link cost 5 to B (B advertises 2) — best cost and next hop? ::: , next hop B. A directly connected subnet needs which static route? ::: None — it's auto-installed as connected. After a link fails, static routing recovers how? ::: It doesn't — a human must reconfigure.


Flashcards

Two matching routes /16 and /24 — which is used?
The /24, by longest-prefix match.
Bellman–Ford with link 1 to A (adv 6) and link 3 to B (adv 1) — cost and next hop?
min(7,4)=4, next hop B.
Do you need a static route for a directly connected subnet?
No — it's installed automatically as a connected route.
Under static routing, what happens when a link fails?
Nothing recovers automatically; admin must fix it manually.
What is counting-to-infinity?
Distance-vector routers slowly increment a dead route's cost via stale advertisements until it hits the max (16 in RIP).
"Ping works one way, reply times out" — likely cause?
Missing return route on the far router (asymmetric static config).
Why is a one-router clinic best served by static routing?
Single exit, no redundancy to reroute to, zero overhead, more secure.