AP CSP Big Idea 4 Packet Switching
AP CSP Packet Switching: Complete Guide (2025‑2026)
Packet switching is the method by which the internet transmits data. Instead of reserving a dedicated connection between sender and receiver (circuit switching), packet switching breaks data into small chunks called packets, routes each packet independently, and reassembles them at the destination. This makes the internet efficient, resilient, and scalable — but means packets may arrive out of order, requiring reassembly.
Contents
How Packet Switching Works
Each packet is routed independently based on current network conditions. If a node fails, packets automatically route around it. Packets from the same message may arrive out of order and must be reassembled.
You send a 9KB email. The network’s maximum packet size is 1,500 bytes. The email is split into 6 packets numbered 1–6.
What happens if packet 4 takes a slower route and arrives after packet 5? Can the email still be read?
Yes — TCP handles this. Each packet carries a sequence number in its header. The receiving device buffers all arriving packets, then uses sequence numbers to reassemble them in the correct order regardless of arrival sequence. If packet 4 never arrives (dropped by an overloaded router), TCP detects the missing acknowledgment and requests retransmission. The email is reconstructed perfectly — the out-of-order arrival is invisible to the user.
Packet vs. Circuit Switching
- Full path reserved before any data sent
- Path held exclusively for duration of call
- Guaranteed capacity and consistent quality
- Idle time wastes reserved bandwidth
- Fails completely if any node on path fails
- No dedicated path reserved in advance
- Network capacity shared among all users
- Efficient: idle bandwidth used by others
- Quality can vary based on congestion
- Reroutes automatically around failures
Compare two scenarios: (A) A 1990s telephone call from New York to Los Angeles, where a dedicated circuit is established for the call’s duration. (B) A video stream from a server in California to a viewer in New York, where data is broken into packets and routed independently.
Which approach is circuit switching, which is packet switching, and what is the key difference in how they handle a link failure?
(A) is circuit switching: the call fails completely if any part of the reserved circuit breaks — you hear silence and must redial. (B) is packet switching: if one router fails, subsequent packets are automatically routed around it through alternative paths. The video may pause briefly but does not fail permanently. This resilience to failure is the core reason packet switching was chosen for ARPANET (which needed to survive node failures in a military conflict).
Packet Headers and Metadata
- Header: Source IP, destination IP, sequence number, protocol, TTL (time to live)
- Payload: The actual data being transmitted
- Headers are readable by every router along the path
- Payload is encrypted by HTTPS (headers usually not)
- Header overhead is why packet switching isn’t 100% efficient
- Read the destination IP in the header
- Look up the best next hop in routing table
- Forward the packet to the next router
- Decrement TTL (prevents infinite loops)
- Do NOT read payload — just route by header
A security researcher argues: ‘Even if the payload is encrypted by HTTPS, packet headers reveal useful information about communication patterns.’ What specific information do headers expose even when content is encrypted?
What can an observer learn from headers alone?
Headers reveal: source and destination IP addresses (who is communicating), timing (when and how often), packet volume (how much data), and protocol information. From this metadata, an observer can infer: which websites you visit (via destination IP/domain), how long you spend there, whether you are video streaming vs. text browsing, and communication patterns between parties. This is why privacy advocates argue that metadata protection is as important as content encryption — headers tell a story even without the payload.
Common Exam Pitfalls
Each packet is routed independently based on current network conditions. Packets from the same message can and do take different paths. TCP reassembles them in order at the destination.
TCP sequence numbers allow correct reassembly regardless of arrival order. Out-of-order arrival is normal and expected — it is not data corruption.
Packet switching shares network capacity and routes independently. Circuit switching reserves a dedicated path. The internet uses packet switching; traditional telephone systems used circuit switching.
HTTPS encrypts the payload (content). Headers — including source and destination IP addresses — are generally not encrypted and are readable by every router along the path.
Check for Understanding
1. In packet switching, if one router along a packet’s route fails, what most likely happens?
- The entire transmission fails and must be restarted from the beginning.
- The packet is lost permanently because it has no alternative path.
- Subsequent packets are routed around the failed node through alternative paths.
- The transmission pauses until the failed router is repaired.
2. A file is split into 5 packets numbered 1–5. They arrive in the order 1, 3, 5, 2, 4. What happens?
- The file is corrupted because the packets arrived out of order.
- Only packets 1, 3, and 5 are kept; 2 and 4 must be retransmitted.
- TCP uses the sequence numbers to reassemble the packets in the correct order.
- The file transfer restarts from packet 1 because of the out-of-order arrival.
3. Consider statements about packet switching:
I. Packets from the same message may travel different routes through the network.
II. Circuit switching provides better fault tolerance than packet switching.
III. Each packet contains a header with source and destination address information.
Which are correct?
- I only
- I and III only
- II and III only
- I, II, and III
4. What is the primary advantage of packet switching over circuit switching for data networks?
- Packet switching guarantees consistent delivery speed.
- Packet switching uses dedicated bandwidth, ensuring no congestion.
- Packet switching shares network capacity efficiently and reroutes around failures automatically.
- Packet switching eliminates the need for routers.
5. A HTTPS-encrypted message travels from a browser to a web server. Each router along the path can read:
- The full content of the message, because routers must decrypt to forward.
- The source and destination IP addresses in the packet header, but not the encrypted payload.
- Nothing — the entire packet including headers is encrypted by HTTPS.
- Only the sequence number — all other header fields are also encrypted.
6. What is the purpose of the TTL (Time to Live) field in a packet header?
- It specifies how long the payload data should be considered current.
- It limits the number of hops a packet can make, preventing it from circulating indefinitely if routing loops occur.
- It encrypts the packet for a set number of seconds during transmission.
- It reserves bandwidth on each router for the packet’s duration.
Frequently Asked Questions
How the AP Exam Tests This
- Identify a property of packet switching that enables fault tolerance
- Explain why packets from the same message may travel different routes
- Determine what a router reads in a packet header to make forwarding decisions
- I/II/III: which statements about packet switching are correct
- Compare packet switching and circuit switching for a given scenario
7. A file is split into 4 packets. They arrive in order 1, 3, 2, 4. What happens to the file?
- The file is corrupted because packets arrived out of order.
- TCP uses sequence numbers to reassemble the packets in the correct order.
- Packets 1 and 4 are kept; 2 and 3 must be retransmitted.
- The file transfer restarts from packet 1.
8. What is the primary purpose of the TTL (Time to Live) field in a packet header?
- It encrypts the packet for a set time duration.
- It limits the number of hops, preventing packets from circulating indefinitely in routing loops.
- It reserves bandwidth for the packet on each router.
- It specifies how long the payload data should be considered valid.
9. Consider: I. Each packet is routed independently based on current network conditions. II. Circuit switching provides better fault tolerance than packet switching. III. Packet headers contain source and destination addressing information.
- I and III only
- I only
- I, II, and III
- II and III only
10. An HTTPS-encrypted message travels across the internet. Each router can read:
- The full message content to route it accurately.
- Only the source and destination IP addresses in the header, not the encrypted payload.
- Nothing — the entire packet is encrypted including headers.
- Only the sequence number.
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]