16.4 How the Internet Works: Protocols, IP Addressing, DNS, URLs, and Reliability
Key Takeaways
- A protocol is an agreed set of rules for formatting and exchanging data, so devices from different makers can communicate; common Internet protocols include IP, TCP, UDP, DNS, DHCP, HTTP, HTTPS, and SMTP.
- IPv4 addresses are 32 bits, written as four decimal numbers such as 192.0.2.10 (about 4.3 billion addresses); IPv6 addresses are 128 bits, written in hexadecimal groups separated by colons (about 3.4 × 10³⁸ addresses).
- In https://www.example.edu:8443/classes/cs101?week=3, https is the protocol (scheme), www is the subdomain, example.edu is the domain name (with the top-level domain .edu), 8443 is the port, and /classes/cs101 is the path.
- DNS is a distributed hierarchy: root servers point to top-level-domain servers such as .com and .edu, which point to the authoritative servers for each domain, which return its IP addresses.
- TCP provides reliability with sequence numbers, acknowledgments, retransmission, and checksums; the Internet gains redundancy from multiple routes, and packet switching lets traffic flow around failures.
What this competency asks
ETS asks you to be familiar with how Internet and Web protocols work:
- Describe the purpose of protocols and identify common Internet and Web protocols.
- Compare IPv4 and IPv6.
- Identify and describe the basic parts of a URL (for example, protocol, subdomain, domain name, port, and path).
- Describe the hierarchical structure of names in the Domain Name System (DNS).
- Describe the purpose and function of IP addressing.
- Identify how Internet protocols address reliability, redundancy, and error handling.
Why protocols?
A protocol is a set of rules for how data are formatted, sent, received, and acknowledged. Because the Internet's protocols are open standards, a phone from one company can load a web page from a server built by another over equipment made by a third. Protocols are organized in layers (Section 16.2).
| Protocol | Purpose | Layer | Default port |
|---|---|---|---|
| IP (Internet Protocol) | Addresses and routes packets between networks | Internet | — |
| TCP (Transmission Control Protocol) | Reliable, ordered, connection-based delivery | Transport | — |
| UDP (User Datagram Protocol) | Fast, connectionless delivery with no guarantees | Transport | — |
| HTTP / HTTPS | Web requests and responses; HTTPS adds TLS encryption | Application | 80 / 443 |
| DNS (Domain Name System) | Translates domain names to IP addresses | Application | 53 |
| DHCP | Assigns IP addresses to devices automatically when they join a network | Application | 67 / 68 |
| SMTP | Sends email between servers | Application | 25 (587 for submission) |
| IMAP / POP3 | Retrieve email to a client | Application | 143 / 110 |
| FTP, SFTP | File transfer (SFTP runs over SSH and is secure) | Application | 21 / 22 |
| SSH | Secure remote login | Application | 22 |
| TLS | Encryption and authentication for other protocols, such as HTTPS | Between application and transport | — |
Ports identify which program on a device should receive the data. The IP address gets data to the right computer, and the port gets it to the right application.
IP addressing
An IP address identifies a device's network interface and its location in the network, so routers can forward packets toward it, much as a street address does for mail.
- DHCP usually assigns addresses automatically (dynamic). Servers often keep static addresses.
- Private addresses, such as
192.168.x.x,10.x.x.x, and172.16.0.0–172.31.255.255, are used inside local networks and are not routed on the public Internet. A router's NAT lets many private devices share one public address.
IPv4 vs. IPv6
| IPv4 | IPv6 | |
|---|---|---|
| Size | 32 bits | 128 bits |
| Notation | Four decimal numbers (0–255) separated by dots: 192.0.2.10 | Eight groups of four hex digits separated by colons: 2001:0db8:0000:0000:0000:0000:0000:0001 |
| Shortening | — | Drop leading zeros and replace one run of zero groups with ::, giving 2001:db8::1 |
| Address space | 2³² ≈ 4.3 billion | 2¹²⁸ ≈ 3.4 × 10³⁸ |
| Status | Free addresses ran out in the 2010s; extended by NAT | Designed to replace IPv4; the two run side by side today |
| Other | Relies heavily on NAT | Enough addresses for every device; built-in autoconfiguration |
(The addresses 192.0.2.x and 2001:db8:: are reserved for documentation examples.)
Parts of a URL
A URL (uniform resource locator) identifies a resource on the Web.
https://www.example.edu:8443/classes/cs101/index.html?week=3#quiz
| Part | Value | Meaning |
|---|---|---|
| Protocol (scheme) | https | How to communicate: secure HTTP |
| Subdomain | www | A host or section within the domain |
| Domain name | example.edu | The registered name: second-level domain example plus top-level domain .edu |
| Top-level domain (TLD) | .edu | The highest level of the name hierarchy |
| Port | 8443 | Optional; when omitted, HTTPS uses 443 and HTTP uses 80 |
| Path | /classes/cs101/index.html | Which resource on the server |
| Query string | ?week=3 | Parameters sent to the server |
| Fragment | #quiz | A location within the page, handled by the browser |
Watch for look-alike domains in phishing links. In https://example.edu.login-check.com/, the actual registered domain is login-check.com, and example.edu is only a subdomain of it.
The Domain Name System
People use names, and routers use numbers. DNS translates between them. Names are hierarchical, read from right to left:
. (root)
└── edu (top-level domain)
└── example (second-level domain: example.edu)
└── www (subdomain / host: www.example.edu)
Resolving www.example.edu:
- The device checks its own cache, then asks its configured recursive resolver, typically run by the ISP, school, or a public DNS service.
- If the answer is not cached, the resolver asks a root server, which refers it to the .edu TLD servers.
- A .edu server refers it to the authoritative servers for example.edu.
- The authoritative server returns the IP address (an A record for IPv4 or an AAAA record for IPv6).
- The resolver caches the answer for its time-to-live (TTL) and returns it to the device.
DNS is distributed: no single server holds every name, and each zone is served by multiple servers, which gives both scale and redundancy.
Reliability, redundancy, and error handling
| Mechanism | What it handles |
|---|---|
| TCP sequence numbers | Reassembles segments in the correct order |
| TCP acknowledgments and retransmission | Resends data that were lost or not acknowledged in time |
| Checksums (in TCP, UDP, and IPv4 headers; CRC in Ethernet frames) | Detect corrupted data, which is then discarded and, with TCP, resent |
| TCP flow and congestion control | Slows the sender when the receiver or network is overloaded |
| Packet switching and dynamic routing | Routers find alternate paths when links fail |
| Redundant links, servers, and DNS servers | No single failure takes down the service |
| Time-to-live (hop limit) | Discards packets caught in routing loops |
TCP or UDP? TCP establishes a connection with a three-way handshake (SYN, SYN-ACK, ACK) and guarantees ordered, complete delivery, so web pages, email, and file transfers use it. UDP skips the handshake and guarantees, trading reliability for speed, so live video, voice calls, games, and most DNS lookups use it. For them, a late packet is useless anyway.
In the URL https://news.example.org:8080/sports/today.html, which part is the domain name?
Which statement correctly compares IPv4 and IPv6?
A file download over TCP loses several packets in transit, yet the file arrives complete and uncorrupted. Which TCP features make this possible?
A resolver with an empty cache must find the IP address of cs.university.edu. Which servers does it consult, in order?