Skip to main content

4.1. Length Encoding

4.1. Length Encoding

The length field indicates the length in octets of the variable NLRI value:

  • If the NLRI length is smaller than 240 (0xf0 hex) octets, the length field can be encoded as a single octet.

  • Otherwise, it is encoded as an extended-length 2-octet value in which the most significant nibble has the hex value 0xf.

In Figure 1 above, values less than 240 are encoded using two hex digits (0xnn). Values above 239 are encoded using 3 hex digits (0xfnnn). The highest value that can be represented with this encoding is 4095. For example, the length value of 239 is encoded as 0xef (single octet), while 240 is encoded as 0xf0f0 (2 octets).