4.3.14Computer Networks

Static routing vs dynamic routing

1,957 words9 min readdifficulty · medium6 backlinks

WHAT each one is


WHY both exist (the trade-off)

Aspect Static Dynamic
Table built by human admin routing protocol
Adapts to failures ❌ no ✅ yes
Bandwidth/CPU overhead none yes (updates + computation)
Scalability poor (manual per route) good
Security high (no injected routes) lower (trust neighbours)
Best for small/stub networks large/changing networks
Convergence instant (already set) takes convergence time
Figure — Static routing vs dynamic routing

HOW static routing works (step by step)

Configuration (Cisco-style syntax) sets one line per destination network:

ip route 192.168.2.0 255.255.255.0 10.0.0.2
        └ dest network ┘ └ mask ┘     └ next hop ┘

HOW dynamic routing works (conceptually)


Common mistakes (steel-manned)


Recall Explain to a 12-year-old (Feynman)

Imagine a city of post offices. Each office needs a chart on the wall saying "to send a letter to this neighbourhood, hand it to that next office." Static = the boss writes the chart by hand with a marker. It's simple and nobody can mess with it — but if a road gets blocked, the chart is now wrong and letters get lost until the boss comes back and rewrites it. Dynamic = the offices phone each other every few minutes saying "this road is open, that one's how far." They keep updating the chart themselves, so if a road closes they reroute automatically — but all that phoning takes time and effort, and a prankster could phone in fake directions.


Flashcards

Who builds the routing table in static routing?
The network administrator, manually.
Who builds the routing table in dynamic routing?
Routing protocols (RIP/OSPF/BGP), automatically by exchanging info.
Does static routing adapt to a link failure?
No — it stays fixed until manually changed.
Two main families of dynamic routing protocols?
Distance-vector (e.g. RIP) and Link-state (e.g. OSPF).
State the Bellman–Ford distance-vector equation.
Dx(d)=minv(c(x,v)+Dv(d))D_x(d)=\min_{v}(c(x,v)+D_v(d)).
Why might a small network prefer static routing?
No protocol overhead, more secure, simpler, predictable.
What is a default route and its prefix?
A catch-all route 0.0.0.0/0 used when no more specific route matches.
Which match rule selects the routing-table entry?
Longest-prefix match.
What algorithm does OSPF (link-state) run on the topology graph?
Dijkstra's shortest-path.
Why must static routes be set on both routers in a path?
Reply packets need a return route; routing is per-direction.
Main downside of dynamic routing vs static?
Consumes bandwidth/CPU, has convergence delay, larger attack surface.
What is convergence time?
Time for all routers to agree on consistent routes after a topology change.

Connections

  • Routing table — the shared output of both methods
  • Bellman-Ford algorithm — math behind distance-vector
  • Dijkstra's algorithm — math behind link-state/OSPF
  • RIP protocol / OSPF protocol / BGP — concrete dynamic protocols
  • Longest prefix match — how a chosen table is used to forward
  • Default gateway — the most common static route
  • Network convergence — the cost dynamic routing pays

Concept Map

filled by

manually

automatically

configured by

uses

exchange

consume

gives

lacks

adapts to

needs

packet matched by

Routing Table

Who fills it?

Static Routing

Dynamic Routing

Human Admin

Routing Protocol RIP OSPF BGP

Update Messages

Bandwidth CPU Attack Surface

Simplicity Security Zero Overhead

No Fault Tolerance

Topology Changes

Convergence Time

Longest-Prefix Match

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, har router ke paas ek routing table hota hai — ek chart jisme likha hota hai "is destination network ke liye packet ko kis next-hop pe bhejna hai." Pura static vs dynamic ka jhagda sirf itna hai: ye table kaun bharta hai aur kab? Static routing me admin khud apne haath se har route type karta hai, aur jab tak koi insaan use change na kare, table waisa ka waisa rehta hai. Dynamic routing me routers aapas me baatein karte hain (RIP, OSPF, BGP jaise protocols se) aur table khud-ba-khud bhar lete hain — agar koi link down ho jaye to automatically naya raasta dhoondh lete hain.

To phir dynamic hi best hai na? Nahi! Adaptivity free nahi aati. Dynamic routing bandwidth kharch karta hai (update messages bhejta rehta hai), CPU/memory kharch karta hai (algorithm chalta rehta hai), aur security ka risk hai (koi fake route inject kar sakta hai). Chhoti ya predictable network me ye sab kharcha bekaar hai — wahan static simple aur safe rehta hai. Isliye trade-off yaad rakho: Static = simple, secure, stable par stubborn (failure pe khud nahi sudhrega); Dynamic = adaptive par mehenga (overhead).

Exam me 80/20 rule: zyada marks isi trade-off table aur Bellman-Ford equation Dx(d)=minv(c(x,v)+Dv(d))D_x(d)=\min_v(c(x,v)+D_v(d)) se aate hain — protocol ke timer-vimer rato mat. Aur ek classic galti: agar tum sirf R1 pe route daal do aur R2 pe return route bhulo, to ping ek hi direction me chalega aur reply timeout ho jayega. Hamesha dono routers pe route set karo.

Go deeper — visual, from zero

Test yourself — Computer Networks

Connections