A2.1 · Book pp. 112–126
Network fundamentals
You use networks all day and notice them only when they fail. This section looks at what they are built from and the rules that keep them working.
What you need to know
| Point | Topic | Level |
|---|---|---|
| A2.1.1 | Purpose and characteristics of networks | SL + HL |
| A2.1.2 | Modern digital infrastructures | SL + HL |
| A2.1.3 | The function of network devices | SL + HL |
| A2.1.4 | Network protocols for transport and application | SL + HL |
| A2.1.5 | The function of the TCP/IP model | HL |
🔬 Try this first
On your computer, run ipconfig on Windows or ifconfig on a Mac or Linux. Find your IP address and your default gateway. By the end of this section you will know what both of them do.
A2.1.1 Purpose and characteristics of networks
A computer network connects devices so that they can share resources and information, such as files, printers, apps and internet access.
| Name | Range | Example | |
|---|---|---|---|
| PAN | Personal area network | About 10 m around one person | Phone, watch and earbuds over Bluetooth |
| LAN | Local area network | One home, building or campus | A school’s computers and printers. Typically 100 Mbps to 10 Gbps |
| WLAN | Wireless LAN | As for a LAN | Wi-Fi in a home |
| WAN | Wide area network | Across cities or continents | A company linking its branch LANs |
| VPN | Virtual private network | Any distance, over a public network | An encrypted tunnel for staff working from home |
Latency is the delay for data to travel across a network. Bandwidth is how much data it can carry each second.
A classic WAN has its own long-distance links. Most modern WANs use the internet instead, with VPNs keeping the traffic private, which is far cheaper.
⚠️ Common mistake
Consumer VPN apps that make you appear in another country are a different use case. In exam answers, focus on secure remote access to a private network.
A2.1.2 Modern digital infrastructures
| Infrastructure | What it is | Benefit | Limitation |
|---|---|---|---|
| Internet | Global network of networks | Near-instant access to services | Vulnerable to hacking, phishing and denial of service |
| Cloud computing | Rented computing from data centres | Scales up or down, with low maintenance cost | Needs reliable internet. Data sits with a third party |
| Distributed systems | Many connected nodes share a goal | Fault tolerant, with many paths | Complex, and data must stay consistent |
| Edge computing | Computing and storage close to users | Lower latency and bandwidth use | More endpoints to secure and maintain |
| Mobile networks | Wireless cell towers | Mobility, and covers places without cables | Dead zones and varying signal strength |
BitTorrent and blockchains are distributed systems. Content delivery networks spread files around the world, and streaming services place servers in major cities as a form of edge computing.
Check yourself
- A farm has sensors in remote fields with no cables. Which infrastructure fits? Mobile networks, if there is coverage.
- Why are distributed systems fault tolerant? If one node fails, the others can continue by another route.
A2.1.3 Network devices
A home “router” is really several logical devices in one box. Learn each device by the problem it solves.
| Device | Function | TCP/IP layer |
|---|---|---|
| Gateway | Connects two different networks and translates between their protocols | Up to application |
| Hardware firewall | Allows or blocks traffic using security rules on addresses and ports | Internet and transport |
| Modem | Converts between digital signals and analogue signals | Network interface |
| Network interface card | Connects one device to a network by cable or antenna | Network interface |
| Router | Forwards packets between networks using IP addresses | Internet |
| Switch | Forwards data inside one LAN using MAC addresses | Network interface |
| Wireless access point | Connects wireless devices to a network, and can extend range | Network interface |
✏️ Book correction
The book places routers at the network interface layer. Routing uses IP addresses, so routers work at the internet layer, as shown above.
A2.1.4 Network protocols
A protocol is a set of rules for how data is sent and received.
TCP and UDP
IP gets data from one computer to another. TCP and UDP get it from one application to another using port numbers, a bit like flat numbers in a building.
| TCP | UDP | |
|---|---|---|
| Connection | Connection-oriented | Connectionless |
| Reliability | Lost or corrupted data is re-sent | No guarantee |
| Order | Sequence numbers restore the order | No guarantee |
| Overhead | Higher, with a 20-byte header or more | Lower, with an 8-byte header |
| Used for | Web, email, files | Live video, voice, games |
| Protocol | Default port | Transport | Use |
|---|---|---|---|
| HTTP | 80 | TCP | Web pages |
| HTTPS | 443 | TCP | Encrypted web pages |
| SSH | 22 | TCP | Secure remote login |
| SMTP | 587 (also 25) | TCP | Sending email |
✍️ Programming: talk over TCP
Run the server, then run the client in a second terminal.
import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: # IPv4 + TCP
s.bind(("0.0.0.0", 65432))
s.listen()
conn, addr = s.accept() # waits for a client
with conn:
print("Connected by", addr)
while True:
data = conn.recv(1024) # up to 1024 bytes
if not data:
break
conn.sendall(data.decode().upper().encode()) import socket
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect(("127.0.0.1", 65432)) # 127.0.0.1 is this computer
s.sendall("hello, server".encode())
print(s.recv(1024).decode()) HTTP and HTTPS
HTTP is the protocol of the web. It is stateless and human-readable. A client sends a request and the server replies with a status code, such as 200 (OK) or 404 (not found).
GET /index.html HTTP/1.1
Host: www.example.com
HTTP/1.1 200 OK
Content-Type: text/html
<h1>Welcome</h1> import requests
response = requests.get("https://www.example.com")
print(response.status_code)
print(response.text[:200]) HTTPS adds encryption, normally TLS, authentication through a server certificate, and integrity, so that changes in transit are detected. It protects against eavesdroppers and man-in-the-middle attacks.
DHCP
DHCP gives a device an IP address when it joins a network. Addresses are leased for a set time, so they can be reused.
HL A2.1.5 The TCP/IP model
The TCP/IP model splits networking into four layers, each with one responsibility. It has largely replaced the older OSI model.
| Layer | Examples | Job | Data unit |
|---|---|---|---|
| Application | HTTP, HTTPS, FTP, SMTP, POP3, DNS | Forms the messages that programs exchange | Message |
| Transport | TCP, UDP | Moves data between the right applications using ports. TCP also splits, checks and re-sends | Segment or datagram |
| Internet | IP | Addresses and routes packets across networks | Packet |
| Network interface | Ethernet, Wi-Fi, MAC addressing | Sends bits to the next device over the physical medium | Frame |
⚠️ Common mistake
Keep a clear map: HTTP, HTTPS and DHCP are application layer. TCP and UDP are transport. Switches and MAC addresses are network interface. Routers and IP are internet.
Quick quiz
HL Extra questions
Exam-style questions
These are written for this site in the style of Paper 1. Answer on paper first, then open the mark points.
-
Describe one difference between a LAN and a WAN. [2]
Mark points
- A LAN covers a small area such as a building [1].
- A WAN connects networks over a large area such as several cities [1].
-
Discuss one benefit and two limitations of cloud computing for a small business. [3]
Mark points
- Benefit: it can scale without buying hardware, which lowers cost [1].
- Limitation: it depends on reliable, fast internet [1].
- Limitation: data on third-party systems raises security and privacy concerns [1].
-
Explain why a video service caches popular films in local servers. [2]
Mark points
- Data has less distance to travel, so latency falls [1].
- Less traffic reaches the main servers, which saves bandwidth [1].
-
Outline the role of a router, a switch and a modem in a home network. [3]
Mark points
- The switch connects devices within the LAN [1].
- The router forwards packets between the LAN and the internet [1].
- The modem converts between digital signals and the form used on the line [1].
-
Compare TCP and UDP. [4]
Mark points
- TCP is connection-oriented, while UDP is connectionless [1].
- TCP guarantees ordered delivery with sequence numbers and acknowledgements [1].
- UDP has less overhead, so it is faster [1].
- UDP can lose or reorder data, which suits live streaming, while TCP suits file transfer [1].
-
Describe three features HTTPS adds to HTTP. [3]
Mark points
- Encryption stops eavesdroppers from reading the data [1].
- Certificates authenticate the server [1].
- Integrity checks detect changes in transit [1].
-
Outline how a laptop gets an IP address when it joins a network. [3]
Mark points
- It broadcasts a DHCP Discover message [1].
- A server sends an Offer of an address from its pool [1].
- The laptop Requests that address and the server Acknowledges it, giving a lease [1].
HL Exam-style questions
-
Describe how a web request passes down the TCP/IP model on the sending computer. [4]
Mark points
- Application: the browser forms an HTTP request [1].
- Transport: TCP splits it into segments and adds ports and sequence numbers [1].
- Internet: IP adds source and destination addresses to form packets [1].
- Network interface: the data is framed with MAC addresses and sent as signals [1].