Configuring MPLS Static

This chapter contains the following sections:

Information About MPLS Static Label Binding

Generally, label switching routers (LSRs) dynamically learn the labels that they should use to label-switch packets by means of label distribution protocols that include:
  • Label Distribution Protocol (LDP), the Internet Engineering Task Force (IETF) standard that is used to bind labels to network addresses

  • Resource Reservation Protocol (RSVP), which is used to distribute labels for traffic engineering (TE)

  • Border Gateway Protocol (BGP), which is used to distribute labels for Multiprotocol Label Switching (MPLS) Virtual Private Networks (VPNs)

To use a learned label to label-switch packets, an LSR installs the label into its Label Forwarding Information Base (LFIB).

The MPLS Static Labels feature provides the means to configure the following statically:
  • The binding between a label and an IPv4 or IPv6 prefix

  • The action corresponding to the binding between a label and an IPv4 or IPv6 prefix—Label swap or pop

  • The contents of an LFIB crossconnect entry

Label Swap and Pop

As a labeled packet traverses the MPLS domain, the outermost label of the label stack is examined at each hop. Depending on the contents of the label, a swap, or pop (dispose) operation is performed on the label stack. Forwarding decisions are made by performing a MPLS table lookup for the label carried in the packet header. The packet header does not need to be reevaluated during packet transit through the network. Because the label has a fixed length and is unstructured, the MPLS forwarding table lookup process is both straightforward and fast.

In a swap operation, the label is swapped with a new label, and the packet is forwarded to the next hop that is determined by the new label.

In a pop operation, the label is removed from the packet, which may reveal an inner label below. If the popped label was the last label on the label stack, the packet exits the MPLS domain. Typically, this process occurs at the egress LSR. A failure of the primary link in the aggregator configuration reroutes the MPLS traffic from the backup link and it is a swap operation.

Benefits

The following are the benefits of MPLS static label binding:
  • Static bindings between labels and IPv4 or IPv6 prefixes can be configured to support MPLS hop-by-hop forwarding through neighbor routers that do not implement LDP label distribution.

  • Static crossconnects can be configured to support MPLS Label Switched Path (LSP) midpoints when neighbor routers do not implement either the LDP or RSVP label distribution, but do implement an MPLS forwarding path.

Guidelines and Limitations for MPLS Static Label Binding

MPLS Static Label Binding has the following guidelines and limitations:

  • Adjacency statistics are not supported in Cisco Nexus 3000 Series switches.

  • ECMP is not supported with POP.

  • MPLS-IPv6 packets are forwarded if the ingress label matches to the IPv4 static configuration and vice versa.

  • The feature currently supports only 16 labels.

  • The MPLS static label binding feature is an enterprise license controlled feature.

  • When MPLS static is configured, the multi-hop recursive routes may not be properly installed. As a workaround, configure next-hop-self on iBGP neighbor configuration or make sure that the configuration has the route-reflector client with a route-map to set the NH.

Configuring MPLS Static

Enabling the MPLS Static Feature

You must globally install and enable the MPLS feature set and then enable the MPLS static feature before you can configure MPLS static labels. To run IPv4 static bindings, you must enable an interface with mpls ip static command. You can now configure MPLS using JSON/XML.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# [no] install feature-set mpls

Installs the MPLS feature set.

The no install feature-set mpls command uninstalls the MPLS feature set.

Step 3

switch(config)# [no] feature-set mpls

Enables the MPLS feature set.

The no feature-set mpls command disables the MPLS feature set.

Step 4

switch(config)# [no] feature mpls static

Enables the MPLS static feature.

The no feature mpls static command disables the MPLS static feature.

Step 5

(Optional) switch(config)# show feature-set

(Optional)

Displays the status of the MPLS feature-set.

Example

This example shows how to enable the MPLS static feature:

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# install feature-set mpls
switch(config)# feature-set mpls
switch(config)# feature mpls static
switch(config)# show feature-set
Feature Set Name      ID        State
--------------------  --------  --------
mpls                   4          enabled

switch(config)# sh feature | inc mpls_static
mpls_static 1 enabled 
#

Reserving Labels for Static Assignment

You can reserve the labels that are to be statically assigned so that they are not dynamically assigned.

Before you begin

Ensure that the MPLS Static feature is enabled.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# mpls label range min-value max-value [ static min-static-value max-static-value ]

Reserves a range of labels for static label assignment.

The range for the minimum and maximum values is from 16 to 471804.

Step 3

(Optional) switch(config)# show mpls label range

(Optional)

Displays information about the range of values for local labels, including those labels that are available for static assignments.

Step 4

(Optional) switch(config)# copy running-config startup-config

(Optional)

Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.

Example

This example shows how to reserve labels for static assignment:

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# mpls label range 17 99 static 100 10000
switch(config)# show mpls label range
Downstream Generic label region: Min/Max label: 17/99
Range for static labels: Min/Max Number: 100/10000
switch(config)#

Configuring MPLS Static Label and Prefix Binding using the Swap and Pop Operations

In a top-of-rack configuration, the outer label is swapped to the specified new label. The packet is forwarded to the next-hop address, which is auto-resolved by the new label.

In an aggregator configuration, the outer label is popped and the packet with the remaining label is forwarded to the next-hop address.

Procedure

  Command or Action Purpose
Step 1

switch# configure terminal

Enters global configuration mode.

Step 2

switch(config)# interface type slot/port

Enters the interface configuration mode for the specified interface.

Step 3

switch(config-if)# mpls ip static

Enables IP over MPLS statically on the specified interface.
Note 

The mpls ip static command needs to be enabled only on MPLS traffic ingress ports.

Step 4

switch(config-if)# mpls static configuration

Enters MPLS static global configuration mode.

Step 5

switch(config-mpls-static)# address-family {ipv4 | ipv6} unicast

Enters global address family configuration mode for the specified IPv4 or IPv6 address family.

Step 6

switch(config-mpls-static-af)# local-label local-label-value prefix destination-prefix destination-prefix-mask

Specifies static binding of incoming labels to IPv4 or IPv6 prefixes.

The local-label-value can range from 100 to 10000.

Step 7

switch(config-mpls-static-af-lbl)# next-hop {destination-ip-next-hop | auto-resolve | backup} out-label {output-label-value | explicit-null | implicit-null}

Sets the next-hop address according to the specified option:
  • destination-ip-next-hop specifies the next-hop destination IPv4 or IPv6 address

  • auto-resolve specifies that the next-hop address will be auto-resolved

  • backup specifies a static next-hop address, which is the backup path

The output label can be:
  • output-label-value specifies the value of the label and ranges from 16 to 1048575

  • explicit-null specifies that the output label is an IETF MPLS explicit null label

  • implicit-null specifies that the output label is an IETF MPLS implicit null label. Implicit-null signifies a pop operation.

Example

This example shows how to configure MPLS static label and IPv4 prefix binding in a top-of-rack configuration (Swap configuration):

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip static
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# local-label 2000 prefix 1.255.200.0 255.255.255.255
switch(config-mpls-static-af-lbl)# next-hop auto-resolve out-label 2001

This example shows how to configure MPLS static label and IPv6 prefix binding in a top-of-rack configuration (Swap configuration):

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip static
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv6 unicast
switch(config-mpls-static-af)# local-label 3001 prefix 2000:1:255:201::1/128
switch(config-mpls-static-af-lbl)# next-hop auto-resolve out-label 3002

This example shows how to configure MPLS static label and IPv4 prefix binding in an aggregator configuration (Pop configuration):

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip static
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv4 unicast
switch(config-mpls-static-af)# local-label 2000 prefix 1.255.200.0 255.255.255.255
switch(config-mpls-static-af-lbl)# next-hop 1.21.1.1 out-label implicit-null
switch(config-mpls-static-af-lbl)# next-hop backup Po24 1.24.1.1 out-label 2000

This example shows how to configure MPLS static label and IPv6 prefix binding in an aggregator configuration (Pop configuration):

switch# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)# interface ethernet 1/1
switch(config-if)# mpls ip static
switch(config-if)# mpls static configuration
switch(config-mpls-static)# address-family ipv6 unicast
switch(config-mpls-static-af)# local-label 3001 prefix 2000:1:255:201::1/128
switch(config-mpls-static-af-lbl)# next-hop 2000:1111:2121:1111:1111:1111:1111:1 out-label implicit-null
switch(config-mpls-static-af-lbl)# next-hop backup Po24 2000:1:24:1::1 out-label 3001

Displaying MPLS Statistics

To display MPLS statistics, use the following commands:

Command

Purpose

show mpls switching detail

Display detailed MPLS switching information.

show mpls forwarding statistics

Displays the MPLS Label Distribution Protocol (LDP) traffic forwarding statistics.

show mpls interfaces ethernet slot/port statistics

Displays the MPLS interface statistics.

show forwarding mpls stats

Displays MPLS forwarding statistics.

Use the clear forwarding mpls stats command to clear these statistics.

show forwarding mpls label label stats

Displays MPLS label forwarding statistics.

show forwarding adjacency mpls stats

Displays MPLS IPv4 adjacency statistics.

Use the clear forwarding adjacency mpls stats command to clear these statistics.

show forwarding adjacency mpls {intf | next-hop} stats

Displays MPLS IPv4 adjacency statistics for the specified interface or next-hop address.

show forwarding mpls drop-stats

Displays the MPLS forwarding packet drop statistics. Accounts the MPLS drop due to the unconfig label, for example, the incoming MPLS label does not match to any configured incoming label.

Use the clear forwarding mpls drop-stats command to clear these statistics.

show forwarding ipv6 adjacency mpls stats

Displays MPLS IPv6 adjacency statistics.

Use the clear forwarding ipv6 adjacency mpls stats command to clear these statistics.

show forwarding ipv6 adjacency mpls {intf | next-hop} stats

Displays MPLS IPv6 adjacency statistics for the specified interface or next-hop address.

show mpls static binding {all | ipv4 | ipv6}

Displays the configured static prefix or label bindings.

See the sample configuration and the sample output as follows:

mpls static configuration
  address-family ipv4 unicast
    local-label 2000 prefix 1.255.200.0/32
      next-hop 1.21.1.1 out-label implicit-null
      next-hop backup Po24 1.24.1.1 out-label 2001
  address-family ipv6 unicast
    local-label 3000 prefix 2000:1:255:201::1/128
      next-hop 2000:1111:2121:1111:1111:1111:1111:1 out-label implicit-null
      next-hop backup Po24 2000:1:24:1::1 out-label 3001

For the above configuration, here is the sample output:
switch(config)# show mpls switching detail

VRF default

IPv4 FEC
 In-Label                       : 2000
 Out-Label stack                : Pop Label
 FEC                            : 1.255.200.0/32
 Out interface                  : Po21
 Next hop                       : 1.21.1.1
 Input traffic statistics       : 0 packets, 0 bytes
 Output statistics per label    : 0 packets, 0 bytes
IPv6 FEC
 In-Label                       : 3000
 Out-Label stack                : Pop Label
 FEC                            : 2000:1:255:201::1/128
 Out interface                  : port-channel21
 Next hop                       : 2000:1111:2121:1111:1111:1111:1111:1
 Input traffic statistics       : 0 packets, 0 bytes
 Output statistics per label    : 0 packets, 0 bytes

switch(config)# show mpls static binding all

1.255.200.0/32: (vrf: default) Incoming label: 2000
  Outgoing labels:
                           1.21.1.1 implicit-null
                         backup 1.24.1.1 2001

2000:1:255:201::1/128: (vrf: default) Incoming label: 3000
  Outgoing labels:
      2000:1111:2121:1111:1111:1111:1111:1 implicit-null
                   backup 2000:1:24:1::1 3001

switch(config)# show forwarding mpls stats
--------+-----------+-------------------+----------------+-------------+-------
Local   |Prefix     |FEC                |Next-Hop        |Interface    |Out
Label   |Table Id   |(Prefix/Tunnel id) |                |             |Label
--------+-----------+-------------------+----------------+-------------+-------
2000    |0x1        |1.255.200.0/32     |1.21.1.1        |Po21         |Pop Label
 HH: 100008, Refcount: 1
Input Pkts : 71884                Input Bytes : 9201152
Output Pkts: 72282                Output Bytes: 8963092
3000    |0x80000001 |2000:1:255:201::1/128 |2000:1111:2121:1111:1111:1111:1111:1 |Po21         |Pop Label
 HH: 100011, Refcount: 1
Input Pkts : 13073                Input Bytes : 1673344
Output Pkts: 13467                Output Bytes: 1669908

switch(config)# show forwarding mpls label 2000 stats
--------+-----------+-------------------+----------------+-------------+-------
Local   |Prefix     |FEC                |Next-Hop        |Interface    |Out
Label   |Table Id   |(Prefix/Tunnel id) |                |             |Label
--------+-----------+-------------------+----------------+-------------+-------
2000    |0x1        |1.255.200.0/32     |1.21.1.1        |Po21         |Pop Label
 HH: 100008, Refcount: 1
Input Pkts : 77129                Input Bytes : 9872512
Output Pkts: 77223                Output Bytes: 9575652

switch(config)# show forwarding adjacency mpls stats

FEC                  next-hop           interface    tx packets           tx bytes             Label info
-------------------- ------------------ ------------ -------------------- -------------------- ----------
1.255.200.0/32       1.21.1.1           Po21         87388                10836236             POP 3
1.255.200.0/32       1.24.1.1           Po24         0                    0                    SWAP 2001
AGG1(config)#
AGG1(config)# show forwarding mpls drop-stats

Dropped packets : 73454
Dropped bytes : 9399304

switch(config)# show forwarding ipv6 adjacency mpls stats

FEC                                           next-hop                                 interface    tx packets           tx bytes             Label info
--------------------------------------------- ---------------------------------------- ------------ -------------------- -------------------- ----------
2000:1:255:201::1/128                         2000:1111:2121:1111:1111:1111:1111:1     Po21         46604                5778896              POP 3
2000:1:255:201::1/128                         2000:1:24:1::1                           Po24         0                    0                    SWAP 3001

switch(config)#