RObust Header Compression (ROHC): Framework and four profiles: RTP, UDP, ESP, and uncompressed
updated by
Extracted elements (29)
CRC computation is split into CRC-STATIC (over unchanging fields) and CRC-DYNAMIC (over changing fields) to reduce per-packet computation cost. The intermediate CRC result after processing static fields can be cached and reused across many packets; only the CRC-DYNAMIC portion must be recomputed for each packet.
ROHC was designed because existing CRTP fails on lossy cellular links with long RTTs (up to 100-200 ms). Each lost packet on such a link causes a burst of subsequent packet losses while context is out of sync, degrading voice quality. ROHC uses local context repair with CRC verification to avoid RTT-dependent recovery.
The five header fields requiring special compression treatment were identified by analysis: IPv4 Identification (16 bits), UDP Checksum (16 bits), RTP Marker (1 bit), RTP Sequence Number (16 bits), and RTP Timestamp (32 bits). These are the only fields needing sophisticated mechanisms; all other fields can be compressed away as static or rarely-changing.
Timer-based TS compression was chosen over pure W-LSB compression because it provides a constant compressed TS size regardless of silence interval length. Other techniques require bits proportional to the duration of a preceding silence period at talkspurt start; timer-based compression avoids this and requires no clock synchronization between compressor and decompressor.
ROHC operates over any link-layer providing in-order, non-duplicating delivery with framing and a negotiation mechanism. It does not require a reliable link — it is explicitly designed for links with BER up to 1E-3 (and in severe cases 1E-2) and RTTs up to 100-200 ms, where previous schemes such as CRTP fail.
All ROHC implementations MUST implement and support all three modes of operation: Unidirectional, Bidirectional Optimistic, and Bidirectional Reliable mode.
Compression with ROHC MUST start in the Unidirectional mode. Transition to a Bidirectional mode may occur once the decompressor sends a feedback packet requesting the transition.
In R-mode, the decompressor MUST ACK each header received with a succeeding CRC, allowing the compressor to advance its W-LSB sliding window and enabling upward state transitions.
Lower layers are RECOMMENDED to deploy error detection for ROHC headers and not deliver ROHC headers with high residual error rates. For residual BER at most 1E-5, ROHC is designed not to increase the number of damaged headers beyond those caught by its own CRC detection.
The channel between compressor and decompressor MUST maintain packet ordering and MUST NOT duplicate packets. Reordering and duplication before the compression point are tolerated and handled.
The link layer MUST provide a way to negotiate header compression parameters (e.g., MAX_CID, supported profiles). For unidirectional links, this negotiation may be performed out-of-band or a priori.
When using scaled RTP Timestamp encoding, the decompressor MUST detect wraparound of the unscaled 32-bit TS and update TS_OFFSET to (wrapped-around unscaled TS) modulo TS_STRIDE.
ROHC defines four compression profiles: 0x0000 (UNCOMPRESSED, pass-through), 0x0001 (ROHC RTP, for RTP/UDP/IP), 0x0002 (ROHC UDP, for UDP/IP without RTP), and 0x0003 (ROHC ESP, for ESP/IP). The decompressor's acceptable profile set is negotiated per channel; the active profile is part of per-context state.
ROHC defines three modes of operation: Unidirectional (U-mode, no feedback), Bidirectional Optimistic (O-mode, sparse feedback for error recovery), and Bidirectional Reliable (R-mode, intensive feedback acknowledging all context updates). States and modes are orthogonal abstractions.
IANA maintains a registry of ROHC profile identifiers. RFC 3095 defines four initial values: 0x0000 (ROHC UNCOMPRESSED), 0x0001 (ROHC RTP), 0x0002 (ROHC UDP), and 0x0003 (ROHC ESP). Assignment of new profile identifiers requires IETF consensus.
ROHC header compression does not introduce new security vulnerabilities but concentrates context information at compression endpoints. If confidentiality is needed, headers should be encrypted after compression or the entire compressed packet should be encrypted. The CRC mechanisms prevent incorrect decompressed headers from being delivered, limiting damage propagation from residual bit errors.
The compressor has three states — IR (Initialization and Refresh), FO (First Order), SO (Second Order) — starting at IR. Upward transitions occur when the compressor is confident the decompressor has required context; downward transitions occur on header pattern changes, NACKs, or timeouts. SO achieves optimal compression where only the SN needs to be sent.
The decompressor has three states — No Context (NC), Static Context (SC), Full Context (FC) — starting at NC. A successful decompression of an IR packet can advance directly to FC. Repeated CRC failures in FC drop back to SC; repeated failures in SC drop to NC. FC is considered a stable operating state.
LSB encoding transmits the k least significant bits of a field. The decompressor recovers the original value using interpretation interval f(v_ref, k) = [v_ref - p, v_ref + (2^k - 1) - p], where p is tuned to the expected change pattern (p=-1 for always-increasing, p=0 for non-decreasing, p=2^(k-1)-1 for small deviations).
Offset IP-ID encoding compresses the difference (IP-ID - RTP SN) using W-LSB rather than IP-ID itself, exploiting that both fields typically increment together. When the source uses random IP-IDs (RND flag set), the field is sent uncompressed. Non-network-byte-order IP-IDs are handled by byte-swapping before compression (NBO flag).
ROHC feedback packets use a 2-bit type field indicating ACK (00), STATIC-NACK (10), or NACK (11). Optional feedback options are type-length-value encoded and include CRC, REJECT, SN-NOT-VALID, SN, CLOCK (decompressor clock resolution), JITTER, and LOSS.
Scaled RTP Timestamp (TS_SCALED) encoding divides TS by TS_STRIDE before W-LSB compression, saving floor(log2(TS_STRIDE)) bits per packet. The relationship TS = TS_SCALED * TS_STRIDE + TS_OFFSET is maintained; TS_STRIDE is transmitted explicitly and TS_OFFSET is derived implicitly from absolute TS values in IR packets.
Self-describing variable-length values encode magnitude in leading bits: first bit 0 = 1 octet (7 bits, up to 127); first bits 10 = 2 octets (14 bits, up to 16383); first bits 110 = 3 octets (21 bits, up to 2097151). Used for TS_STRIDE and other widely-varying compression parameters.
The IR-DYN packet (type octet 11111000) carries only the dynamic chain, not the static chain. It is used to refresh or update dynamic context state (e.g., after a mode transition) without retransmitting static fields already established.
The IR (Initialization and Refresh) packet has type octet 11111101, followed by a 1-byte profile identifier, a 1-byte CRC over the entire packet, then static chain encoding all static header fields, followed by a dynamic chain encoding all dynamic fields in uncompressed form.
Timer-based TS compression uses local clocks to approximate the scaled TS (T_approx = T_ref + (a_n - a_ref) / TIME_STRIDE), transmitting only k LSBs as refinement. The bit count k = ceiling(log2(2*J+1)) where J = Max_Jitter_BC + Max_Jitter_CD + 2, accounting for observed jitter, expected channel jitter, and clock quantization error.
UO-0 is the most compressed packet type: 4-bit SN LSBs + 3-bit CRC in a single octet (first bit 0), used in U/O-mode SO state. R-0 is the R-mode equivalent; R-0-CRC adds a 7-bit CRC and is used when the compressor needs context-update acknowledgment.
UOR-2 (format 11xxxxxx) carries 6 bits of RTP SN or TS scaled value in the first octet with an 8-bit CRC in the second octet. Extension headers 0, 1, 2, and 3 can be appended to carry additional bits of SN/TS/IP-ID or to update irregular fields.
Window-based LSB (W-LSB) encoding adds robustness by having the compressor maintain a sliding window of candidate reference values the decompressor may use. The compressor selects k = max(g(v_min, v), g(v_max, v)) to guarantee correct decompression regardless of which window entry the decompressor uses as reference.