Packets and Packet Switching

Imagine you want to send a friend a huge photo across the network. You could try to shove the whole thing down the wire in one long, unbroken stream — but that would be like driving a mile-long lorry down a single road. Nothing else could get past until your lorry had finished, and if the road were blocked halfway, the whole delivery would be stuck.

Real networks do something much cleverer. They chop your data into lots of small chunks called packets, and fire them off independently — like posting a long letter as a stack of separate, numbered postcards instead of one enormous parcel. Each postcard finds its own way to the destination, and the numbers let your friend put the message back together at the other end. This is packet switching, and it is the idea the whole internet is built on.

What's inside a packet?

A packet is not just a raw slice of your data. Each one is a tidy little envelope with three parts: a header, the payload, and a trailer.

Packet switching: every packet finds its own way

Once the message is split up, the packets are let loose on the network. The special machines that pass them along are called routers. At every router, each packet's destination address is read and the router sends it on down whatever link looks best right now. Because the network is a mesh of many links, two packets from the same message can travel by completely different routes — and that is perfectly fine.

Step through the diagram: the message is split into three numbered packets, they scatter across the network by different paths, arrive in a jumbled order, and are finally reassembled using their sequence numbers.

Putting the message back together

Because every packet chose its own route, they don't necessarily arrive in the order they were sent — a packet that took a short, quiet path might overtake one stuck behind congestion. This is where the sequence numbers earn their keep. The receiving computer:

Only once every numbered packet is present and correct is the payload reassembled into the original photo, file, or page. The gaps and the shuffling are invisible to you — you just see the picture appear.

Why bother? Because it's brilliantly efficient

Splitting data into independent packets buys two big wins:

Packet switching grew out of 1960s research (the ARPANET) into networks that could keep working even if parts of them were destroyed. An older telephone-style network reserves one unbroken circuit for the whole call — cut it and the call drops dead. A packet-switched network has no single circuit to cut: every packet is free to find a new way round. Damage a few links and the traffic just flows around the hole, like water around a rock. That "no fixed path" design is why the modern internet is so hard to knock over.

It's tempting to picture your message flowing to its destination as one smooth, unbroken stream that arrives whole and in order. It doesn't! The data is broken into separate packets that travel independently, often by different routes, and they can easily arrive out of order (packet 5 before packet 3). That's completely normal — the sequence numbers in the headers are what let the receiver shuffle them back into the right order. Never assume packets arrive in the order they were sent.