PROTOCOL FIELD GUIDE
How FTP works
Separate a persistent command connection from a data connection. Follow a passive-mode file download and interpret FTP reply classes.
- Default port
- 21 control; separate data connection
- Transport / carrier
- TCP
- Category
- application
1. Open the control channel
The client connects to port 21 and receives 220. USER and PASS authorize the session; classic FTP exposes these commands in plaintext.
2. Choose a representation
TYPE I selects binary transfer. Text mode can transform line endings, so binary mode matters for arbitrary files.
3. Negotiate passive data
EPSV tells the client which server port to connect to for data. The control connection stays open while a second TCP connection carries file bytes.
4. Retrieve a file
RETR starts the transfer. A 150 reply precedes the data; 226 confirms transfer completion on the control channel.
5. Close the session
QUIT ends control communication. Passive FTP differs from active mode, in which the server opens the data connection toward the client.
Protocol relationships
Protocols cooperate across layers. Compare the neighboring lessons to distinguish addressing, delivery, application semantics and encryption.
Standards and editorial method
Written and implemented independently by NavSprout. Lessons summarize public protocol standards using synthetic documentation addresses and fictional credentials. Consult the standards for complete wire formats and normative behavior.
RFC 959 ↗ RFC 2428 ↗