Network Layer
IP (v4 and v6), ICMP, ARP, DHCP, NAT, intradomain (OSPF) and interdomain (BGP) routing.
The network layer is what turns 'a wire between two computers' into 'the Internet'. IP gives every machine an address; routing gets datagrams from one to another. Most of the layer's complexity isn't in the data path (one router does almost nothing fancy on a forwarded packet) — it's in the control plane (how routing tables are computed and updated). The overview piece nails this split (forwarding vs routing, data plane vs control plane) and is the first thing to read.
For interviews, know IPv4 addressing (CIDR, subnets), the difference between static and dynamic routing, the difference between intradomain (OSPF) and interdomain (BGP) routing, and what ARP and DHCP do. NAT and firewalls come up almost as often as the routing protocols themselves. The 'life of a packet' walkthrough is the integration piece — read it last, after every protocol page makes sense in isolation.
Key concepts
- Forwarding (data plane) is per-packet; routing (control plane) computes the table
- IP is the lowest-common-denominator contract — datagrams, best effort, no order
- Routing is either static (hand-edited) or dynamic (protocols that converge)
- Routing protocols (OSPF, BGP) populate the routing table; IP just forwards using it
- ARP maps IP to MAC inside a LAN; DHCP gets you an IP in the first place
- NAT translates between private and public IPs and breaks the end-to-end principle
- BGP is policy-based path-vector routing between ASes — fragile by design, essential by necessity
Reference template
// A packet's journey across the Internet
1. App writes data → TCP segment → IP datagram
2. Lookup default gateway → ARP for the MAC
3. Forward to gateway → router consults routing table
4. Hop by hop across ASes → BGP-chosen paths
5. Arrive at destination AS → OSPF-chosen path inside
6. Last hop → ARP → deliver to host Adapt to your problem; the structure is the load-bearing part.
Common pitfalls
- Treating BGP as 'just another routing protocol' — its policy and trust model are unique
- Forgetting that NAT breaks listening services from outside without port forwarding / UPnP
- Mixing up CIDR /N notation — the smaller N, the bigger the subnet
- Skipping IPv6 — exhaustion of IPv4 is real and growing
Related topics
Items (12)
- What Is the Network Layer?
Forwarding vs routing, the control plane vs the data plane — what turns 'a wire between two hosts' into 'the Internet'.
Concept Foundational - IPv4 — Addressing, Subnets, Fragmentation
32-bit addresses, classless inter-domain routing (CIDR), subnet masks, fragmentation, the IPv4 header.
Building Block Foundational - IPv6 — Why and How
128-bit addresses, simplified header, no fragmentation by routers, IPv4 exhaustion as the forcing function.
Building Block Intermediate - ICMP — The Internet's Control Channel
ping, traceroute, destination-unreachable, time-exceeded, redirect — how the network tells you what went wrong.
Building Block Foundational - ARP — Address Resolution Protocol
Mapping IPv4 addresses to MAC addresses inside a subnet. The cache, the request/reply, and the spoofing risk.
Building Block Foundational - DHCP — Dynamic Host Configuration
DISCOVER / OFFER / REQUEST / ACK. The four-way handshake that gets your laptop an IP address.
Building Block Foundational - NAT and Firewalls
Why everyone is behind a NAT, how it breaks the end-to-end principle, and the firewall stances (stateful vs stateless) you'll meet.
Building Block Intermediate - Static vs Dynamic Routing
Hand-edited tables vs protocols that converge. When each is correct, and the operational cost of choosing wrong.
Concept Intermediate - Distance-Vector Routing and RIP
Bellman-Ford on the control plane — each router advertises distances to its neighbours, count-to-infinity, split-horizon, poison-reverse, and why RIP capped at 15 hops.
Building Block Intermediate - Intradomain Routing — OSPF
Link-state routing inside an AS, Dijkstra's algorithm, hello protocol, area hierarchies — the routing protocol of enterprises and ISPs.
Building Block Intermediate - Interdomain Routing — BGP
Path-vector routing between ASes, policy-based selection, the trust model that makes BGP both essential and fragile.
Building Block Advanced - The Life of a Packet — End to End
A single HTTP request from address-bar keypress to rendered page — ARP, DHCP, DNS, IP, TCP, HTTP and back, narrated layer by layer.
System Intermediate