← 📬 Application Layer: DNS, HTTP, Email
Subtopic 3 of 3

8.3Email and FTP

The idea

SMTP sends mail; POP3 and IMAP fetch it. FTP uses a control connection and a separate data connection. HTTP is stateless, while FTP and POP3 are stateful.

Think of it like this: SMTP is the postman delivering to your mailbox; POP3 or IMAP is you collecting from the box.

Why it exists

GATE asks which protocol pair sends and retrieves mail, or which protocols are stateful.

How it works

  1. Send: SMTP (TCP 25). Retrieve: POP3 (110) or IMAP (143).
  2. IMAP keeps mail on the server, POP3 usually downloads it.
  3. FTP: control on 21 (stays open), data on 20 (one per transfer).
  4. Stateful: FTP, POP3. Stateless: HTTP.

Worked example: Which pair sends and retrieves e-mail, in that order?

SMTP, POP3 (GATE 2019).

Now play with it

  • →Read the table and pick the retrieval protocols.
  • →Which port does FTP's data connection use?
ProtocolDirectionPortStateNotes
SMTPclient → server, server → server (send)25stateful commandspush protocol; MIME adds attachments
POP3server → client (retrieve)110statefulusually downloads and deletes
IMAPserver → client (retrieve)143statefulmail stays on server, folders
FTPfile transfer21 control, 20 datastateful, 2 connectionscontrol connection is persistent
HTTPweb80statelesscookies add state

To send then retrieve e-mail: SMTP then POP3 (or IMAP).

Check yourself

Which of these is a stateful application layer protocol?

Remember: SMTP sends, POP3 or IMAP retrieve. FTP: 2 connections, stateful. HTTP stateless.
Exam notes (the dense version)

SMTP (TCP 25) pushes mail from a client to a server and between servers. To retrieve mail use POP3 (TCP 110, downloads and usually deletes) or IMAP (TCP 143, keeps mail on the server, folders). MIME adds attachments and non-ASCII content to the mail format. FTP uses two TCP connections: control (port 21, persistent, stateful) and data (port 20, new for each file transfer). POP3 and FTP are stateful; HTTP is stateless.

Previous year questions: Application Layer: DNS, HTTP, Email (9)

PYQs are grouped by topic, so this is the full set for Application Layer: DNS, HTTP, Email; try the ones that match this subtopic. Open all 9 on the topic page.