This chapter covers the background and configuration of frame mode Multiprotocol Label Switching (MPLS). The following common configurations and features are discussed:
- 10-1: Configuring Basic MPLS—MPLS is a high-performance packet forwarding technology that is based on Layer 2 switching instead of relying only on Layer 3 routing. Routers use labels added between the Layer 2 and Layer 3 headers for forwarding decisions.
- 10-2: MPLS Traffic Engineering—Service providers can use traffic engineering on MPLS-enabled routers to route a customer's network traffic based on throughput and delay. Tunnels are created for label switch paths (LSP) using the Resource Reservation Protocol (RSVP).
- 10-3: MPLS Virtual Private Networks (VPN)—MPLS VPNs have separate virtual routing and forwarding (VRF) instances for each customer in addition to a global routing table that is used to reach other routers in the provider network. Each VRF has a 64-bit route distinguisher (RD) to keep each customer's IP subnet separate from other routing and forwarding tables. BGP route target communities are used in exchanging route information between routers.
10-1 Configuring Basic MPLS
Multiprotocol Label Switching (MPLS) is a high-performance packet forwarding technology based on Layer 2 switching instead of Layer 3 routing. Routers are configured for MPLS forward frames based on labels instead of traditional Layer 3 IP unicast routing that performs Layer 3 lookups on the destination address at each hop. MPLS labels are inserted between the Layer 2 and Layer 3 headers and can be pushed (added), popped (removed), swapped, or aggregated (removing the top label and performing a Layer 3 lookup).
- MPLS is attractive to service providers because of its scalability and features. Providers can scale easier with MPLS than using Asynchronous Transfer Mode (ATM) or Frame Relay permanent virtual circuits (PVC). The traffic engineering features of MPLS enable providers to route traffic not just on a destination address but also on other factors such as bandwidth requirements and quality of service (QoS).
- A label switch router (LSR) is any router or switch that implements label distribution and can forward packets based on labels. An edge-LSR is any router that performs label imposition (push) or label disposition (pop). An ATM LSR is an ATM switch that can act as an LSR. With ATM LSRs, cell switching is used for the label forwarding table.
- MPLS-enabled routers communicate with each other using the Label Distribution Protocol (LDP). LSRs discover each other using hello packets, and peer relationships are maintained using keepalives. LSRs share label binding information with other LSRs. The label bindings build a forwarding equivalence class (FEC). A forwarding equivalence class is a group of IP packets forwarded in the same manner, over the same path, with the same forwarding treatment.
- Routers still rely on Layer 3 routing protocols for determining the path a packet should take. However, routing information, along with VPN, traffic engineering, and QoS information, is sent to the data plane to build a label forwarding information base (LFIB) for optimal forwarding performance.
Configuration
- (Required) Enable Cisco Express Forwarding (CEF):
(global) ip cef [distributed]
CEF must be enabled on all routers running MPLS and on interfaces receiving unlabeled IP packets. Core routers do not perform CEF switching but must have CEF enabled globally to exchange labels. Enter the distributed keyword if your router supports distributed CEF (dCEF). Use dCEF when you want your line cards (for example, VIP cards) to perform the express forwarding so that the route processor (RP) can handle routing protocols. - (Required) Start MPLS packet switching:
(global and interface) mpls ip
You must enable MPLS forwarding both globally and on the router interfaces for which you want to participate in MPLS forwarding. This command enables label switching of IPv4 packets according to normally routed paths. (Additional configuration is needed to support traffic engineering, QoS, and VPNs.) When this command is entered, Label Distribution Protocol (LDP) hello and keepalives are sent and received on the interfaces enabled for MPLS. - (Optional) Select the distribution protocol either globally or on a particular interface:
(global) mpls label protcol {ldp | tdp}
-or-(interface) mpls label protocol {ldp | tdp | both}
Starting with Cisco IOS Software Release 12.4(3), the default protocol changed from Cisco Tag Distribution Protocol (TDP) to the IETF LDP. When changing the protocol on an interface, you have the option of enabling both TDP and LDP. LSRs must run the same distribution protocol to establish a peer session and exchange label information. - (Optional) Manually configure the LDP identifier:
(global) mpls ldp router-id interface [force]
MPLS-enabled routers identify themselves in LDP messages using an identifier. By default, the identifier is the highest IP address of all loopback interfaces. If there are no loopback interfaces, the router uses the highest IP address of all active interfaces. You can manually configure the LDP identifier with this command. The router then uses whatever IP address is configured on the interface you specify. The IP address entered must be reachable by adjacent LSRs. A common symptom of having an unreachable LDP ID IP address is that the forwarding information base (FIB) is populated, but there is no information in the label information forwarding base (LFIB). By default, a router ID is not changed until the interface currently used for the router ID is shut down, the IP address on that interface changes or is removed, or the router is rebooted. You can use the force keyword to force the router to change the router ID. - (Optional) Enable the distribution of labels associated with the IP default route:
(global) mpls ip default-route
By default, Cisco routers will not distribute labels for the IP default route. Enter this command to enable dynamic switching of labels for a router's default route. - (Optional) Enable MD5 authentication between peers:
(global) mpls ldp neighbor ip-address password password-string
MD5 authentication can be configured to verify TCP communication between two LDP peers. Both peers must be configured to use the same password. - (Optional) Enable the MPLS LDP autoconfiguration feature for OSPF interfaces:
(router) mpls ldp autoconfig [area area-id]
Normally, you must enter the mpls ip command both globally and on each interface for which you want to send and receive LDP packets. This process might be time-consuming and prone to human errors when configuring a router with many interfaces. The autoconfiguration feature helps with these issues by automatically enabling LDP on every interface associated with an OSPF or IS-IS instance. Note that you still need to enable LDP globally. When configuring LDP autoconfiguration for OSPF, you can choose to only enable LDP for interfaces belonging to a particular area by entering the area keyword followed by the area number. - (Optional) Enable the MPLS LDP autoconfiguration feature for IS-IS interfaces:
(router) mpls ldp autoconfig [level-1 | level-2]
Like autoconfiguration for OSPF, you must first enter the global mpls ip command before you can allow the autoconfiguration feature. Optionally, you can allow autoconfiguration on interfaces configured for level-1 or level-2 routing by entering the level-1 or level-2 keywords, respectively.
Example
Figure 10-1 is used for this example. The three routers are configured for MPLS with manually configured LDP identifiers and MD5 peer authentication. Additionally, RouterB is configured for OSPF autoconfiguration for Area 0, and LDP is disabled on RouterA's FastEthernet0/0 interface.
Figure 10-1 Basic MPLS Configuration Example
RouterA hostname RouterA ! ip cef mpls ip mpls ldp router-id 1.1.1.1 mpls ldp neighbor 2.2.2.2 password C1sc0 ! interface fastethernet0/0 ip address 172.16.0.1 255.255.0.0 no mpls ip ! interface fastethernet0/1 ip address 172.17.0.1 255.255.0.0 mpls ip ! interface loopback 0 ip address 10.1.1.1 255.255.255.255 ! interface loopback 1 ip address 1.1.1.1 255.255.255.255 ! router ospf 1 router-id 10.1.1.1 network 172.16.0.0 0.0.255.255 area 0 network 172.17.0.0 0.0.255.255 area 0 network 10.1.1.1 0.0.0.0 area 0 network 1.1.1.1 0.0.0.0 area 0 RouterB hostname RouterB ! mpls ip mpls ldp router-id 2.2.2.2 mpls ldp neighbor 1.1.1.1 password C1sc0 mpls ldp neighbor 3.3.3.3 password C1sc0 ! interface fastethernet0/0 ip address 172.17.0.2 255.255.0.0 ! interface fastethernet0/1 ip address 172.18.0.1 255.255.0.0 ! interface loopback0 ip address 10.2.2.2 255.255.255.255 ! interface loopback1 ip address 2.2.2.2 255.255.255.255 ! router ospf 1 router-id 10.2.2.2 network 172.17.0.0 0.0.255.255 area 0 network 172.18.0.0 0.0.255.255 area 0 network 10.2.2.2 0.0.0.0 area 0 network 2.2.2.2 0.0.0.0 area 0 mpls ldp autoconfig area 0 RouterC hostname RouterC ! mpls ip mpls ldp router-id 3.3.3.3 mpls ldp neighbor 2.2.2.2 password C1sc0 ! interface fastethernet0/0 ip address 172.18.0.2 255.255.0.0 mpls ip ! interface fastethernet0/1 ip address 172.19.0.1 255.255.0.0 mpls ip ! interface loopback0 ip address 10.3.3.3 255.255.255.255 ! interface loopback1 ip address 3.3.3.3 255.255.255.255 ! router ospf 1 router-id 10.3.3.3 network 172.18.0.0 0.0.255.255 area 0 network 172.19.0.0 0.0.255.255 area 0 network 10.3.3.3 0.0.0.0 area 0 network 3.3.3.3 0.0.0.0 area 0