- 2072 Asoj · 2+8 marks
SMTP; FTP types and working principle
Short answer
SMTP is the push protocol (TCP port 25/587) for sending email between servers. FTP uses two connections: control on port 21 and a separate data connection; types include active, passive, anonymous, authenticated, secure. It transfers files with commands like RETR/STOR after authenticating via USER/PASS.
What do you mean by SMTP? Explain the types of FTP and its working principle.
SMTP
Simple Mail Transfer Protocol (SMTP) (RFC 5321) is the application-layer protocol used to send e-mail from a user's mail client to a mail server and between mail servers. It works over TCP, port 25 for server-to-server and 587 (or 465 with TLS) for client submission. It is a text-based push protocol; receiving mail is done by POP3 or IMAP.
Mail transfer steps:
- User agent submits the mail to its mail server.
- The server finds the recipient's mail server using the DNS MX record.
- The server opens a TCP connection and runs the SMTP dialogue.
- The recipient's server stores the mail in the mailbox.
Dialogue:
S: 220 mail.example.np ready
C: EHLO pc1.example.com
S: 250 OK
C: MAIL FROM:<ram@example.com>
S: 250 OK
C: RCPT TO:<sita@example.np>
S: 250 OK
C: DATA
S: 354 End with <CRLF>.<CRLF>
C: Subject: Hello ... .
S: 250 Queued
C: QUIT
S: 221 Bye
Types of FTP
- Active FTP: the client opens the control connection to server port 21 and tells the server its data port (PORT command); the server connects back from port 20 to the client.
- Passive FTP: the client sends PASV, the server replies with a high port and the client makes the data connection too. It works behind firewalls and NAT.
- Anonymous FTP: public access, no account needed.
- Authenticated FTP: user name and password.
- Secure FTP: FTPS (FTP over TLS) and SFTP (over SSH).
Working principle of FTP
FTP uses a client/server model with two TCP connections.
Client Server
|---- control connection (21) ----|
| USER/PASS, LIST, RETR, STOR |
|<--- replies 220, 230, 226 ------|
|==== data connection (20 or n) ==|
|<===== file contents ============|
- The client opens a control connection to port 21 and authenticates with USER and PASS.
- The client issues commands such as LIST (directory), RETR (download), STOR (upload), CWD (change directory).
- For each transfer a separate data connection is created (active or passive mode) and closed when the transfer finishes. Control and data are separate ("out-of-band" control).
- The server sends a reply code (e.g. 226 Transfer complete).
- The session ends with QUIT.
Data may be sent in ASCII or binary mode. FTP keeps state about the session (user, current directory), unlike HTTP.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- CGI working; JSP vs ASP; AJAX · Internet and Intranet, chapter 6
- GPS, components and working principle · Surveying II, chapter 8 · asked 19×
- Working principle of a digital telephone exchange · Telecommunications, chapter 4 · asked 4×
- DC motor working principle and torque equation · Electrical Machines I, chapter 4 · asked 4×
- MOSFET construction and working principle · Basic Electronics Engineering, chapter 3 · asked 2×