Interconnection · Lesson 04

How does a router choose a path?

A router does not need a complete map in every packet. It compares the destination address with its routing table, selects the most specific matching prefix, and forwards the packet to a next hop.

After a change

Routing information needs time to settle.

When a link fails or a route changes, routers do not all learn the new information at the same instant. They exchange updates, recalculate their choices, and install new forwarding entries. Convergence is the process of moving from those different temporary views to compatible forwarding decisions.

During convergence, one router may still send traffic toward a failed link while another has already chosen an alternate path. Depending on the protocol and topology, traffic can be delayed, dropped, looped temporarily, or sent into a blackhole until the new information spreads.

Convergence is a transition, not a permanent routing mode.Faster convergence reduces the time exposed to inconsistent decisions, but it does not remove the need to observe updates and verify the resulting path.

Prefix notation

CIDR tells the router how much of an address is the network.

In CIDR notation, the number after the slash tells how many leading bits belong to the network prefix. The remaining bits identify addresses inside that range. For IPv4, a /16 leaves 16 host bits and represents up to 65,536 addresses; a /24 leaves 8 host bits and represents 256.

When a destination matches both 10.20.0.0/16 and 10.20.4.0/24, the /24 route wins because it describes a narrower range and matches more leading bits. This is the longest-prefix match rule.

A longer prefix is more specific, not necessarily physically longer.CIDR describes address grouping. The selected next hop still depends on the routing table and the policies that installed its entries.

Routing scope

Is the protocol used inside or between networks?

An IGP (Interior Gateway Protocol) operates inside one autonomous system, such as a provider, company, or campus network. OSPF and IS-IS distribute internal topology information so routers in that organisation can calculate paths.

An EGP (Exterior Gateway Protocol) exchanges reachability between autonomous systems. BGP does not try to build one shared map of the whole Internet: it carries prefixes and path information so each organisation can apply its own routing policy.

OSPF and IS-IS optimise paths inside one routing domain; BGP connects routing domains.IGPs focus on internal topology and convergence. BGP focuses on reachability between autonomous systems and the policies that choose among possible paths.

The forwarding problem

Every hop only needs the next useful decision.

When a packet arrives, a router reads the destination IP (Internet Protocol) address and checks its routing table. The table describes reachable prefixes and the interface or next router to use.

Several entries may match. The longest, most specific prefix wins. If nothing more specific matches, a default route can provide a last-resort path.

Routing is hop by hop.The current router chooses the next step. The whole end-to-end path emerges as each router repeats that decision.

Build the model

Four pieces of a route

01

Destination prefix

Describes a range of addresses, such as 10.20.0.0/16.

02

Next hop

Names the neighboring router that should receive the packet next.

03

Interface

Identifies the local link used to send the frame onward.

04

Default route

Provides a fallback when no more specific destination is known.

Routing-table updates

A route can be fixed, coordinated, or distributed.

A static update is entered by an administrator and stays unchanged until someone edits it. A synchronous update follows a coordinated round or shared event: routers exchange or apply information at an agreed moment. An asynchronous update propagates when each router detects a change, so different routers can learn it at different times.

Dynamic routing protocols usually behave in a distributed way. Distance-vector protocols exchange reachability with neighbours; link-state protocols flood link changes and recalculate locally; BGP announces and withdraws prefixes between autonomous systems.

Convergence is the transition, not the route itself.During an update, routers may temporarily hold different views. The network converges when their forwarding decisions settle on compatible information.
STATICConfigured entry

An administrator writes the prefix and next hop. No routing protocol changes it automatically.

Predictable and simple, but every topology change needs a manual edit.

Decision model

Who knows the network well enough to choose?

In centralized routing, a controller or management plane builds a broader view of the topology, computes paths, and installs forwarding rules on routers or switches. SDN (Software-Defined Networking) is a common example. The global view can optimise decisions, but the controller and its control channel become important dependencies.

In decentralized routing, each router exchanges information with neighbours and makes forwarding decisions locally. OSPF, IS-IS, and BGP distribute reachability rather than relying on one device to calculate every path. This avoids a single decision point, but convergence can be progressive and temporary differences are normal.

CENTRALIZEDController computes

A controller keeps a broad topology view and installs forwarding decisions on network devices.

The controller is a powerful decision point and a dependency to protect.

Mini experiment

Choose a next hop

Select a destination and compare the matching routes. The most specific prefix wins.

ROUTEDirect branch

10.20.4.18 matches 10.20.4.0/24, so the router sends it to the local branch interface.

The /24 route is more specific than the broader /16 route.

Knowledge check

Test your routing model

Answer five questions. The answer order changes each time.

0 / 5