Why Can’t We Just Send Data in One Big Chunk?
Imagine you want to send a large photograph to a friend across the internet. The image file might be several megabytes — millions of bytes of data. If the internet tried to send this file as one continuous stream along a single path, it would tie up that entire route for the duration of the transfer. No one else could use those connections until your photo finished sending. If anything went wrong halfway through — a cable fault, a router crash — the entire transfer would fail and you would have to start again from scratch.
This is clearly not how the internet works. You can browse the web, stream music, and send messages all at the same time, sharing the same network connections with millions of other users worldwide. The solution that makes this possible is called packet switching.
Packet switching is the method the internet uses to transmit data. Instead of sending a file as one big block, the data is broken into small, manageable pieces called packets. Each packet is sent independently across the network, potentially taking different routes, and is reassembled at the destination to recreate the original data.
In this topic you will learn:
- What packet switching is and why it is used
- The structure of a data packet: header, payload, and trailer
- The step-by-step process of how packet switching works
- How packet switching compares to circuit switching
- The role of routers in forwarding packets across the network
- A real-world analogy to help you remember the concept
Why Use Packet Switching?
Packet switching became the standard for computer networks because it solves several critical problems with data transmission. There are three main reasons why it is used:
1. Efficient Use of Bandwidth
When data is split into packets, multiple users can share the same network connections simultaneously. While one user’s packets travel along a link, another user’s packets can use the same link in the gaps between them. This is like a motorway where many cars from different journeys share the same road at the same time, rather than closing the entire motorway for one car to travel from start to finish.
Without packet switching, sending a large file would monopolise an entire route, wasting bandwidth whenever there were brief pauses in the transmission. Packet switching ensures that network capacity is used as fully as possible.
2. Fault Tolerance
Because each packet is sent independently and can take a different route, the network is fault tolerant. If one router or cable fails, packets can simply be rerouted around the problem. The sender does not even need to know about the failure — the network handles it automatically.
This was actually one of the original motivations for developing packet switching. The US military wanted a communication system that could survive partial destruction. If a bomb destroyed one part of the network, messages would still get through by finding alternative routes — exactly what packet switching enables.
3. Fairness
Packet switching ensures that no single user can dominate the network. Because data is broken into small packets and these packets are interleaved with packets from other users, everyone gets a fair share of the available bandwidth. Multiple users share the same network lines fairly, rather than one user blocking everyone else while their large file transfers.
The Structure of a Packet
A packet is not just a random chunk of data. Every packet has a carefully defined structure with three distinct parts: the header, the payload, and the trailer (sometimes called the footer). Think of a packet like a letter in an envelope — the envelope has the address on the outside (header), the letter inside (payload), and a seal on the back to confirm it has not been tampered with (trailer).
+------------------------------------------------------+
| PACKET |
+----------------+---------------------+---------------+
| HEADER | PAYLOAD | TRAILER |
| | | |
| - Source IP | The actual data | - Error check |
| - Dest. IP | being sent | (checksum) |
| - Packet No. | | - End of |
| - Total Pkts | Typically | packet |
| - TTL | 500-1500 bytes | marker |
| - Protocol | | |
+----------------+---------------------+---------------+
The Header
The header is attached to the front of every packet and contains essential information that routers and the destination computer need to handle the packet correctly. It is like the address label on a parcel. The header includes:
- Source IP address: The IP address of the computer that sent the packet. This tells the destination where the data came from and where to send any replies or error messages.
- Destination IP address: The IP address of the computer the packet is being sent to. Routers use this to decide where to forward the packet next.
- Packet number (sequence number): A number indicating this packet’s position in the sequence. For example, if a file is split into 20 packets, this might be “packet 7 of 20.” The destination uses this to reassemble the packets in the correct order.
- Total number of packets: How many packets the original data was split into. This tells the destination how many packets to expect, so it knows when it has received them all.
- TTL (Time to Live): A counter that limits how long a packet can travel around the network. Each time the packet passes through a router, the TTL is reduced by one. If it reaches zero, the packet is discarded. This prevents lost or misdirected packets from circling the network forever, wasting bandwidth.
- Protocol: Identifies which protocol (set of rules) should be used to handle the data. For example, HTTP for web pages, SMTP for email, or FTP for file transfers. This tells the destination computer which application or service the data belongs to.
The Payload
The payload is the middle section of the packet and contains the actual data being transmitted. This is the useful content — a piece of an image, a fragment of a web page, part of an email message, or a segment of a video stream.
The payload is typically between 500 and 1,500 bytes in size. The maximum payload size is determined by the network’s Maximum Transmission Unit (MTU). On most networks, the MTU is 1,500 bytes. Keeping packets small means they can be transmitted quickly and retransmitted efficiently if an error occurs.
The Trailer (Footer)
The trailer is attached to the end of the packet and serves two important purposes:
- Error checking data (checksum): A mathematical value calculated from the contents of the packet. When the packet arrives at its destination, the same calculation is performed on the received data. If the result matches the checksum in the trailer, the data arrived intact. If it does not match, the packet has been corrupted during transmission and must be re-requested.
- End of packet marker: A special sequence that signals to the receiving device that this is the end of the current packet. This helps the receiver distinguish where one packet ends and the next begins.
How Packet Switching Works: Step by Step
Now that you understand the structure of a packet, let us walk through the entire process of how data gets from one computer to another using packet switching. Imagine you are sending an image from your computer in London to a friend’s computer in Edinburgh.
Step 1: Data Is Split into Packets at the Source
Your computer takes the image file and divides it into small chunks. Each chunk becomes the payload of a packet. If the image is 15,000 bytes and each payload can hold 1,500 bytes, the file will be split into 10 packets.
Step 2: Each Packet Is Labelled
Your computer adds a header to each packet containing the source IP address (your computer), the destination IP address (your friend’s computer), the packet’s sequence number (1 of 10, 2 of 10, etc.), the total number of packets (10), a TTL value, and the protocol. A trailer with error-checking data is also added.
Step 3: Packets Are Sent Across the Network Independently
The packets are sent out onto the network. Crucially, each packet is treated as an independent unit. They do not have to travel together or follow the same route. Each packet makes its own way through the network.
Step 4: Routers Examine Each Packet and Forward It
At each point in the network, a router examines the packet’s destination IP address in the header. The router consults its routing table to determine the best next step (the “next hop”) for the packet to take towards its destination. The router then forwards the packet to the next router along the route.
Step 5: Packets May Take Different Routes
Because the internet is a complex mesh of interconnected routers and links, there are usually many possible paths between two points. Different packets from the same file may take completely different routes. Packet 1 might travel through Manchester and Leeds, while Packet 2 goes through Birmingham and Sheffield. Routers make decisions based on current network conditions — if one route is congested or a link has failed, they redirect packets along a different path.
SOURCE (London) DESTINATION (Edinburgh)
| ^
|---> Router A ---> Router C ---> Router F ---> | (Packet 1, 3, 7)
| |
|---> Router A ---> Router D ---> Router F ---> | (Packet 2, 5)
| |
|---> Router B ---> Router E ---> Router F ---> | (Packet 4, 6, 8, 9, 10)
Step 6: Packets Arrive at the Destination (Possibly Out of Order)
Because packets take different routes, they may arrive at the destination at different times and in a different order from which they were sent. Packet 5 might arrive before Packet 2, or Packet 10 might arrive before Packet 3. This is completely normal in packet switching.
Step 7: Packets Are Reassembled in the Correct Order
The destination computer uses the sequence numbers in each packet’s header to put all the packets back in the correct order. It knows it needs 10 packets (from the “total packets” field), so it waits until all 10 have arrived, then arranges them from 1 to 10 and extracts the payload from each one to reconstruct the original image file.
Step 8: Error Checking and Retransmission
The destination checks each packet’s checksum (in the trailer) to verify the data was not corrupted during transmission. If a packet is damaged or missing (perhaps it was discarded because its TTL reached zero, or it was lost due to a network error), the destination sends a request back to the source asking for that specific packet to be re-sent. Only the damaged or missing packets need to be retransmitted — not the entire file.
The Role of Routers in Packet Switching
Routers are the unsung heroes of the internet. Without them, packets would have no way of finding their destination. A router is a networking device that sits at junctions in the network and makes decisions about where to send each packet next.
What Do Routers Do?
- Examine packet headers: When a router receives a packet, it reads the destination IP address from the packet’s header. This tells the router where the packet ultimately needs to go.
- Consult routing tables: The router maintains a routing table — a database that maps destination addresses to the best “next hop” (the next router along the path). Routing tables are updated dynamically as network conditions change.
- Forward packets to the next hop: Based on the routing table, the router sends the packet to the next router that brings it closer to its destination. This process repeats at each router until the packet reaches the destination network.
- Manage network traffic: Routers can detect congestion and redirect packets along less busy routes. If a link fails, the routing table is updated and future packets are sent via alternative paths.
- Decrement the TTL: Each router reduces the packet’s TTL by one. If the TTL reaches zero, the router discards the packet. This prevents misdirected packets from looping endlessly around the network.
Think of routers like traffic police at junctions. Each officer looks at the address on a package, checks their map, and points it in the right direction towards the next junction. No single officer knows the entire route — they just know the best next step from their position.
Real-World Analogy: Sending a Book by Post
One of the best ways to understand packet switching is through a simple analogy. Imagine you want to send a book to a friend, but the postal service will only accept envelopes, not heavy parcels. Here is what you would do:
- Tear out the pages: You carefully remove each page from the book. Each page is like a packet’s payload — a small piece of the original data.
- Number the pages: You write a page number on each one (e.g., “page 14 of 200”). This is like the sequence number in the packet header.
- Put each page in a separate envelope: Each envelope has your address (source IP), your friend’s address (destination IP), and the page number. The envelope is the header, and the page inside is the payload.
- Post the envelopes separately: You drop all 200 envelopes in the postbox. The postal service does not send them all together on the same van — they get mixed in with other people’s mail and may travel via different sorting offices and delivery routes.
- Envelopes arrive at different times: Your friend starts receiving envelopes over several days. Page 47 might arrive before page 3. Page 150 might arrive on Tuesday while page 12 arrives on Wednesday. This is just like packets arriving out of order.
- Your friend reassembles the book: Using the page numbers, your friend puts all the pages back in the correct order (1, 2, 3 ... 200) and reconstructs the book. This is reassembly using sequence numbers.
- Check for missing pages: If any envelopes were lost in the post, your friend notices the gap (e.g., page 87 is missing) and contacts you to re-send just that page. This is like error checking and retransmission.
This analogy captures the essential ideas of packet switching: breaking data into pieces, labelling them, sending them independently through a shared system, and reassembling them at the destination.
Packet Switching vs Circuit Switching
To fully understand packet switching, it helps to compare it to the older method it replaced: circuit switching. Circuit switching is the technology used by traditional telephone networks.
How Circuit Switching Works
In circuit switching, a dedicated path (circuit) is established between the sender and receiver before any data is transmitted. This path remains exclusively reserved for that communication for the entire duration of the connection, even during silences or pauses. Think of an old-fashioned telephone call: when you dial a number, the telephone exchange creates a continuous electrical circuit from your phone to the other person’s phone. That circuit is yours alone until you hang up.
Comparison Table
| Feature | Packet Switching | Circuit Switching |
|---|---|---|
| Connection type | No dedicated path — packets find their own routes independently | A dedicated path (circuit) is established and held open for the entire session |
| Bandwidth usage | Efficient — bandwidth is shared among many users; unused capacity is available to others | Wasteful — the circuit is reserved even during silences or idle periods |
| Fault tolerance | High — if a route fails, packets can be rerouted automatically | Low — if any part of the circuit fails, the entire connection is lost |
| Data order | Packets may arrive out of order and must be reassembled | Data arrives in order because it follows a single path |
| Setup time | No setup needed — packets are sent immediately | A circuit must be established before data can flow (setup delay) |
| Suitable for | Internet, email, web browsing, file transfer, streaming | Traditional telephone calls, dedicated private connections |
| Example | The internet | Traditional landline telephone network (PSTN) |
| Guaranteed quality | No guarantee — packets may be delayed, lost, or arrive out of order | Guaranteed bandwidth and consistent quality for the duration of the call |
Test Your Knowledge
Try these interactive exercises to check your understanding of packet switching. Read each question carefully and think about your answer before clicking.
Exercise 1: Packet Assembly Challenge
Packets have arrived at the destination out of order! Read the packet information and click the packets in the correct sequence order (from first to last) to reassemble the original message.
Exercise 2: Packet Switching Quiz
Test your knowledge of packet switching concepts. Read each question and select the correct answer.
Exercise 3: Packet Part Identifier
Read the description below and identify which part of a packet it belongs to: Header, Payload, or Trailer.
Practice Questions
Click on each question to reveal the answer. Try to answer in your head or on paper first before checking!
Answer: Packet switching is a method of transmitting data across a network by breaking it into small units called packets. Each packet is sent independently across the network, potentially taking different routes, and is reassembled at the destination using sequence numbers. It is used on the internet because: (1) it makes efficient use of bandwidth — multiple users share the same network connections by interleaving their packets; (2) it is fault tolerant — if a route fails, packets can be rerouted via alternative paths; (3) it is fair — no single user can monopolise the network because data is sent in small packets that are mixed with other users’ traffic.
Answer: A data packet has three parts: (1) Header — contains routing and control information including the source IP address, destination IP address, packet sequence number, total number of packets, TTL (Time to Live), and the protocol. The header is used by routers to forward the packet and by the destination to reassemble packets. (2) Payload — contains the actual data being transmitted (e.g., part of an image, web page, or email). The payload is typically 500–1,500 bytes. (3) Trailer (footer) — contains error checking data (a checksum) used to verify the packet was not corrupted, and an end-of-packet marker that indicates where the packet ends.
Answer: TTL (Time to Live) is a value stored in the header of each packet. It is set to a number (e.g., 64) when the packet is first sent. Each time the packet passes through a router, the TTL is decremented (reduced) by one. If the TTL reaches zero, the packet is discarded by the router. TTL is necessary because without it, a misdirected or lost packet could keep circling the network indefinitely, passing from router to router in a loop. This would waste bandwidth and could cause network congestion. TTL ensures that packets have a limited lifespan and are eventually removed from the network if they cannot reach their destination.
Answer: A router is a networking device that directs packets across the network towards their destination. When a router receives a packet, it: (1) examines the destination IP address in the packet’s header; (2) consults its routing table — a database that maps destination addresses to the best next hop (the next router along the path); (3) forwards the packet to the appropriate next router; (4) decrements the TTL by one (and discards the packet if TTL reaches zero). Routers also help manage congestion by detecting busy routes and redirecting packets via less congested paths. Their routing tables are updated dynamically as network conditions change.
Answer: Packet switching — Advantage: bandwidth is used efficiently because multiple users share network connections, and unused capacity is available to others. Disadvantage: packets may arrive out of order and must be reassembled, and there is no guaranteed bandwidth or quality of service. Circuit switching — Advantage: a dedicated path is established, guaranteeing consistent bandwidth and data arriving in order, which is ideal for real-time communication like voice calls. Disadvantage: the dedicated circuit is reserved even during periods of silence, wasting bandwidth that could otherwise be used by other communications. Also, if any part of the circuit fails, the entire connection is lost.
Answer: (1) The file is split into packets: 9,000 ÷ 1,500 = 6 packets. Each packet contains up to 1,500 bytes of the file in its payload. (2) Each packet is given a header containing the source IP, destination IP, sequence number (1 of 6, 2 of 6, etc.), total packets (6), TTL, and protocol. A trailer with a checksum is also added. (3) The 6 packets are sent independently across the network. (4) Routers at each junction examine the destination IP and forward each packet towards the destination. (5) Packets may take different routes and arrive out of order. (6) The destination uses the sequence numbers to reassemble the 6 packets in the correct order (1, 2, 3, 4, 5, 6). (7) The destination checks each packet’s checksum. If any packet is corrupted or missing, it sends a request for retransmission of that specific packet.
Answer: Packet switching is fault tolerant because each packet is routed independently across the network. If one router or network link fails, packets do not all fail with it. Instead, routers detect the failure, update their routing tables, and redirect subsequent packets via alternative paths. For example, if a user in London is sending data to a server in New York, and a transatlantic cable between two routers fails, the packets that have not yet been sent will be automatically rerouted through a different cable or path. The sender does not even need to know about the failure — the network handles it transparently. In contrast, circuit switching would lose the entire connection if any part of the dedicated circuit failed.
Answer: Imagine sending a book by post: (1) You tear out each page — this is like splitting data into packets (each page is a payload). (2) You number each page (e.g., page 1 of 200) — this is like adding a sequence number to the packet header. (3) You put each page in a separate envelope with your address and the recipient’s address — the envelope represents the header (with source and destination IP addresses), and the page inside is the payload. (4) You post them separately — each envelope (packet) travels independently through the postal system (network). (5) Envelopes travel via different sorting offices — this is like packets being routed via different paths by routers. (6) Envelopes arrive at different times and in a jumbled order — this mirrors packets arriving out of order. (7) The recipient uses page numbers to put the book back together — the destination uses sequence numbers to reassemble packets. (8) If any pages are missing, the recipient asks you to re-send just those pages — this is like error checking and retransmission of corrupted or lost packets.
Key Vocabulary
This table summarises the essential terms for this topic. Use it for revision and to check your understanding.
| Term | Definition |
|---|---|
| Packet switching | A method of transmitting data by breaking it into small independent packets, sending them across the network (possibly via different routes), and reassembling them at the destination |
| Packet | A small unit of data transmitted across a network, consisting of a header, payload, and trailer |
| Header | The front section of a packet containing routing and control information: source IP, destination IP, sequence number, total packets, TTL, and protocol |
| Payload | The middle section of a packet containing the actual data being transmitted, typically 500–1,500 bytes |
| Trailer (footer) | The end section of a packet containing error-checking data (checksum) and an end-of-packet marker |
| Sequence number | A number in the packet header indicating its position in the original data (e.g., packet 3 of 10), used for correct reassembly |
| TTL (Time to Live) | A counter in the packet header decremented by each router; if it reaches zero, the packet is discarded to prevent infinite loops |
| Checksum | A mathematical value in the trailer used to detect whether the packet data was corrupted during transmission |
| Router | A networking device that examines packet headers and forwards packets towards their destination using routing tables |
| Routing table | A database maintained by a router that maps destination addresses to the best next hop for forwarding packets |
| Next hop | The next router along the path that a packet should be forwarded to, as determined by the current router’s routing table |
| Circuit switching | An older method of communication where a dedicated path is established between sender and receiver for the entire duration of the connection |
| Bandwidth | The maximum amount of data that can be transmitted over a network connection in a given time, measured in bits per second |
| Fault tolerant | The ability of a system to continue functioning when part of it fails — in packet switching, packets reroute around failures |
| Protocol | A set of rules governing how data is transmitted and received across a network (e.g., HTTP, SMTP, FTP) |
| Reassembly | The process of putting packets back in the correct order at the destination using their sequence numbers to reconstruct the original data |
| MTU (Maximum Transmission Unit) | The largest size of packet (in bytes) that a network can transmit; commonly 1,500 bytes on most networks |
How to Succeed in the Exam
Past Paper Questions
Try these exam-style questions, then click to reveal the mark scheme answer.
Describe the process of packet switching when data is sent across a network. [4] marks
Mark scheme:
- Data is broken into packets (1)
- Each packet contains the source and destination IP addresses and a sequence number (1)
- Packets may take different routes across the network to reach the destination (1)
- Packets are reassembled in the correct order at the destination using the sequence numbers (1)
Explain one advantage and one disadvantage of packet switching. [2] marks
Mark scheme:
- Advantage: if one route is blocked or congested, packets can take alternative routes / more reliable / efficient use of bandwidth (1)
- Disadvantage: packets may arrive out of order and need to be reassembled / this adds processing overhead / latency for real-time applications (1)
Packet Switching in Your Daily Life
Now that you understand packet switching, you can appreciate that every single thing you do online relies on this process. Consider these everyday activities:
- Loading a web page: When you visit a website, the HTML, CSS, JavaScript, and images are all broken into packets, sent across the internet from the web server to your device, and reassembled by your browser to display the page. Hundreds or even thousands of packets may be involved in loading a single page.
- Sending a message: When you send a text message through an app like WhatsApp or iMessage, your message is split into packets, routed through the internet, and delivered to the recipient’s device. The packets may travel through routers on different continents before arriving.
- Streaming a video: When you watch a YouTube video or a Netflix show, the video data is continuously broken into packets and streamed to your device. If some packets are delayed, you might see buffering — this is the player waiting for missing packets to arrive before it can continue playing.
- Online gaming: Every action you take in an online game (moving, shooting, chatting) is sent as packets to the game server and to other players. Low latency (fast packet delivery) is critical for smooth gameplay — this is why “ping” (a measure of packet round-trip time) matters so much to gamers.
The beauty of packet switching is that all of these activities happen simultaneously across the same network infrastructure. Your web browsing packets, your friend’s video stream, and a business’s email traffic all share the same routers and cables, each packet finding its own way to its destination. This sharing is what makes the internet so powerful and efficient.
Challenge yourself: Next time you experience slow internet or a video buffer, think about what might be happening at the packet level. Are packets being delayed because the network is congested? Are some being lost and retransmitted? Understanding packet switching gives you insight into why your internet sometimes behaves the way it does.