Routing Algorithms
Routers exchange information to choose efficient paths through the network. Most protocols fall into two families:
Link‑State
Routers flood the state of their links so each node can build a full map and run Dijkstra's algorithm to compute shortest paths. OSPF is the most common example.
Distance‑Vector
Nodes share only the distance to each destination with neighbors. RIP uses this simpler approach but converges more slowly.
Metrics
Paths are selected according to metrics such as hop count, bandwidth or delay. Choosing good metrics keeps traffic flowing smoothly and avoids routing loops.