CIE AS & A Level Computer Science, section 14.1 (Protocols)
What a protocol is
A protocol is a set of rules for communication, so that devices from different makers can understand each other. It covers the format of the data, the order it is sent, how errors are detected, and how a connection starts and ends.
The TCP/IP stack
The TCP/IP model divides networking into four layers. Each layer has its own protocols and does its own job, using the layer below.
| Layer | Job | Examples |
|---|---|---|
| Application | the user's software uses the network to send and receive messages | HTTP, SMTP, FTP |
| Transport | breaks data into packets, numbers them, sets port numbers, and checks they all arrive | TCP, UDP |
| Internet (network) | adds IP addresses and chooses a route | IP |
| Link (network access) | sends the data across the physical connection, using MAC addresses | Ethernet, Wi-Fi |
Sending data
At the sender, data passes down the layers, each layer adding its own header (information for the matching layer at the receiver). At the receiver, the data passes up the layers, with each header removed.
Why layers are used
- Each layer can be changed without affecting the others.
- Different teams can develop the layers.
- Problems are easier to find.
- Standard protocols allow different systems to work together.
Common mistake: mixing up the layers' jobs. The transport layer deals with packets and ports, but IP addresses and routing belong to the internet layer. Also, a protocol is a set of rules, not a piece of hardware.
Exam tip: for each layer, give its name, its job and an example protocol. Describe the data going down the stack when sent and up when received.
Check yourself
What is a protocol?
A set of rules for communication between devices.
Which TCP/IP layer adds IP addresses?
The internet layer.
Give one advantage of splitting networking into layers.
Each layer can be changed or improved without affecting the others.