MPLS Primer for the interested
Here is a fast facts MPLS primer. MPLS is the most Zen protocol; it just doesn’t care what it carries in the payload. It has this unquie ability that allows MPLS to be used for a variety of things. Lets dig in and take a look.
Multiprotocol Label Switching (MPLS)
MPLS is an open standard (RFC 3031) that was designed to use labels to make forwarding decisions. One of the great features of MPLS is that it can transport many different types of payloads, e.g., Ethernet, ATM, PPP, IPv4, IPv6. It is an efficient protocol because the routers only need to do one IP lookup (when the packet first enters the MPLS domain) until it reaches the last hop router before the packet is forwarded to the host.
Use Cases:
This list is not exhaustive but includes the major use cases for MPLS.
1. Transparent tunneling over Service Provider Networks which allows for:
a. A BGP free core
b. Layer 2/Layer 3 VPN service to Customers
2. Traffic Engineering
a. Distribute load over underutilized links
b. Give bandwidth guarantees
c. Detect and repair failures quickly
While MPLS is/was primarily used in Service Provider environments, you can find use cases for the Enterprise. It is worth looking into.
MPLS Devices
MPLS device terminology is pretty straight forward. There are three primary devices that exist within an MPLS network.
· Customer Edge (CE) Device – the last hop device in the Customer’s network. This device is usually not MPLS aware, i.e., it runs only IP forwarding and not MPLS forwarding.
· Provider Edge (PE) Device – the last hop device in the Provider’s network, connects to the P devices and is sometimes referred to as the Label Edge Router (LER). This device will run IP and MPLS.
· Provider (P) Device – the core device at the center of the Providers network. It is sometimes referred to as a Label Switch Router (LSR). This device only runs MPLS, i.e., all switching occurs based on MPLS labels.
Forwarding Equivalency Class (FEC)
A FEC is defined as a group of IP packets which are forwarded over the same path (to the same next-hop), and with the same treatment.
MPLS Label (Header)
The MPLS header is 4-bytes in total comprising of:
· 20 bit label = locally significant to router
· 3 bit EXP = Class of Service
· S bit = defines last label in the label stack
· 8 bit TTL = Time to Live
The label is used to identify a FEC. The label is imposed (inserted) between the Layer 2 header and the Layer 3 header. The top label appears first in the packet where the bottom label is last.
Label Operation
Routers will perform various label operations depending on if the packet is incoming or outgoing.
· Label Push – adds a label to incoming packet; label imposition
· Label Swap – replaces the label on an incoming packet
· Label Pop – removes the label on an outgoing packet; label disposition
There is another technique referred to as Penultimate Hop Popping (PHP). Without PHP, the egress PE router must perform two lookups. First it has lookup the destination prefix associated with the label, and then once it has the prefix; the router must look up the next-hop for the destination prefix. With PHP, the next-to-last hop router (the penultimate router) will perform the label pop operation. This means the egress PE router will not have to do the label lookup because it is receiving an IP packet (the penultimate router has popped the label off before forwarding it to the egress router).
MPLS uses the implicit-null label to inform the router to perform PHP. The egress router will advertise the implicit-null label for all directly connected prefixes.
Label Distribution
There are two protocols used for distributing labels in the network: Tagged Distribution Protocol (TDP) and Label Distribution Protocol (LDP).
TDP
· Cisco proprietary protocol that use TCP port 711 to advertise labels.
LDP
· Standard protocol
· Uses UDP multicast 224.0.0.2:646 to discover neighbors
· Uses TCP port 646 once neighbors are discovered
· Advertises labels for IGP learned routes
Each router running MPLS will distribute the labels they are using for each prefix to its neighbors; think EIGRP not OSPF. Each router only knows about its neighbor’s labels and does not have a full view of the network.
MPLS switching logic is very straight forward; if traffic comes in interface-1 with label X, then send it out interface-2 with label Y. LDP is preferred and more widely used, so we will focus our efforts on LDP.
Configuration:
Router(config)#ip cef
Router(config)#mpls label protocol ldp
MPLS Data Structures
Like all protocols, MPLS has a few data structures to store its information. Before we get into the data structures there is one important fact about MPLS, you need to have CEF running. Without CEF enabled, the router will not enable MPLS forwarding. The MPLS adjacency will still come up, but you will not have MPLS forwarding functioning.
The first data structure is the Label Information Base (LIB). The LIB is a database used by MPLS to store labels learned from other LSRs and also labels assigned by the local router.
The second data structure is the Label Forwarding Information Base (LFIB). The LFIB is used by MPLS for switching labeled packets – think about it like CEFs FIB but for MPLS.
MPLS LIB:
Router#sho mpls ldp bindings
tib entry: 10.0.0.0/30, rev 14
local binding: tag: 19
remote binding: tsr: 172.0.0.4:0, tag: 20
remote binding: tsr: 172.0.0.2:0, tag: imp-null
tib entry: 10.0.0.4/30, rev 4
local binding: tag: imp-null
remote binding: tsr: 172.0.0.4:0, tag: 19
remote binding: tsr: 172.0.0.2:0, tag: imp-null
MPLS LFIB:
Router#sho mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 172.0.0.2/32 0 Fa0/1 10.0.0.5
17 Pop tag 172.0.0.4/32 0 Fa0/0 10.0.0.10
18 16 172.0.0.1/32 0 Fa0/1 10.0.0.5
19 Pop tag 10.0.0.0/30 0 Fa0/1 10.0.0.5
“Special” Labels
There are a few labels that have special meanings, one of which is the implicit-null label that we discussed earlier. There is another label – rather a lack of label – that you might see in the LFIB. In the LFIB, you may see no label listed under outgoing label. This indicates that the next hop router and the local router have not formed a MPLS adjacency. So the local router will send pure IP packets to the next hop router.
So where pop label tells the router to pop the top label off, no label instructs the router to remove all labels and send a pure IP packet to the next-hop. Be aware of no label, if you are expecting MPLS to be running between the neighboring routers and you see no label, you have a problem.
Full Example Configuration
The basic configuration for MPLS is very simple. First you have to enable CEF and LDP/TDP. Next, you enable the interfaces that you want to run MPLS on; this would be the interfaces connecting all your routers together. One thing to keep in mind, you don’t need to enable MPLS on interfaces like you would OSPF or EIGRP, i.e. to enable those networks to be distributed within the protocol. You are only enabling MPLS on interfaces to enable hellos to go out and form adjacencies. MPLS will by default, take all known prefixes learned from the configured IGP and append labels to them.
Configuration Template
Router(config)#ip cef
Router(config)#mpls label protocol ldp
Router(config)#int f0/0
Router(config-if)#mpls ip
Here are a few useful commands that I have listed below.
· show mpls ldp bindings – displays LIB
· show mpls forwarding-table – displays LFIB
· show mpls ldp neighbors – displays LDP adjacencies
· show mpls interfaces – displays all interfaces that MPLS is enabled on
Well that’s what we have, I hope you were able to pay attention long enough; it will be well worth it. Stay tuned for MPLS VPNs and 6PE - that’s when the magic happens. Now go on, have some fun, get your MPLS on!
Is there anything I missed or needs to be corrected? Let me know.
More Information
http://www.cisco.com/en/US/docs/ios/12_0st/12_0st21/feature/guide/fs_rtr.html#wp1067202
http://www.cisco.com/en/US/tech/tk436/tk428/technologies_q_and_a_item09186a00800949e5.shtml
http://www.amazon.com/MPLS-VPN-Architectures-Ivan-Pepelnjak/dp/1587050021/ref=sr_1_4?ie=UTF8&qid=1328021275&sr=8-4
http://www.amazon.com/MPLS-Fundamentals-Luc-Ghein/dp/1587051974/ref=sr_1_1?ie=UTF8&qid=1328021275&sr=8-1
5 Notes/ Hide
-
cjinfantino posted this

