Protocol ExplorerGuidesPricing

FTP Protocol: Control and Data Connections

File Transfer Protocol uses a control connection for commands and a separate data connection for directory listings or file contents. That split explains many firewall and NAT surprises.

Updated · Editorial approach and simulation limits

One FTP session uses separate control and data paths

The client first opens a control connection to the server and exchanges commands such as USER, PASS, TYPE, PASV, RETR and STOR. File bytes and directory listings move over a separate data connection. A control connection can remain open while multiple data transfers are started and closed.

In active mode, the server initiates the data connection toward the client. In passive mode, the server advertises a listening endpoint and the client initiates that data connection. Firewalls and NAT can permit the control channel while blocking the data channel, making login appear successful even though a transfer fails.

FTP replies describe command state, not file success alone

FTP commands and server replies are line-oriented on the control channel. A preliminary reply can indicate that a transfer is starting; a later completion reply reports whether the operation finished. Check the final server reply and data connection closure before concluding that a file was transferred successfully.

The negotiated transfer type and mode affect how data is represented. A trace should correlate the command, server response, chosen data endpoint, direction and final completion. A directory listing is a transfer too, so it can fail for the same data-channel reasons as a file.

Classic FTP exposes credentials and data

Traditional FTP does not encrypt its control or data connections. User names, passwords, commands and transferred content may be visible to observers with access to the path. FTPS adds TLS in particular deployments; SFTP is a different file-transfer subsystem carried over SSH, not a secure mode of FTP.

Use the cited specification to understand the classic exchange, and use an encrypted alternative for sensitive transfers. The Protocol Explorer FTP sequence is an educational simulation and does not connect to a server or transfer a file.

Explore FTP interactively

Follow the matching exchange packet by packet. The animation is a scripted teaching model with illustrative timing, not a capture of your network.

Open the FTP animation · Compare Free and Pro

Specification and source

For exact protocol requirements, consult the primary document: RFC 959: File Transfer Protocol. This page summarizes selected behavior and is not a substitute for the specification.

Related protocol lessons

Browse all application protocols · Compare the transports used by application protocols