1

Let's say, that I have two directly connected routers r1 and r2. For example, I do see that the r2 sends a Label Mapping Message to r1 and provides several labels including 21(0x15):

enter image description here

r1 associates the label 21 with prefix 192.0.2.7/32 in the LDP label database:

Input label database, 192.0.2.1:0--192.0.2.4:0
Labels received: 7
  Label     Prefix
     23      192.0.2.1/32
     17      192.0.2.2/32
     16      192.0.2.3/32
      3      192.0.2.4/32
     19      192.0.2.5/32
     20      192.0.2.6/32
     21      192.0.2.7/32

Why did r1 associate the label 21 with prefix 192.0.2.7/32?

1 Answer 1

3

FEC Elements are addresses or prefixes which, when included in an FEC TLV as part of a Mapping Message, are mapped to the associated label.

If you expand the FEC Element 1 section of your packet capture it will most likely display the element 192.0.2.7/32. That's encoded in the FEC TLV in the format documented in RFC5036 §3.4.1 and each element has the following structure & fields:

Prefix FEC Element value encoding:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Prefix (2)   |     Address Family            |     PreLen    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                     Prefix                                    |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

         Address Family
            Two octet quantity containing a value from ADDRESS FAMILY
            NUMBERS in [ASSIGNED_AF] that encodes the address family for
            the address prefix in the Prefix field.

         PreLen
            One octet unsigned integer containing the length in bits of
            the address prefix that follows.  A length of zero indicates
            a prefix that matches all addresses (the default
            destination); in this case, the Prefix itself is zero
            octets).

         Prefix
            An address prefix encoded according to the Address Family
            field, whose length, in bits, was specified in the PreLen
            field, padded to a byte boundary.

The mapping message itself is documented in §3.5.7.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.