Learning Objectives
By the end of this chapter, you will be able to:
- Define HTTP and how HTTPS adds TLS.
- Trace mail through SMTP, POP3, IMAP and compare retrieval.
- Distinguish FTP from SFTP and FTPS on security and ports.
- Map each protocol to its port and use.
- Choose the protocol for a bank, cooperative, or IRD flow.
Three jobs
TCP/IP carries bytes. Application protocols give them a job. Group by job.
| Job | Protocols | What moves | Direction |
|---|---|---|---|
| View pages and APIs | HTTP, HTTPS | HTML, JSON, images | Browser pulls from server |
| Send and fetch mail | SMTP, POP3, IMAP | Messages, attachments | Send SMTP, fetch POP3 or IMAP |
| Move files | FTP, FTPS, SFTP | Files, folders | Client pushes or pulls |
A bank portal, a cooperative mail domain, and an IRD filing share the same network. Each picks the protocol that fits the audit need.
HTTP
HTTP follows the client server pattern. Browser asks, server answers.
sequenceDiagram
participant B as Browser
participant W as Web Server
B->>W: GET /statement HTTP/1.1
W->>W: Auth and fetch
W-->>B: 200 OK + HTML
B->>B: Render
GET fetches, POST submits. Reply carries a status code.
| Code | Meaning | Action |
|---|---|---|
| 200 | Success | Render payload |
| 301, 302 | Moved | Follow new URL |
| 401, 403 | Unauthorized or forbidden | Re-authenticate |
| 404 | Not found | Check URL |
| 500 | Server error | Retry, alert admin |
| Aspect | HTTP | HTTPS |
|---|---|---|
| Security | Plain text | TLS encrypted |
| Port | 80 | 443 |
| Browser cue | Not secure | Padlock |
| Use today | Avoid for login or payment | Default for all sites |
HTTPS wraps HTTP in TLS. One certificate and a redirect from 80 to 443 fixes login leaks on shared WiFi.
Mail needs a send leg and a fetch leg.
flowchart LR
A[Sender app] -->|SMTP 25 or 587| S1[Sender server]
S1 -->|SMTP 25| S2[Receiver server]
S2 -->|IMAP 143 or POP3 110| B[Receiver app]
- SMTP: sends mail, client to server and server to server. Port 587 for authenticated submission, 25 between servers. Use STARTTLS.
- POP3: fetch by download and usually delete. Port 110, 995 with TLS. One device holds the copy.
- IMAP: fetch by sync. Port 143, 993 with TLS. Mail stays on server. Read and delete sync everywhere.
Webmail shows the mailbox over HTTPS on 443, while servers still use SMTP behind.
| Aspect | POP3 | IMAP |
|---|---|---|
| After fetch | On device, server cleared | On server, cached locally |
| Multiple devices | Different views | Same folders everywhere |
| Server search | No | Yes |
| Backup | User backs up device | Server backup covers mail |
| Best for | Single PC | Phone plus laptop plus web |
For audit work, IMAP is the default.
FTP
Plain FTP is clear text. User, password, and files travel readable. That removes it from bank or IRD use.
| Variant | Security | Ports | Use |
|---|---|---|---|
| FTP | None | 21 control, 20 data | Legacy only |
| FTPS | TLS over FTP | 21 plus data | FTP with encryption |
| SFTP | SSH | 22 | Preferred for jobs |
If SSH is available, use SFTP on 22. Never send a payslip over FTP on 21.
Ports
IP finds the building, port finds the desk.
| Group | Protocol | Port | Remember |
|---|---|---|---|
| Web | HTTP | 80 | Unencrypted |
| Web | HTTPS | 443 | Encrypted |
| Mail send | SMTP | 25, 587 | 587 with auth |
| Mail sync | IMAP | 143, 993 TLS | Keep on server |
| Mail download | POP3 | 110, 995 TLS | Download and delete |
| File | SFTP | 22 | Inside SSH |
| Name | DNS | 53 | Name lookup |
Learn the group, then the number.
Self-check
Nepal worked example: cooperative mail and IRD upload on 2081-11-18 (NPR)
A Butwal cooperative with 900 members must send 900 statements and upload its IRD register on 2081-11-18.
- Domain mail with IMAP and SMTP for 15 boxes: Rs 18,000 per year, Rs 1,500 per month.
- POP3 resend cost: 3 percent of 900 need resend because sent copy lives on one PC. 27 times 15 minutes at Rs 300 per hour = Rs 2,025 per month.
- IRD risk: one blocked FTP upload plus Rs 5,000 penalty. SFTP hop on 22 costs Rs 1,200 per month and avoids it.
- Bandwidth: 900 times 80 KB plus 2 MB = 74 MB, under Rs 1 at Rs 6 per GB.
Decision: spend Rs 2,700 per month for IMAP plus SFTP hop, save Rs 2,025 in labour plus Rs 5,000 penalty risk, and keep a server sent folder. Figures are illustrative.
Example: On 2081-11-18 treat each transfer as an audit record. Does SMTP log sender and time, does IMAP keep a server copy, does SFTP on 22 produce a log for IRD. If any leg uses FTP 21 or HTTP 80, name the fix.
Summary
- HTTP fetches with GET and POST. HTTPS is TLS on 443.
- SMTP on 25 or 587 sends, POP3 on 110 or IMAP on 143 fetches.
- IMAP syncs and preserves backup, POP3 suits one device.
- FTP on 21 is clear text, use SFTP on 22 for IRD files.
Key Takeaways
- HTTPS on 443 is the default. HTTP on 80 risks any login.
- SMTP sends, IMAP or POP3 fetches.
- Group saves marks: view to 443, sync to 993, secure file to 22.
Discussion Questions
- Why redirect HTTP 80 to HTTPS 443 even for public pages?
- When does POP3 hide audit risk?
- Which log proves an IRD file left on time, SMTP, IMAP, or SFTP?
Exercises
Short answer
- Expand SMTP, POP3, IMAP, FTPS and state one job each.
- Contrast SMTP with IMAP on direction and port.
- What do 200, 404, and 500 mean?
Long answer
- Trace a payslip email from officer to member with SMTP, IMAP, and HTTPS legs plus ports and encryption, then compare POP3 and IMAP for a firm that needs auditable mail.
- Size total transfer for 400 HTTPS pages at 250 KB plus a 2 MB SFTP upload on 2081-11-18, map each to its port, and justify rejecting FTP 21 and HTTP 80 with one month NPR cost for domain mail.


