Introduction to MPLS

This module explains the basic concepts related to Multiprotocol Label Switching and describes how to configure it on Cisco Smart Switches.

Feature history for Multiprotocol Label Switching

This table provides release and platform support information for the features explained in this module.

These features are available in all the releases subsequent to the one they were introduced in, unless noted otherwise.

Release

Feature name and description

Supported platform

Cisco IOS XE 17.18.2

Multiprotocol Label Switching

Cisco C9350 Series Smart Switches

Cisco C9610 Series Smart Switches

Multiprotocol Label Switching

A Multiprotocol Label Switching (MPLS) system is a high-performance packet forwarding technology that

  • combines the performance and capabilities of Layer 2 (data link layer) switching with the scalability and flexibility of Layer 3 (network layer) routing

  • optimizes transit by using labels instead of analyzing full headers at each switch, and

  • supports all Layer 3 protocols, allowing for scalability far beyond traditional networks.

Label switching is a packet forwarding technique that

  • analyzes the Layer 3 packet header once at the edge

  • assigns a fixed-length label for forwarding, and

  • enables rapid, simple forwarding decisions at each network node.

Multiple different headers can map to the same label if they share the same forwarding path, grouping them into a forwarding equivalence class.

How label switching differs from conventional Layer 3 forwarding

Label switching differs from conventional Layer 3 forwarding in these aspects.

Label switching

Conventional Layer 3 forwarding

Analyzes the Layer 3 header only once at the network edge

Analyzes the Layer 3 header independently at each switch as the packet traverses the network

Maps the Layer 3 header to a fixed-length, unstructured label

Uses information from the Layer 3 header, often the destination address, for a routing table lookup at every hop

The initial label assignment may consider more than just the Layer 3 header, for example, routing policy

Forwarding decisions are typically based only on the Layer 3 header fields of the packet

Many different headers can map to the same label if they follow the same path, forwarding equivalence class (FEC)

Each header is handled individually, requiring repeated analysis and lookup at each switch

After labeling, forwarding decisions at each hop are based on the label, not the original packet header

Every switch examines the Layer 3 header of the packet and performs a potentially complex routing table lookup to decide the next hop

Swaps labels at each MPLS switch, and refers to the MPLS forwarding table for the next hop, allowing fast and simple forwarding

Header analysis and routing table lookup can be complex and must be repeated at every hop, leading to slower forwarding

Label bindings

Each label switching router (LSR) in the network makes an independent, local decision as to which label value to use to represent a forwarding equivalence class. This association is known as a label binding.

Each LSR informs its neighbors of the label bindings it has made. This awareness of label bindings by neighboring switches is facilitated by these protocols:

  • Label Distribution Protocol (LDP): enables peer LSRs in an MPLS network to exchange label binding information for supporting hop-by-hop forwarding in an MPLS network

  • Border Gateway Protocol (BGP): used to support MPLS virtual private networks (VPNs)

Benefits of Multiprotocol Label Switching

Multiprotocol Label Switching offers these benefits:

  • Enables the differentiation of services without requiring substantial changes to existing infrastructure

  • Helps address rapid growth in network utilization

  • Operates flexibly across any combination of Layer 2 technologies

Restrictions for Multiprotocol Label Switching

The support for Multiprotocol Label Switching is subjected to these restrictions:

  • Does not support MPLS fragmentation

  • Does not support MPLS maximum transmission unit (MTU) configuration. MPLS MTU value equals the IP MTU value of the port or switch, by default.

  • Supports only the default mode—per-VRF MPLS label allocation mode. However, the devices can inter-operate with remote peers operating in the per-prefix mode.

  • Does not support the ip unnumbered command in MPLS configuration

  • You cannot enable MPLS LDP on a Virtual Routing and Forwarding (VRF) interface.

How label switching works

Summary

The key components involved in the process are:

  • Ingress router: analyzes the Layer 3 packet header, assigns a label, and adds the label to the packet

  • Label switching routers (LSRs): swap labels and forward packets based on local label forwarding tables

  • Forwarding equivalence class: a set of packets treated identically for forwarding, represented by the same label

Label switching uses an ingress router to assign a fixed-length label to each packet, allowing label switching routers (LSRs) to forward packets quickly based on label lookups, all while grouping similar packets into forwarding equivalence classes.

Workflow

These stages describe how label switching works:

  1. The ingress router examines the Layer 3 header of an incoming packet and determines its forwarding equivalence class.
  2. The router assigns a label based on this analysis and attaches a label header to the packet.
  3. As the labeled packet traverses the MPLS network, each LSR uses the label to look up forwarding information, swaps the label as needed, and forwards the packet—without re-examining the original header. Forwarding decisions at subsequent hops can use routing policy, not just header contents.
  4. The process continues until the packet reaches its destination or exits the MPLS domain.

Result

Packets are forwarded efficiently through the network with minimal processing at each hop, resulting in higher performance and scalability compared to conventional Layer 3 forwarding.

Configure a switch for MPLS switching

Before you begin

Enable Cisco Express Forwarding (CEF) before you configure the switch for MPLS switching.

Procedure


Step 1

Enable Cisco Express Forwarding (CEF) on the switch.

Example:


Device#configure
Device(config)#ip cef distributed

Step 2

Configure the range of local labels available for use with MPLS applications on packet interfaces.

Example:


Device(config)#mpls label range 16 4096

Step 3

Specify the label distribution protocol for the platform.

Example:


Device(config)#mpls label protocol ldp
Device(config)#end

Step 4

Verify whether Cisco Express Forwarding configuration was successful.

Example:


Device# show ip cef summary

IPv4 CEF is enabled for distributed and running
VRF Default
 150 prefixes (149/1 fwd/non-fwd)
 Table id 0x0
 Database epoch:        4 (150 entries at this epoch)
Device#

Configure a switch for MPLS forwarding

Before you begin

Enable forwarding of IPv4 packets before you configure the switch for MPLS forwarding.

Procedure


Step 1

Enable MPLS forwarding of IPv4 packets along routed physical interfaces (Gigabit Ethernet), Switch Virtual Interface (SVI), or port channels.

Example:

For Gigabit Ethernet interface:


Device#configure terminal
Device(config)#interface TenGigabitEthernet 1/0/1
Device(config-if)#mpls ip

Example:

For SVI:


Device(config)#iinterface vlan 1000
Device(config-if)#mpls ip

Step 2

Specify the label distribution protocol for the interface.

Example:


Device(config-if)#mpls label protocol ldp
Device(config-if)#end

Note

 

You cannot enable MPLS LDP on a Virtual Routing and Forwarding (VRF) interface.

Step 3

Verify whether the MPLS forwarding configuration on the switch was successful.

  1. Verify the running configuration on the switch.

    Example:

    For Gigabit Ethernet interface:

    
    Device# show running-config interface TenGigabitEthernet 1/0/1
    
    Building configuration...
    
    Current configuration : 307 bytes
    !
    interface TenGigabitEthernet1/0/1
     no switchport
     ip address xx.xx.x.x xxx.xxx.xxx.x
     mpls ip
     mpls label protocol ldp
    end
    

    For SVI:

    
    
    Device# show running-config interface Vlan1000
    
    Building configuration...
    
    Current configuration : 187 bytes
    !
    interface Vlan1000
     ip address xx.xx.x.x xxx.xxx.xxx.x
     mpls ip
     mpls label protocol ldp
    end
    
  2. Verify MPLS interface details.

    Example:

    For Gigabit Ethernet interface:

    
    Device# show mpls interfaces detail
    Interface TenGigabitEthernet 1/0/1:
            Type Unknown
            IP labeling enabled
            LSP Tunnel labeling not enabled
            IP FRR labeling not enabled
            BGP labeling not enabled
            MPLS not operational
            MTU = 1500
    

    For SVI:

    
    Device# show mpls interfaces detail
    Interface Vlan100:
            Type Unknown
            IP labeling enabled (ldp) :
              Interface config
            LSP Tunnel labeling not enabled
            IP FRR labeling not enabled
            BGP labeling not enabled
            MPLS operational
            MTU = 1500
    

Step 4

Verify MPLS forwarding information on the switch.

Example:


For Gigabit Ethernet interface:
Device# show mpls forwarding-table 
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop    
Label      Label      or Tunnel Id     Switched      interface              
500        No Label   l2ckt(3)         0             Gi3/0/22   point2point 
501        No Label   l2ckt(1)         12310411816789 none       point2point 
502        No Label   l2ckt(2)         0             none       point2point 
503        566        15.15.15.15/32   0             Po5        192.1.1.2   
504        530        7.7.7.7/32       538728528     Po5        192.1.1.2   
505        573        6.6.6.10/32      0             Po5        192.1.1.2   
506        606        6.6.6.6/32       0             Po5        192.1.1.2   
507        explicit-n 1.1.1.1/32       0             Po5        192.1.1.2   
556        543        19.10.1.0/24     0             Po5        192.1.1.2   
567        568        20.1.1.0/24      0             Po5        192.1.1.2   
568        574        21.1.1.0/24      0             Po5        192.1.1.2   
574        No Label   213.1.1.0/24[V]  0             aggregate/vpn113 
575        No Label   213.1.2.0/24[V]  0             aggregate/vpn114 
576        No Label   213.1.3.0/24[V]  0             aggregate/vpn115 
577        No Label   213:1:1::/64     0             aggregate  
594        502        103.1.1.0/24     0             Po5        192.1.1.2   
595        509        31.1.1.0/24      0             Po5        192.1.1.2   
596        539        15.15.1.0/24     0             Po5        192.1.1.2   
597        550        14.14.1.0/24     0             Po5        192.1.1.2   
633        614        2.2.2.0/24       0             Po5        192.1.1.2   
634        577        90.90.90.90/32   873684        Po5        192.1.1.2   
635        608        154.1.1.0/24     0             Po5        192.1.1.2   
636        609        153.1.1.0/24     0             Po5        192.1.1.2   
Device# end