FTP, File Transfer Protocol

Description Glossary RFCs Publications Obsolete RFCs

Description:

Protocol suite: TCP/IP.
Protocol type:Application layer file transfer protocol.
Ports:20 (TCP) default data; 21 (TCP) control.
URI:ftp:
MIME subtype:
SNMP MIBs:
Working groups: cat, Common Authentication Technology.
ftpext
, Extensions to FTP.
Links:

FTP uses the Telnet protocol on the control connection.

RFC 1579:

The FTP specification says that by default, all data transfers should be over a single connection. An active open is done by the server, from its port 20 to the same port on the client machine as was used for the control connection. The client does a passive open. For better or worse, most current FTP clients do not behave that way. A new connection is used for each transfer; to avoid running afoul of TCP's TIMEWAIT state, the client picks a new port number each time and sends a PORT command announcing that to the server.


MAC header IP header TCP header FTP message

FTP message format:

FTP commands are Telnet strings terminated by the Telnet end of line code. The command codes themselves are alphabetic character strings terminated by the character <Space> if parameters follow and <CRLF> otherwise.


FTP Commands:

CommandDescriptionReferences
ABORAbort. 
ACCTAccount. 
ADATAuthentication/Security Data. RFC 2228
ALLOAllocate. 
APPEAppend. 
AUTHAuthentication/Security Mechanism. RFC 2228
CCCClear Command Channel. RFC 2228
CDUPChange to parent directory. RFC 959
CONFConfidentiality Protected Command. RFC 2228
CWDChange working directory. RFC 697
DELEDelete. 
ENCPrivacy Protected Command. RFC 2228
EPRTExtended Data port. RFC 2428
EPSVExtended Passive. RFC 2428
FEATFeature. RFC 2389
HELPHelp. 
LANGLanguage negotiation. RFC 2640
LISTList. 
LPRTLong data port. RFC 1639
LPSVLong passive. RFC 1639
MDTMFile modification time. RFC 3659
MICIntegrity Protected Command. RFC 2228
MKDMake directory. RFC 959
MLSD  RFC 3659
MLST  RFC 3659
MODETransfer mode. 
NLSTName list. 
NOOPNo operation. 
OPTSOptions. RFC 2389
PASSPassword. 
PASVPassive mode. 
PBSZProtection Buffer Size. RFC 2228
PORTData port. 
PROTData Channel Protection Level. RFC 2228
PWDPrint working directory. RFC 959
QUITLogout. 
REINReinitialize. 
RESTRestart of interrupted transfer. RFC 3659
RETRRetrieve. 
RMDRemove directory. RFC 959
RNFRRename from. 
RNTORename to. 
SITESite parameters. 
SIZEFile size. RFC 3659
SMNTStructure mount. RFC 959
STATStatus. 
STORStore. 
STOUStore unique. RFC 959
STRUFile structure. 
SYSTSystem. RFC 959
TYPERepresentation type. 
USERUser name. 
XCUPChange to the parent of the current working directory. RFC 775
XMKDMake a directory. RFC 775
XPWDPrint the current working directory. RFC 775
XRCP  RFC 743
XRMDRemove the directory. RFC 775
XRSQ  RFC 743
XSEMSend, Mail if cannot. RFC 737
XSENSend to terminal. RFC 737

FTP reply code format:

CodeDescription
1yzPositive Preliminary reply.
2yzPositive Completion reply.
3yzPositive Intermediate reply.
4yzTransient Negative Completion reply.
5yzPermanent Negative Completion reply.
x0zSyntax. These replies refer to syntax errors, syntactically correct commands that don't fit any functional category, unimplemented or superfluous commands.
x1zInformation. These are replies to requests for information, such as status or help.
x2zConnections. Replies referring to the control and data connections.
x3zAuthentication and accounting. Replies for the login process and accounting procedures.
x4zFile system. These replies indicate the status of the Server file system vis-a-vis the requested transfer or other file system action.
x5z 

FTP reply codes:

CodeDescription
110Restart marker reply.
120Service ready in nnn minutes.
125Data connection already open; transfer starting.
150File status okay; about to open data connection.
200Command okay.
202Command not implemented, superfluous at this site.
211System status, or system help reply.
212Directory status.
213File status.
214Help message.
215NAME system type.
220Service ready for new user.
221Service closing control connection.
225Data connection open; no transfer in progress.
226Closing data connection.
227Entering Passive Mode <h1,h2,h3,h4,p1,p2>.
228Entering Long Passive Mode.
229Extended Passive Mode Entered.
230User logged in, proceed.
250Requested file action okay, completed.
257"PATHNAME" created.
331User name okay, need password.
332Need account for login.
350Requested file action pending further information.
421 Service not available, closing control connection.
425 Can't open data connection.
426 Connection closed; transfer aborted.
450 Requested file action not taken.
451 Requested action aborted. Local error in processing.
452 Requested action not taken.
500Syntax error, command unrecognized.
501Syntax error in parameters or arguments.
502Command not implemented.
503Bad sequence of commands.
504Command not implemented for that parameter.
521Supported address families are <af1, .., afn>
522Protocol not supported.
530Not logged in.
532Need account for storing files.
550Requested action not taken.
551Requested action aborted. Page type unknown.
552Requested file action aborted.
553Requested action not taken.
554Requested action not taken: invalid REST parameter.
555Requested action not taken: type or stru mismatch.

Glossary:

Access controls.
(RFC 959) Access controls define users' access privileges to the use of a system, and to the files in that system. Access controls are necessary to prevent unauthorized or accidental use of files. It is the prerogative of a server-FTP process to invoke access controls.

Anonymous FTP.
This is the ability of an FTP client to connect to an FTP server with minimal authentication and gain access to public files. Security problems may arise when such a user can read all files on the system or can create files.

DTP, data transfer process.
The DTP establishes and manages the data connection. It can be active or passive.

Page.
(RFC 959) A file may be structured as a set of independent parts called pages. FTP supports the transmission of discontinuous files as independent indexed pages.


RFCs:

[RFC 114] A FILE TRANSFER PROTOCOL.

[RFC 281] A suggested Addition to File Transfer Protocol.

[RFC 354] THE FILE TRANSFER PROTOCOL.

[RFC 385] COMMENTS ON THE FILE TRANSFER PROTOCOL (RFC 354).

[RFC 412] User FTP Documentation.

[RFC 414] FILE TRANSFER PROTOCOL (FTP) STATUS AND FURTHER COMMENTS.

[RFC 430] COMMENTS ON FILE TRANSFER PROTOCOL.

[RFC 438] FTP Server-Server Interaction.

[RFC 454] FILE TRANSFER PROTOCOL - Meeting Announcement and a New Proposed Document.

[RFC 458] Mail Retrieval via FTP.

[RFC 463] FTP Comments and Response to RFC 430.

[RFC 468] FTP DATA COMPRESSION.

[RFC 475] FTP and the Network Mail System.

[RFC 478] FTP Server-Server Interaction-II.

[RFC 479] Use of FTP by the NIC Journal.

[RFC 480] Host-Dependent FTP Parameters.

[RFC 506] An FTP Command-Naming Problem.

[RFC 529] A Note on Protocol Synch Sequences.

[RFC 542] File Transfer Protocol for the ARPA Network.

[RFC 571] Tenex FTP Problem.

[RFC 573] Data and File Transfer - Some Measurement Results.

[RFC 593] Telnet and FTP Implementation Schedule Change.

[RFC 614] Response to RFC 607, "Comments on the File Transfer Protocol".

[RFC 624] Comments on the File Transfer Protocol.

[RFC 630] FTP Error Code Usage for More Reliable Mail Service.

[RFC 640] Revised FTP Reply Codes.

[RFC 697] CWD Command of FTP.

[RFC 737] FTP Extension: XSEN.

[RFC 743] FTP extension: XRSQ/XRCP.

[RFC 775] DIRECTORY ORIENTED FTP COMMANDS.

[RFC 949] FTP UNIQUE-NAMED STORE COMMAND.

[RFC 959] File Transfer Protocol (FTP).

[RFC 1123] Requirements for Internet Hosts -- Application and Support.

[RFC 1415] FTP-FTAM Gateway Specification.

[RFC 1579] Firewall-Friendly FTP.

[RFC 1635] How to Use Anonymous FTP.

[RFC 1639] FTP Operation Over Big Address Records (FOOBAR).

[RFC 2228] FTP Security Extensions.

[RFC 2389] Feature negotiation mechanism for the File Transfer Protocol.

[RFC 2428] FTP Extensions for IPv6 and NATs.

[RFC 2577] FTP Security Considerations.

[RFC 2585] Internet X.509 Public Key Infrastructure Operational Protocols: FTP and HTTP.

[RFC 2640] Internationalization of the File Transfer Protocol.

[RFC 2773] Encryption using KEA and SKIPJACK.

[RFC 3027] Protocol Complications with the IP Network Address Translator.

[RFC 3659] Extensions to FTP.

[RFC 4217] Securing FTP with TLS.


Publications:


Obsolete RFCs:

[RFC 172] THE FILE TRANSFER PROTOCOL.

[RFC 264] THE DATA TRANSFER PROTOCOL.

[RFC 265] THE FILE TRANSFER PROTOCOL.

[RFC 607] Comments on the File Transfer Protocol.

[RFC 765] FILE TRANSFER PROTOCOL.

[RFC 1545] FTP Operation Over Big Address Records (FOOBAR).

[RFC 1738] Uniform Resource Locators (URL).


Description Glossary RFCs Publications Obsolete RFCs