Routing & Switching
Routers choose paths between networks using routing tables built statically or by routing protocols.
Cheat sheet
- ▸Distance Vector (RIP): share tables with neighbours; Bellman-Ford; count-to-infinity problem.
- ▸Link State (OSPF): flood link info; each router runs Dijkstra.
- ▸BGP: path-vector protocol between autonomous systems (the Internet).
- ▸Longest prefix match picks the routing table entry.
- ▸TTL prevents packets looping forever.
- ▸VLANs split one physical switch into multiple broadcast domains.
Routing protocols
| Protocol | Type | Algorithm | Scope |
|---|---|---|---|
| RIP | Distance vector | Bellman-Ford | Small networks (max 15 hops) |
| OSPF | Link state | Dijkstra | Within an AS |
| BGP | Path vector | Policy-based | Between ASes |
Top 10 campus interview questions
Quick quiz
1. OSPF uses:
2. Protocol between ISPs:
3. Count-to-infinity affects:
4. RIP considers this hop count unreachable:
5. Traceroute relies on: