MPLS TE - Affinity attribute flag assignment best practices

When implementing MPLS traffic engineering, the attribute flags and tunnel affinity configuration allow you to set attributes on interfaces and configure tunnels to either include or exclude specific links based on those attributes. This is also known as link coloring.

The inclusion or exclusion of traffic is achieved using an affinity and a mask that are applied to particular links. These values are compared with the attribute flag to allow or disallow traffic.

An attribute flag is a 32-bits in length. This means that it can be used to define 32 separate properties on a link.

It is best practice to assign a particular attribute to a single bit. For example:

Link typeBinaryHex
Fiber0000 00010x1
Satellite0000 00100x2
DSL0000 01000x4
Link to another country0000 10000x8
Encrypted link0001 00000x10

It is possible to use multiple flag bits to represent a particular link type like so:

Link typeBinaryHex
Fiber0000 00110x3
Satellite0000 11000xC
DSL0011 00000x30
Link to another country0100 00000x40
Encrypted link1000 00000x80

However, the bits used for each link type must be mutually exclusive. In other words they must not overlap. The following overlapping flags will cause problems:

Link typeBinaryHex
Fiber0000 00110x3
Satellite0000 11110xF
DSL0011 10000x38
Link to another country0111 00000x70
Encrypted link1100 00000x80

In this case, you cannot uniquely identify the link type using the affinity and mask values.

https://networklessons.com/mpls/mpls-te-affinity-attribute

Links to this page: