Visual RFC.
ALL RFCs / RFC 2428
Read the RFC ↗

RFC 2428 / START HERE

Extended FTP data connections, before the details

FTP extensions: choosing a separate file-data connection

FTP means File Transfer Protocol. Commands use a control connection; file bytes use a separate data connection. RFC 2428 defines EPRT and EPSV so the endpoints can describe IPv4 or IPv6 data connections without the old IPv4-only address layout.

Why it exists

EPSV asks the server to listen and returns only a port, reusing the known control peer in ordinary two-machine transfers. This avoids an embedded address for a NAT to rewrite. It does not supply encryption, authorization, a data-port mapping or a guarantee that a firewall will allow the connection.

A familiar example

Imagine downloading a file: the client asks for a data listener with EPSV, reads 229 (|||6446|), then connects to the same server at port 6446. Download bytes travel back to the client. The guide also shows a separate three-machine EPRT example, protocol errors, listener cleanup with ABOR and the per-session EPSV ALL commitment.

Helpful background

You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.

What you’ll learn next

Begin with chapter one, or choose a topic.

  1. Separate the control conversation from the fileAn FTP client sends commands on one TCP connection. The file travels on another connection, whose opening direction matters.
  2. Read an EPRT endpoint without IPv4 assumptionsEPRT describes an address family, a network address and a listening TCP port, separated by one chosen printable delimiter.
  3. Distinguish 200 acceptance from a 522 protocol errorA three-machine proxy FTP controller can give sending server A the receiving server B’s listening endpoint. Server support must still match.
  4. Use the EPSV port without an embedded addressA normal EPSV response leaves two endpoint fields blank. Reuse the control connection’s server address and network protocol, with the returned data port.
  5. Close an unsuitable listener before retryingIn proxy FTP the default control-family listener may not suit the other server. Abort that listener, then request the needed network protocol.
  6. Keep EPSV ALL scoped to its FTP sessionEPSV ALL commits the current session to EPSV for further data-connection setup. A later need for a three-machine transfer requires a new FTP session.
Start with chapter one →

This introduction explains RFC 2428 (1998). Read the original RFC ↗