0% found this document useful (0 votes)
20 views11 pages

MPLS

Uploaded by

upendramax52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views11 pages

MPLS

Uploaded by

upendramax52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

MPLS

Why do we use MPLS (multiprotocol label switching)


MPLS (Multi-Protocol Label Switching) is a mechanism that switches traffic based on
labels instead of routing traffic. It’s typically seen in service provider networks and can
transport pretty much everything…IP, IPv6, Ethernet, frame-relay, PPP. MPLS VPN is a
popular technique to build VPNs for customers over the MPLS provider network.
Mpls provides labeling and makes ip routing fast, it works on layer2.5 protocol

MPLS VPN and MPLS BGP


Per customer routing (private routing)
Virtual networks
Fast processing uses labels

Mpls PE (provider edge) and P (provider)routers perform three major operations


Label push
Add a label to an incoming packet
AKA label imposition
Label Swap
-replace the label in an incoming packet
Label pop
-remove the label from an outgoing packet
-AKA label disposition
You will find three different routers:
CE (customer edge): this device is the last device in the customer’s network, it could be a
L2 or L3 device. In my picture I used a router but for example, it could be a switch. This
device does not use MPLS.
PE (provider edge): this device is owned by the ISP and sits at the edge of the ISP’s network. It
has an important role it receives packets or frames from the customer and will then add a MPLS
label to it and forwards towards the core. Another common name for this device is LER (label
edge router)
P(provider): this device connects to PE router and other P routers. It has a simple job, it
switches packets based on their labels or removes the label. Another common name for
this device is the LSR(label switch router or transit router.

LABEL value: this is where you will find the value of the label.
EXP: these are the three experimental bits. These are used for QOS, normally the IP
precedence value of the IP packet will be copied here.
S: this is the “bottom of stack” bit. With the MPLS it’s possible to add more than one
label. You will see why in some of the MPLS VPN lessons. When this bit is set to one, it’s
the last MPLS header. When it’s set to zero then there is one or more MPLS headers left.
TTL: just like in the IP header, this is the time to live field. We can use this for traces in
the MPLS network. Each hop decrements the TTL by one.
The MPLS header is added in between the L2 and L3 header:
That’s why we call it’s a layer 2.5 protocol
MPLS LDP (label distribution protocol)
Previously there was TDP (the Tag Distribution Protocol) is a two-party protocol that
runs over a connection-oriented transport layer with guaranteed sequential delivery.
Tag switching routers use this protocol to communicate tag binding information to their
peers. We do not use TDP. We only use LDP
MPLS doesn’t exchanges label automatically
LDP is a protocol that automatically generates and exchange labels between routers
Each router will logically generate labels for its prefixes and will then advertise the label
values to its neighbors.
It’s a standard based on cisco proprietary TDP (tag Distribution Protocol).
Like many other protocols,
LDP first establish neighbor adjacency before it exchanges label information. It works a
bit different than most protocols though.
First, we send UDP multicast hello packets to discover other neighbors. Once two routers
decide to become neighbors, they build the neighbor adjacency using a tcp connection.
This connection is then used for the exchange of label information. Normally a loopback
interface is used for the neighbor adjacency. Here’s an example
The hello packets are sent to multicast address 224.0.0.2 using source/destination UDP
port 646.
Each router has a unique ID called the LSR (label switch Router) ID.
By default, it will select the highest ip address on a loopback interface. If you don’t have
any loopback interface then we will use the highest ip address on a physical interface.
At the bottom you find the transport address. This is what we use to build the actual TCP
connection. Like the LSR ID,
The router selected the IP address in the loopback interface as the transport address.
Make sure that the IP address that LDP has selected for the transport address is advertised
in your routing protocol.
Otherwise, your routers will be able to hear each other’s hello packets but they can’t form
a neighbor adjancy since the transport addresses are unreachable.
This is different compared to how routing protocols like OSPF or EIGRP form neighbor
adjancies. For example, when your un ospf then your routers will form neighbor adjancies
on all the interfaces that run OSPF.
LDP will only form a single neighbor adjancey no matter how many interfaces you have in
between your routers:
LDP is a bit similar to BGP when you use the loopback interfaces for the neighbor
adjancey. When we use BGP we have to use the update-source command to select the
source, LDP does it automatically.
So once our LDP routers have become neighbors, how we do exchange label information?
With normal routing we use routing protocols like EIGRP, OSPF or BGP to learn prefixes
from other routers. These are all stored in the RIB (routing information base) this is your
routing table.
The information in the RIB used to build the FIB (forwarding information base) which is
what we us for actual forwarding of ip packets. These table are all used for the IP packets
but for MPLS we use something else.
When we use LDP, we locally generate a label for each prefix that we can find in the RIB.
This information is then added to the LIB (label information bases).
The information is the LIB is used to build the LFIB (label forwarding information base).
When the router has to forwards a packet with a MPLS label on it, it will use the LFIB for
forwarding decisions.
Prerequisite for LDP to run.
CEF (cisco express forwarding) & routing should be already done.
Show IP cef to check CEF is running or not.
LDP hello is 5-sec
LDP hold down – 15 secs
Port number – Udp 646
Multicast address 224.0.0.2
The multilayer switch will use the information form tables that are build by the (control
plane) to build hardware tables. It will use the routing table to build the FIB (forwarding
information Base) and the ARP table to build the adjacency table. This is the fastest
switching method because we now have all the layer 2 and 3 information required to
forward IP packets in hardware.
Before we enable MPLS we will configure OSPF/eigrp so that all networks are advertised:
R1,R2,R3
Router ospf 1
Network 0.0.0.0 255.255.255.255 area 0
R1config#mpls label protocol ldp
R1(config)#mpls ldp router-id loopback 0
Now lets enable MPLS on ethernet interfaces
R1(config)#interface ethernet 0/0
R1(config-if)#mpls ip

MPLS LDP (Label Distribution Protocol)


LDP is a protocol that automatically generates and exchanges labels between routers.
Each router will locally generate labels for its prefixes and will then advertise the label
values to its neighbours.

It’s a standard, based on Cisco’s proprietary TDP (Tag Distribution Protocol). It’s pretty
much the same story as 802.1Q/ISL or PaGP/LACP. Cisco created a protocol and a
standard was created later. Nowadays almost everyone uses LDP instead of TDP.

Like many other protocols, LDP first establishes a neighbor adjacency before it
exchanges label information. It works a bit different than most protocols though…

First, we send UDP multicast hello packets to discover other neighbours. Once two
routers decide to become neighbours, they build the neighbor adjacency using a TCP
connection. This connection is then used for the exchange of label information.
Normally a loopback interface is used for the neighbor adjacency. Here’s an example:

The two routers above will send multicast hello packets on their Fast Ethernet
interfaces. Within this hello packet, they will advertise a transport IP address. This IP
address is then used to establish the TCP connection between the two routers. Here’s
what the hello packet looks like in Wireshark:
In the capture above you can see a couple of interesting things:

 The hello packets are sent to multicast address 224.0.0.2 using


source/destination UDP port 646.
 Each router has a unique ID called the LSR (Label Switch Router) ID. This is
similar to how most protocols select an ID, by default it will select the highest IP
address on a loopback interface. If you don’t have any loopback interfaces then
we will use the highest IP address on a physical interface.
 At the bottom you find the transport address. This is what we use to build the
actual TCP connection. Like the LSR ID, the router selected the IP address on the
loopback interface as the transport address.

Make sure that the IP address that LDP has selected for the transport address is
advertised in your routing protocol. Otherwise, your routers will be able to hear each
other’s hello packets but they can’t form a neighbor adjacency since the transport
address(es) are unreachable.
This is different compared to how routing protocols like OSPF or EIGRP form neighbor
adjacencies. For example, when you run OSPF then your routers will form neighbor
adjacencies on all interfaces that run OSPF:
LDP will only form a single neighbor adjacency, no matter how many interfaces you
have in between your routers:

LDP is a bit similar to BGP when you use the loopback interfaces for the neighbor
adjacency. When we use BGP we have to use the update-source command to select the
source, LDP does it automatically.

So once our LDP routers have become neighbours, how do we exchange label
information? To explain this, let’s do a quick review of how normal routing uses the RIB
and FIB.
With normal routing, we use routing protocols like EIGRP, OSPF or BGP to learn prefixes
from other routers. These are all stored in the RIB (Routing Information Base), this
is your routing table.

The information in the RIB is used to build the FIB (Forwarding Information
Base) which is what we use for actual forwarding of IP packet. These tables are all used
for IP packets but for MPLS we use something else:

When we use LDP on Cisco IOS, we locally generate a label for each prefix that we
can find in the RIB, except for BGP prefixes. This information is then added to
the LIB (Label Information Base).
The information in the LIB is used to build the LFIB (Label Forwarding Information
Base). When the router has to forward a packet with a MPLS label on it, it will use the
LFIB for forwarding decisions.

MPLS LDP Label Filtering Example


Once you enable MPLS on the interfaces between the routers and LDP neighbor
adjacencies have been formed, a label will be advertised for each network. With LDP
however we can configure filters to decide what networks should get a label and which
ones shouldn’t be tagged. I’ll use the following topology to demonstrate this:

Above we have 3 routers and each router has 2 loopback interfaces so that we have
plenty of networks to play with. Before we enable MPLS we’ll configure OSPF so that all
networks are advertised:

R1,R2,R3:

(config)#router ospf 1

(config-router)#network 0.0.0.0 255.255.255.255 area 0

We’ll do this the easy way and activate OSPF on all interfaces. Now let’s enable MPLS
on the Fast Ethernet interfaces:

R1(config)#interface fast Ethernet 0/0

R1(config-if)#mpls ip

R2(config)#interface fast Ethernet 0/0

R2(config-if)#mpls ip

R2(config-if)#exit
R2(config)#interface fastEthernet 0/1

R2(config-if)#mpls ip

R3(config)#interface fastEthernet 0/0

R3(config-if)#mpls ip

Let’s check if we have LDP neighbors:

R2#show Mpls ldp neighbor | include Peer

Peer LDP Ident: 11.11.11.11:0; Local LDP Ident 22.22.22.22:0

Peer LDP Ident: 33.33.33.33:0; Local LDP Ident 22.22.22.22:0

So far so good, now let’s take a look at the LDP labels that have been generated:

R1#show Mpls forwarding-table

Local Outgoing Prefix Bytes tag Outgoing Next Hop

tag tag or VC or Tunnel Id switched interface

16 Pop tag 2.2.2.2/32 0 Fa0/0 192.168.12.2

17 17 33.33.33.33/32 0 Fa0/0 192.168.12.2

18 18 3.3.3.3/32 0 Fa0/0 192.168.12.2

19 Pop tag 22.22.22.22/32 0 Fa0/0 192.168.12.2

20 Pop tag 192.168.23.0/24 0 Fa0/0 192.168.12.2

R2#show mpls forwarding-table

Local Outgoing Prefix Bytes tag Outgoing Next Hop

tag tag or VC or Tunnel Id switched interface

16 Pop tag 1.1.1.1/32 0 Fa0/0 192.168.12.1

17 Pop tag 33.33.33.33/32 0 Fa0/1 192.168.23.3


18 Pop tag 3.3.3.3/32 0 Fa0/1 192.168.23.3

19 Pop tag 11.11.11.11/32 0 Fa0/0 192.168.12.1

R3#show mpls forwarding-table

Local Outgoing Prefix Bytes tag Outgoing Next Hop

tag tag or VC or Tunnel Id switched interface

16 Pop tag 192.168.12.0/24 0 Fa0/0 192.168.23.2

17 16 1.1.1.1/32 0 Fa0/0 192.168.23.2

18 Pop tag 2.2.2.2/32 0 Fa0/0 192.168.23.2

19 Pop tag 22.22.22.22/32 0 Fa0/0 192.168.23.2

20 19 11.11.11.11/32 0 Fa0/0 192.168.23.2

For all networks a label has been generated by LDP. Now let’s configure filtering so that
we only generate labels for the loopback 0 interfaces. This is how you do it:

You might also like