---
title: "IP Addressing and How Routers Choose a Path"
description: "How an address splits into a network part and a host part, and how a router uses its forwarding table to pick the next hop without knowing the whole route. No single machine holds a map of the interne"
canonical: https://lightmysky.com/learn/computing/ip-addressing-and-how-routers-choose-a-path-mt_l0dRGocXGw
source: https://lightmysky.com/learn/computing/ip-addressing-and-how-routers-choose-a-path-mt_l0dRGocXGw.md
retrieved: 2026-09-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`.

# IP Addressing and How Routers Choose a Path

How an address splits into a network part and a host part, and how a router uses its forwarding table to pick the next hop without knowing the whole route. No single machine holds a map of the internet.

Subject: Computing · Area: Computer Systems · Ages 17 to 18
Page: https://lightmysky.com/learn/computing/ip-addressing-and-how-routers-choose-a-path-mt_l0dRGocXGw

## Ready when they can

- Split an address with a subnet mask into its network and host parts
- Decide from a small forwarding table which link a packet leaves on
- Explain why two packets of one message can take different routes and still arrive

## Lesson: Finding the way for every packet

Every device on a network needs an address. IPv4 writes each one as four numbers, like 192.168.1.20. A subnet mask marks which part of the address names the network and which part names the device itself. Think of the network part as the street and the host part as the house number.

**Example.** Take 210.1.1.100 with the mask 255.255.255.224. The lowest address in its subnet is the network address, 210.1.1.96. The highest address is the broadcast address, 210.1.1.127. The addresses you can hand to devices sit between those two.

Routers keep small forwarding tables that match address prefixes to outgoing links. For each packet they cover every row's prefix against the destination and take the longest match. Suppose a table sends 192.168.1.0/24 out on link A, 192.168.0.0/16 out on link B, and everything else out on link C. A packet for 192.168.1.20 matches the first two rows, and the longer /24 wins, so it leaves on link A. Packets headed outside your own network go to the default gateway, the usual door out, and the wrong gateway strands them with nowhere to go.

**Tip.** Each packet carries its full source and destination addresses, so routers judge every packet afresh. That is why two packets of one message can take different routes when a link clogs or fails. No single machine holds a map of the whole internet, and none needs to, because each router only picks the next hop. The receiver at the far end reassembles the packets and hides the whole adventure from your apps.

**Recap.** Split each address with its mask, forward every packet by its longest match, and let the receiver reassemble the pieces.

## Practice

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

## Needs first

- [Network Layers and the Protocol Stack](https://lightmysky.com/learn/computing/network-layers-and-the-protocol-stack-mt_O3Ew6c2ynD)
- [Hexadecimal as Binary Shorthand](https://lightmysky.com/learn/computing/hexadecimal-as-binary-shorthand-mt_OV6PHdnU6N)
- [Binary Numbers and Place Value](https://lightmysky.com/learn/computing/binary-numbers-and-place-value-mt_t67akIKBmI)

## Opens up

- [Layering and Encapsulation in the Protocol Stack](https://lightmysky.com/learn/computing/layering-and-encapsulation-in-the-protocol-stack-mt_D33SEBslXH)
- [Routing: How a Path Is Learned](https://lightmysky.com/learn/computing/routing-how-a-path-is-learned-mt_gyqPDrV6Uo)
