Formal Notation for RObust Header Compression (ROHC-FN)
Extracted elements (29)
Field values are represented on the wire as the binary value of 'val % (2^len)', allowing ROHC-FN expressions to use the full range of integers internally while confining the exchanged bit strings to bounded unsigned values. For example, CVALUE=-1 with CLENGTH=8 yields the bit string 11111111.
ROHC-FN is a declarative language that is referentially transparent with no side effects, meaning any expression is guaranteed to have the same value wherever it appears in the notation and can always be interchanged with its value. This design choice ensures that both compression and decompression are fully described by a single field definition via two-way matching rather than procedural assignment.
ROHC-FN was created because previous header compression profiles specified using English text combined with ASCII box notation were sometimes unclear and ambiguous, revealing limitations when defining complex structures and encodings for compressed formats. No other formal notation existed that met the requirements for rigorously defining both compressed and uncompressed formats and the relationships between them.
The lsb offset_param allows the interpretation interval to be positioned asymmetrically around the context reference value. Setting offset_param=0 allows only same-or-increasing values; offset_param=-1 allows only increasing values; offset_param=2^num_lsbs_param allows only decreasing values, enabling efficient encoding for fields with predictable monotonic behavior.
The scope of ROHC-FN is limited to specifying the relationship between compressed and uncompressed formats. To form a complete ROHC profile specification, the control logic for profile behaviour — including context management, feedback messages, and robustness principles — must be defined by other means outside the formal notation.
All ROHC-FN identifiers must start with an alphabetic character; identifiers for constants must be entirely upper case. It is illegal to have two identifiers that differ only in capitalisation within the same scope, and reserved words (ENFORCE, THIS, VARIABLE, UVALUE, CLENGTH, COMPRESSED, etc.) may not be used as identifiers.
Expressions cannot be used directly as encoding methods because they only define a single attribute whereas a field requires multiple attributes. For example, 'field =:= (x + 20) / 4' is explicitly prohibited; a proper encoding method must be used instead.
ROHC-FN specifications are case-sensitive and are written in the 7-bit ASCII character set. A specification consists of zero or more constant definitions, an optional global control field list, and one or more encoding method definitions.
The total length of each compressed format must always be defined, and the CLENGTH of every field in a compressed format must be defined such that there is an unambiguous mapping from the compressed bit string to the listed fields.
The total length of each uncompressed format must always be defined, and the ULENGTH of every field in an uncompressed format must be defined such that there is an unambiguous mapping from the uncompressed bit string to the listed fields.
An encoding method may define multiple COMPRESSED formats for a single UNCOMPRESSED format. The compressor selects any combination where no binding fails; a discriminator field (control field with compressed_value) uniquely identifies the chosen format to the decompressor.
Each field in ROHC-FN has four attributes: UVALUE (uncompressed numerical value), ULENGTH (uncompressed length in bits), CVALUE (compressed numerical value), and CLENGTH (compressed length in bits). Attributes are undefined until bound; conflicting bindings cause the enclosing format to fail.
Fields that are contiguous in a compressed format but non-contiguous in the uncompressed format can be grouped using a colon-separated list to the left of '=:='. The group is presented to the encoding method as a concatenated bit string; the combined length attributes equal the sum of the individual length attributes.
Profile-specific encoding methods that are not definable using the ROHC-FN library (e.g., inferred_ip_v4_header_checksum) may be defined either in formal ROHC-FN syntax within the profile specification or by a rigorous plain-text definition. They are referenced in the FN specification by name followed by a quoted pointer to where they are defined.
The COMPRESSED section specifies the order and encoding of fields in the compressed format; field order need not match the UNCOMPRESSED section. Every field's CLENGTH must be defined across all sections so the total compressed length is unambiguously determined.
The compressed_value(len, val) encoding method encodes control fields that have no counterpart in the uncompressed header (ULENGTH=0). CLENGTH is bound to 'len' and CVALUE to 'val'. A binary string literal in single quotes ('01101') is shorthand for compressed_value(5, 13) and is the standard way to specify discriminator fields.
The CONTROL section declares fields that do not appear in the uncompressed header but carry an uncompressed value (ULENGTH > 0). Control fields communicate per-flow information (e.g., IP-ID behavior) not explicitly present in protocol headers, enabling profile-specific compression optimizations.
The crc(crc_bits, bit_pattern, initial_value, block_data_value, block_data_length) encoding method produces a CRC calculated using the algorithm defined in RFC 4995. The CRC is computed in LSB order; the bit_pattern omits the highest-order term (always implicit) so an n-term polynomial uses n-1 bits.
The DEFAULT section specifies fallback encoding methods for fields that are not explicitly bound in a given compressed or uncompressed format. Default bindings are overridden whenever a format provides its own binding for a field's value; they keep multi-format definitions concise.
The ENFORCE statement adds predicates to a format that must all be fulfilled for the format to succeed. It binds a single field attribute via a boolean expression; if the expression evaluates to false the format cannot be used, if undefined the binding is created and the format proceeds.
The INITIAL section specifies context-only bindings applied when a field's context is undefined, allowing context-dependent methods such as static and lsb to be used from the very first packet of a flow. Initial bindings must not themselves depend on the context.
The irregular(len) encoding method transmits all bits of a field unchanged: ULENGTH and CLENGTH are both bound to 'len' and CVALUE is bound equal to UVALUE. It is a fail-safe encoding for fields that cannot be compressed, such as TCP checksum.
The keyword THIS refers to the field (contiguous group of bits) that the current encoding method is encoding, giving access to its attributes such as THIS.ULENGTH. It is particularly useful in crc encoding to calculate a CRC over all bits in the header being encoded.
The lsb(num_lsbs_param, offset_param) encoding method transmits the least significant bits of a field. The decompressor selects the value within the interpretation interval [ref_value - offset_param, ref_value + 2^num_lsbs_param - 1 - offset_param] whose LSBs match CVALUE. The CLENGTH is bound to num_lsbs_param.
The '=:=' operator means 'is encoded by' and represents a two-way mapping between compressed and uncompressed field attributes. During compression the uncompressed attributes are known and compressed attributes are matched; during decompression the direction is reversed — both operations are captured in a single field definition.
The static encoding method compresses a field whose length and value match an existing context entry to zero bits (CLENGTH=0). At the compressor the binding succeeds only when the context value equals the uncompressed value; at the decompressor it succeeds only if a valid context entry exists.
The UNCOMPRESSED section of an encoding method specifies the order of fields in the uncompressed header. The sum of all ULENGTH values in the list must equal THIS.ULENGTH, and every field's ULENGTH must be unambiguously defined across all sections for an unambiguous bit-to-field mapping.
The uncompressed_value(len, val) encoding method encodes fields whose uncompressed value is known or calculable via an expression. ULENGTH is bound to 'len', UVALUE to 'val', and CLENGTH to 0, so no compressed bits are transmitted; the decompressor reconstructs the field from the known parameters.
ROHC-FN is a formal notation language similar to ABNF and is not believed to raise any security issues. The notation describes structure and relationships between header formats rather than executable behavior.