FTP
File Transfer ProtocolApplication layer · OSI 7Dual-connection file transfer and why encryption replaced it
| No. | Time | Source | Destination | Protocol | Info | Size |
|---|---|---|---|---|---|---|
| Play the first step to capture packets. | ||||||
Overview
copies files using two separate TCP connections: one control channel for commands, and a new data connection for each file or directory listing. Standard FTP sends logins and files in plain text.
File Transfer Protocol (RFC 959) keeps a persistent control connection on TCP port 21 while opening ephemeral data connections per transfer. Modern deployments use SFTP (over ) or FTPS (RFC 4217).
Key facts
- Layer
- Application (over TCP)
- Control port
- TCP 21
- Data socket
- Separate TCP connection per file
- Encryption
- None in classic FTP
- Safer options
- SFTP (over SSH) or FTPS
Two connections finished the download
Port 21 handled commands while port 50069 carried the file bytes, and closing the data socket marked the end of the file. Modern systems replace classic FTP with SFTP or FTPS to encrypt passwords and data.
Completed RFC 959 passive FTP transfer: port 21 control, port 50069 data handshake, 4,000-byte binary stream, FIN EOF signaling, and 221 close.
- Connections
- 2 (port 21 control + port 50069 data)
- Transferred
- 4,000 B across 3 segments
- Classic flaw
- Credentials and files unencrypted
- Encrypted alternatives
- SFTP or FTPS
Try it yourself
Prefer SFTP over SSH on the command line
SFTP runs inside an encrypted SSH connection on port 22 instead of classic plain-text FTP.
sftp alice@example.com