---
title: "Routing: How a Path Is Learned"
description: "No router knows the whole network. Inside one organisation routers exchange what they know until their tables agree; between organisations the choice is shaped by policy and business relationships as "
canonical: https://lightmysky.com/learn/computing/routing-how-a-path-is-learned-mt_gyqPDrV6Uo
source: https://lightmysky.com/learn/computing/routing-how-a-path-is-learned-mt_gyqPDrV6Uo.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Routing: How a Path Is Learned

No router knows the whole network. Inside one organisation routers exchange what they know until their tables agree; between organisations the choice is shaped by policy and business relationships as much as by distance.

Subject: Computing · Area: Networks & Security · Ages 19 to 20
Page: https://lightmysky.com/learn/computing/routing-how-a-path-is-learned-mt_gyqPDrV6Uo

## Ready when they can

- Run a distance-vector exchange on a small network until the tables settle
- Explain why a link failure can take time to reach other routers in the model
- Say why policy can select a longer path between organisations

## Lesson: How routers learn the way together

A network can be represented as a graph: devices are vertices, links are edges, and a path follows connected edges from one device to another. Each router keeps a forwarding table with a next hop for each destination it knows. Unlike Dijkstra, where one solver holds the whole weighted graph, no router starts with a full or central map. Each router starts with only its own links and neighbours and learns farther routes through exchanges.

**Example.** In a small distance-vector model, each router sends its current best distances to its neighbours. A route through a neighbour costs the link cost to that neighbour plus the distance that neighbour advertises. A router keeps the lower cost, and exchanges repeat until no table changes. Example: X links to Z at cost 7 and to Y at cost 2. Y advertises distance 3 to Z. Through Y, X gets 2 + 3 = 5, which beats 7, so X records cost 5 to Z with next hop Y.

*(drawing: Neighbour exchanges let a far router learn a route step by step.)*

In this model, a failed link changes one router's information first. An update or later exchange carries that change to neighbours, then farther routers. A router accepts a higher cost when it comes from the neighbour it already uses as next hop. Until the information arrives, some tables can still contain the old route. Real protocols add rules such as triggered updates and loop prevention.

Between organisations, path choice is not only a distance calculation. Network operators apply policy to routes they accept and advertise. A route with more network hops can be chosen when policy allows it and rejects a shorter alternative.

**Recap.** Routers learn routes through neighbour exchanges, spread changes through the network, and apply policy at organisational borders.

*Original instructional content authored for os-taxonomy.*

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Dijkstra's Shortest Path](https://lightmysky.com/learn/computing/dijkstras-shortest-path-mt_GvUzbY92qL)
- [IP Addressing and How Routers Choose a Path](https://lightmysky.com/learn/computing/ip-addressing-and-how-routers-choose-a-path-mt_l0dRGocXGw)
- [Naming: DNS and the Resolution Path](https://lightmysky.com/learn/computing/naming-dns-and-the-resolution-path-mt_omttmGkEgW)

## Opens up

- [The Web as a Protocol: Requests, State and Caching](https://lightmysky.com/learn/computing/the-web-as-a-protocol-requests-state-and-caching-mt_MDiW4Vt0bo)
