2.1 Networks – The Internet
Objective
Explain how a Uniform Resource Locator (URL) is used to locate a resource on the World Wide Web (WWW) and describe the role of the Domain Name Service (DNS). In addition, understand the underlying networking concepts required by the Cambridge International AS & A Level Computer Science (9618) syllabus.
1. Internet Architecture – The TCP/IP Stack
| Layer (TCP/IP model) | Primary Function | Typical Protocols |
|---|
| Application | Provides network services directly to user applications (web browsing, email, file transfer, etc.). | HTTP, HTTPS, FTP, SMTP, POP3, IMAP, DNS, Telnet, SSH |
| Transport | Ensures reliable (TCP) or fast, connection‑less (UDP) data transfer between end‑systems. | TCP, UDP |
| Internet | Routes packets across multiple networks using IP addresses. | IPv4, IPv6, ICMP |
| Link (Network Access) | Handles physical transmission of bits on a local link. | Ethernet, Wi‑Fi (IEEE 802.11), PPP, Token‑Ring |
2. What Is a URL?
A Uniform Resource Locator (URL) is a textual address that tells a web client (normally a browser) what resource is required and how to obtain it.
2.1 Components of a URL
| Component | Purpose | Example (using https://user:pass@www.example.com:8443/articles/ai/introduction.html?lang=en#overview) |
|---|
| Scheme | Identifies the protocol to be used. | https |
| User‑info (optional) | Credentials for authentication (rarely used in modern browsers). | user:pass |
| Host (domain name) | Human‑readable name that will be resolved to an IP address. | www.example.com |
| Port (optional) | Specifies the service port; defaults are 80 for HTTP, 443 for HTTPS. | 8443 |
| Path | Hierarchical location of the resource on the server’s file system. | /articles/ai/introduction.html |
| Query | Key‑value pairs that supply additional parameters. | ?lang=en |
| Fragment | Identifier of a secondary resource within the primary document (e.g., a section heading). | #overview |
3. How a URL Locates a Resource
- Parsing – The browser separates the URL into its components.
- Select protocol handler – The scheme determines which application‑layer protocol (HTTP, HTTPS, FTP, etc.) will be used.
- Domain name resolution – The host part (
www.example.com) is sent to the DNS resolver to obtain an IP address (IPv4 or IPv6). - Establish transport connection – Using the returned IP address and the required port, the client opens a TCP (or UDP) connection.
- Application‑layer request – For HTTP/HTTPS the client sends a request line that includes the path and query string.
- Server response – The server returns the requested resource (HTML, image, video, etc.) or an error status.
- Fragment handling – If a fragment identifier is present, the browser scrolls to the corresponding element after rendering.
Sample Pseudo‑code for a Recursive DNS Resolver (AO2 style)
function resolve(hostname):
if cache.contains(hostname):
return cache.get(hostname)
// query the configured recursive resolver
answer = queryRecursiveResolver(hostname)
if answer.isAuthoritative():
cache.store(hostname, answer.address, answer.TTL)
return answer.address
else:
// fallback – perform an iterative lookup starting at the root
return iterativeLookup(hostname)
4. Example Walk‑through (IPv4 & IPv6)
Resolve https://www.example.com/articles/ai/introduction.html?lang=en#overview
- Parse – scheme =
https; host = www.example.com; path = /articles/ai/introduction.html; query = lang=en; fragment = overview. - DNS query – Resolver asks the recursive DNS server for an
A (IPv4) and an AAAA (IPv6) record. - Resolution chain – Root →
.com TLD → authoritative server for example.com → returns:A: 93.184.216.34AAAA: 2606:2800:220:1:248:1893:25c8:1946
- Transport – Browser opens a TCP connection to the chosen address (e.g., IPv4
93.184.216.34) on port 443. - HTTPS handshake – TLS negotiation establishes an encrypted channel.
- HTTP request:
GET /articles/ai/introduction.html?lang=en HTTP/1.1Host: www.example.com
Connection: close
- Response – Server returns the HTML document; the browser renders it and jumps to the element with
id="overview".
5. Domain Name Service (DNS)
- Distributed hierarchical database – Root → Top‑Level Domains (TLDs) → Second‑level domains → Sub‑domains.
- Resolver process – Local cache → configured recursive resolver → authoritative name servers.
- Common record types
A – IPv4 address.AAAA – IPv6 address.CNAME – Canonical name (alias).MX – Mail exchange (used by SMTP).NS – Name‑server delegation.TXT – Arbitrary text (often used for SPF, DKIM).
- TTL (Time‑to‑Live) – Determines how long a record may be cached before a fresh query is required.
- DNS caching – Browsers, operating systems and recursive resolvers cache records to speed up look‑ups; stale entries can cause “wrong‑site” errors if TTLs are too long.
- DNSSEC – Adds digital signatures to DNS records, allowing resolvers to verify authenticity and protect against spoofing attacks.
- Security considerations
- Cache poisoning – an attacker injects false records into a resolver’s cache.
- Man‑in‑the‑middle attacks – mitigated by DNSSEC and TLS/HTTPS.
6. IP Addressing Fundamentals
6.1 IPv4 vs. IPv6
| Version | Notation | Size | Typical Example |
|---|
| IPv4 | dotted‑decimal (four octets) | 32 bits (≈ 4 billion addresses) | 192.0.2.146 |
| IPv6 | colon‑hex (eight 16‑bit groups) | 128 bits (≈ 3.4 × 10³⁸ addresses) | 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
6.2 Public vs. Private IPv4 Ranges
- 10.0.0.0 / 8 – 10.0.0.0 – 10.255.255.255
- 172.16.0.0 / 12 – 172.16.0.0 – 172.31.255.255
- 192.168.0.0 / 16 – 192.168.0.0 – 192.168.255.255
These addresses are not routable on the public Internet; they are used behind a NAT (Network Address Translation) device.
6.3 Subnetting & CIDR
Subnetting divides a network into smaller logical segments. CIDR notation combines the address with a prefix length indicating the number of network bits.
IP address: 192.168.1.0/24
Binary: 11000000.10101000.00000001.00000000
Network bits: 24 (11000000.10101000.00000001)
Host bits: 8 (00000000‑11111111)
Network address: 192.168.1.0
Broadcast address: 192.168.1.255
Usable hosts: 192.168.1.1 – 192.168.1.254 (254 hosts)
6.4 Static vs. Dynamic IP Addressing
- Static – Manually configured; remains constant (useful for servers, printers, or devices that need a fixed address).
- Dynamic – Assigned automatically by DHCP (Dynamic Host Configuration Protocol); simplifies management of large LANs.
7. Network Devices, Topologies & Communication Models
7.1 Key Network Devices
| Device | Function |
|---|
| Router | Connects different networks; forwards packets based on IP routing tables. |
| Switch | Operates at the link layer; forwards frames within a LAN based on MAC addresses. |
| Hub | Simple repeater; broadcasts incoming frames to all ports (now largely obsolete). |
| Network Interface Card (NIC) | Provides a physical interface for a device to join a network. |
| Access Point (AP) | Enables wireless devices to connect to a wired LAN. |
| Firewall | Filters traffic based on rules; can be hardware‑ or software‑based. |
7.2 Common LAN/WAN Topologies
- Star – All nodes connect to a central switch or hub (most common in modern LANs).
- Bus – Nodes share a single communication line; historically used with coaxial Ethernet.
- Ring – Each node connects to two neighbours; token‑ring is an example (largely obsolete).
- Mesh – Multiple redundant paths; typical in WAN backbones and some wireless ad‑hoc networks.
7.3 Client‑Server vs. Peer‑to‑Peer (P2P)
- Client‑Server – Centralised server provides resources/services; clients request them (e.g., web browsing, email).
- Peer‑to‑Peer – Every node can act as both client and server; resources are shared directly (e.g., file‑sharing, BitTorrent).
7.4 Thin‑Client vs. Thick‑Client
- Thin‑client – Minimal processing and storage on the local device; most work is performed on a remote server (e.g., web‑based applications, virtual desktop infrastructure).
- Thick‑client (fat client) – Performs most processing locally; requires installation of software and often more powerful hardware (e.g., desktop office suites, video games).
8. Cloud Computing Overview (Syllabus Link)
- Service models
- Software‑as‑a‑Service (SaaS) – Applications delivered over the Internet (e.g., Google Docs).
- Platform‑as‑a‑Service (PaaS) – Development platforms provided as a service (e.g., Heroku).
- Infrastructure‑as‑a‑Service (IaaS) – Virtualised hardware resources (e.g., Amazon EC2).
- Deployment models
- Public cloud – Services offered to the general public over the Internet.
- Private cloud – Cloud infrastructure operated solely for one organisation (often on‑premises).
- Hybrid cloud – Combination of public and private clouds, allowing data and applications to move between them.
- Relevance to networking
- Relies heavily on DNS for service discovery.
- Uses virtual networks, load balancers and firewalls to control traffic.
- Security is enhanced by TLS/HTTPS, DNSSEC and cloud‑provider firewalls.
9. URLs in Other Protocols
| Protocol | Typical URL scheme | Purpose |
|---|
| HTTP / HTTPS | http://, https:// | Web pages and web services. |
| FTP | ftp:// | File transfer (upload/download). |
| SMTP (mail) | mailto: | Open a mail client to compose an e‑mail. |
| Telnet / SSH | telnet://, ssh:// | Remote command‑line access. |
| File | file:// | Access a local file system resource. |
10. Key Points to Remember
- A URL tells a browser what to request (host, path, query) and how to request it (scheme/protocol).
- DNS translates the human‑friendly host name into a machine‑readable IP address (IPv4 or IPv6).
- IP addressing, subnetting and the distinction between public and private ranges are essential for routing traffic on the Internet.
- Thin‑client and thick‑client architectures affect where processing occurs and influence bandwidth requirements.
- Cloud‑computing models (SaaS, PaaS, IaaS) rely on the same underlying networking concepts – DNS, IP routing, firewalls and encryption.
- Security measures such as TLS/HTTPS, DNSSEC and firewalls protect data while it travels across the network.