Published by Patrick Mutisya · 14 days ago
This section explains the most common application‑layer protocols used on the Internet, their purposes, typical ports and the type of communication they employ.
| Protocol | Purpose | Typical Port(s) | Communication Model | Connection Type |
|---|---|---|---|---|
| HTTP | Transfer hypertext documents and other resources (web pages, images, JSON, etc.) | 80 (plain), 443 (HTTPS) | Client‑Server | Stateless request/response over TCP |
| FTP | Upload and download files between client and server | 21 (control), 20 (data – active mode) or random high ports (passive mode) | Client‑Server | Stateful session over TCP |
| POP3 | Retrieve email from a mail server and optionally delete it | 110 (plain), 995 (POP3S) | Client‑Server | Stateless after each download; uses TCP |
| IMAP | Access and manipulate email stored on a server without removing it | 143 (plain), 993 (IMAPS) | Client‑Server | Stateful session over TCP |
| SMTP | Send email from client to mail server and between mail servers | 25 (plain), 587 (submission), 465 (SMTPS) | Client‑Server | Stateless transaction over TCP |
| BitTorrent | Distribute large files efficiently using a peer‑to‑peer network | 6881‑6889 (default), can use any high port | Peer‑to‑Peer (swarm) | Stateful connections over TCP (and optional UDP for DHT) |
HTTP is the foundation of data communication for the World Wide Web. It follows a request/response model where a client (usually a web browser) sends a request line, headers and optionally a body, and the server replies with a status line, headers and a body containing the requested resource.
Typical request methods include GET, POST, PUT, DELETE, and HEAD. The response status codes are grouped into categories: \$1xx\$ (informational), \$2xx\$ (success), \$3xx\$ (redirection), \$4xx\$ (client error), \$5xx\$ (server error).
FTP provides a reliable way to transfer files between a client and a server. It uses two separate TCP connections:
Common commands include USER, PASS, LIST, RETR, STOR, and QUIT.
POP3 is a simple protocol for retrieving email from a mail server. The typical workflow is:
LIST to see available messages.RETR n to download message n.DELE n to delete the message from the server.QUIT.Because POP3 usually removes messages after download, it is best suited for single‑device access.
IMAP allows clients to manage email directly on the server, supporting multiple folders, message flags, and simultaneous access from several devices. Key commands include SELECT, FETCH, SEARCH, STORE, and EXPUNGE. Unlike POP3, messages remain on the server unless explicitly deleted.
SMTP is used for sending mail. The typical path of an email is:
SMTP commands include HELO/EHLO, MAIL FROM, RCPT TO, DATA, and QUIT.
BitTorrent distributes large files by breaking them into small pieces and sharing those pieces among many peers. The process involves:
The protocol uses a swarm model, where the overall download speed improves as more peers join and share pieces.
All the protocols above operate at the application layer of the OSI/TCP‑IP model, but they differ in purpose, communication pattern and state management. The table below highlights the main contrasts.
| Aspect | HTTP | FTP | POP3 | IMAP | SMTP | BitTorrent |
|---|---|---|---|---|---|---|
| Primary Use | Web page and resource retrieval | File upload/download | Download email (delete after) | Manage email on server | Send email | Distribute large files |
| Model | Client‑Server | Client‑Server | Client‑Server | Client‑Server | Client‑Server (relay) | Peer‑to‑Peer (swarm) |
| Statefulness | Stateless per request | Stateful session | Stateless after each download | Stateful session | Stateless transaction | Stateful connections |
| Typical Port(s) | 80 / 443 | 21 / 20 (active) or high ports (passive) | 110 / 995 | 143 / 993 | 25 / 587 / 465 | 6881‑6889 (default) |