Robust Header Compression
The need for header compression
In streaming applications, the overhead of IP, UDP, and RTP is 40 bytes for IPv4, or 60 bytes for IPv6. For VoIP this corresponds to around 60% of the total amount of data sent. Such large overheads may be tolerable in local wired links where capacity is often not an issue, but are excessive for wide area networks and wireless systems where bandwidth is scarce.
ROHC compresses these 40 bytes or 60 bytes of overhead typically into only 1 or 3 bytes by placing a compressor before the link that has limited capacity, and a decompressor after that link. The compressor converts the large overhead to only a few bytes, while the decompressor does the opposite.
The ROHC compression scheme differs from other compression schemes such as IETF RFC 1144 and RFC 2508 by the fact that it performs well over links where the packet loss rate is high, such as wireless links.
Main ROHC compression principles
The ROHC protocol takes advantage of the information redundancy in the different headers of:
- one single network packet (eg. the payload lengths in IP and UDP headers),
- several network packets that belongs to one single stream (eg. the IP addresses).
Redundant information is transmitted in first packets only. Next packets contain variable information only, eg. identifiers or sequence numbers. Theses fields are furthermore transmitted in a adequate compressed form to save some more bits.
For better performances, the packets must be classified into streams before being compressed. This is a requirement to take advantage of inter-packet redundancy. The classification algorithm is not defined by the ROHC protocol itself but left to the implementations. Once a stream of packets was identified, it is compressed according to the compression profile that fits best. A compression profile defines the way to compress the different fields in the network headers. Several compression profiles are available: Uncompressed, IP-only, IP/UDP, IP/UDP-Lite, IP/ESP, IP/UDP/RTP, IP/UDP-Lite/RTP and IP/TCP.
Modes of operation
According to RFC 3095 the ROHC scheme has three modes of operation:
- the Unidirectional mode (U-mode),
- the Bidirectional Optimistic mode (O-mode),
- the Bidirectional Reliable mode (R-mode).
Both the compressor and the decompressor starts in U-mode. They may then operate a transition to O-mode if a usable return link is available and the decompressor sends to the compressor a positive acknowledgement with O-mode specified. The transition to R-mode is achieved the same way.
Unidirectional Mode (U-Mode)
In the Unidirectional mode of operation, packets are only sent in one direction: from compressor to decompressor. This mode therefore makes ROHC usable over links where a return path from decompressor to compressor is unavailable or undesirable. In order to handle potential decompression errors, the compressor sends periodic refreshes of the stream context to the decompressor.
Bidirectional Optimistic Mode (O-Mode)
The Bidirectional Optimistic mode is similar to the Unidirectional mode, except that a feedback channel is used to send error recovery requests and (optionally) acknowledgments of significant context updates from the decompressor to compressor. The O-mode aims to maximize compression efficiency and sparse usage of the feedback channel.
Bidirectional Reliable Mode (R-Mode)
The Bidirectional Reliable mode differs in many ways from the previous two. The most important differences are a more intensive usage of the feedback channel and a stricter logic at both the compressor and the decompressor that prevents loss of context synchronization between compressor and decompressor except for very high residual bit error rates.
The notion of compressor/decompressor states is orthogonal to the operational modes. Whatever the mode is, both the compressor and the decompressor work in one of their three states. They are basically finite state machines. Every incoming packet may cause the compressor/decompressor to change its internal state. Every state refers to a defined behaviour and compression level.
The ROHC algorithm is similar to video compression, in that a base frame and then several difference frames are sent to represent an IP packet flow. This has the advantage of allowing ROHC to survive many packet losses in its highest compression state, as long as the base frames are not lost.
The compressor's state machine defines the following three states:
- Initialization and Refresh (IR) State,
- First Order (FO) State,
- Second Order (SO) State.
Operations in the different compressor states
In Initialization and Refresh (IR) state, the compressor has just been created or reset, and full packet headers are sent. In First-Order (FO) state, the compressor has detected and stored the static fields (such as IP addresses and port numbers) on both sides of the connection. The compressor is also sending dynamic packet field differences in FO state. Thus, FO state is essentially static and pseudo-dynamic compression. In Second-Order (SO) state, the compressor is suppressing all dynamic fields such as RTP sequence numbers, and sending only a logical sequence number and partial checksum to cause the other side to predictively generate and verify the headers of the next expected packet. In general, FO state compresses all static fields and most dynamic fields. SO state is compressing all dynamic fields predictively using a sequence number and checksum.
Transitions between compressor states
Transitions between the above states occur when the compressor:
- compresses a packet that contains too many variations,
- receives a positive/negative feedback from the decompressor,
- periodically refreshes the context.
Second-Order ROHC Headers - 1-Byte Headers
A typical ROHC implementation will aim to get the terminal into Second-Order state, where a 1-byte ROHC header can be substituted for the 40-byte IPv4/UDP/RTP or the 60-byte IPv6/UDP/RTP (i.e. VoIP) header. In this state, the 8-bit ROHC header contains three fields:
- a 1-bit packet-type flag (set to '1' only for longer ROHC headers),
- a 4-bit sequence number (with a range of −1 ... +14 packets from the base frame), and
- a 3-bit CRC.
The decompressor's state machine defines the following three states:
- No Context State,
- Static Context State,
- Full Context State.
Transitions between the above states occur when the decompressor:
- successfully decompresses a packet,
- fails to decompress several packets.
The size of the sequence number (SN) field governs the number of packets that ROHC can lose before the compressor must be reset to continue. The W-LSB algorithm is used to compress the SN in a robust way. The size of the sequence number in 1 and 2 byte ROHC packets is either 4 bits ( −1/+14 frame offset ), or 6 bits ( −1/+62 frame offset ), respectively, so ROHC can tolerate at most 62 lost frames with a 1-2 byte header.
Additional compression profiles
The RFC 3095 defines a generic compression mechanism. It may be extended by defining new compression profiles dedicated to specific protocol headers. New RFCs were published to compress new protocols:
- The RFC 3843 defines a compression profile for IP headers or IP tunnels,
- The RFC 4019 defines a compression profile for IP/UDP-Lite and IP/UDP-Lite/RTP headers,
- The RFC 6846 defines a compression profile for IP/TCP headers.
Newer ROHC RFCs
There have been 2 new RFCs published RFC 4995 and RFC 5225 to address the confusion some have encountered when attempting to interpret and implement ROHC. The first document defines a ROHC framework, while the second defines newer versions of the established ROHC profiles.
- Michael Dosch and Steve Church. "VoIP In The Broadcast Studio". Axia Audio. Retrieved 2011-06-21.
- Official charter of the ROHC IETF working group
- RFC 3095 - "ROHC Framework and four profiles: RTP, UDP, ESP, and uncompressed"
- RFC 3759 - "ROHC Terminology and Channel Mapping Examples"
- RFC 4815 - "Corrections and Clarifications to RFC 3095"
- RFC 4995 - "The RObust Header Compression (ROHC) Framework"
- RFC 4996 - "RObust Header Compression (ROHC): A Profile for TCP/IP (ROHC-TCP)"
- RFC 4997 - "Formal Notation for ROHC"
- RFC 5225 - "RObust Header Compression Version 2 (ROHCv2): Profiles for RTP, UDP, IP, ESP and UDP-Lite"
- RFC 6846 - "RObust Header Compression (ROHC): A Profile for TCP/IP (ROHC-TCP)"
- A free implementation of ROHC on sourceforge.net
- A free and efficient library implementing the ROHC standard