Networking · 32 min read
Packets
Why networks chop data into small, independently routable pieces instead of one continuous stream, and what that choice forces every higher layer to confront.
Why this exists
Shared networks cannot let one conversation monopolize the wire. A single unbroken transfer would block everyone else for the whole duration, and any glitch midway would force a full restart from byte zero.
Early circuit-switched systems reserved a path end to end. That worked for phone calls with predictable rates. It failed for bursty computer traffic: idle reserved capacity is waste, and a busy reserved path starves everyone else.
Packets turn communication into multiplexable units that can be queued, routed, dropped, and retried independently. That design is what makes a global shared internet possible: many conversations interleave on the same links, and failure is local to a unit rather than fatal to an entire transfer.
Axioms & primitives
- 01Links have finite capacity and are shared among many conversations.
- 02A packet is a chunk of data plus enough header for the network to forward it without understanding the payload.
- 03Networks may drop, reorder, delay, duplicate, or corrupt packets without apology; higher layers must decide what that means.
- 04Independence of packets enables multiplexing and selective recovery; it also forces apps to reassemble meaning from pieces.
- 05Header overhead is the tax you pay for independent routing and demultiplexing.
- 06Maximum size is constrained by link MTU; exceeding it forces fragmentation or a shrink-and-retry dance.
Learning objectives
After this lesson you should be able to:
- Explain why shared links force packetization instead of circuit monopolies, including the restart and fairness arguments.
- Name at least four failure modes packets can suffer in transit and map each to a plausible higher-layer response.
- Reason about the tradeoff between large payloads (amortized headers) and small payloads (lower loss cost, lower latency).
- Distinguish 'the network dropped a packet' from 'the application failed' when reading a symptom.
- Describe what MTU means and what happens when a packet exceeds it on IPv4 versus IPv6 path MTU discovery.
Progressive depth
Read the layers in order for a full explanation. Or open the layer you need.
Intuition
If you tried to send a movie as one unbroken electrical signal across the world, any glitch would force a full restart, and nobody else could use the path while you held it. That is the circuit mindset: reserve the pipe, send everything, release the pipe.
Packets are bite-sized shipments. If one is lost, only that bite is resent (when something above cares). Others keep flowing. That is how video calls, web pages, and file downloads can share the same Wi-Fi without taking turns for minutes at a time.
The uncomfortable corollary: the network does not promise your bites will arrive, arrive once, or arrive in order. It promises only to try. Every reliable experience you have on the internet is someone above the network reconstructing order and filling gaps.
Formal shape
A packet typically includes addressing and control metadata (headers) and a payload. Routers and switches forward based on headers without needing to understand the payload. That separation is what lets the same forwarding machinery carry DNS, video, and bank APIs.
Maximum Transmission Unit (MTU) limits how large a packet can be on a given link. Ethernet commonly offers a 1500-byte IP MTU. When a packet is too large, IPv4 may fragment it (often discouraged), while IPv6 largely rejects fragmentation in the network and relies on path MTU discovery: the sender learns a hop refused a large packet (via ICMP) and shrinks.
Encapsulation puts packets inside packets when tunneling or stacking layers: an IP packet may ride inside an Ethernet frame; a VPN may wrap an inner IP packet inside an outer one. Each wrap adds header tax and can change the effective MTU.
The end-to-end principle says intelligence belongs at the edges when possible: the network moves packets; applications decide what loss and reorder mean. Congestion signals (drops, ECN marks, delay) are how the shared fabric asks edges to slow down.
A packet on the path
Click a stage to see what the network does to each bite-sized shipment.
Loading diagram...
Select a stage to read the boundary detail.
Worked examples
A DNS query often fits in a single small UDP datagram. One loss means one retry; there is no giant transfer to restart. A file download becomes thousands of packets. TCP (or QUIC) tracks which pieces arrived and retransmits only the missing ones.
A video call generates a steady stream of small media packets. When you see "packet loss" on a call, the network discarded units under congestion or radio noise. The app must conceal the gap (packet loss concealment, bitrate drop) or show artifacts. Retransmitting a frame that is already late often makes things worse.
Traceroute works by sending packets with increasing hop limits and watching where they expire. You are literally probing the packet-forwarding graph. Ping sends echo requests and measures round-trip time for replies. Both tools exist because packets are independently observable units.
Worked size tradeoff: a 40-byte header on a 60-byte payload is brutal overhead. The same header on a 1400-byte payload is cheap. But if 1% of packets are lost, losing a 1400-byte piece wastes more goodput than losing a 200-byte piece. Interactive apps often prefer smaller units for latency; bulk transfer prefers larger ones for efficiency.
Edge cases
Tiny packets waste capacity on headers. Huge packets hit MTU walls and amplify loss cost. Path MTU black holes appear when ICMP feedback is filtered: large packets vanish and the sender never learns why.
Real-time media often prefers UDP so late packets can be skipped rather than delaying everything behind retransmission. Store-and-forward delay in routers means packets sit in queues: latency is often queuing, not speed-of-light. Bufferbloat is what happens when those queues are absurdly deep.
Jitter (variation in delay) breaks interactive apps even when average latency looks fine. Duplicate packets happen; protocols must be idempotent or detect duplicates. Reordering can look like loss to naive receivers that only track "next expected."
Corruption that slips past link CRC and IP/TCP checksums is rare but not impossible on bulk transfers; applications that need strong integrity add cryptographic checks. Wireless links may drop bursts of packets together, which interacts badly with designs that assume independent random loss.
Mental models
Postal letters
Each letter has an address and a body. The postal system moves letters, not whole novels as one inseparable object. If one letter is lost, you resend that letter.
Highway cars
Many destinations share lanes. Small vehicles interleave. One giant convoy blocks everyone behind it.
Chopped movie reel
A film shipped as one continuous strip fails completely on a tear. Shipped as numbered frames, only missing frames need replacement.
Tax on every shipment
Every packet pays header bytes. Tiny payloads make the tax dominate; huge payloads make each loss expensive. Design lives in the middle.
Common misconceptions
Myth
Packets guarantee delivery.
Reality
IP packets are best-effort. Reliability, if needed, is built above them (for example TCP or QUIC) or by the application itself.
Myth
Bigger packets are always better.
Reality
Larger payloads amortize headers but increase loss cost and latency on error. Networks also enforce maximum sizes (MTU).
Myth
Packet loss always means a broken cable.
Reality
Loss is often intentional congestion management (router queue overflow) or wireless interference. It is a normal control signal, not only a hardware fault.
Myth
If packets arrive, they arrive in order.
Reality
Different paths, retransmission, and ECMP can reorder. Protocols that need order must impose it with sequence numbers.
Exercises
Work these without looking up answers first. Check yourself against the intent notes.
Exercise 01
A 10 MB file must cross a network with 1% random packet loss and 1500-byte packets. Qualitatively, why is 'send as one giant blob' worse than 'send as packets with retransmission of only lost ones'?
Hint: Think about what fraction of work is wasted when the last byte fails versus when one packet in a hundred fails.
What good looks like
Learner names monopolization of the link, full restart cost on any error, and selective retransmission of lost units. Mentions that expected retransmit volume is roughly 1% of packets, not 100% of the file.
Exercise 02
List four distinct reasons a packet might never arrive, and for each say whether retransmission at the transport layer is usually appropriate.
What good looks like
Covers congestion drop, corruption, misrouting/TTL expiry, and wireless burst loss; distinguishes media (skip) vs file transfer (retransmit). Mentions that TTL expiry is a control-plane/routing symptom, not something TCP should paper over forever.
Exercise 03
An IPv6 host sends 1500-byte packets; an intermediate link has MTU 1280; ICMP 'packet too big' is filtered. What does the user experience, and what mechanism is broken?
What good looks like
Large transfers stall or fail; path MTU discovery is broken by missing ICMP feedback. Learner proposes shrinking packet size or fixing ICMP filtering as remedies.
Sources & further reading
External references. Prefer primary documents and clear explainers.
- An introduction to computer networks
high · 2017-maps
- How the internet works
high · 2017-maps
- Understand routed network traffic flows
medium · 2017-maps
- RFC 791 - Internet Protocol
high
Go deeper on your own
These picks go past the foundation in this lesson. Use them when you want a primary spec, official docs, or a longer walkthrough.
Defines the IPv4 datagram format and fragmentation rules. Open it when you need exact header fields.
- Practical Networking: Host to HostDeep dive
Follows a packet across a simple path with encapsulation at each hop. Use it to connect the idea to wire formats.
Free textbook chapter on packets and delay. Read when you want worked examples beyond this lesson.