Thursday, May 28, 2015

MPLS -- Label

MPLS stands for Multiprotocol Label Switching.

Label switching indicates that the packets switched are no longer IPv4 packets, IPv6 packets, or
even Layer 2 frames when switched, but they are labeled. The most important item to MPLS is
the label.

MPLS Labels

One MPLS label is a field of 32 bits with a certain structure , 


MPLS Label

The first 20 bits are the label value. This value can be between 0 and 220–1, or 1,048,575.
The bits 20 to 22 are the three experimental (EXP) bits. These bits are used solely for quality of
service (QoS)
Bit 23 is the Bottom of Stack (BoS) bit. It is 0, unless this is the bottom label in the stack.
The stack is the collection of labels that are found on top of the packet.so last label has BoS bit 1.
Bits 24 to 31 are the eight bits used for Time To Live (TTL). This TTL has the same function as
the TTL found in the IP header

The first label in the stack is called the top label, and the last label is called the bottom label.
There can be any no of label in between.


Label
EXP
BoS
TTL
 Label
 EXP
0
TTL 
 Label
 EXP
....
TTL 
 Label
EXP 
...
TTL 
 Label
EXP 
1
 TTL


Encoding of MPLS

                              Placement of the label stack for labeled packets.




The Layer 2 encapsulation of the link can be almost any encapsulation that Cisco IOS supports:
PPP, High-Level Data Link Control (HDLC), Ethernet, and so on. Assuming that the transported
protocol is IPv4

MPLS is not a Layer 2 protocol because the Layer 2 encapsulation is still present with labeled packets. MPLS also is not really a Layer 3 protocol because the Layer 3 protocol is still present, too. Therefore, MPLS does not fit in the OSI layering too well. Perhaps the easiest thing to do is to view MPLS as the 2.5 layer and be done with it.

Label switch router (LSR)

A label switch router (LSR) is a router that supports MPLS. It is capable of understanding MPLS
labels and of receiving and transmitting a labeled packet on a data link. Three kinds of LSRs exist
in an MPLS network:
■ Ingress LSRs—Ingress LSRs receive a packet that is not labeled yet, insert a label (stack) in
front of the packet, and send it on a data link.

■ Egress LSRs—Egress LSRs receive labeled packets, remove the label(s), and send them on
a data link. Ingress and egress LSRs are edge LSRs.

■ Intermediate LSRs—Intermediate LSRs receive an incoming labeled packet, perform an
operation on it, switch the packet, and send the packet on the correct data link.

An LSR can do the three operations: pop, push, or swap.

An LSR that pushes labels onto a packet that was not labeled yet is called an imposing LSR  , it is  ingress LSR

An LSR that removes all labels from the labeled packet before switching out the
packet is a disposing LSR. One that does disposition is an egress LSR.

Ingress and egress LSRs are referred to as provideredge (PE) routers.
Intermediate LSRs are referred to as provider (P) routers

Label Switched Path

A label switched path (LSP) is a sequence of LSRs that switch a labeled packet through an MPLS network or part of an MPLS network.

Note :-LSP is unidirectional

The ingress LSR of an LSP is not necessarily the first router to label the packet. The packet might have already been labeled by a preceding LSR. Such a case would be a nested LSP—that is, an LSP inside another LSP.

Forwarding Equivalence Class
  A Forwarding Equivalence Class (FEC) is a group or flow of packets that are forwarded along the same path and are treated the same with regard to the forwarding treatment.
Packets belonging to the same FEC have the same label.    
However, not all packets that have the same label belong to the same FEC, because their EXP values might differ;
Some FEC example

  • Packets with Layer 3 destination IP addresses matching a certain prefix
  • Multicast packets belonging to a certain group
  • Packets with the same forwarding treatment, based on the precedence or IP DiffServ Code Point (DSCP) field
  • Packets with Layer 3 destination IP addresses that belong to a set of Border Gateway Protocol (BGP) prefixes, all with the same BGP next hop.
  • One PVC to another PVC
Label Distribution

  •      The ingress LSR imposes one or more labels on the packet.
  •      The intermediate LSRs swap the top label (the incoming label) of the received labeled  packet with another label (the outgoing label) and transmit the packet on the outgoing link.
  •       The egress LSR of the LSP strips off the labels of this LSP and forwards the packet

    Labels have no global meaning across the network. For adjacent routers to agree which label to use for which prefix, they need some form of communication between them; otherwise, the routers do not know which outgoing label needs to match which incoming label. A label distribution protocol is needed..
Label can be distributed in 2 ways,
■ Piggyback the labels on an existing IP routing protocol
■ Have a separate protocol distribute labels

BGP is a routing protocol  that can carry prefixes and distribute labels at the same time. However, BGP is not an IGP


The second method—running a separate protocol for label distribution—has the advantage of  being routing protocol independent.



Several varieties of protocols distribute labels:

■ Tag Distribution Protocol (TDP)
■ Label Distribution Protocol (LDP)
■ Resource Reservation Protocol (RSVP)
TDP, which predates LDP, was the first protocol for label distribution developed and implemented by Cisco. However, TDP is proprietary to Cisco. TDP is becoming obsolete.

The IETF later formalized LDP. LDP and TDP are similar in the way they operate,
Label distribution by RSVP is used for MPLS TE only.



.
Label Distribution with LDP

For every IGP IP prefix in its IP routing table, each LSR creates a local binding—that is, it binds a label to the IPv4 prefix. The LSR then distributes this binding to all its LDP neighbors. These received bindings become remote bindings. The neighbors then store these remote and local bindings in a special table, the label information base (LIB). Each LSR has only one local binding
per prefix, at least when the label space is per platform. If the label space is per interface, one local label binding can exist per prefix per interface. Therefore, you can have one label per prefix or one label per prefix per interface, but the LSR gets more than one remote binding because it usually
has more than one adjacent LSR.

The LSR chooses the remote binding received from the downstream LSR, which is the next hop in the routing table for that prefix. It uses this information to set up its label forwarding information base (LFIB) where the label from the local binding serves as the incoming label and the label from the one remote binding chosen via the routing table serves as the outgoing label.

Label Forwarding Instance Base

The LFIB is the table used to forward labeled packets. It is populated with the incoming and outgoing labels for the LSPs. The incoming label is the label from the local binding on the particular LSR. The outgoing label is the label from the remote binding chosen by the LSR from all possible remote bindings.
All these remote bindings are found in the LIB. The LFIB chooses only one of the possible outgoing labels from all the possible remote bindings in the LIB and  installs it in the LFIB.


The remote label chosen depends on which path is the best path found in the routing table.


In the case of MPLS traffic engineering, the labels are distributed by RSVP


Continued.....MPLS- Label Spaces


No comments:

Post a Comment