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

ProtocolTypeAlgorithmScope
RIPDistance vectorBellman-FordSmall networks (max 15 hops)
OSPFLink stateDijkstraWithin an AS
BGPPath vectorPolicy-basedBetween 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: