Packed Encoding Rules

Packed Encoding Rules (PER) are ASN.1 encoding rules for producing a compact transfer syntax for data structures described in ASN.1, defined in 1994.

Packed Encoding Rules provides a much more compact encoding than Basic Encoding Rules as Packed Encoding Rules uses additional information, such as the lower and upper limits for numeric values, from the ASN.1 specification to represent the data units using the minimum number of bits.

The compactness requires that the decoder knows the complete abstract syntax of the data structure to be decoded.

unaligned and aligned #

There are two variations of packed encoding rules unaligned and aligned.
  • unaligned encoding - the bits are packed with no regard for octet (byte) boundaries.
  • aligned encoding - certain types of data structures are aligned on octet boundaries, meaning there may be some number of wasted padding bits. Unaligned encoding uses the least number of bits, but presumably at some cost in processing time.

Packed Encoding Rules also define a restricted set of encoding rules, called CANONICAL-PER, which is intended to produce only a single possible encoding for any given data structure. CANONICAL-PER's role is therefore similar to the role of Distinguished Encoding Rules or Canonical Encoding Rules.

More Information #

There might be more information for this subject on one of the following: