Summary

  • RFC 959, October 1985, gives FTP two channels: a control connection between the protocol interpreters that “follows the Telnet Protocol”, and a data connection that is “a full duplex connection over which data is transferred, in a specified mode and type”.
  • Both ends can play either role. The server, “in its normal ‘active’ state, establishes the data connection with the ‘listening’ data port”, and it “can be placed in a ‘passive’ state to listen for, rather than initiate a connection”.
  • The bill for the split arrives as reachability, not parsing. Because either end may be the listener, the protocol can demand a connection in a direction that a firewall or an address translator has already decided not to allow.

Two channels, on purpose

Telnet put its commands inside the data stream and paid for the privilege with an escape byte: every reader has to watch for it, and every payload has to be scanned in case it appears. FTP took the other road. Commands travel on one connection, bytes on another, and neither has to be parsed around the other.

That separation buys real things. A transfer can be restarted without replaying the control dialogue. A directory listing can be read while a file is still moving. And the data channel can be pointed at a party that is not the one doing the asking — a convenience that later became a small industry of trouble.

Who listens, who calls

The protocol names both ends and lets either one be the listener. In the ordinary arrangement the client announces an address and a port on the control channel, and the server dials back. The client says where the bits should go; the server makes the call.

Documents of the era treated that as the natural order, and on a network where every host could reach every other host and nobody stood in the middle with an opinion, it was. The address and port arrived as text inside the control conversation, which meant the control conversation had to be trusted to speak for the client. It also meant the client could speak for somebody else: the same field that named its own listening port could name a stranger’s, and the server would cheerfully open the data connection there. Convenience and exposure were the same design decision.

The middlebox arrives

Then the network grew a middle. A firewall that permits outbound requests and refuses unsolicited inbound ones inverts FTP’s default. The client’s control connection is outbound and unremarkable. The server’s data connection back to the client looks like something arriving from nowhere, because from the firewall’s point of view it is.

Passive mode answers this: the client asks the server to listen, the client dials, and the transfer rides a connection the firewall already believes in. The mechanism was in RFC 959 from the beginning. What changed was not the protocol but the default — the network’s opinion about which direction connections may run, applied retroactively to a design that had assumed no such opinion existed.

Note what the middle actually got. It did not get a vote in the specification, a seat in the working group, or any liability for breaking a protocol it never read. It got a veto, exercised silently, over the direction of a connection. That is a great deal of power for a box that is usually configured once and forgotten.

A protocol that names its own addresses

FTP’s control channel carries addresses and ports as data, which is convenient right up to the moment something rewrites addresses in flight. The rewrite happens to the packets; the text inside them keeps its original opinion. A translator that changes the source address of a connection but not the address written in the control command has produced a conversation about a host that no longer exists.

The workarounds are awkward for the same reason. An application-layer gateway has to parse the control channel, find the address, rewrite it, and hope both ends agree about what was said. The fix has to be applied to the conversation about the connection rather than to the connection — a strange place to put a fix, and the only place available.

What the split taught

Separating control from data solves the parser’s problem and hands the network a new one. In-band protocols tax every reader. Out-of-band protocols tax every device that has an opinion about which direction connections may run — and the second tax is collected by parties who never agreed to the design and cannot be billed for getting it wrong.

Neither choice is free. The useful question for a new protocol is not which cost is lower in theory but which cost it can actually pay: the cost of escaping every payload, or the cost of explaining its connection pattern to every device in the path, in a language those devices do not read.

The durable lesson

FTP still works because both modes exist. The part that aged badly was not the idea of two channels. It was the assumption that a conversation between two consenting hosts is a conversation the network will allow.

The old formula — rough consensus and running code — is usually read as a statement about engineering discipline. It is also a hierarchy. When a specification and a deployment disagree about what is real, the deployment wins, and the specification is quietly amended.

Any protocol that tells its peer where to connect should expect the network to disagree, and should carry a way to reverse the direction. Better still, it should assume the middle is populated by parties with veto power, no liability, and no interest in being consulted — because that is what the middle is.