What is a protocol?
A protocol is a set of rules for how data is sent and received. The rules say things like:
- how data is split up and in what format,
- how each device is addressed,
- how to check for errors and what to do if data is lost,
- how fast to send and how to start and end a conversation.
Think of two people talking. If one speaks Tamil and the other only Spanish, nothing gets through. Devices made by different companies can talk because they all follow the same standard protocols.
The four-layer TCP/IP model
Networking is a big job, so it is split into layers. Each layer does one job and uses the layer below it.
| Layer | Job | Example protocols |
|---|---|---|
| 4. Application | Gives services to apps (web, email, file transfer) | HTTP, HTTPS, SMTP, IMAP, FTP |
| 3. Transport | Splits data into packets, numbers them, checks they arrive, resends lost ones | TCP, UDP |
| 2. Internet | Adds IP addresses and routes packets between networks | IP |
| 1. Link | Sends bits over the physical connection inside one network | Ethernet, Wi-Fi |
Why use layers?
- Each layer is simpler to design and test on its own.
- One layer can change without changing the others (you can swap a cable for Wi-Fi and the browser does not care).
- Different companies can build different layers that still work together.
Wrapping and unwrapping
Going down the sender's stack, each layer adds its own header (extra information such as port numbers or addresses). Going up the receiver's stack, each layer removes its header. This is called encapsulation.
Application and transport protocols: TCP/IP, HTTP, HTTPS, SMTP, IMAP
- HTTP (HyperText Transfer Protocol): a browser asks a web server for a page and the server sends it back.
- HTTPS: HTTP with encryption. Data is scrambled so anyone who catches it cannot read it. Used for logins and payments. Browsers show a lock.
- SMTP (Simple Mail Transfer Protocol): sends email from your app to the mail server, and between mail servers.
- IMAP (Internet Message Access Protocol): reads email. The mail stays on the server, so your phone and laptop show the same inbox.
- FTP: moves files between computers.
- TCP (Transmission Control Protocol): sets up a connection, splits data into numbered packets, checks every packet arrived and resends lost ones, then puts them back in order.
- UDP: sends packets fast with no checking. Good for video calls and online games, where speed matters more than a missing frame.
- IP (Internet Protocol): gives each packet the sender's and receiver's IP addresses so routers can pass it on, hop by hop.
TCP/IP is the name for the whole family of protocols used on the internet, named after its two most important members.
Link layer: Ethernet and Wi-Fi
- Ethernet: rules for sending data along cables in a wired LAN. Each device has a MAC address. Data travels in frames. Fast and reliable, not affected by walls.
- Wi-Fi: rules for sending data by radio waves to a wireless access point or router. Easy to move around, but walls and distance make it weaker, and it should be protected with encryption (for example WPA2 or WPA3) and a strong password.
Both live in the Link layer. The layers above do not care which one is used.
Try it: follow a web page through the layers
- You type a web address. The browser uses HTTPS (Application).
- TCP splits the request into packets and numbers them (Transport).
- IP adds the server's address (Internet).
- Wi-Fi sends the frames to your router by radio (Link).
- At the server, each layer removes its header, going up, until the web server reads the request.
Now try it in the 3D free play with different protocols.
Key formulas and definitions
- [object Object]
- [object Object]
- [object Object]
- [object Object]
Worked examples
1. Which layer does SMTP belong to, and what does it do?
SMTP is in the Application layer. It sends email from your device to your mail server and between mail servers.
2. A file of 4,000 bytes is split into packets that each carry 1,000 bytes of data. How many packets does TCP send, and what happens if packet 3 never arrives?
4,000 ÷ 1,000 = 4 packets, numbered 1 to 4. The receiver notices number 3 is missing and does not confirm it, so TCP sends packet 3 again. The packets are then put back in order 1, 2, 3, 4.
3. Your school replaces all network cables with Wi-Fi. Which layer changes? Does the web browser need to change?
Only the Link layer changes (Ethernet → Wi-Fi). The browser (Application layer) does not change, because each layer is independent. This is one key benefit of layering.
4. Why should an online shop use HTTPS and not HTTP?
HTTPS encrypts the data, so card details and passwords cannot be read if someone intercepts the packets. HTTP sends plain text that anyone listening could read.
Common mistakes
- Mixing up SMTP and IMAP: SMTP sends email out; IMAP reads email that is stored on the server.
- Thinking HTTPS is a different layer from HTTP. Both are Application-layer; HTTPS just adds encryption.
- Putting the layers in the wrong order. From the top: Application, Transport, Internet, Link.
- Saying Wi-Fi is the internet. Wi-Fi is only a Link-layer way to connect to the local network; the internet is the network of networks.