Summary

  • RFC 2035 never sent a complete JPEG file inside a video frame. It dropped the tables and markers that were stable or inferable, then repeated a compact eight-octet RTP/JPEG header — Type, Q, Width, Height and a 24-bit Fragment Offset — on every packet.
  • Timestamp, sequence number, offset and marker answered four different questions: frame membership, stream order, byte placement and declared end. Together they exposed gaps and permitted out-of-order placement. None of them, alone, proved a frame.
  • Restart markers bounded decoder state, and Types 4 and 5 aligned restart intervals to packet boundaries so a receiver could decode something after a loss. Bounded recovery is not pixel truth, timely playout or a satisfied viewer.

A packet can arrive second and still know it belongs first. That is the quiet, slightly smug power of RFC 2035's Fragment Offset. The receiver never has to confuse network arrival order with image order: a 24-bit field says exactly where this packet's scan bytes sit inside the JPEG frame. It is a coordinate, not a verdict.

That single distinction carries the entire design. Published in October 1996, RFC 2035 put JPEG-compressed video on RTP by refusing to treat a frame as a file that must be reproduced verbatim on the wire. A conventional JPEG interchange stream spends a lot of bytes describing tables, dimensions and coding choices. When those descriptions stay stable — or can be regenerated by an agreed rule — repeating them in every frame buys bandwidth bills and no new picture. RFC 2035 deleted the repetition and made the receiver rebuild the missing syntax from a small header stapled to every packet.

The saving was real. So was the bill it deferred: a new evidence contract. Once the full JPEG wrapper is gone, the receiver must know precisely which declarations replace it, where scan bytes go, when a frame starts and stops, and where decoder state may safely restart. RFC 2035 supplies those coordinates. It never promises the picture behind them is intact.

Four researchers and one expensive habit

The document carries four names — L. Berc, W. Fenner, R. Frederick and S. McCanne — from the Berkeley lab circle that built vic, the videoconferencing tool that made multicast video on the experimental MBone feel like the future. In 1996 that future ran on thin pipes and lost packets as a matter of routine. Every byte spent re-describing a quantisation table that had not changed since the last frame was a byte not spent on the picture.

So they made a bet that looks obvious in hindsight and was quietly radical at the time: the wire does not need to carry a file. It needs to carry enough for the far end to rebuild one.

What RFC 2035 cut, and what it made you rebuild

The payload format targets a deliberately narrow JPEG surface: sequential DCT, a single interleaved scan, and a small set of sampling arrangements. The restriction is the point. It lets modest hardware codecs meet on one common representation instead of forcing every endpoint to implement the full sprawl of baseline JPEG.

An RTP/JPEG payload therefore begins with entropy-coded scan data, not with the familiar procession of marker segments and table definitions you would find in a complete interchange image. Restart markers are the exception. Everything else is represented by an eight-octet header in every packet: a type-specific byte, a three-byte Fragment Offset, Type, Q, Width and Height.

Type names the agreed JPEG interpretation. Q names the quantisation rule. Width and Height express dimensions in units of eight pixels. None of this is bureaucratic duplication. RFC 2035 expects a source to adapt rate by changing quality or resolution mid-session, so a receiver cannot safely infer these values once and then forget them. For Q from 1 through 99, the document defines how the quantisation tables are derived. Values of 100 and above depend on dynamically supplied tables through a session mechanism outside RFC 2035; zero is reserved.

These fields are reconstruction inputs, not certificates. A packet declaring Q=50 at a particular width and height hands the receiver locally observable declarations with which to build the omitted JPEG syntax. It does not hand over proof that the encoder applied the declared tables correctly, that the compressed scan survived intact, or that the resulting pixels resemble anything a camera ever saw.

Four signals, four questions

Every fragment of one frame carries the same RTP timestamp. RTP sequence numbers expose the order in which packets were sent and make missing positions in that stream visible. Fragment Offset gives the byte position of this payload within the frame's JPEG scan. The RTP marker bit identifies the packet declared to end the frame.

It is tempting to compress all four into one dashboard flag called "frame received". That destroys every distinction worth having. A shared timestamp groups packets and says nothing about completeness. A sequence gap flags a missing RTP packet but not which scan-byte range vanished. A Fragment Offset places bytes without authenticating them. A marker declares an end without proving every earlier fragment showed up.

Used together, the fields support a far stronger local test. A receiver can allocate a frame buffer, copy each fragment straight to the offset it declares, compare the next offset against the previous offset plus payload length, and flag gaps or overlaps. Arrival order stops being a reconstruction dependency. This is precisely why the RFC prefers RTP-level fragmentation over dumping the job on IP: lose one IP fragment and the IP layer may withhold the entire datagram, intact bytes included. Separate RTP packets keep delivery independent and hand the sender finer control over packet size and rate.

The document also owns up to an awkward corner. Lose the last packet of a frame and its marker goes with it. The next frame's zero-offset packet then becomes the essential evidence that a new frame has begun, and continuity through to that frame's marked final packet can establish an intact successor. The missing marker and the missing scan bytes are two different absences. A capture worth keeping preserves both facts.

Restart markers: a smaller blast radius, not a repair kit

JPEG entropy coding carries state. Huffman decoding and DC prediction normally chain later data to earlier data. Restart markers reset that state, creating points where a decoder can start again. RFC 2035 assigns different Type behaviours around them.

Types 0 and 1 use no restart markers. Types 2 and 3 permit them without aligning RTP packet boundaries to restart intervals. Types 4 and 5 go further: restart intervals align with packets, and a type-specific restart count says whether a packet sits at the beginning, middle or end of the interval sequence. A receiver holding one intact aligned interval can decode that interval without possessing every earlier scan byte.

"Can" is doing the heavy lifting. The format creates a bounded recovery opportunity. It does not invent the missing region of the image, guarantee that the intact interval contains anything worth looking at, or ensure the packet beat its playout deadline. Partial decode is a decoder capability conditioned on observed structure — not packet-loss concealment, and certainly not a service-level promise.

History deserves the same discipline. RFC 2435 later obsoleted RFC 2035 and changed the payload format; the current IANA registry cites that successor for static payload type 26. Those facts describe today's standards record. They do not license us to import RFC 2435's optional headers or revised restart mechanism back into the older specification.

The evidence stops at the decoder door

From a packet capture an operator can prove a great deal: which packets declared the same timestamp, how sequence numbers advanced, which scan ranges their offsets covered, whether the marked end ever appeared, which Type and Q were declared, what dimensions were announced, and whether restart-aligned intervals were structurally intact. A decoder log adds whether the reconstructed syntax was accepted and which regions came out.

Every added observation is another layer, and each layer answers a smaller question than the one above it. A legal JPEG reconstruction does not prove lossless pixels — JPEG is lossy by construction. A complete frame does not prove it met a playout deadline. A timely decode does not prove continuous motion. A rendered buffer does not prove a viewer watched, understood or cared. Modern "quality" scores are one more interpretation stacked on top, and they live well outside this RFC.

Lu Heng's running-code discipline fits here because the protocol's best claims are local and falsifiable. Preserve the packet bytes. Preserve timestamp, sequence, marker and offset as separate fields. Record the exact reconstruction rule and the decoder's answer. Then refuse to let the symbolic statement — "the picture arrived" — carry more weight than those events can bear.

RFC 2035's economy came from a thin common layer: omit what can be reconstructed, repeat only the context whose changes matter, and keep placement visible above lower-layer fragmentation. Its honesty comes from the same thinness. The packet can tell a receiver where it belongs. The evidence for a picture still has to be assembled, layer by layer, by someone willing to keep the receipts.

Sources