Close an unsuitable listener before retrying
05In proxy FTP the default control-family listener may not suit the other server. Abort that listener, then request the needed network protocol.
After cleanup, EPSV 2 asks for IPv6. A supported chosen server creates a new listener; an unsupported alternative returns 522 (1) and creates none.
Key idea: ABOR cleans up the old listener; a new protocol request is a separate decision.
Terms
- FTP
- File Transfer Protocol. Its control connection carries commands; a separate data connection carries a file or directory listing.
- Client / server
- The client sends FTP commands. Which side opens the data TCP connection is a separate choice.
- Address family
- The network protocol number: 1 for IPv4 and 2 for IPv6 in these examples.
- Passive mode
- The server listens for a data TCP connection that the connecting peer opens.
Rules & examples
ABOR cleans up the old listener; a new protocol request is a separate decision.
- Without an argument EPSV selects the network protocol of the control connection. In this proxy fixture that is family 1, while the other data peer supports only family 2.
- If the returned protocol is unsupported by the host that will connect, the client MUST issue ABOR to let the server close the listening connection. It can then send EPSV <net-prt> for a specific family.
- A server supporting the requested protocol SHOULD use it. Otherwise it MUST return the 522 response defined in §2, including its supported-protocol list. Do not turn SHOULD into an unconditional successful-listener promise.
- The supported and unsupported results are alternatives after cleanup. A different-family server address must be known separately in this proxy setup; it is not returned in the blank EPSV address field. Full proxy routing, authorization and FTP transfer-state machinery remain outside this example.
Documentation addresses and chosen listening ports. Each chapter is a separate bounded example; FTP authentication, authorization, file commands and transfer replies are not a complete FTP implementation here. EPRT/EPSV provide no encryption or guaranteed reachability.
Sources
New to this? Start hereA quick picture + helpful background
Commands arrange a separate file connection
Imagine arranging a delivery by phone, then opening a separate delivery entrance. EPSV asks the server to listen; EPRT can describe another receiving endpoint in a proxy setup. The analogy separates arranging a connection from moving the file and does not promise access through a firewall.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.