A protocol is an agreed set of rules for how devices communicate. Without protocols, a laptop from one maker could not talk to a server from another. This lesson explains the layered TCP/IP model and the key application protocols.
The TCP/IP layers
Network communication is divided into layers, each with its own job.
- Application layer: protocols that applications use, such as HTTP, FTP, SMTP, DNS.
- Transport layer: end-to-end delivery between programs. TCP and UDP live here.
- Internet (network) layer: addressing and routing across networks. IP lives here.
- Link layer: delivery on the local network, such as Ethernet and Wi-Fi.
Each layer adds its own header around the data as it moves down (encapsulation) and removes it on the way up. Layers can be updated independently, which is the main benefit.
IP, TCP and UDP
- IP (Internet Protocol): gives each device an address (IPv4 such as 192.168.1.10, or longer IPv6) and breaks data into packets that are routed independently. IP does not guarantee delivery.
- TCP (Transmission Control Protocol): reliable and ordered. It sets up a connection (the three-way handshake), numbers packets, acknowledges receipt, and resends missing ones. Used for web pages and email.
- UDP (User Datagram Protocol): connectionless and fast, with no guarantee of delivery or order. Used for streaming, voice calls and games, where speed matters more than perfection.
Common application protocols
- HTTP / HTTPS: transfers web pages. A browser sends a request (such as GET) and the server returns a response with a status code like 200 (OK) or 404 (not found). HTTPS adds TLS encryption.
- FTP (File Transfer Protocol): transfers files between computers. Plain FTP is not encrypted; SFTP or FTPS add security.
- SMTP (Simple Mail Transfer Protocol): sends email between mail servers and from client to server.
- POP3 and IMAP: retrieve email. IMAP keeps messages on the server and syncs across devices, while POP3 usually downloads them.
- DNS: translates domain names such as example.com into IP addresses.
Ports
A port number identifies which service on a device should receive data. Defaults include 80 for HTTP, 443 for HTTPS, 25 for SMTP and 21 for FTP.
Example: loading a web page: DNS finds the IP, TCP opens a connection to port 443, HTTPS requests the page, and the data returns in many packets that TCP reassembles in order.
Check your understanding
Which protocol provides reliable, ordered delivery?
- UDP
- TCP
- DNS
- ICMP
Answer: TCP. It uses acknowledgements and retransmission.
Which protocol is used to send email?
- SMTP
- FTP
- HTTP
- DNS
Answer: SMTP. It transfers outgoing mail between servers.
Why is UDP often used for live video calls?
- It is more secure
- It is faster, and occasional loss is acceptable
- It guarantees every packet arrives
- It uses no network
Answer: It is faster, and occasional loss is acceptable. Waiting to resend old data would cause lag.
What does DNS do?
- Encrypts data
- Translates domain names to IP addresses
- Sends email
- Stores files
Answer: Translates domain names to IP addresses. Computers route using IP addresses.
