MPLS label got 4 bytes and is inserted between L2 and L3. It encapsulates the L2 frame.
- the first 20 bits is label itself, which is assigned to each packet.
- next 3 bites is EXP filed which contain QoS or IPPresence values.
- next one bit is bottom of stack indicator. This indicates if the label is the last label. You can encapsulate many times IP packet. For example for MPLS VPN you will probably have 2 labels for each packet. For MPLS VPN Traffic Engineering you will have 3 labels,…
- last 8 bit is TTL value for loop prevention.
MPLS label stack
Usually only one label is assigned to a packet. But multiple labels in label stack are supported. These scenarios may produce more than one label:
- MPLS VPNs (two labels) – the top label points to the egress router, and the second label identifies the VPN. Typically the second label is called VPN label. So the first label identifies the exit router of the virtual point to point connection and the second label identifies the specific VPN.
- MPLS TE (two or more labels) – the top label points to the endpoint of traffice engineering tunnel and the first label points to the real destination
- MPLS VPN combined with MPLS TE (three or more labels)
Sharing the Label information
LSRs are forwarding packets based on its labels. There must be some label propagation within a MPLS network. This doesnt happen automatically thats why you must explicitly configure some of the LDP protocols for that purpose.
Tag Distribution Protocol
- Cisco proprietary
- Old – not used
- TCP port 711
Label Distribution Protocol
- default on cisco
- UDP 646
- used for MPLS TE labels
Sharing the label information is similar to how routing protocol works. The Edge ASRs assings different labels to different networks. Then these labels are propagated to neighbor MPLS routers with the information of behind what label is what network. Then the label assign its local label to that network and send it to other neighbor and this neighbor will do the same.