Video summary

5.2 Routing algorithms: link state routing

Main summary

Key takeaways

Educational

Main Ideas

Routing algorithms determine a good route through a network from a source to a destination. A route is a sequence of routers and links that packets traverse.

What counts as “good” depends on how the network operator defines link cost. Cost may reflect:

  • Hop count or distance
  • Bandwidth, with higher bandwidth assigned a lower cost
  • Congestion or queuing delay, with higher congestion assigned a higher cost

Two broad approaches to routing are:

  • Link state: Routers use network-wide topology and link-cost information. Dijkstra’s algorithm is an example.
  • Distance vector: Routers begin with information about their directly connected links and iteratively exchange information with their neighbors. Bellman–Ford is an example.

Routing algorithms can also be classified as static or dynamic, depending on how they operate over time. The lecture focuses on centralized link-state routing with Dijkstra’s algorithm.

Link-State Graph and Notation

A network can be represented as a graph:

  • Routers are nodes.
  • Direct connections are edges or links.
  • Each link has a cost.

The direct cost from node a to node b is written (c_{ab}). If there is no direct link, the cost is infinity. Costs can differ by direction.

Dijkstra’s algorithm uses:

  • (D(a)): The current best-known cost from the source to node a.
  • (P(a)): The predecessor of a on the currently known least-cost path.
  • (N’): The set of nodes whose least-cost paths from the source are known with certainty.

Dijkstra’s Link-State Algorithm

Dijkstra’s algorithm computes least-cost paths from one source node to every other node.

  1. Initialize

    • Put the source node in (N’).
    • For each other node:
      • If it is directly connected to the source, set its initial cost to the link cost and its predecessor to the source.
      • Otherwise, set its cost to infinity.
  2. Select the next node

    • Among the nodes not in (N’), choose the one with the smallest current cost.
    • Add it to (N’). Its least-cost path is now confirmed.
  3. Update neighboring nodes

    • For each neighbor (b) of the newly added node (a) that is not already in (N’), compare:
      • The current best-known cost to (b).
      • The cost to reach (a), plus the direct link cost from (a) to (b).
    • Keep the smaller value and update the predecessor if the route through (a) is better.
  4. Repeat

    • Continue selecting and updating nodes until all nodes have been added to (N’).

Because the algorithm confirms one destination per iteration, after (k) iterations it has found the least-cost paths to the (k) closest destinations.

Worked Example and Forwarding

The example uses a six-node network with source u. Initially, the direct costs from u are:

  • To v: 2
  • To w: 5
  • To x: 1
  • To y and z: infinity

The algorithm repeatedly selects the lowest-cost node that has not yet been confirmed and updates the costs to its neighbors. A tie between v and y, both at cost 2, is broken arbitrarily by choosing y.

The final least-cost routing tree lets the source construct a forwarding table:

  • To reach v, forward directly to v.
  • To reach x, y, w, or z, forward first to x, the next hop on the least-cost paths from u.

Complexity

  • Computational complexity: (O(n^2)) in the version described. The main loop runs once per node, with up to (O(n)) comparisons in each pass.
  • Message complexity: (O(n^2)) to distribute link-state information. Each of the (n) routers broadcasts its information, and each broadcast can be disseminated with (O(n)) link crossings.

Dynamic-Cost Pathology

If link costs change with short-term traffic load, routing can become unstable. In the example, routers’ traffic loads determine link costs. As routers observe changing costs, they switch routes; those changes then alter the loads and costs, prompting further switches.

As a result, routes can oscillate between directions rather than settling down. The example illustrates why defining costs based on short-term congestion or load can produce subtle behavior.

Speakers and Sources Featured

  • Lecturer/narrator: Jim Kurose, as indicated by the video context
  • Other speakers: None
  • Algorithms discussed: Dijkstra’s link-state algorithm and, as a contrast and preview, Bellman–Ford distance-vector routing
  • Historical reference: Early ARPANET routing algorithms that used short-term, load-dependent link costs

Rate this summary

Your feedback will help improve summaries.

Improve this summary

Reprocess with a stronger model when the summary feels incomplete or inaccurate.

Pro

Translate summary in another language

Pro

Ask questions to this video

Chat for follow-up questions, clarifications, and source-backed answers.

Coming soon

Share this summary

Original video