Multiprotocol Label Switching as the name implies is a switching technology which uses labels instead of the source and destination IP to make forwarding decisions. Like a RIB and FIB an MPLS enabled router will be creating a LIB and a LFIB database to make forwarding decisions. , it decreases the forwarding overhead on the core routers. MPLS technologies are applicable to any network layer protocol.
Label Distribution Protocol uses TCP port 646, and TDP uses TCP port 711. These ports are opened on the router interface only when mpls ip is configured on the interface. The use of TCP as a transport protocol results in reliable delivery of LDP/TDP information with robust flow control and congestion handling mechanisms.
MPLS uses a 32-bit label field that contains the following information:
- 20-bit label
- 3-bit experimental field
- 8-bit time-to-live (TTL) field
- MPLS technology is intended to be used anywhere regardless of Layer 1 media and Layer 2 protocol.
- MPLS uses a 32-bit label field that is inserted between Layer 2 and Layer 3 headers (frame-mode).
- MPLS over ATM uses the ATM header as the label (cell-mode).
- Label switch router (LSR) primarily forwards labeled packets (label swapping)
- Edge LSR primarily labels IP packets and forwards them into MPLS domain, or removes labels and forwards IP packets out of the MPLS domain
A forwarding equivalence class (FEC) is a term used in Multiprotocol Label Switching (MPLS) to describe a set of packets with similar or identical characteristics which may be forwarded the same way; that is, they may be bound to the same MPLS label.
Characteristics determining the FEC of a higher-layer packet depend on the configuration of the router, but typically this is at least the destination IP address. Quality of service class is also often used. Thus, a forward equivalence class tends to correspond to a label switched path (LSP). The reverse is not true, however: an LSP may be (and usually is) used for multiple FECs.
In the following example I am using MPLS in the service provider network and all it requires is enabling mpls on the physical interfaces between the Link state routers.Configuration on PE1
interface Ethernet0/0
description to P1 eth0/0
ip address 192.168.100.2 255.255.255.0
mpls ip
!
interface Ethernet0/3
description to P2 eth0/3
ip address 192.168.102.2 255.255.255.0
mpls ip
Configuration on PE2
interface Ethernet0/0
description to P2 eth0/0
ip address 192.168.103.4 255.255.255.0
mpls ip
!
interface Ethernet0/2
description to P1 eth0/2
ip address 192.168.101.4 255.255.255.0
mpls ip
Configuration on P1
interface Ethernet0/0
description to PE1 eth0/0
ip address 192.168.100.3 255.255.255.0
mpls ip
!
interface Ethernet0/2
description to PE2 eth0/2
ip address 192.168.101.3 255.255.255.0
mpls ip
Configuration on P2
interface Ethernet0/0
description to PE2 eth0/0
ip address 192.168.103.3 255.255.255.0
mpls ip
!
interface Ethernet0/3
description to PE1 eth0/3
ip address 192.168.102.3 255.255.255.0
mpls ip
So from a configuration point of view we can see that it is very simple and straight forward. Let's deep dive into how MPLS is working within this network.
Let's first check the MPLS LDP neighbors
PE2#show mpls ldp neighbor
Peer LDP Ident: 3.3.3.3:0; Local LDP Ident 4.4.4.4:0
TCP connection: 3.3.3.3.646 - 4.4.4.4.19917
State: Oper; Msgs sent/rcvd: 30/32; Downstream
Up time: 00:17:39
LDP discovery sources:
Ethernet0/2, Src IP addr: 192.168.101.3
Addresses bound to peer LDP Ident:
192.168.100.3 3.3.3.3 192.168.101.3
Peer LDP Ident: 5.5.5.5:0; Local LDP Ident 4.4.4.4:0
TCP connection: 5.5.5.5.11581 - 4.4.4.4.646
State: Oper; Msgs sent/rcvd: 31/31; Downstream
Up time: 00:17:37
LDP discovery sources:
Ethernet0/0, Src IP addr: 192.168.103.3
Addresses bound to peer LDP Ident:
192.168.103.3 5.5.5.5 192.168.102.3
For every destination there is a mapping of the label that is imposed on each hop.
PE2#show mpls ip binding
2.2.2.2/32
in label: 21
out label: 20 lsr: 3.3.3.3:0 inuse
out label: 20 lsr: 5.5.5.5:0 inuse
3.3.3.3/32
in label: 20
out label: imp-null lsr: 3.3.3.3:0 inuse
out label: 19 lsr: 5.5.5.5:0
4.4.4.4/32
in label: imp-null
out label: 19 lsr: 3.3.3.3:0
out label: 18 lsr: 5.5.5.5:0
5.5.5.5/32
in label: 19
out label: 18 lsr: 3.3.3.3:0
out label: imp-null lsr: 5.5.5.5:0 inuse
192.168.100.0/24
in label: 23
out label: imp-null lsr: 3.3.3.3:0 inuse
out label: 22 lsr: 5.5.5.5:0
192.168.101.0/24
in label: imp-null
out label: imp-null lsr: 3.3.3.3:0
out label: 21 lsr: 5.5.5.5:0
192.168.102.0/24
in label: 22
out label: 22 lsr: 3.3.3.3:0
out label: imp-null lsr: 5.5.5.5:0 inuse
192.168.103.0/24
in label: imp-null
out label: 21 lsr: 3.3.3.3:0
out label: imp-null lsr: 5.5.5.5:0
The Label Forwarding Information Base (LFIB)
PE2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
19 Pop Label 5.5.5.5/32 0 Et0/0 192.168.103.3
20 Pop Label 3.3.3.3/32 0 Et0/2 192.168.101.3
21 20 2.2.2.2/32 0 Et0/2 192.168.101.3
20 2.2.2.2/32 0 Et0/0 192.168.103.3
22 Pop Label 192.168.102.0/24 0 Et0/0 192.168.103.3
23 Pop Label 192.168.100.0/24 0 Et0/2 192.168.101.3
24 No Label 7.7.7.7/32[V] 0 Et0/1 10.1.1.6
25 No Label 9.9.9.9/32[V] 0 Et0/3 10.2.2.6
PE1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
18 Pop Label 5.5.5.5/32 540 Et0/3 192.168.102.3
19 19 4.4.4.4/32 628 Et0/0 192.168.100.3
18 4.4.4.4/32 0 Et0/3 192.168.102.3
20 Pop Label 3.3.3.3/32 0 Et0/0 192.168.100.3
21 Pop Label 192.168.103.0/24 0 Et0/3 192.168.102.3
22 Pop Label 192.168.101.0/24 0 Et0/0 192.168.100.3
23 No Label 1.1.1.1/32[V] 0 Et0/1 10.1.1.2
24 No Label 8.8.8.8/32[V] 0 Et0/2 10.2.2.2
The MPLS label range on Cisco devices is between 16 to 100000
Downstream Generic label region: Min/Max label: 16/100000