OCR H446, section 1.3.3 (b)
The Internet is a worldwide network of networks. Millions of smaller networks (homes, schools, businesses, governments) are connected by routers, and all follow the same protocols, so that they can communicate. It has no single owner, and has many alternative routes, so that if part fails, data can go another way.
The World Wide Web is just one service that runs on the Internet. Email and file transfer are others.
LANs and WANs
| LAN (local area network) | WAN (wide area network) | |
|---|---|---|
| Area | One site: a home, school or office building | A large area: a country or the world |
| Ownership | Usually owned and managed by the organisation | Often uses links leased from telecoms companies |
| Speed | Usually faster | Often slower, and more expensive per unit of speed |
| Technology | Ethernet cables, WiFi | Leased lines, fibre, satellite, mobile networks |
| Example | A school's network | The Internet is the largest WAN. A company linking offices in different cities |
The TCP/IP stack
The protocols of the Internet are organised in layers, called the TCP/IP stack. Each layer has its own job and uses the services of the layer below it.
| Layer | Job |
|---|---|
| Application | Provides the services used by programs, such as the web and email. It defines the messages the programs exchange |
| Transport | TCP splits data into segments, adds port numbers (to identify the program), puts them back in order, and resends any lost ones. It makes delivery reliable. (UDP is faster but doesn't guarantee delivery, and is used for streaming and games) |
| Internet (network) | IP adds the source and destination IP addresses, and routes packets across networks |
| Link | Sends frames over one physical link, using MAC addresses |
When data is sent, it passes down the stack, with each layer adding its own header (encapsulation). At the receiver it passes up, each layer removing its header.
Protocol layering
Splitting the protocols into layers has benefits:
- Each layer is independent: it only needs to know what the layer below provides, not how. So a layer can be changed or improved without affecting the others (for example moving from Ethernet to WiFi doesn't change HTTP).
- It makes the protocols simpler to design and understand, and easier to fix faults.
- Different companies can work on different layers, and the parts still fit together because the interfaces between layers are standard.
- It encourages standards and interoperability.
The Domain Name System (DNS)
People use names like www.example.com, but computers route using IP addresses such as 93.184.216.34. The DNS is a worldwide, distributed directory that translates a domain name into an IP address.
- You type
www.example.comin the browser. - Your device sends the name to a DNS resolver (usually its ISP's), which first checks its cache (addresses it has looked up recently).
- If the address isn't in the cache, the resolver asks other DNS servers in turn: a root server, then the top-level domain (TLD) name server for .com, then the authoritative name server for example.com, which holds the address.
- The IP address is returned to your device, and is cached along the way so the next lookup is quicker. If no address can be found, an error is returned instead.
- The browser connects to that IP address.
Domain names have a hierarchy, read from right to left: top-level domain (.com, .uk), then the domain (example), then the host (www).
Packet switching
In packet switching, a message is split into small pieces called packets, and each packet is sent separately.
- Each packet has a header with the source and destination addresses, a sequence number (to reassemble in order) and a time to live (hop limit), plus the data and an error check.
- Routers read the destination address, and pass each packet on to the next router, choosing a route that suits at that moment. Different packets of the same message can take different routes.
- At the destination, the packets are put back in order and the message is reassembled. Lost or damaged packets are resent.
Advantages: efficient use of the network (links are shared), robust (packets go around failures), lost packets only need to be resent individually, and it is harder to intercept a whole message, since its packets may take different routes.
Disadvantages: packets may arrive late or out of order, so the delay (latency) varies, and reassembly is needed.
Circuit switching
In circuit switching, a dedicated path (circuit) is set up between the sender and the receiver for the whole conversation, and nothing else can use it until it ends. The traditional telephone network worked this way.
- A connection is established (the call is dialled).
- The whole path is reserved, giving a constant, guaranteed bandwidth.
- Data (the voice) flows along the same route in order.
- The circuit is released at the end.
Advantages: a steady, predictable connection, with no delays or reordering. Good for real-time voice.
Disadvantages: the circuit is reserved even when no data is flowing, so it wastes capacity. Setting up takes time, and if a link fails, the call is lost.
Comparison
| Packet switching | Circuit switching | |
|---|---|---|
| Path | Not fixed: each packet may take a different route | Dedicated path for the whole connection |
| Capacity | Shared with other users, so efficient | Reserved, so often wasted |
| Set-up | None | Needed before sending |
| Delay | Varies | Constant |
| Reliability | High: goes around failures | Lower: link failure ends the call |
| Used for | The Internet, email, web | Traditional telephone calls |
Worked example
Task: explain what happens, in terms of the TCP/IP stack, when you load a web page.
- Application layer: the browser makes an HTTP request for the page. First, DNS converts the domain name into the server's IP address.
- Transport layer: TCP splits the request into segments, adds the port number (80 or 443), and numbers them.
- Internet layer: IP adds the source and destination IP addresses, making packets, which routers forward across the Internet. The packets may take different routes.
- Link layer: each packet is sent over the local link (WiFi or Ethernet) using MAC addresses.
- At the server, the layers are reversed: the packets are reassembled in order by TCP, and passed up to the web server, which sends the page back the same way.
Exam tip: name the four layers in order and give a job for each. For layering, say that each layer is independent, so one can change without affecting the others. For packet and circuit switching, compare dedicated or shared paths, and efficiency.
Check yourself
Name the four layers of the TCP/IP stack
Application, transport, internet (network) and link.
Give one benefit of protocol layering
Each layer is independent, so one can be changed without affecting the others, and it makes the protocols simpler to design, fix and standardise.
What does DNS do?
It translates a domain name into the IP address of the server.
Give one difference between packet switching and circuit switching
In packet switching, data is split into packets that can take different routes and share the network. In circuit switching, a dedicated path is reserved between the two ends for the whole connection.
What is the difference between a LAN and a WAN?
A LAN covers a small area such as one site and is usually owned by the organisation. A WAN covers a large area, such as a country or the world, and often uses leased links.