Multiprotocol Label Switching (MPLS) 中正大學資工系 黃仁竑 Outline Introduction Label Encoding Label Assignment Label Distribution Label Swapping Label Merging Conclusion 中正資工/黃仁竑 2 Introduction IETF Multiprotocol Label Switching Working Group created in 1997 Integrates the label swapping forwarding paradigm with network layer routing Use a short, fixed-length label Examples of MPLS Tag Switching (Cisco) 中正資工/黃仁竑 3 Why MPLS MPLS versus Datagram Routed Network Simplified forwarding Efficient explicit routing Traffic engineering QoS routing Complex mapping from IP packets to FEC (Forwarding Equivalence Class) MPLS versus ATM Scaling of the routing protocol Common operation over packet and cell media Easier management 中正資工/黃仁竑 4 Basics of MPLS Semantics assigned to a stream label Labels are associated with specific streams of data (FEC) Forwarding Methods Short fixed length labels to identify streams Looking up a label in a table, swapping labels, and possibly decreasing and checking a TTL May make direct use of layer 2 forwarding (e.g. ATM) Label Distribution Methods Allow nodes to determine which labels to use for specific streams May use some sort of control exchange, or be piggybacked on a routing protocol By LDP 中正資工/黃仁竑 5 Next Hop Label Forwarding Entry NHLFE is used when forwarding a labeled packet, it contains next hop operations replace the label at the top of the label stack with a new label pop the label stack replace and push one or more new labels data link encapsulation how to encode the label stack other information for properly dispose of the packet 中正資工/黃仁竑 6 Label Stack Label stack A labeled packet may carry a number of labels A Label A short fixed length significant identifier Based on the stream or forwarding equivalence class (FEC) Only have local significance Label encoding MPLS generic encapsulation mechanism ATM SVC, SVP, SVP multipoint encoding methods Others 中正資工/黃仁竑 7 Label Switched Path (LSP) Begins with an LSR (LSP Ingress) that pushes on a level m label Intermediate LSRs make their forwarding decision by label switching on a level m label Ends (LSP Egress) when forwarding decision is made by label switching on a level m-k label (k>0) or when a forwarding decision is made by nonMPLS forwarding procedures The label stack may be popped at the penultimate LSR of the LSP, rather than at the LSP Egress reduce times of label lookup at LSP egress 中正資工/黃仁竑 8 Label Encoding Generic MPLS encapsulation Between the data link layer and network layer headers Network layer protocol independent A label contains Label Stack A sequence of label stack entries Time-to-Live (TTL) Similar to what is provided by IP (e.g. traceroute) Class of Service (CoS) Allows multiple service classes within the same label 中正資工/黃仁竑 9 Label Stack Entry 0 20 Label Exp 23 S 31 TTL Label(20bits) carries the actual value of the label 0/2:IPv4/v6 Explicit NULL Label must be sole label stack entry (forward based on IPv4/v6) 1:Router Alert Label;(need software process) 3:Implicit NULL Label Exp(3bits):reserved S(1bits):Bottom of Stack TTL(8bits):Time to Live 中正資工/黃仁竑 10 Label Encoding ATM Switches as LSRs SVC Encoding Use the VPI/VCI field to encode the label Each LSP is realized as an ATM SVC ATM-LSR cannot perform PUSH or POP SVP Encoding VPI : Top of label stack VCI : Second label on the stack Permits the use of ATM VP switching can’t include a non-MPLS ATM network SVP Multipoint Encoding VPI : Top of label stack VCI : Part for the second label on the stack, the remainder to identify the LSP ingress Multipoint-to-point VPs 中正資工/黃仁竑 11 Label Assignment Topology driven (Tag) In response to normal processing of routing protocol control traffic Labels are pre-assigned; no label setup latency at forwarding time Request driven (RSVP) In response to normal processing of request based control traffic May require a large number of labels to be assigned Traffic driven (Ipsilon) The arrival of data at an LSR triggers label assignment and distribution Label setup latency; potential for packet reordering 中正資工/黃仁竑 12 Label Distribution Explicit Label Distribution Downstream label allocation label allocation is done by the downstream LSR most natural mechanism for unicast traffic Upstream label allocation label allocation is done by the upstream LSR may be used for optimality for some multicast traffic A unique label for an egress LSR within the MPLS domain Any stream to a particular MPLS egress node could use the label of that node. 中正資工/黃仁竑 13 Label Distribution Explicit Label Distribution Protocol (LDP) Reliability : by transport protocol (TCP) or as part of LDP Separate routing computation and label distribution Piggybacking on Other Control Messages Use existing routing/control protocol for distributing routing/control and label information OSPF, BGP, RSVP, PIM Combine routing and label distribution Label purge mechanisms By time out Exchange of MPLS control packets 中正資工/黃仁竑 14 Label Distribution Protocol LDP Peer: Two LSRs that exchange label/stream mapping information via LDP LDP messages Discovery messages announce and maintain the presence of LSR via UDP Session messages maintain session between LDP peers Advertisement message label operation (Label distribution) Notification message advisory information and signal error information Error notification:signal fatal errors Advisory notification: status of the LDP session or some previous message received from the peer. 中正資工/黃仁竑 15 Label Swapping Example : Forwarding a Labeled Packet Labeled Packet Map the incoming label to an next hop label, determines where to forward the packet Encodes the new label stack into the packet, and then forwards it Unlabeled Packet Incoming Label Map (ILM) Input Port Label 1 4 Output Port Label 2 6 Label Switching Router (LSR) L3 Header LSR analyzes the L3 header, to determine the packet’s stream Map the stream to a next hop, determines where to forward the packet Encodes the new label stack into the packet, and then forwards it L2 Header IP Router Module Label Dat H3 中正資工/黃仁竑 4 H2 Dat 1 H3 6 H2 2 16 Use of MPLS in a Hierarchy Swap L1 L4 OSPF R2 R1 L2 Push IN OUT IN OUT L2 L3 L3 L1 Swap OUT L1 R3 IN OUT L1 L4 R5 R6 R4 Pop L2 L3 L3 L1 L1 L1 L1 BGP L2 L1 Domain 1 中正資工/黃仁竑 Domain 2 17 Route Selection Hop by hop routing Like conventional IP routing Each hop makes independent choice of next hop Repair of a failed route done locally Explicit routing Manual or based on dynamic routing The LSP next hop is chosen by a single node Useful for policy routing and/or traffic engineering If an explicit route is specified for an LSP, then that route must be followed 中正資工/黃仁竑 18 Loop Handling Loop Survival minimizes the impact of loops Loop Detection allows loops to be set up, but detects them and eliminates them later Loop Prevention avoiding setting up a loop 中正資工/黃仁竑 19 Loop Survival Allow the network to operate well even though short term transient loops may be formed by the routing protocol Possible solutions Use of TTL to limit the hops that a packet traversed Use of dynamic routing protocol which converges fast looping packets may cause congestion which may then affect the converge speed of routing protocol Use of fair queueing to limit the impact of looping packets on normal packets 中正資工/黃仁竑 20 Loop Detection Loop may be set up, but will be subsequently detected. Possible solutions Loop Detection Control Protocol (LDCP) transmit LDCP packet when route change LDCP is forwarded towards destination until destination TTL exceeded return to a node which originally transmitted it Path Vector Control message: list of LSRs on the path hop count to each egress node (like RIP?) 中正資工/黃仁竑 21 Loop Prevention Ensure loops are never set up Possible solutions labels are propagated from the egress switch, control packets which propagate the labels also include the path diffusion mechanism when route changes colored mechanism a color consist of address of the node that created the color and a local id that is unique within the node a node that finds a change in the next hop creates a color and passes it to the new next hop stops when a loop or a loop free path is found explicit routing configured use routing protocol (link state or path vector) 中正資工/黃仁竑 22 Diffusion Algorithm On a route change, R ask N for a label and the associated LSR ID for that stream R looks in the LSR ID list If R is in the list (route loop), the old LSP will continue to be used until the route protocol break the loop If R is not in the list, R will start a diffusion computation Diffusion computation prunes tree of paths that would loop if R switches to new LSP When the diffusion completes, R switches to new LSP and discards old LSP 中正資工/黃仁竑 R New Path Old Path N E 23 Diffusion Computation An extension of Path Vector mechanism An LSR, D, detects the next hop for an FEC has changed, transmits a query message with a Path Vector containing its id to its upstream A LSR, U, that receives a query will determine if D is the next hop for the given FEC if not, then U return OK message if so, then U checks if the Path Vector already contains it id if yes, a loop is detected, U responds with a LOOP msg if not, U adds its id to the Path Vector and propagates the query message to its upstream neighbors 中正資工/黃仁竑 24 What to Do if a Loop is Detected If a loop is know to exist L2 label-swapped path is not setup Packet is forwarding using normal L3 forwarding Problems : Nodes which are not capable of L3 forwarding discard packet L2 forwarding faster than L3 forwarding node will not be capable of forwarding the same volume of traffic at l3, some packets will be discarded packet lost cause TCP to backoff, which will in turn reduce the load and allow the network to stabilize until the label binding is reestablished again. 中正資工/黃仁竑 25 Label Merging Label merging An LSR may want to bind multiple incoming labels to a particular FEC once packets are transmitted, the information that they arrived with different labels is not Non-merging LSRs In ATM, label merging may cause interleaving of cells from various packets MPLS support procedures which allow ATM switches to function as merging LSRs 中正資工/黃仁竑 26 Merge over ATM VP Merge (SVP multipoint encoding) Packet from different sources are distinguished by using different VCs within the VP Advantage : no new hardware Disadvantage : requires coordination of the VCI space VC Merge Switches are required to buffer cells from one packet until the entire packet is received Advantage : straightforward application of VC switching Disadvantage : New hardware (based on per-VC queuing) Delays at the merge points 中正資工/黃仁竑 27 Conclusion MPLS A more general forwarding mechanism Cooperates with routing/control protocol Provides Integrated service, Differentiated service Allows flow aggregation (FEC) for QoS routing Support Multicast? 中正資工/黃仁竑 28