ABNF

Augmented Backus-Naur Form

Protocol →
Introduced in Rel-8

ABNF is a formal syntax specification language used in 3GPP to unambiguously define protocol message formats and encoding rules, ensuring interoperability between network elements.

Category
Protocol
Introduced
Rel-8
Where
Core Network › Evolved Packet Core
Specifications
12 specs
ABNF Description Purpose Specifications

Description

Augmented Backus-Naur Form (ABNF) is a metalanguage based on the Backus-Naur Form (BNF), enhanced with additional operators and capabilities specifically designed for defining the syntax of communication protocols. In 3GPP specifications, ABNF is the primary formalism used to specify the precise structure of protocol data units (PDUs), message formats for various interfaces (e.g., Diameter, HTTP), and the encoding of complex information elements. It defines rules for character sequences, specifying which strings of symbols are valid according to the protocol's grammar. ABNF rules consist of a rule name defined by an equals sign and the rule's definition, using a combination of terminal values (literal text or numeric character values) and other rule names. Operators such as concatenation, alternation (represented by a forward slash '/'), repetition (using '*', '+', or specific ranges like 'n*m'), optional elements (enclosed in '[]'), and grouping (enclosed in '()') allow for the construction of sophisticated and precise syntactic definitions. The language also supports comments and case-insensitive string literals, which are particularly useful for text-based protocols.

The core of ABNF's operation in 3GPP lies in its role as the definitive source for protocol implementation. When a specification like 3GPP TS 29.329 (Sh Interface) defines Diameter application commands, it uses ABNF to specify the exact order, data types, and optionality of Attribute-Value Pairs (AVPs) within the command. This includes defining the header format, mandatory and optional AVPs, and the nesting of grouped AVPs. For example, an ABNF rule might define a 'User-Name' AVP as containing a UTF8String of a certain format. This formal definition is then used by equipment vendors to generate parsing code, validate incoming messages, and construct outgoing messages correctly, ensuring that a session management request from one vendor's Policy and Charging Rules Function (PCRF) is correctly understood by another vendor's Policy and Charging Enforcement Function (PCEF).

Key components of an ABNF specification include core rules (like ALPHA, DIGIT, CRLF) defined in RFC 5234, which provide basic building blocks, and protocol-specific rules defined in the 3GPP specification itself. The parsing process involves starting with a top-level rule (e.g., the rule for a complete Diameter message) and recursively applying the defined rules to match the input string against the grammar. A successful parse indicates a syntactically valid message. 3GPP's use of ABNF spans numerous technical specifications, particularly those defining Diameter-based interfaces in the core network (e.g., Gx, Rx, S6a), HTTP/2-based services (e.g., N5, N7 in 5GC), and management interfaces. Its precision is critical for automated testing, protocol conformance validation, and the development of software libraries that handle 3GPP protocol stacks, forming the syntactic backbone that guarantees reliable and unambiguous communication across multi-vendor networks.

Purpose & Motivation

ABNF was adopted by 3GPP to solve the critical problem of ambiguity in protocol specification. Prior to the widespread use of formal syntax definitions, protocol specifications were often described using prose and informal diagrams, which led to different interpretations by implementers. This resulted in interoperability issues, where network elements from different vendors could not communicate correctly despite both claiming to follow the same standard. These interoperability failures caused service outages, billing errors, and increased integration time and cost for operators. The need for a rigorous, unambiguous, and machine-processable language became paramount as 3GPP networks grew in complexity, introducing numerous new interfaces and protocols with each release.

The creation and standardization of ABNF, primarily documented in IETF RFC 5234, provided a solution that was both human-readable and suitable for automated processing. 3GPP leveraged this existing, well-understood standard to bring formal rigor to its own protocol definitions. The motivation was to ensure that a protocol data unit defined in a 3GPP specification had one and only one valid interpretation. This allows for the generation of parser code, the creation of conformance test suites that can mechanically verify an implementation's output against the grammar, and the clear identification of mandatory, optional, and conditional elements within a message. By using ABNF, 3GPP shifted from descriptive specifications to prescriptive ones, where the allowed syntax is explicitly enumerated.

Historically, this approach addressed the limitations of earlier ad-hoc methods. It provided a common language for standards authors, implementers, and testers. For 3GPP, starting notably in Release 8 with the System Architecture Evolution (SAE) and the introduction of many new Diameter-based interfaces, ABNF became the de facto tool for defining the syntax of these protocols. Its use has continued and expanded into the 5G era for defining HTTP/2 and JSON-based service-based interfaces, proving its adaptability to both binary and text-based protocol encodings. The purpose remains unchanged: to eliminate implementation guesswork and serve as the single source of truth for what constitutes a syntactically valid protocol message, which is a foundational requirement for a globally interoperable telecommunications ecosystem.

Evolution Across Releases

Rel-8 Initial

ABNF was introduced as the formal syntax definition language for the new Diameter-based interfaces defined for the Evolved Packet Core (EPC), such as Gx (PCRF-PCEF), Rx (AF-PCRF), and S6a (HSS-MME). It provided the initial, precise grammatical rules for Diameter Application Commands and Attribute-Value Pairs (AVPs), establishing a rigorous foundation for protocol implementation and interoperability in the SAE architecture.

Explore further

Broader topics and technologies where ABNF plays a role.

Defining Specifications

3GPP specifications that define or reference ABNF, with the latest known release. Sourced from the 3GPP document catalog — see methodology.

SpecificationTitleRelease
TS 29.173 vj00 Diameter-based SLh Interface for LCS Rel-19
TS 29.229 vj10 Diameter Protocol for Cx/Dx Interfaces Rel-19
TS 29.238 vj00 H.248 Profile for IBCF-TrGW Interface Rel-19
TS 29.329 vj10 Diameter Protocol for Sh Interface Rel-19
TS 29.334 vj00 IMS-ALG to IMS-AGW Interface Protocol Rel-19
TS 29.336 vj10 HSS Diameter Interfaces for PDN Interworking Rel-19
TS 29.337 vj00 Diameter T4 Interface for MTC Device Triggering Rel-19
TS 29.338 vj30 Diameter protocols for SMS in MME/5GS Rel-19
TS 32.260 vj10 IMS Charging Management Rel-19
TS 32.272 vj00 Charging for Push-to-Talk over Cellular (PoC) Rel-19
TS 32.273 vj00 MBMS Charging Management Rel-19
TR 33.978 v1800 Interim Security for Early IMS Rel-8