Topic 4c – Internet Protocols and Client-Server Interaction

Data does not teleport. It travels in packets, through layers, following rules — and it arrives remarkably fast.

Learning Objectives

By the end of this topic, you should be able to:

Learning Activities

To help you meet the learning objectives, we have prepared a combination of readings, activities, and videos.

Course Readings

These reading were designed to introduce the course topics to an audience of educators. They should be considered "required" and read in order.

Supplemental Readings

Some participants find it helpful to read about a topic from a source written for a slightly more technical audience. These supplemental readings cover similar material as the course readings but may not fully align with the course learning objectives. Use them as an optional complement to your study, not a substitute for the course readings.

Activity

When this course has a face-to-face component I conduct a hands-on, unplugged activity that gives participants an opportunity to explore the concept of network packets and the need for well thought out protocols. While you do not have an opportunity to complete this activity with your peers, I think it is worth your time to read the activity and consider what it would look like both with adults and with your students.

 

Checking for Understanding, Questions

Packets, Layers, and the Webpage Journey

  1. In your own words, explain what a packet is and why the Internet breaks messages into packets rather than sending them as one continuous stream.
  2. Why might two packets from the same message arrive at the destination by different routes? How does the destination know how to reassemble them correctly?
  3. What is the role of each of the four Internet software layers? Which layers are present on routers, and which are only present at the origin and destination?
  4. Trace the complete journey of a webpage request in your own words. Start from the moment you type a URL and press Enter, and end when the page appears on your screen. Include at least five distinct steps and name the layer or component responsible for each.
  5. What is packet switching, and how does it differ from the circuit-switched approach used by old telephone networks? What advantage does packet switching provide?

Ports

  1. What problem do port numbers solve? Why is an IP address alone not sufficient to deliver a message to the right destination?
  2. A web server is running HTTP on port 80 and HTTPS on port 443. A mail server is running SMTP on port 25. All three services are running on the same machine. When a packet arrives addressed to that machine, how does the transport layer know which application should receive it?
  3. A student notices the URL http://intranet.school.edu:8080/schedule on the school's internal website. What does the :8080 indicate, and why might it be there?

TCP vs. UDP

  1. What does it mean to say TCP is "connection-oriented" and UDP is "connectionless"? What practical difference does this make for the applications that use each?
  2. TCP is described as "reliable" and UDP as "unreliable." Does "unreliable" mean UDP is broken or inferior? Explain why UDP is sometimes the better choice despite this label.
  3. For each of the following applications, identify whether TCP or UDP is the more appropriate choice and explain why:
    • Loading a webpage
    • A live video call in Google Meet
    • Downloading a software update
    • A DNS lookup
    • Sending an email
  4. A student asks: "If UDP might lose packets, why would anyone use it?" How would you answer?

Checking for Understanding, Answers

You can compare your answers to the following answer key.

Show Answer Key

Packets, Layers, and the Webpage Journey

  1. A packet is a small, fixed-size chunk of data with a header containing the source address, destination address, and sequence information. The Internet breaks messages into packets because: (1) it allows multiple conversations to share the same network links simultaneously (packet switching); (2) if one packet is lost or corrupted, only that packet needs to be retransmitted, not the whole message; (3) packets can take different routes around congestion or failures, making the network more resilient.
  2. Packets from the same message can take different routes because routers make independent forwarding decisions based on current network conditions — if one path is congested, a router may send subsequent packets a different way. The destination knows how to reassemble them correctly because each packet carries a sequence number in its header. The receiving device collects all packets, reorders them by sequence number, and reassembles the original message. TCP also handles retransmission of any missing packets.
  3. The four layers: (1) Application layer — the protocol used by the specific application (HTTP, SMTP, DNS); present only at origin and destination. (2) Transport layer — TCP or UDP; manages end-to-end delivery, ports, reliability; present only at origin and destination. (3) Internet/Network layer — IP addressing and routing; present at every device including routers. (4) Link layer — local delivery on a single physical network segment; present at every device. Routers operate primarily at the Internet layer (and link layer) but not the transport or application layers.
  4. Sample trace (five steps minimum):
    • DNS lookup (Application/Transport/Internet layers) — browser sends a DNS query to resolve the domain name to an IP address.
    • TCP handshake (Transport layer) — browser establishes a TCP connection with the web server at that IP address.
    • HTTP request (Application layer) — browser sends an HTTP GET request for the specific page. \
    • Packet routing (Internet/Link layers) — the request is broken into packets, each routed across the Internet through multiple routers.
    • HTTP response (Application layer) — the web server sends back the HTML and associated resources in packets.
    • Reassembly and rendering (Transport/Application layers) — the browser reassembles the packets and renders the HTML into a visual page.
  5. In circuit switching (used by traditional telephone networks), a dedicated physical path is reserved between caller and receiver for the entire duration of the call — even during silences, that capacity is occupied. Packet switching sends data in independent packets that share network links with everyone else's traffic. The advantage: packet switching makes much more efficient use of network capacity, since links are only used when data is actually being sent. This is why the Internet can serve billions of users simultaneously on shared infrastructure.

Ports

  1. An IP address identifies a device on the network, but a single device may be running dozens of different network applications simultaneously (a browser, an email client, a video call, a game). Port numbers identify which application on that device should receive a given packet. Without ports, the operating system would have no way to route an incoming packet to the correct process.
  2. The incoming packet's header contains a destination port number. The transport layer reads that number and delivers the packet to whichever application is currently listening on that port. HTTP traffic with destination port 80 goes to the web server process; HTTPS traffic with destination port 443 also goes to the web server (its HTTPS listener); SMTP traffic with destination port 25 goes to the mail server process.
  3. The :8080 indicates a non-standard port number — the web server for this particular resource is listening on port 8080 instead of the default port 80. This is common when a second or test web server is running on the same machine alongside the main one (which uses port 80), or when a standard web server on a school network is blocked by the firewall. Port 8080 is a widely used alternative HTTP port.

TCP vs. UDP

  1. Connection-oriented (TCP) means TCP establishes a connection before any data is sent (via the three-way handshake), guarantees delivery and ordering, and formally closes the connection when done. Connectionless (UDP) means UDP sends packets with no prior setup, no acknowledgment, and no guarantee that they arrive or arrive in order. Practically: TCP applications receive complete, correctly ordered data but at the cost of latency; UDP applications receive data as fast as possible but may experience gaps or glitches.
  2. "Unreliable" does not mean UDP is broken — it means UDP does not include the overhead of guaranteed delivery. For applications where speed matters more than perfection — live video calls, online games, streaming audio — a slightly dropped packet causes only a brief glitch, while TCP's retransmission overhead would cause a noticeable delay or stutter. UDP is often the better choice precisely because it does not try to fix lost packets: by the time a retransmission arrives, the data would be stale anyway.
    • Loading a webpage: TCP — all HTML, CSS, and images must arrive correctly and completely for the page to display properly.
    • Live video call in Google Meet: UDP — real-time audio/video can tolerate occasional lost packets (brief glitches) but cannot tolerate the delays caused by TCP retransmission.
    • Downloading a software update: TCP — every byte of the installer must arrive correctly; a corrupted file would be unusable.
    • A DNS lookup: UDP — DNS queries are tiny and need fast responses; if no reply arrives, the client simply re-sends the query. The overhead of TCP connection setup would be disproportionate.
    • Sending an email: TCP — an email must arrive complete and intact; SMTP uses TCP to ensure reliable delivery between mail servers.
  3. The speed advantage is worth the risk for the right applications. When you are on a live video call, a packet that arrives 200 milliseconds late is worse than useless — TCP would delay all subsequent audio waiting for it, causing a noticeable stutter. UDP simply moves on; the receiver fills the gap with a brief silence or glitch and continues. For real-time applications, the latency cost of reliability is higher than the quality cost of occasional loss. UDP is not a flaw; it is a deliberate design choice for scenarios where speed beats completeness.

If you still have questions or concerns you can use the videos below to try and further your understanding.

Extend Your Learning

The following resources go a little deeper on topics we touched on but did not fully explore in the readings. These are entirely optional — none of this material appears on the Competency Demo — but each one is a natural "next question" from something covered this week.

  • QUIC: a newer transport protocol
    Google developed a protocol called QUIC that combines the reliability of TCP with much of the speed of UDP. It is now the foundation of HTTP/3, the latest version of the web's core protocol. This article from Cloudflare covers how QUIC improves on TCP and why it required a redesign rather than just tweaking the existing protocol.
    What is HTTP/3? — Cloudflare
  • Traceroute: seeing the hops
    The traceroute command (called tracert on Windows) shows every router a packet passes through on its way to a destination, along with the time taken at each hop. Running traceroute google.com from a school network is a concrete, visual demonstration of packet routing — you can see packets leaving the school, passing through the ISP, and reaching their destination. This How-To Geek article explains how to use it.
    How to Use Traceroute — HowToGeek
  • Firewalls and port blocking
    School network firewalls work largely by blocking traffic on specific port numbers. Understanding which ports are blocked explains why certain services are inaccessible on school networks while others work fine. This article from Palo Alto Networks covers how firewalls use port-based rules and what more advanced firewalls can do beyond simple port blocking.
    What is a Firewall? — Palo Alto Networks