Chapter II: MPLS Architecture
MPLS Labels
One MPLS label is a field of 32 bits with a certain structure.
(MPLS label figure).
The first 20 bits are the label value. This value can be between 0 and 2^20-1, or , 1,048,575. However , the first 16 values are exempted from normal use; that is , they have a special meaning.
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). It is 0, unless this is the bottom label in the stack. If so the BoS bit is set to 1. THe stack can consist of just one label, or it might have more. The number of labels (that is, the 32-bit field) that you can find in the stack is limitless.
Bits 24 to 31 are the eight bit used for Time To Live (TTL). This TTL has the same function as the TTL found in the IP header.
Label Stacking
MPLS-Capable routers might need more than one label on top of the packet to route that packet through the MPLS network. This is done by packing the labels into a stack. The first label in the stack is called the top label, and the last label is called the bottom label. In between , you can have any number of labels.
Some MPLS applications actually need more than one label in the label stack to forward the labeled packets. Two examples of such MPLS applications are MPLS VPN and AToM.
Encoding of MPLS
The label stack sits in front of the Layer 3 packet that is, before the header of the transported protocol, but after the Layer 2 header. Often, the MPLS label stack is called the shim header because of its placement.
Assuming that the transported protocol is IPv4, and the encapsulation of a link is PPP, the label stack is present after the PPP header but before the IPv4 header.
Because the label stack in the Layer 2 frame is placed before the Layer 3 header or other transported protocol, you must have new values for the Data link Layer protocol Field, indicating that what follows the Layer 2 header is an MPLS labeled packet.
The data link layer protocol field is a value indication what payload type the layer 2 frame is carrying.
MPLS Protocol identifier values for layer 2 encapsulation types.
- PPP - PPP protocol field - 0281
- Ethernet/802.3 LLC/SNAP encapsulation - Ethertype Value 8847
- HDCL - Protocol - 8847
- Frame Relay - NLPID (Network level protocol ID) - 80
MPLS and the OSI reference Model.
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. Therefore, MPLS does not fit in the OSI layering too well. The easiest thing to do is to view MPLS as the 2.5 layer and be done with it.
Label Switch Router.
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: Intermidiate 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.
It must be able to pop one or more labels (remove one or more labels from the top of the label stack) before switching the packet out.
An LSR must also be able to push one or more labels onto the received packet. If the received packet is already labeled, the LSR pushes one or more labels onto the label stack and switches out the packet. If the packet is not labeled yet, the LSR creates a label stack and pushes it onto the packet.
An LSR must also be able to swap a label. This simply means that when a labeled packet is received, the top label of the label stack is swapped with a new label and the packet is switched on the outgoing data link.
An LSR that pushes labels onto a packet that was not labeled yet is called imposing LSR because it is the first LSR to impose labels onto the packet.
An LSR that removes all labels form the labeled packet before switching out the pakcet is a disposing LSR.
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.
The first LSR of an LSP is the ingress LSR for that LSP, whereas the last LSR of the LSP is the egress LSR. All the LSRs in between the ingress and egress LSRs are the intermediate LSRs.
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 case would be a nested LSP, that is an LSP inside another LSP. A backup traffic engineering (TE) tunnel is an example of such a nested 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. All 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; the forwarding treatment could be different, and they culd belong to a different FEC.
The router that decides which packets belong to which FEC is the ingress LSR.
FECs examples:
- Packets with Layer 3 destination IP addresses matching a certain prefix.
- Multicast packets belonging to a certain group.
- Packet with the same forwarding treatment, Based on the precedence or IP DiffServ Code Point (DSCP) field.
- Layer 2 frames carried across an MPLS network received on one VC or (Sub) interface on the ingress LSR and transmitted on one VC or (Sub)interface on the egress LSR.
- Packets with Layer 3 destination IP addresses that belong to a set of BGP prefixes, all with the same BGP next hop.
Label Distribution
You need a mechanism to tell the routers which labels to use when forwarding a packet. Labels are local to each pair of adjacent routers. 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 need to match which incoming label. A label distribution protocol is needed.
You can distribute labels in two ways:
- Piggyback the labels on an existing IP routing protocol.
- Have a separate protocol distribute labels.
Piggyback the labels on an Existing IP routing Protocol.
The big advantage of having the routing protocol carry the labels is that the routing and label distribution are always in sync, which means that you cannot have a label if the prefix is missing or vice versa. It also eliminates the need of another protocol running on the LSR to do the label distribution.
The implementation for distance vector routing protocols (Such as EIGRP) is straightforward , because each router originates a prefix from its routing table. The router then just binds a label to that prefix.
Link state routing protocols (IS-IS and OSPF) do not function in this way. Each router originates link state updates that are then foprwardied unchanged by all routers inside one area. The problem is that for MPLS to work, each router needs to distribute a label for each IGP prefix even the routers that are not originators of that prefix. Link state routing protocols need to be enhanced in an intrisuve way to be able to do this. Therefore, for link state routing protocols, a separate protocol is preferred to distribute the labels.
BGP is a routing protocol that can carry prefices and distribute labels at the same time. BGP is used primarily for label distribution in MPLS VPN networks.
Running a Separate Protocol for Label Distribution.
Has the advantage of being routing protocol independent. the disadvantage of this mehotd is that a new protocol is needed on the LSRs.
The choice of all router vendors was to have a new label distribution protocol distribute the labels for IGP prefixes. this is label distribution protocol (LDP).
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. LDP and TDP are similar in the way they operate , but LDP has more functionality than TDP.
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 bingin because it usually has more than one adjacent LSR.
Out of all the remote bindings for one prefix, the LSR needs to pick only one and use that one to determine the outgoing label for that IP prefix. The routing table determines what the next hop of the IPv4 prefix is. 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.Therefore, when an LSR receives a labeled packet it is now capable of swapping the incoming label it assigned , with the outgoing label assigned by the adjacent next-hop LSR.
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.
MPLS Payload
The MPLS label has no Network Level Protocol Identifier field. This field is present in all Layer 2 frames to indicate what the Layer 3 protocol is.
Intermediate LSRs do not need to know what the MPLS payload is because all the information eeded to switch the packet is known by looking at the top label only. For the forwarding based on the top abel to be correct, the intermediate LSR must have a local and remote binding for the top label.
An Egress LSR that is removing all labels on top of the packet must know what the MPLS payload is, because it must forward the MPLS payload further on.
That egress LSR is the one that made the local binding, which means that that LSR assigned a local label to that FEC, and it is taht label that is used as an incoming label on the packet. Therefore, the egress LSR knows what the MPLS payload is by looking at the label, because it is the egress LSR that created the label binding for that FEC, and i knows what that FEC is.
MPLS label spaces
- If per interface label is used, the packet is not forwarded solely based on the label, but based on both the incoming interface and the label.
- The other possibility is that the label is not unique per interface, but over the LSR assigning the label. This is called per-platform label space.
- If per-platform label space is used, the packet is forwarded solely based on the label, independently from the incoming interface.
In cisco IOS, all Label Switching Controlled-ATM (LC-ATM) interfaces have a per-interface label space, whereas all ATM frame-based and non-ATM interfaces have a per-platform label space.
Different MPLS modes.
- Label Distribution mode
- Label retention mode
- LSP control Mode.
Label Distribution Modes.
The MPLS architecture has two modes to distribute label bindings
- Downstream-on-Demand (DoD) label distribution mode.
- Unsolicited Downstream (UD) label distribution mode.
In the DoD mode, each LSR request its next-hop (that is, downstream) LSR on an LSP, a label binding for that FEC. Each LSR receives one binding per FEC only from its downstream LSR on that FEC.
In the UD mode, each LSR distributes a binding to its adjacent LSRs, without those LSRs requesting a label. In the UD mode, an LSR receives a remote label binding drom each adjacent LSR.
In Cisco IOS, all interfaces except LC-ATM interfaces use the UD label distribution mode. all LC-ATM use the DoD label distribution mode.
Label Retention Modes
- Liberal Label Retention (LLR) mode.
- Conservative Label Retention (CLR) mode.
In LLR mode, an LSR keeps all received remote bindings in the LIB. One of these bindings is the remote binding received from the downstream or next hop for that FEC. The label from that remote binding is used in the LFIB, but none of the labels from the other remote bindings are put int he LFIB; therefore, not all are used to forward packets.
At any time, the routing topology can change, for example due to a link going down or a router being removed. the next hop router for a particular FEC can change. At that time, the label for the new next-hop router is already n the LIB and the LFIB can be quickly updated with the new outgoing label.
In CLR mode an LSR that is running this mode does not store all remote bindings in the LIB, but it stores only the remore bindings that is associated with the next-hop LSR for a particular FEC.
LLR mode gives you quicker adaptation to routing changes, whereas CLR mode gives you fewer labels to store and a better usage of the available memory on the router.
In cisco IOS , the retention mode for LC-ATM interfaces is the CLR mode. LLR mode for all other types of interfaces.
LSP control Modes
- Independent LSP control mode
- Ordered LSP control Mode.
The LSR can create a local binding for a FEC independently from the other LSRs. This is called Independent LSP control Mode. In this control mode, each LSR creates a local binding for a particular FEC as soon as it recognizes the FEC. Usually, this means that the prefix for the FEC is in its routing table.
In ordered LSP Control Mode, an LSR only creates a local binding for a FEC if it recognizes that it is the egress LSR for the FEC or if the LSR has received a label binding from the next hop for this FEC.
Cisco IOS uses Independent LSP control mode. ATM switches runn ing IOS use Ordered LSP control mode by default.
No comments:
Post a Comment