wire / wire-format / ftp-protocol
FTP is a client-server protocol for file transfer. Control connection (port 21, text commands): USER, PASS, CWD, PWD, LIST, RETR, STOR, DELE, MKD, RMD, QUIT, PASV, PORT, TYPE, MODE, STRU. Data connection (port 20 or passive port): transfers file data. Two modes: active (server connects to client) and passive (client connects to server).
aka: FTP (File Transfer Protocol)
spec: RFC 959
FTP is a client-server protocol for file transfer. Control connection (port 21, text commands): USER, PASS, CWD, PWD, LIST, RETR, STOR, DELE, MKD, RMD, QUIT, PASV, PORT, TYPE, MODE, STRU. Data connection (port 20 or passive port): transfers file data. Two modes: active (server connects to client) and passive (client connects to server).
| field | size | meaning |
|---|---|---|
| Control connection | TCP port 21 | Text-based command/response. Commands: USER, PASS, CWD, PWD, LIST, RETR, STOR, DELE, MKD, RMD, QUIT, PASV, PORT, TYPE (A/I), MODE (S/B/C), STRU (F/R/P). |
| Data connection | TCP port 20 (active) or passive | Transfers file data. Active: server connects to client's port. Passive: client connects to server's port (PASV response gives IP+port). |
| Response codes | 3 digits | 1xx preliminary, 2xx success, 3xx intermediate, 4xx transient error, 5xx permanent error. E.g., 220 (service ready), 230 (logged in), 226 (transfer complete), 530 (not logged in). |
| Transfer types | config | TYPE A (ASCII, converts line endings), TYPE I (Image/binary, no conversion). |
| Passive mode | PASV | Client sends PASV; server responds with IP and port (h1,h2,h3,h4,p1,p2). Client connects to that address. |
example:
00 00
FTP (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/ftp-protocol
or /wire-format/ftp-protocol.json