- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
01-Basic MPLS configuration | 286.25 KB |
Specifying the label type advertised by the egress
Enabling sending of MPLS TTL-expired messages
Displaying and maintaining MPLS
The switch operates in IRF or standalone (the default) mode. For more information about IRF, see IRF Configuration Guide.
Multiprotocol Label Switching (MPLS) provides connection-oriented label switching over connectionless IP backbone networks.
Overview
MPLS integrates both the flexibility of IP routing and the simplicity of Layer 2 switching, and delivers the following advantages:
· High speed and efficiency—MPLS uses short- and fixed-length labels to forward packets, avoiding complicated routing table lookups.
· Multiprotocol support—MPLS resides between the link layer and the network layer. It can work over various link layer protocols (for example, PPP, ATM, frame relay, and Ethernet) to provide connection-oriented services for various network layer protocols (for example, IPv4, IPv6, and IPX).
· Good scalability—The connection-oriented switching and multi-layer label stack features enable MPLS to deliver various extended services, such as VPN, traffic engineering, and QoS.
Basic concepts
FEC
MPLS groups packets with the same characteristics (such as packets with the same destination or service class) into a class, called a "forwarding equivalence class (FEC)." Packets of the same FEC are handled in the same way on an MPLS network.
Label
A label uniquely identifies a FEC and has local significance.
A label is encapsulated between the Layer 2 header and Layer 3 header of a packet. It is four bytes long and consists of the following fields:
· Label—20-bit label value.
· TC—3-bit traffic class, used for QoS. It is also called "Exp."
· S—1-bit bottom of stack flag. A label stack can comprise multiple labels. The label nearest to the Layer 2 header is called the "top label," and the label nearest to the Layer 3 header is called the "bottom label." The S field is set to 1 if the label is the bottom label and set to 0 if not.
· TTL—8-bit time to live field used for routing loop prevention.
LSR
A router that performs MPLS forwarding is a label switching router (LSR).
LSP
A label switched path (LSP) is the path along which packets of a FEC travel through an MPLS network.
An LSP is a unidirectional packet forwarding path. Two neighboring LSRs are called the "upstream LSR" and "downstream LSR" along the direction of an LSP. In Figure 2, LSR B is the downstream LSR of LSR A, and LSR A is the upstream LSR of LSR B.
LFIB
The Label Forwarding Information Base (LFIB) on an MPLS network functions like the Forwarding Information Base (FIB) on an IP network. When an LSR receives a labeled packet, it searches the LFIB to obtain information for forwarding the packet, such as the label operation type, the outgoing label value, and the next hop.
Control plane and forwarding plane
An MPLS node consists of a control plane and a forwarding plane.
· Control plane—Assigns labels, distributes FEC-label mappings to neighbor LSRs, creates the LFIB, and establishes and removes LSPs.
· Forwarding plane—Forwards packets according to the LFIB.
MPLS network architecture
Figure 3 MPLS network architecture
An MPLS network comprises the following types of LSRs:
· Ingress LSR—Ingress LSR of packets. It labels packets entering into the MPLS network.
· Transit LSR—Intermediate LSRs in the MPLS network. The transit LSRs on an LSP forward packets to the egress LSR according to labels.
· Egress LSR—Egress LSR of packets. It removes labels from packets and forwards the packets to their destination networks.
LSP establishment
LSPs fall into static and dynamic LSPs.
· Static LSP
To establish a static LSP, you must configure an LFIB entry on each LSR along the LSP. Establishing static LSPs consumes fewer resources than establishing dynamic LSPs, but static LSPs cannot automatically adapt to network topology changes. Therefore, static LSPs are suitable for small-scale networks with simple, stable topologies.
· Dynamic LSP
Dynamic LSPs are established by label distribution protocols (also called MPLS signaling protocols). They classify FECs, distribute FEC-label mappings, and establish and maintain LSPs. Label distribution protocols include protocols designed specifically for label distribution, such as the Label Distribution Protocol (LDP), and protocols extended to support label distribution, such as MP-BGP and RSVP-TE.
In this chapter, the term "label distribution protocols" refers to all protocols for label distribution. The term "LDP" refers to the RFC 5036 LDP.
A dynamic LSP is established in the following steps:
1. A downstream LSR classifies FECs according to destination addresses.
2. The downstream LSR assigns a label for each FEC, and distributes the FEC-label binding to its upstream LSR.
3. The upstream LSR establishes an LFIB entry for the FEC according to the binding information.
After all LSRs along the LSP establish an LFIB entry for the FEC, a dynamic LSP is established for the packets of this FEC.
Figure 4 Dynamic LSP establishment
MPLS forwarding
As shown in Figure 5, a packet is forwarded over the MPLS network in the following steps:
1. Router B (the ingress LSR) receives a packet with no label. It identifies the FIB entry that matches the destination address of the packet, pushes the outgoing label (40 in this example) to the packet, and forwards the labeled packet out of GigabitEthernet 3/0/2 to the next hop LSR Router C.
2. When receiving the labeled packet, Router C identifies the LFIB entry that has an incoming label of 40, uses the outgoing label 50 of the entry to replace label 40 in the packet, and forwards the labeled packet out of the outgoing interface GigabitEthernet 3/0/2 to the next hop LSR Router D.
3. When receiving the labeled packet, Router D (the egress) identifies the LFIB entry that has an incoming label of 50, removes the label from the packet, and forwards the packet out of the outgoing interface GigabitEthernet 3/0/2 to the next hop LSR Router E. If the LFIB entry records no outgoing interface or next hop information, Router D identifies the FIB entry by the IP header and then forwards the packet according to the FIB entry.
PHP
An egress node must perform two forwarding table lookups to forward a packet: two LFIB lookups (if the packet has more than one label), or one LFIB lookup and one FIB lookup (if the packet has only one label).
The penultimate hop popping (PHP) feature can pop the label at the penultimate node, so the egress node only performs one table lookup.
A PHP-capable egress node sends the penultimate node an implicit null label of 3. This label never appears in the label stack of packets. If an incoming packet matches an LFIB entry comprising the implicit null label, the penultimate node pops the top label of the packet and forwards the packet to the egress LSR. The egress LSR directly forwards the packet.
Sometimes, the egress node must use the TC field in the label to perform QoS. To keep the TC information, you can configure the egress node to send the penultimate node an explicit null label of 0. If an incoming packet matches an LFIB entry comprising the explicit null label, the penultimate hop replaces the value of the top label with value 0, and forwards the packet to the egress node. The egress node gets the TC information, pops the label of the packet, and forwards the packet.
Protocols and standards
· RFC 3031, Multiprotocol Label Switching Architecture
· RFC 3032, MPLS Label Stack Encoding
· RFC 5462, Multiprotocol Label Switching (MPLS) Label Stack Entry: "EXP" Field Renamed to "Traffic Class" Field
MPLS configuration task list
Tasks at a glance |
(Required.) Enabling MPLS |
(Optional.) Configuring MPLS MTU |
(Optional.) Specifying the label type advertised by the egress |
(Optional.) Configuring TTL propagation |
(Optional.) Enabling sending of MPLS TTL-expired messages |
Enabling MPLS
You must enable MPLS on all interfaces related to MPLS forwarding.
Before you enable MPLS, complete the following tasks:
· Configure link layer protocols to ensure connectivity at the link layer.
Configure IP addresses for interfaces to ensure IP connectivity between neighboring nodes.
Configure static routes or an IGP protocol to ensure IP connectivity among LSRs.
To enable MPLS:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure an LSR ID for the local node. |
mpls lsr-id lsr-id |
By default, no LSR ID is configured. An LSR ID must be unique in an MPLS network and in IP address format. H3C recommends using the IP address of a loopback interface as an LSR ID. |
3. Enter the view of the interface that needs to perform MPLS forwarding. |
interface interface-type interface-number |
N/A |
4. Enable MPLS for the interface. |
mpls enable |
By default, MPLS is disabled on an interface. |
Configuring MPLS MTU
MPLS inserts the label stack between the link layer header and network layer header of each packet. To make sure the size of MPLS labeled packets is smaller than the MTU of an interface, configure an MPLS MTU on the interface.
MPLS compares each MPLS packet against the interface MPLS MTU. When the packet exceeds the MPLS MTU:
· If fragmentation is allowed, MPLS removes the label stack from the packet, fragments the IP packet (the length of a fragment is the MPLS MTU minus the length of the label stack), adds the label stack to each fragment, and forwards the fragments.
· If fragmentation is not allowed, the LSR drops the packet.
To configure an MPLS MTU for an interface:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enter interface view. |
interface interface-type interface-number |
N/A |
3. Configure an MPLS MTU for the interface. |
mpls mtu value |
By default, no MPLS MTU is configured on an interface. |
The following applies when an interface handles MPLS packets:
· MPLS packets carrying L2VPN or IPv6 packets are always forwarded by an interface, even if the length of the MPLS packets exceeds the MPLS MTU of the interface.
· If the MPLS MTU of an interface is greater than the MTU of the interface, data forwarding may fail on the interface.
· If you do not configure the MPLS MTU of an interface, fragmentation of MPLS packets is based on the MTU of the interface without considering MPLS labels. An MPLS fragment might be larger than the interface MTU and be dropped.
Specifying the label type advertised by the egress
In an MPLS network, an egress can advertise the following types of labels:
· Implicit null label with a value of 3.
· Explicit null label with a value of 0.
· Non-null label with a value in the range of 16 to 1023.
For LSPs established by a label distribution protocol, the label advertised by the egress determines how the penultimate hop processes a labeled packet.
· If the egress advertises an implicit null label, the penultimate hop directly pops the top label of a matching packet.
· If the egress advertises an explicit null label, the penultimate hop swaps the top label value of a matching packet with the explicit null label.
· If the egress advertises a non-null label (normal label), the penultimate hop swaps the top label of a matching packet with the specific label assigned by the egress.
Configuration guidelines
If the penultimate hop supports PHP, H3C recommends that you configure the egress to advertise an implicit null label to the penultimate hop. If you want to simplify packet forwarding on the egress but keep labels in packets for the egress to determine QoS policies, you can configure the egress to advertise an explicit null label to the penultimate hop. H3C does not recommend using non-null labels except in some special scenarios.
As a penultimate hop, the switch allows the egress to advertise to the penultimate hop an implicit null label or an explicit null label.
The mpls label advertise command takes effect only for the LSPs established after the command is executed. To apply the new setting to LSPs established before the command is executed, delete and then re-establish those LSPs:
· To re-establish LDP LSPs, execute the reset mpls ldp command to reset the LDP session.
· To re-establish BGP LSPs, delete the routes corresponding to the BGP LSPs, and then redistribute the routes.
Configuration procedure
To specify the type of label that the egress node will advertise to the penultimate hop:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Specify the label type advertised by the egress to the penultimate hop. |
mpls label advertise { explicit-null | implicit-null } |
By default, an egress advertises an implicit null label to the penultimate hop. |
Configuring TTL propagation
When TTL propagation is enabled, the ingress node copies the TTL value of an IP packet to the TTL field of the label. Each LSR on the LSP decreases the label TTL value by 1. The LSR that pops the label copies the remaining label TTL value back to the IP TTL of the packet, so the IP TTL value can reflect how many hops the packet has traversed in the MPLS network. The IP tracert facility can show the real path along which the packet has traveled.
Figure 6 TTL propagation
When TTL propagation is disabled, the ingress node sets the label TTL to 255. Each LSR on the LSP decreases the label TTL value by 1. The LSR that pops the label does not change the IP TTL value when popping the label. Therefore, the MPLS backbone nodes are invisible to user networks, and the IP tracert facility cannot show the real path in the MPLS network.
Figure 7 Without TTL propagation
Follow these guidelines when you configure TTL propagation:
· H3C recommends setting the same TTL processing mode on all LSRs of an LSP.
· To enable TTL propagation for a VPN, you must enable it on all PE devices in the VPN, so that you can get the same traceroute result (hop count) from those PEs.
To enable TTL propagation:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enable TTL propagation. |
mpls ttl propagate { public | vpn } |
By default, TTL propagation is enabled only for public-network packets. This command affects only the propagation between IP TTL and label TTL. Within an MPLS network, TTL is always copied between the labels of an MPLS packet. |
Enabling sending of MPLS TTL-expired messages
This feature enables an LSR to generate an ICMP TTL-expired message upon receiving an MPLS packet with a TTL of 1. If the MPLS packet has only one label, the LSR sends the ICMP TTL-expired message back to the source through IP routing. If the MPLS packet has multiple labels, the LSR sends it along the LSP to the egress, which then sends the message back to the source.
To enable sending of MPLS TTL-expired messages:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enable sending of MPLS TTL-expired messages. |
mpls ttl expiration enable |
By default, this function is enabled. |
Displaying and maintaining MPLS
Execute display commands in any view.
Task |
Command |
Display MPLS interface information. |
display mpls interface [ interface-type interface-number ] |
Display usage information about MPLS labels. |
display mpls label { label-value1 [ to label-value2 ] | all } |
Display LSP information. |
display mpls lsp [ egress | in-label label-value | ingress | outgoing-interface interface-type interface-number | protocol { bgp | ldp | local | rsvp-te | static | static-cr } | transit ] [ vpn-instance vpn-instance-name ] [ ipv4-dest mask-length | ipv6 [ ipv6-dest prefix-length ] ] [ verbose ] |
Display usage information about NIDs. |
display mpls nid [ nid-value1 [ to nid-value2 ] ] |
Display LSP statistics. |
display mpls lsp statistics |
Display MPLS summary information. |
display mpls summary |
Display ILM entries (in standalone mode). |
display mpls forwarding ilm [ label ] slot slot-number |
Display ILM entries (in IRF mode). |
display mpls forwarding ilm [ label ] chassis chassis-number slot slot-number |
Display NHLFE entries (in standalone mode). |
display mpls forwarding nhlfe [ nid ] slot slot-number |
Display NHLFE entries (in IRF mode). |
display mpls forwarding nhlfe [ nid ] chassis chassis-number slot slot-number |