Learning Objectives

By the end of this chapter, you will be able to:

  • Explain HTTP and what HTTPS adds.
  • Use methods GET and POST and status codes 200, 301, 404, 500.
  • Trace email via SMTP, POP3, IMAP and choose between POP3 and IMAP.
  • Choose FTP, FTPS, or SFTP for file transfer.
  • Map protocols to ports for a Nepali business setup.

Three Protocol Families

TCP and IP move packets, application protocols give them meaning. For BBM, three families matter: HTTP for web, email protocols for formal mail, and file transfer for catalogues and backups.

Grouped Framework: Three Families

Family 1: Web - HTTP and HTTPS

HTTP is the web client server protocol. Browser sends request, server returns response. GET fetches, POST submits forms. Responses carry status:

Status Meaning Business reading
200 OK Success Normal
301 / 302 Redirect, page moved Update links and SEO
404 Not Found No resource Broken link
500 Internal Server Error Server failure Check logs

HTTPS is HTTP over TLS encryption, with padlock, required for logins and payments. Default for all public sites.

Aspect HTTP HTTPS
Security Plain text Encrypted with TLS
Port 80 443
Browser sign Not secure Padlock
sequenceDiagram
  participant B as Browser
  participant W as Web server
  B->>W: GET /products/1182 over port 443 TLS
  W->>W: Find product
  W-->>B: 200 OK + HTML
  B->>B: Render

Cache GET product pages on a CDN to cut load time in the valley without extra servers.

Family 2: Email - SMTP, POP3, IMAP

Email is a relay chain.

  • SMTP - sending. Client to own server, then server to server.
  • POP3 - downloading. Pulls mail to one device, often deletes from server. Weak for multi device.
  • IMAP - syncing. Keeps mail on server, mirrors to devices. Modern default.
flowchart LR
  A[Sender app] -->|SMTP 587| S1[Sender server]
  S1 -->|SMTP 25 or 587| S2[Receiver server]
  S2 -->|IMAP 143 or POP3 110| B[Receiver apps]
Aspect POP3 IMAP
Where mail lives One device On server, synced
Multi device Poor Good
Server storage Little More, budget quota
Best for Single PC Business with phone and laptop

Webmail shows mail via HTTPS, but SMTP still moves it between organisations. For SMEs on phone and PC, IMAP on ports 587 and 993 avoids lost threads.

Family 3: File Transfer - FTP, FTPS, SFTP

  • FTP ports 20 and 21 - classic but sends passwords plain, avoid on internet.
  • FTPS - FTP over TLS, encrypts, needs firewall tuning.
  • SFTP port 22 over SSH - encrypts all, traverses firewalls cleanly, preferred for shop.com.np updates. Clients: FileZilla, WinSCP.

Common Ports

Protocol Port Use
HTTP 80 Web, plain
HTTPS 443 Web, secure
SMTP 25, 587 Sending mail
POP3 110 Receive, download
IMAP 143, 993 with TLS Receive, sync
FTP 20, 21 File transfer plain
SSH / SFTP 22 Secure shell and transfer
DNS 53 Name lookup

Close unused ports. Leaving FTP open invites brute force.

Nepal BBM Angle: Retail, Hotel, and Supply Chain

Retail (Birgunj and Kathmandu). Wholesaler emails price circulars via SMTP, retailers fetch via IMAP on phone and laptop. IMAP is chosen so a phone replacement does not lose mail. Site runs HTTPS only with redirect from port 80 to 443 and proper 301 after redesign. Images upload via SFTP on port 22, not plain FTP.

Hotel (Nagarkot and Pokhara). Confirmation mail must be trusted, so SPF, DKIM, and DMARC are set on domain. Reception shares one IMAP mailbox between desk PC and manager phone, so status stays in sync.

Supply chain. Warehouses replace FTP on port 21 with SFTP on port 22, with key rotation and IP limit. Knowing 404 vs 500 saves time: 404 is wrong path, 500 is application failure.

Worked Example: NPR Cost on BS 2081

Scenario dated Mangsir 10, 2081. A Lalitpur boutique on boutique.com.np plans Year 1:

  • Domain admin: NPR 1,000 plus hosting with DNS NPR 8,500 including TLS
  • Email: 5 IMAP mailboxes at NPR 400 per month = 400 x 5 x 12 = NPR 24,000
  • SFTP included, training half day NPR 12,000

Year 1 total = 1,000 + 8,500 + 24,000 + 12,000 = NPR 45,500. Year 2 without training = NPR 33,500. Using automated free TLS saves NPR 4,000 per year vs paid certificate, enough for extra quota or backup.

Choosing POP3 risks losing the only copy of a client thread when a phone is lost, which often exceeds the mailbox fee.

Self-Check

Check your understanding 1. Site shows Not secure. Protocol and port? HTTP on 80, move to HTTPS on 443 with TLS. 2. Mail read on phone still unread on PC. Cause and fix? On POP3, switch to IMAP for sync. 3. CSV upload fails with 404 vs 500? 404 wrong path, 500 server failure. 4. Why avoid plain FTP on 21? Passwords travel plain, use SFTP on 22.

Try This

On Chaitra 5, 2081 a retailer sends a 25 MB catalogue PDF to 180 shops and also hosts it for HTTPS download.

  1. Email as 180 attachments with 10 percent overhead = 25 x 1.10 x 180 = 4,950 MB. Web host is one upload 25 MB plus downloads only for those who click, much less and no mailbox quota.
  2. SMTP limit 20 per minute, time = 180 / 20 = 9 minutes minimum.
  3. SFTP upload at 4 Mbps: 25 MB = 200 Mb. 200 / 4 = 50 seconds ideal. Best is one SFTP upload and send link by email.
Answer sketch One upload plus link saves transfer, quota, and time, and lets you track 200 OK downloads rather than filling 180 mailboxes.

Summary

HTTP fetches web resources, HTTPS adds TLS on 443. Email uses SMTP to send and IMAP or POP3 to receive, with IMAP for multi device. FTP moves files but plain FTP is unsafe, SFTP on 22 is preferred. Ports name the service and guide firewall policy.

Key Takeaways

  • HTTP methods GET and POST, codes 200, 301, 404, 500.
  • HTTPS on 443 is default.
  • SMTP sends, IMAP syncs, POP3 downloads.
  • FTP plain on 21, SFTP secure on 22.
  • Ports 80, 443, 25/587, 110, 143/993, 22, 53 identify service.

Exam-Style Questions

Short answer

  1. Expand HTTP, SMTP, IMAP, FTP and one use each.
  2. Contrast HTTP and HTTPS.
  3. What does 404 mean vs 500?

Long answer

  1. Trace email from Birgunj sender to Kathmandu receiver with protocols and ports, and compare POP3 vs IMAP.
  2. Justify HTTP, email, and file choices for a new com.np retail site.