Saturday, February 4, 2023

MPLS Label and its Exchange Protocol

MPLS Label Format

The MPLS header has been standardized, you can find it in RFC 3032. The header is pretty simple, here’s what it looks like:                           

MPLS uses a 32-bit label field that contains the following information:

  • 20-bit label
  • 3-bit experimental field (EXP): these are the three experimental bits. These are used for QoS, normally the IP precedence value of the IP packet will be copied here.
  • 1-bit bottom-of-stack indicator (S): this is the “bottom of stack” bit. With MPLS it’s possible to add more than one label, you’ll see why in some of the MPLS VPN lessons. When this bit is set to one, it’s the last MPLS header. When it’s set to zero then there is one or more MPLS headers left.
S = 1  à indicates, it is a last label
S = 0  à indicates, it is not a last label
  • 8-bit time-to-live field (TTL): just like in the IP header, this is the time to live field. You can use this for traces in the MPLS network. Each hop decrements the TTL by one.

The MPLS header is added in between the L2 and L3 header. That’s why we call it a “layer 2.5” protocol.

MPLS Label Stack

  • Protocol identifier (PID) in a L2 header specifies that the payload starts with a label (labels) and is followed by an IP header
  • Bottom-of-stack bit indicates whether the next header is another label or a L3 header
  • Receiving router uses the top label only

List of the ethertype values used to identify L3 protocols with most L2 encapsulations: 

  • Unlabeled IP unicast: PID=0x0800 identifies that the frame payload is an IP packet.
  • Labelled IP unicast: PID=0x8847 identifies that the frame payload is a unicast IP packet with at least one label preceding the IP header. The bottom of- bit indicates when the IP header starts.
  • Labelled IP multicast: PID=0x8848 identifies that the frame payload is a multicast IP packet with at least one label preceding the IP header. The bottom-of-bit indicates when the IP header starts.

Label Stacking Application

  • VPN/Transport Services, which use an inner Label to map traffic to specific interfaces, and an outer label to route through the network.
  • MPLS VPNs (two labels—the top label points to the egress routers and the second label identifies the VPN)
  • Traffic Engineering (MPLS-TE) (two or more labels—the top label points to the endpoint of the traffic engineering tunnel and the second label points to the destination)
  • MPLS VPNs combined with Traffic Engineering (three or more labels)

Label Exchange Protocol

There are two types of Label Exchange Protocol as:

  • LDP – Label Distribution Protocol
Cisco Standard
Port – 646/UDP, 646/TCP
Support Authentication

  • TDP – Tag Distribution Protocol
IETF Standard
Port – 711/UDP, 711/TCP
No Authentication Support

Label Distribution Protocol (LDP)

Labels are created based on the forwarding equivalence classes (FECs) created through the layer 3 routing protocol.  For label swapping to be possible, common understanding of which FECs map to which labels must be achieved between adjacent routers.  The communication of label binding information (I.e., the binding of an FEC to a specific label value) between LSRs is accomplished by label distribution.

Let say we have 2 router R1 and R2 connected, and we have LDP enabled on the interface.

As soon as LDP is enabled, we have below operation as:

  • Hello Packet has been exchanged between router R1 and R2 with Source: Interface IP and Destination: 224.0.0.2 with port 646/UDP.
To check that hello packet is exchanged or not, command is,
         show mpls ldp discovery
  • Once both the router knows each other parameter and formed neighbor, the router with highest router-id initiates TCP session with source as random port and destination port as 646/TCP.
To check the TCP session is developed or not, command is,
         show mpls ldp neighbor

No comments:

Post a Comment