Picture a printer file: a line of text, then forty spaces, then the next line. The sender pushes one byte for those forty spaces. Not forty-one. One. And that byte carries no value at all — only a count. The receiver is simply expected to know what to repeat.

That is FTP's COMPRESSED mode, and it is a small, elegant act of borrowing. The missing byte was never lost. It had been named earlier, on the control connection, by TYPE. Which makes MODE C less a compression scheme than a contract — and a standing warning to anyone who thinks a packet capture is the whole story.

The short version

  • FTP's COMPRESSED mode had three run forms: literal data, an explicitly repeated byte, and filler. Only the filler form dropped the value.
  • The receiver rebuilt that value from TYPE: a space for ASCII or EBCDIC, a zero byte for Image or Local byte representation.
  • A MODE C capture without its parameter timeline can preserve every transmitted octet and still fail to reproduce the file.

A count with nothing after it

The shortest run in FTP's old compression grammar is easy to misread. Its leading two bits are 11; the remaining six bits give a count. That single byte stands for a string of fillers. There is no sample byte behind it.

This was never the general rule for repeated data. RFC 765 and RFC 959 separately defined a replicated-byte form: leading class 10, the lower six bits carrying the count, and the next byte supplying the value to repeat. An amber byte repeated twenty times needed both a descriptor and an amber sample. Filler got the privileged treatment — count alone was enough.

That asymmetry hands a parser a clean invariant. After a replication descriptor, a missing sample means truncation. After a filler descriptor, hunting for a sample is the mistake. Get the class right before deciding what must follow.

TYPE supplied what MODE left out

The absent value lived in representation state. Under ASCII, filler meant a space, code 32. Under EBCDIC, that representation's space, code 64. Under Image or Local byte representation, a zero byte.

So the same filler descriptor could yield different output without a single transmitted bit changing. Decode it under TYPE A and you get blanks; decode the identical bytes under TYPE I and you get zeros. The mode alone never held enough information to settle the answer.

RFC 959 admits the dependency with unusual frankness. Transmission mode and representation are basically independent, it says — except Compressed mode, where the nature of the filler byte depends on representation type. That one sentence kills a convenient but false abstraction: MODE C as a self-contained stream codec.

Three forms, three different questions

Regular data used a descriptor with a zero high bit and a seven-bit positive count up to 127; the next n bytes were copied literally. That form said: here are several values, none of them inferred.

Replicated data used the 10 class, a six-bit count and one explicit byte. It said: repeat this value I just handed you. The filler form used 11 and only a count. It said: repeat whatever this representation has already designated as empty.

Compression therefore rested on meaning, not on statistics. A run of zeros under ASCII was not automatically a filler run — ASCII's privileged filler was space. Meanwhile Image mode could conjure zeros it never received. Which form was legal depended on a definition established outside the run.

Control information took a fourth path. A zero escape byte followed by a descriptor carried Block-mode codes — record boundaries, file boundaries — and applied them to the string that followed. Before handing anything to storage, the grammar had to separate literal spans, explicit replication, implicit filler and control.

Why printer files made the bargain pay

RFC 959 pitched COMPRESSED mode as trading a little CPU for bandwidth on very large transfers, and singled out printer files — including output from remote-job-entry hosts — as the case where it paid best. In that world, long fields of spaces were not a hypothetical. They were the recurring cost of fixed layouts and formatted output.

Giving space a one-byte run form made historical sense. So did giving zero that role for Image and Local byte data. The trick was compact precisely because representation had already narrowed what "filler" could mean.

And that economy bred a dependency. A capture appliance that kept only the data connection threw away part of the decoder. A gateway that normalized TYPE in its log while leaving the compressed bytes untouched could make later reconstruction disagree with the original receiver. A forensic tool that labels every count-without-value "truncated" would reject perfectly legal traffic.

Negotiation carved the stream into epochs

TYPE, STRU and MODE were transfer parameters carried on the control connection. MODE C chose the compressed grammar; TYPE chose the representation. Their effects met inside the filler form.

A trustworthy trace therefore binds each data span to the parameter state in force when the transfer began. It records accepted commands and replies, not the commands a client merely attempted. It resets or closes decoder state at the same boundaries the protocol implementation does. Change the parameters before the next transfer and the same descriptor needs a new interpretation.

This reaches well beyond FTP archaeology. Any encoding that pulls a value out of negotiated state drags that state into the evidence. A payload hash proves which encoded bytes you kept. It does not prove which decoded object those bytes denoted.

A base command is not a promise

RFC 959 assigned S, B and C to Stream, Block and Compressed, and made Stream the default. RFC 1123 later built the minimum implementation around Stream mode and noted that FTP carried real but rarely implemented features. None of that should be inflated into a claim that MODE C was universal, or that today's software accepts it.

RFC 5797 and the IANA FTP Commands and Extensions registry keep MODE as a base parameter-setting command referenced to RFC 959. That is vocabulary evidence. It is not a live conformance test for the C argument, the run parser, or round-trip preservation.

What to keep when the byte is missing

Useful evidence keeps the raw data stream with its hash and length; the accepted TYPE/STRU/MODE timeline; every decoded span and control event; the final parser state; and a hash of the canonical reconstructed output. It distinguishes a filler run from an explicit replication even when both happen to produce identical bytes.

Canaries should replay one filler descriptor under ASCII, EBCDIC, Image and Local byte; set an arbitrary repeated value beside it; split descriptors and samples across receive calls; exercise the maximum regular span; and close right after a replication descriptor with no sample. The expected outcomes differ by grammar, not by packet boundary.

The sender never sent the filler byte because the session had already named it. FTP bought bandwidth by borrowing meaning from context. The saving was real. So was the bill — and it comes due every time someone tries to read those bytes as evidence.

Sources