Topic 024 / Core
IP addressing and routing
Chapter 3.1 · Network Foundations
What and why
For the internet layer (→ 23) to deliver a packet, every host needs an address, and every router on the path needs a way to decide where to forward the packet next. An IP address identifies a host on a network; routing is the hop-by-hop process routers use to forward a packet toward the network that contains its destination address. Builds on: → 23.
Diagram
Host A (10.0.1.5) ── Router R1 ── Router R2 ── Host B (203.0.113.9)
same subnet as R1 forwards toward destination network
203.0.113.0/24
How it works
- An address splits into a network portion and a host portion; the subnet mask (or CIDR
suffix, e.g.
/24) defines where that split falls. - Private address ranges are used inside an organization's own network and are not globally routable; NAT (network address translation) rewrites private addresses to a shared public one at the boundary so those hosts can still reach the public internet.
- A router receiving a packet looks up the destination address in its routing table and forwards toward the most specific matching route (longest-prefix match).
- Each hop repeats step 3 until the packet reaches a router directly attached to the destination's network, which delivers it to the host.
Practical example
(illustrative). A request from host A to host B crosses two routers: R1 (A's local gateway) and R2 (closer to B's network). Each router only needs to know "which direction is closer to 203.0.113.0/24" — not the full path — which is what keeps routing tables a manageable size even though the number of hosts on the internet is enormous.
When to use it
- Use when: debugging reachability — "can host A reach host B's network at all" is a routing question, separate from "is the service on host B actually listening."
- Avoid when: memorizing exact subnet arithmetic if you don't operate network infrastructure directly — understanding that addresses split into network/host portions and that routers forward toward networks, not individual hosts, is usually enough.
- Failure scenarios: overlapping private address ranges when two networks are later connected (common after a merger or a VPN link); NAT breaking protocols that assume two hosts can connect to each other directly; a misconfigured route silently black-holing traffic to one destination while everything else works.
- Simpler alternative: none — addressing and routing are what make a network a network; the judgment call is only how deep to go into the mechanics for your role.
Practice
(mechanism kind — trace by hand; 15–20 min, no lab services). Given an IP
address and a /24 subnet mask, compute the network address and the range of host
addresses it contains. Then run traceroute (or tracert) to a real public host and
count the hops — each line is one router making the forwarding decision from step 3. Done
when the network/host split is computed correctly and you can say what each hop represents.
Key takeaway
Addressing identifies hosts and networks; routing moves a packet toward the right network one hop at a time, without any router needing the whole path. Done when you can: compute a network address from an IP and mask, and explain what NAT is hiding at a network boundary. Used next in → 26 (DNS resolves names to these addresses), → 94 (global traffic routing).
References
None — this topic makes no external claims.
Source directory