MPLS FUNDAMENTALS DINESH BHATT Manager MPLS 1 Prerequisites
MPLS FUNDAMENTALS DINESH BHATT Manager (MPLS) 1
Pre-requisites knowledge for understanding MPLS OSI & TCP/IP layered architecture TCP/IP protocol suite Switch, Router & various protocols they support IP addressing & routing methodology 2
TCP/IP and OSI Model TCP/IP has simple hierarchical design & clear corresponding relations with OSI reference model is as below 7 Application layer 6 Presentation layer 5 Session layer 4 Transport layer 3 Network layer 2 Data link layer 1 Physical layer OSI reference model Application layer Transport layer Internet layer Network Interface Physical layer TCP/IP 3
IP Addressing & Network Mask 32 bits Dotted Decimal Network 255 Maximum Host 255 32 172 IP Add. 128 64 32 16 8 4 2 1 11111111 128 64 32 16 8 4 2 1 Binary 16 122 204 Example 10101100 00010000 01111010 1100 Binary 255 1111 255 1111 0 00000000 Also written as “/16” where 16 represents the number of 1 s in the mask. Hence the network of the above IP Add is 172. 16. 0. 0. /16 4
TCP/IP Protocol Stack Application Layer HTTP, Telnet, FTP, TFTP, Ping, etc TCP/UDP Transport Layer Internet Layer Network Interface Layer Physical Layer IP Routing protocols Provide application program network interfaces Establish terminal to terminal connection ICMP ARP/RARP Ethernet, 802. 3, PPP, HDLC, FR, etc Interfaces and wires/cables Addressing and route selecting Physical media access Binary data flow transmission 5
Hub, Switches Routers Ethernet Hub 10 All nodes share 10 Mbps Switched Ethernet Switch Backbone Each node has 10 Mbps Router 10 One device sending at a time. Hub works at layer 1 Multiple devices sending at the same time. Switch uses MAC address (L 2) to filter the network. They do not look at the Network layer header and hence faster (LAN) Router works at Layer 3, i. e. Network layer, uses IP addresses for facilitating communications amongst the switches or WAN communications ( for which it 6 is connected to other Router)
MPLS- Definition • • It stands for Multi-Protocol Label Switching. It is the technique that provides virtual path capability to packet(label) switches. It aim is to avoid some drawbacks of both circuit switching and packet switching and to increase the utilization of bandwidth. MPLS is basically deployed to manage the traffic within the ISP. It combines the benefits of both Circuit switching and packet switching. It uses Circuit switching within ISP. and IP based packet switching within ISPs. The general idea behind MPLS is to attach a discrete set of labels to IP packets to perform a specific function, without forcing routers and switches to dive into IP addresses or other information in each packet to obtain instructions relating to that particular function. It efficiently enables Traffic Engineering & quality of service in networks. 7
MPLS and ISO model IETF main goal is that when a layer is added, no modification is needed on the existing layers. All new protocol must be backward compatible 7 to 5 Applications TCP PPP UDP IP MPLS Frame 4 3 ATM (*) 2 Physical (Optical - Electrical) 1 FR Relay 8
MPLS Advantages 1. MPLS provides all the required convergence of all type of networks be it IP-network, Next Generation network or our traditional legacy (TDM) network. 2. By collapsing multiple existing backbone service delivery platform into a single MPLS enable backbone –CONVERGENCE can be achieved. 3. Reduces Cap. Ex & Op. Ex by reduction of number of network element. 4. Increase relaibility. 5. Seamless Inter-works & Inter-operate with other N/W’s. 6. IP Rich services can be deployed with minimal Cap. Ex and faster way. 7. Provides VPN (L 3 & L 2 intranet, extranet), IPsec, internet. 9
MPLS: Multi Protocol Label Switching, a Layer 2+ switching, is a versatile solution to address the problems faced by present day Network- Speed, Scalability, Quality of Services(Qo. S) & Traffic engineering In conventional packet forwarding every router opens the IP datagram and looks at IP header to find out destination IP address and then with the help of its routing table takes independent decision to forward the packet. Handling a bulky IP header and then reconstructing it before forwarding to next router compromises with the speed of entire operation. This operation takes place at layer-3. Unlike conventional forwarding of IP packets, MPLS classifies each packet and attaches a small label with IP datagram at the ingress point of MPLS network. subsequent, routers only look at the label and route the packet after swapping the label with new one. Developed to integrate IP and ATM & Layer-2 protocols (e. g. Ethernet, ATM, PPP, Frame Relay etc. ). Packet forwarding is done based on Labels. Support multiple Layer-3 protocols, such as IP, IPv 6, IPX, SNA, OSPF , BGP, static , RIP etc. 10
MPLS Elements / Terms. . . LER - Label Edge Router ( PE- Provider Edge) LSR - Label Switch Router (P- Provider or Core Router) FEC - Forward Equivalence Class Label - Associates a packet to a FEC Label Stack - Multiple labels containing information on how a packet is forwarded. Shim - Header containing a Label Stack Label Switch Path - path that a packet follows for a specific FEC LDP - Label Distribution Protocol, used to distribute Label information between MPLS-aware network devices Label Swapping - manipulation of labels to forward packets towards the destination. 11
Origin: To Integrate IP with ATM IP MPLS Connectionless control plane Connectionless forwarding plane Connection-oriented forwarding plane ATM Connection-oriented control plane Connection-oriented forwarding plane 12
Connection-oriented Features S 2 1 S 6 1 S 2 S 6 1 S 8 S 3 S 1 S 5 S 8 VC S 5 2 S 3 2 S 4 S 7 Connectionless: packet route connection-oriented: cell switching • Path 1 = S 1, S 2, S 6, S 8 VC = S 1, S 4, S 7, S 8 • Path 2 = S 1, S 4, S 7, S 8 • • The data reach their destination out of order along different paths The data reach their destination in order along the same connection • Fixed time delay, easy to control • Connection types: PVC SVC 13
Traditional IP Forwarding Parse IP header mapped to next hop IP header is parse at each hop, resulting in low efficiency. q It is hard to deploy Qo. S and the efficiency is rather low. q All routers are expected to know all routes in the entire network. q 14
Basic Working Process of MPLS Core LSR Edge LSR IP IP Traditional IP forwarding L 1 IP L 2 Label forwarding IP L 3 IP Traditional IP forwarding 15
Basic MPLS Concepts LER IP LER LSR MPLS domain LSR LER LSP MPLS LSR LER LSR: Label Switch Router LER: Label Edge Router LSP: Label Switch Path 16
FEC Classification • A packet can be mapped to a particular FEC based on the following criteria: • destination IP address, • source IP address, • TCP/UDP port, • in case of inter AS-MPLS, Source-AS and Dest-AS, • class of service, • application used, • … • any combination of the previous criteria. Ingress Label 6 FEC Egress Label 138. 120. 6/24 - xxxx 9 • FECs are manually initiated by the operator • A FEC is associated with at least one Label Ingress Label FEC Attribute Egress Label 6 138. 120. 6/24 - xxxx A 9 6 138. 120. 6/24 - xxxx B 12 17
MPLS Encapsulation Format and Label 0 20 23 24 31 Label Layer 2 header q EXP MPLS header IP header S 32 bits TTL Data Two types of MPLS encapsulation for ATM and FR: ¦ shim encapsulation: similar to other link layers ¦ Cell mode: VC (VPI/VCI for ATM, DLCI for FR) is directly used as the label Label : Exp : S: TTL : Label value Experimental Use ( Class of Service) Bottom of Stack (set to 1 for the last entry in the label) Time To Live 18
MPLS TTL Processing Regard the entire MPLS domain as one hop IP TTL -MPLS TTL= 255 MPLS TTL -- Ingress LER LSR IP TTL -- Egress LER Include MPLS TTL in IP TTL -MPLS TTL=IP TTL Ingress LER MPLS TTL -- MPLS TTL -IP TTL=MPLS TTL LSR Egress LER 19
Label Position in Packet Ethernet /SONET /SDH packet Frame mode ATM packet Cell mode ATM packet Ethernet header /PPP header ATM header VPI/VCI Label Layer-3 data 20
Label Stack Layer 2 header MPLS header IP header Data Theoretically, label stack enables limitless nesting to provide infinite service support. This is simply the greatest advantage of MPLS technology. 21
Label Switched Path Ingress Interface Label 1 5 Ingress Interface Label FEC Egress Interface Label 138. 120 3 1 12 FEC Egress Interface Label 138. 120 4 x 12 MPLS switch 3 1 4 138. 120 1 127. 20 2 MPLS switch 1 3 2 3 1 MPLS switch 192. 168 2 MPLS switch Ingress Interface Label 1 x FEC Egress Interface Label 5 3 138. 120 22
Hop by Hop IP forwarding Ingress Interface Label 1 Default Ingress Interface Label FEC Egress Interface Label 3 None 1 MPLS switch 138. 1 3 1 2 20. 6. 1 1 2 0. 6. . 12 138 2 MPLS switch 2. 6. 1 0 127. 20 2 1. 1 1338 138. 120. 6. 12 ? ? Ingress Interface Label 1 x 1 ? ? 138. 1 20. 61. 1 2 2 3 4 None Default ? ? 2 Default FEC Egress Interface Label 4 x 138. 120. 6. 12 3 MPLS switch 192. 168 2 MPLS switch FEC Egress Interface Label None 3 Default 23
IP forwarding using LSP Ingress Interface Label 1 5 Ingress Interface Label FEC Egress Interface Label 3 138. 120 1 12 FEC Egress Interface Label 138. 120 1 138. 1 2. 6. 1 1 0. 12 MPLS switch 138 1 138. 120. 6. 12 x 12 MPLS switch 138. 120. 6. 123 127. 20 4 2 3 1 4 138. 120. 6. 12 3 2 20. 6. 1 2 MPLS switch 192. 168 2 MPLS switch Ingress Interface Label 1 x FEC Egress Interface Label 138. 120 July 29, 2000 TECON 2000 3 5 24 24
Basic Concepts of Label Forwarding q FEC (Forwarding Equivalence Class): Import the packets with identical characteristics into the same LSP q q q NHLFE (Next Hop Label Forwarding Entry): Describe label operations ¦ next hop ¦ label operation types: push/pop/swap/null ¦ Link layer encapsulation types FTN (FEC to NHLFE): Map FEC to NHLFE ILM (Incoming Label Map): Map MPLS label to NHLFE 25
Label Forwarding Stack label operation: pop Label operation: push Parse IP header FEC bound with LSP FTN->NHLFE A Ingress LER Label operation: swap ILM->NHLFE B C LSR ILM->NHLFE Parse IP header distribute FEC mapped to next hop D Egress LER q The traditional routing protocol and Label Distribution Protocol (LDP) serve to create routing table and label mapping table (FEC-Label mapping) in each LSR for FECs with service requirement, i. e. create LSP successfully. q Ingress LER receives a packet, determines the FEC that the packet belongs to, and label the packet q In MPLS domain, packets are forwarded in accordance with labels and label forwarding table via the forwarding unit q Egress LER removes the label and continues forwarding the packet 26
NHLFE A: NHLFE FEC next hop 10. 0. 1. 0/24 Transmitting interface E 1 B Label operation Others Add label L 1 … B: NHLFE Ingress label Next hop L 1 C Transmitting interface E 1 label operation Remove the previous label and add L 2 Others … C: NHLFE Ingress label Next hop L 2 D Transmitting interface E 1 Label operation Remove label Others … 27
Pop at Last Hop But One (PHP) Label operation: push Parse IP header FEC bound with LSP FTN->NHLFE Ingress LER Label operation: swap Label operation: pop ILM->NHLFE LSR Parse IP header Distribute FEC Mapped to next hop Egress LER The label at the outmost layer does not make any sense to the last hop. Thus, it is advisable to pop the label at the last hop but one to ease the burden of the last hop. If there is only one layer of label, the last hop will perform IP forwarding directly; otherwise, it will perform the internal label forwarding. 28
Creating LSP q q LSP drive modes: ¦ Driven by stream: incoming packets drive LSP creation ¦ Driven by topology: topology information (route) drives LSP creation ¦ Driven by application: application (like Qo. S) drives LSP creation Signaling protocol is used to distribute labels between LSRs and establish LSP: ¦ LDP: Label Distribution Protocol ¦ CR-LDP: Constrained Route LDP ¦ RSVP-TE ¦ MP-BGP ¦ PIM 29
Several Issues Concerning Label Distribution Label allocation mode q q q ¦ Do. D : downstream-on-demand ¦ DU: downstream unsolicited Label control mode ¦ Ordered ¦ Independent Label hold mode ¦ Conservative retention mode : upon receiving a label, if there is no route destined for the corresponding FEC, hold the label for later use ¦ Liberal mode: upon receiving a label, if there is no route destined for corresponding FEC, discard the label 30
Label Allocation Mode: Do. D Route triggering Label 18 is 分配到 171. 68. 10/24 allocated to 的标签为 18 171. 68. 10/24 分配到 171. 68. 10/24 Label 20 is allocated to 171. 68. 10/24 的标签为 20 171. 68. 40/24 Upstream 171. 68. 10/24 LSR 1 LSR 2 LSR 3 Downstream 请求到目的地址 Requesting labels destined for 171. 68. 10/24 的标签 The upstream LSR sends a label request (containing FEC description information) to the downstream LSR. The downstream LSR allocates a label to this FEC and feeds back the bound label to the upstream LSR via the label mapping message. 31
Label Allocation Mode: DU Route triggering Upstream 171. 68. 40/24 Label 18 can be used to reach 171. 68. 10/24 到 171. 68. 10/24 Label 20 can be used to reach 171. 68. 10/24 可以使用标签 20 Downstream 171. 68. 10/24 Once the LDP session is set up successfully, the downstream LSR will initiatively advertise the label mapping message to its upstream LSR. The upstream router will save the label in the label mapping table. 32
Label Control Mode: Ordered Not until it receives a label mapping message from its downstream LSP will it send the message upstream DOD+ Ordered Upstream Downstream DU+ Ordered Upstream Downstream 33
Label Control Mode: Independent Whether it receives a label mapping message from its downstream LSR, it will send upstream a label mapping message immediately. DOD+ independent Upstream Downstream DU+ independent Upstream Downstream 34
Label Retention: Conservative Retention Mode An LSR stores only the labels received from next-hop LSRs; all other labels are ignored. mapping label 20 mapping label 30 LSR 2 LSR 1 mapping label 16 172. 16. 2/24 LSR 3 LSR 4 mapping label 17 Drop LSR 5 35
Label Retention: Liberal Retention Mode Every LSR stores the received label in its LIB, even when the label is not received from a next-hop LSR. mapping label 20 mapping label 30 LSR 2 LSR 1 mapping label 16 172. 16. 2/24 LSR 3 LSR 4 mapping label 17 store LSR 5 36
Common Collocation 2: DU + Ordered + Conservative Upstream Downstream A waste of label resources q Useless LSPs would be created q Label merge is required at branches q LSPs can be set up quickly and reliably q 37
Common Collocation 1: Do. D + Ordered + Liberal Upstream Downstream q It is relatively easy to control the use of labels and the creation of LSPs q ATM/FR frame mode can only use Do. D 38
Label Forwarding Table IN interface IN label Prefix/MASK OUT interface (next hop) OUT label Serial 0 50 10. 1. 1. 0/24 Eth 0(3. 3) 80 Serial 1 51 10. 1. 1. 0/24 Eth 0(3. 3) 80 Serial 1 62 70. 1. 2. 0/24 Eth 0(3. 3) 52 Serial 1 52 20. 1. 2. 0/24 Eth 1(4. 4) 52 Serial 2 77 30. 1. 2. 0/24 Serial 3(5. 5) 3(pop) q The “in” and “out” is correspond to the label swap,not the label distribution. ¦ The in label is that I distribute to the others, I will not put it to the packet ¦ The out label is the others distribute to me, I will put it to the packet 39
LSP Loop Detection Path looping shall be avoided even in setting up LSP within the MPLS domain. LSP path looping can be avoided in two ways: n Maximum hop number; n Path vector 40
Basic Concepts of LDP is a MPLS control and signaling protocol Main functions: n Release Label-FEC mapping n Create and maintain label switching path LDP serves to distribute and maintain label mapping messages between peers in the form of message. LDP uses the TCP transmission service. 41
LDP Message Types Discovery message: Used to discover LDP adjacencies in the network Session message: Used to set up, maintain and terminate a session between LDP peers Distribution message: Used to create, change and delete label mappings related to FEC Notification message: Used to provide recommendation or error notification information 42
LDP Message Switching UDP-Hello Discovery stage UDP-Hello TCP connection establishment Session creation and maintenance Session initialization Label request LSP creation and maintenance FEC Label mapping 43
Basic MPLS Configurations (1) Designate ID for LSR It is necessary to configure the LSR with an ID before configuring other MPLS commands. The ID is generally in the format of IP address, and shall be unique within the domain. mpls lsr-id X. X Note: make configurations in the system view. Activate/deactivate the LDP or enter the LDP view To configure LDP, first activate the LDP and enter the LDP view mpls ldp Note: make configurations in the system view 44
Basic MPLS Configurations (2) Enable interface LDP mpls ldp enable Note: make configurations in the interface view LDP loop detection control n Enable loop detection Loop-detect n Set the maximum hot number for loop detection hops-count hop-number n Set the maximum value for the path vector path-vectors pv-number Note: make configurations in the LDP view 45
MPLS Debugging MPLS display commands n Display information about LDP and LSR display mpls ldp n Display information about LDP-enabled interface display mpls ldp interface n Display information about all LSPs established in the public network display mpls lsp 46
Configuration Example Suppose a network consists of four NE routers, where Router B is connected to Router C via SDH, while Router B is connected to Router A and Router D via Ethernet. The four routers all support MPLS. LSP can be set up between any two routers. The operational routing protocol is OSPF Router B ethernet 1/0/0 168. 1. 1. 2 pos 2/0/1 ethernet 8/0/0 100. 168. 1. 1. 1 1. 2 Router A ethernet 1/0/1 Router D 172. 17. 1. 1 ethernet 2/0/1 172. 17. 1. 2 Router C is configured with: [Quidway] interface pos 7/0/0 [Quidway-Pos 7/0/0] ip address 100. 10. 1. 1 255. 0 q Configuration procedure [Quidway] router id 172. 16. 1. 2 [Quidway] ospf ¦ Configure ip address for the Router C [Quidway-ospf] area 0 interface [Quidway-ospf-area-0. 0] network 100. 1. 0 ¦ Configure the ospf protocol 0. 0. 0. 255 [Quidway] mpls lsr-id 172. 16. 1. 2 ¦ Configure the MPLS LDP [Quidway] mpls ldp [Quidway-Pos 7/0/0] mpls ldp enable ip route-static 171. 68. 0. 0 255. 0. 0 Serial 0 ip route-static vpn-instance VPN-A 0. 0 192. 168. 1. 1 public 47
TRAFFIC ENGINEERING 48
QUALITY OF SERVICE
MPLS VPN Network Structure VPN_A i. BGP sessions 10. 2. 0. 0 CE CE VPN_B 10. 2. 0. 0 CE PE P P 11. 5. 0. 0 VPN_A PE CE 10. 1. 0. 0 VPN_A 11. 6. 0. 0 VPN_B CE PE PE CE VPN_B 10. 3. 0. 0 10. 1. 0. 0 CE l CE (Custom Edge): The user equipment directly connected with the service provider. l PE (Provider Edge Router): The edge router on the backbone network, connected with CE and mainly responsible for access of the VPN service. l P (Provider Router): The core router on the backbone network, mainly responsible for the routing and fast forwarding functions. 50
CR-LDP and RSVP-TE are both signaling mechanisms used to support Traffic Engineering across an MPLS backbone. RSVP is a Qo. S signaling protocol that is an IETF standard and has existed for quite some time. RSVP-TE extends RSVP to support label distribution and explicit routing while CR-LDP proposed to extend LDP (designed for hop-by-hop label distribution to support Qo. S signaling and explicit routing). MPLS Traffic Engineering tunnels are not limited to IP route selection procedures and thus will spread network traffic more uniformly across the backbone taking advantage of all available links. A signaling protocol is required to set up these explicit MPLS routes or tunnels. There are many similarities between CR-LSP and RSVP-TE for constraintbased routing. The Explicit Route Objects that are used are extremely similar. Both protocols use ordered Label Switched Path (LSP) setup procedures. Both protocols include some Qo. S information in the signaling messages to enable resource allocation and LSP establishment to take place automatically. At the present time CD-LDP development has ended and RSVP-TE has emerged as the "winner" for traffic engineering protocols. 51
VPNv 4 and IPv 4 Address Families VPNV 4 address structure: Route Distinguisher (8 bytes) IPv 4 address To enable different VPNs to use the same address space, a new address family, i. e. VPNv 4, is introduced. The original standard address family is called IPv 4. VPNv 4 address family mainly serves to transfer VPN routes between PE routers. RD is unique among different VPNs. If two VPNs use the same IP address, PE router will add different RDs for them and convert the address into a unique VPN-v 4 address without causing conflict of the address space. The standard route received by PE from CE is the IPv 4 route. To import VRF routing tables and distribute them to other routers, a RD is needed. It is suggested that the RDs of the same VPN be configured the same. 52
MPLS/VPN RD RD structure: TYPE (2 - Administrator Field Assigned Number Field byte) 2 -byte ASN RD format: 1 4 -byte IP address 4 -byte assigned number 2 -byte assigned number n 16 -bit Autonomous System Number (ASN): 32 -bit user-defined number, e. g. 100: 1 n 32 -bit IP address: 16 -bit customized number, e. g. 172. 1. 1. 1: 1 Usually, each site is assigned with a unique RD, which is the identifier of VRF. Difference between the routing table of public network and the routing table of private network: n n The routing table of public network is generated by the IGP routes, which may include the BGP-4 (IPv 4) route, but not the VPN route. VRF routing table includes the specific VPN routes. It may include the routes redistributed from MP-i. BGP route to VRF, or the route obtained from CE by the vrf route instance. 53
VRF- VPN Routing & Forwarding VRF can be regarded as a virtual router structured as follows: n It is associated with some interfaces and has a forwarding table based on these interfaces. n A set of rules is available to control import of the route into VPN or export of the route from VPN. n The route can be redistributed to the routing table (static route, RIP instance, BGP) via some routing protocols. n VRF is configured on PE and exchange the route with CE. The route independently exists in the VRF routing table (routing table of the private network). PE maintains a separate forwarding table for each site. Each site has a unique VRF. If (and only if) two sites have identical forwarding table, they share a VRF. The interface/sub-interface connected with CE is mapped to VRF. The routes in VRF will be distributed to the sites (usually connected on other PEs) belonging to the same VPN. 54
Distribution of VRF Routes P Router CE Router Site l PE PE MP-i. BGP CE Router Site The PE router distributes the local VPN route information via the MPLS/VPN backbone network. l The transmitting PE exports the local VRF routes via MP-i. BGP (with the export-target attribute). l The receiving PE imports the route to the VRF where it belongs (with the matched import-target attribute). 55
Basic Intranet Model VPN A SITE -1 MPLS/VPN Backbone Site-1 & Site-2 routes RT=VPN -A MP-i. BGP VPN A Site-3 & Site-4 routes RT=VPN -A SITE -3 P Router SITE -2 VPN A Site-1 routes Site-2 routes Site-3 routes Site-4 routes Site-1 routes Site-2 routes Site-3 routes Site-4 routes SITE -4 VPN A 56
MPLS/VPN Packet Forwarding-1 In Label - FEC Out Label 197. 26. 15. 1/32 VPN-A VRF 149. 27. 2. 0/24, NH=197. 26. 15. 1 Label=(28) PE-1 41 Beijing 149. 27. 2. 0/24 41 28 149. 27. 2. 27 Shanghai When the ingress PE receives an ordinary IP packet from CE, PE adds it to the corresponding VPN forwarding table based on the VRF to which the ingress interface belongs, and searches for the next hop and label. 57
MPLS/VPN Packet Forwarding-2 In Label 28(V) FEC 149. 27. 2. 0/24 VPN-A VRF 149. 27. 2. 0/24, NH=beijign Out Label - In Label FEC Out Label 41 197. 26. 15. 1/32 POP VPN-A VRF 149. 27. 2. 0/24, NH=197. 26. 15. 1 Label=(28) PE-1 149. 27. 2. 27 28 149. 27. 2. 27 41 28 Beijing 149. 27. 2. 0/24 l 149. 27. 2. 27 Shanghai The second last hop router pops up the external layer label and sends it to the egress PE according to the next hop. l The egress PE router judges the CE that the packet will go to based on the internal layer label. l Pop up the internal layer label and forward the packet to the destination CE as an ordinary IP packet. 58
59
- Slides: 59