The Internet: protocols, addressing and packet switching
A-Level Computer Science · Communication
Internet versus World Wide Web
The Internet is the global network infrastructure; the Web is one service running on it, alongside email and file transfer. Getting this distinction right is a standard one-mark question.
The TCP/IP stack
Four layers. Application (HTTP, FTP, SMTP) speaks to the program. Transport (TCP) splits data into packets, numbers them, acknowledges and retransmits. Internet (IP) adds source and destination addresses and routes. Link puts the bits on the physical medium. Each layer adds a header on the way down and the receiver strips them on the way up — layering means one layer can change without rewriting the others.
Packet switching
Data is split into packets, each carrying a header (source, destination, sequence number) and a trailer (error check). Packets may take different routes and arrive out of order; the receiver reorders by sequence number and requests missing packets. Compared with circuit switching, packet switching uses the network efficiently and survives a broken link, but adds delay and cannot guarantee ordering.
Addressing
MAC is a fixed hardware address used within a local network; IP is a logical address that changes with location and is used to route between networks. IPv4 is $32$ bits and has run out; IPv6 is $128$ bits. Public addresses are routable on the Internet; private ones are not, which is why NAT exists.
DNS
DNS turns a domain name into an IP address. The resolver asks a root server, then a TLD server, then the authoritative name server for the domain; results are cached to avoid repeating the walk. Without DNS the Web still works — but only if you type $142.250.…$ instead of a name.
Worked example: tracing a web request
A user types www.truong.edu.vn into a browser. Describe what happens until the page is displayed, stating clearly the role of DNS, TCP, IP and packet switching.
Solution
1. Name resolution (DNS). The browser needs an IP address; it cannot use the name. It checks the local cache first; if there is no entry, the resolver asks a root server, is pointed to the server for .vn, then to the authoritative server for truong.edu.vn, and receives the IP address. The result is cached along with a time to live.
2. Establishing a connection (TCP). The browser opens a TCP connection to port $80$ or $443$ at that address. TCP is the layer that guarantees reliability: it numbers and acknowledges.
3. Sending the request (Application). An HTTP GET / request is created at the application layer and passed down.
4. Encapsulation and routing (Transport → Internet → Link). TCP splits the data into packets and numbers them; IP attaches source and destination addresses to each packet; the link layer puts bits onto the medium. Each layer adds its own header.
5. Packet switching. The routers along the way read the destination IP address and forward each packet along the best route at that moment, so two packets of the same page can take two different paths and arrive out of order.
6. The receiver unwraps in reverse. The server strips the headers from the bottom up, TCP reorders by sequence number and requests retransmission of any missing packet, then delivers the complete data to the web software. The HTTP response travels back through exactly the same sequence of steps, and the browser builds the page.
Point to stress: DNS works only in the first step; guaranteeing no packets are lost and that they arrive in order is TCP's job, not IP's.