BER-TLV

Basic Encoding Rules - Tag Length Value

Protocol →
Introduced in Rel-8

BER-TLV is a standardized data encoding format used in 3GPP specifications that structures data into a tag, length, and value for reliable exchange in smart card applications like USIMs.

Category
Protocol
Introduced
Rel-8
Where
User Equipment › SIM/USIM
Specifications
2 specs
BER-TLV Description Purpose Related Classification Detected Changes Specifications

Description

BER-TLV is a fundamental data encoding scheme derived from the ASN.1 (Abstract Syntax Notation One) Basic Encoding Rules. It provides a structured method to represent complex data objects as a sequential byte stream, enabling interoperability between different systems. The encoding follows a strict triplet format: a Tag field, a Length field, and a Value field. The Tag is a unique identifier that classifies the data object, indicating its type, class (universal, application, context-specific, or private), and whether it is primitive (simple data) or constructed (contains nested TLV objects). The Length field specifies the size of the Value field in bytes, using either a definite or indefinite length encoding. The Value field contains the actual data payload, which can be simple binary data or, in the case of constructed tags, a concatenated series of nested BER-TLV data objects.

In 3GPP systems, BER-TLV is extensively specified in technical specifications such as 3GPP TS 31.102 (Characteristics of the Universal Subscriber Identity Module (USIM) application) and TS 31.103 (Characteristics of the IP Multimedia Services Identity Module (ISIM) application). It is the primary encoding mechanism for commands and responses exchanged between the Mobile Equipment (ME) and the Universal Integrated Circuit Card (UICC) hosting the USIM/ISIM. This includes commands for file access, authentication, and management of applications and services. The protocol operates over the logical channel established between the terminal and the card, ensuring that complex, hierarchical data structures—such as file structures, security parameters, and service parameters—can be transmitted and parsed reliably.

The architecture of BER-TLV encoding is inherently hierarchical and self-describing. A single BER-TLV data object can encapsulate multiple subordinate TLV objects within its Value field when using a constructed tag. This allows for the representation of complex, tree-like data structures essential for mobile telecommunications, such as the EF (Elementary File) directory structure on a USIM or the storage of authentication vectors and network-specific parameters. The precise rules for tag encoding (including tag number and class), length encoding (short, long, or indefinite form), and value representation ensure that any compliant entity can decode the data stream without prior knowledge of its content structure beyond the specification definitions. This decouples the data semantics from the transmission format, providing tremendous flexibility for future expansions and new data types within the 3GPP ecosystem.

Its role in the network is foundational for secure and reliable subscriber identity management and service provisioning. Every time a mobile device performs an authentication procedure with the network, reads a file from the USIM, or updates a service parameter, the data is formatted using BER-TLV. The encoding's robustness prevents parsing errors, supports backward and forward compatibility through its extensible tag space, and enables the UICC to manage a wide array of applications and data in a standardized manner. This makes BER-TLV a critical, albeit often invisible, protocol layer ensuring the integrity of data exchanges at the very edge of the cellular network—the subscriber identity module.

Purpose & Motivation

BER-TLV was created to solve the problem of efficiently and unambiguously encoding structured data for transmission and storage in telecommunications systems, particularly for smart card interfaces. Prior to such standardized encoding, ad-hoc binary formats were used, which led to interoperability issues, difficulties in parsing, and challenges in extending systems with new data types. The adoption of ASN.1 and its Basic Encoding Rules provided a formal, internationally standardized method (ITU-T X.690) for describing and encoding data structures. 3GPP adopted this for UICC applications to ensure that all mobile devices and network infrastructure could reliably communicate with subscriber identity modules from any manufacturer.

The historical context lies in the evolution of GSM and 3G systems towards more complex services requiring sophisticated data management on the SIM card. As services moved beyond simple subscriber identification to include authentication algorithms, file systems, and application toolkit commands, a flexible and robust data representation became essential. BER-TLV addresses the limitations of fixed-format or proprietary encodings by providing a self-describing format. The tag explicitly identifies the data object, the length field allows for variable-sized data, and the nesting capability (constructed encoding) allows complex hierarchies. This solved critical problems of data integrity, parsing reliability, and future-proof extensibility without requiring changes to the fundamental command interface between the terminal and the card.

Furthermore, its purpose extends to enabling secure and manageable service provisioning. By standardizing the data encoding for USIM/ISIM applications, 3GPP ensured that security-sensitive data, such as cryptographic keys and authentication sequences, could be packaged and transmitted in a predictable, analyzable format. This is vital for preventing errors that could lead to security vulnerabilities or service failures. The motivation was to create a foundational, reliable data layer that supports the entire ecosystem of mobile subscriber identity, from basic network access to advanced IP Multimedia Subsystem (IMS) services, by providing a common language for data on the UICC.

Classification

Part ofTLV

Detected Changes Across Releases

from 3GPP Change Requests

Specific changes extracted from the „Change history“ tables of 3GPP specifications (36 CRs across 5 releases). Complements the general historical overview above with the evidence-based evolution of this function.

Studied in Rel-8, normative work from Rel-15.

Rel-15 10 changes

In Release 15, updates to BER-TLV functions included clarifications and corrections to the length of specific TLVs within key 5GS files, such as those in EF5GAUTHKEYS and EF5GS3GPPLOCI. These changes ensured alignment with security specifications and corrected data structure definitions for network parameters. Furthermore, the release introduced enhancements for USIM configuration data to support new 5G capabilities like PDU session control and updated mission critical services.

  • USIM Service Table update for PDU session call control support TS 31.102CR0786
  • Allow configuration of MCS (Access Identity 2) via USIM. TS 31.102CR0794
  • Mission Critical Services configuration data update to USIM TS 31.102CR0808
  • Enhance USIM OPL configuration to support 3 bytes TAC when in NG-RAN. TS 31.102CR0818
  • Updates to USIM management procedures for 5GS TS 31.102CR0806
  • Correct Kseaf and Kausf length in EF5GAUTHKEYS to align with SA3 specification TS 31.102CR0810

+ 4 more changes

Rel-16 11 changes

In Release 16, the BER-TLV function was updated to support new USIM configuration capabilities, including the storage of a URSP policy, a PS Data Off list for home and roaming, and lists for RLOS PLMNs, trusted non-3GPP networks, and UAC Access Identities. The release also introduced corrections to file formatting and specific file identifiers, such as the EFEARFCNList File ID value. Furthermore, it added support for a dedicated AID for USIM applications using non-IMSI based SUPI types and the storage of a separate KSEAF for non-3GPP access.

  • Support for USIM configuration of RLOS PLMN list TS 31.102CR0847
  • URSP storage in USIM TS 31.102CR0861
  • Specify storage for a potentially separate KSEAF for non-3gpp access on the USIM TS 31.102CR0864
  • SUCI value with SUPI format NSI TS 31.102CR0879
  • USIM configuration of RLOS allowed MCC list TS 31.102CR0881
  • Support for Trusted non-3GPP access networks list by USIM TS 31.102CR0891

+ 5 more changes

Rel-17 11 changes

In Release 17, the BER-TLV function was extended to support new USIM Elementary Files (EFs) for storing pre-configured CAG information, SOR-CMCI parameters, and disaster roaming configuration data. It also added EFs for eDRX parameters in NG-RAN, 5G NSWO configuration, and the 'No E-UTRA Disabling In 5GS' indicator. Furthermore, support was included for an EF to configure warning message reception in SNPNs and for updated URSP rule references.

  • Introduce a USIM file to store pre-configured CAG information list TS 31.102CR0904
  • SOR-CMCI storage in USIM TS 31.102CR0917
  • Addition of USIM files for the indication of whether disaster roaming is enabled in the UE, disaster roaming wait range, disaster return wait range and applicability indicator for disaster roaming PLMNs list provided by VPLMN. TS 31.102CR0938
  • Adding eDRX parameters in the USIM for NG-RAN TS 31.102CR0943
  • 5G NSWO (Non-Seamless WLAN Offload) configuration support in the USIM compromised proposal. TS 31.102CR0946
  • Support of 'No E-UTRA Disabling In 5GS' in USIM TS 31.102CR0947

+ 5 more changes

Rel-18 3 changes

In Release 18, the BER-TLV function was extended to support new Elementary Files (EFs) on the USIM for enhanced capabilities. Specifically, this included adding an EF for Access Control to GBA_U_APIs and an EF for IMS Data Channel configuration. Furthermore, the release mandated the enabling of Service n°133 when Service n°123 is enabled, extending the storage of 5G security parameters.

  • 5G Security Parameters extended storage on USIM (Mandating Service n°133 to be enabled when Service n°123 is enabled) Rel18. TS 31.102CR1014
  • Add EF of Access Control to GBA_U_APIs to the USIM TS 31.102CR1007
  • Add EF of IMS Data Channel configuration to the USIM TS 31.102CR1006
Rel-19 1 change

In Release 19, the BER-TLV function was updated to ensure backward compatibility for USIMs that lack extended security parameter storage in the EF_5GAuthKeys file. This change specifically handles the scenario where a USIM does not have the storage capability for these extended parameters, ensuring the ME can still interoperate with such legacy USIMs. The modification is defined within the USIM application specifications for file structures and security functions to maintain interoperability.

  • Backward compatibility handling of USIM without extended security parameter storage in EF_5GAuthKeys - Rel19 TS 31.102CR1074

Explore further

Broader topics and technologies where BER-TLV plays a role.

Defining Specifications

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

SpecificationTitleRelease
TS 31.102 vj40 USIM Application Specification Rel-19
TS 31.103 vj00 ISIM Application Specification Rel-19