Sunday, August 17, 2014

MPLS Overview, MPLS Label Distribution Protocol (LDP)

Multiprotocol Label Switching
-Open standard per RFC 3031
-Previous Cisco proprietary tag switching

MPLS Overview – Multiprotocol
-can transport different payloads
-Layer 2
--Ethernet, HDLC, PPP, Frame and ATM
-Layer3
-IPv4 & IPv6

MPLS is made up of two portions
Multiprotocol encap because it can transport different types payloads.
Including both layer 2 and layer 3 (there is also extensions to transport IPv6 over MPLS called 6PE)

MPLS Label Switching
-Traffic is switched between interfaces based on locally significant label values
-Similar to how a frame relay or ATM switch uses input/output DLCIs and VPI/VPCs

MPLS Label Format
-4 byte header used to switch packets
-RFC 3032 – MPLS label Stack Encoding
-- 20 bit label = locally significant to router
--3 bit EXP = Class of Service (QoS)
--S bit = Defines last label in the label stack (used by provide edge router)
--8 bit TTL = Time to live

Sits between the layer 2 and layer 3 encap.


How Labels work:
-MPLS Labels are bound to FECs
--Forward Equivalency Class
--IPv4 prefix for the CCIE purposes
Router uses MPLS LFIB to switch traffic
-Essentially CEF table + Label
Switching Logic
-If traffic comes in IF1 with label X send it out IF2 with Label Y

Based on label value to an IPv4 prefix association in the network, the binding of the Label and the Prefix value is known as the FEC.
The FEC is used to switch the label between the routers CEF table which is now known as the LFIB – CEF + Label Value.

In IPv4 – we determine the destination based on the outgoing interface.
In MPLS the outgoing interface is based on the incoming label value. The routers in the MPLS transit path need to agree on what the locally significant labels are. The actual labels values can be used over and over because they are really only relevant to the local router.

MPLS Device Roles:
PE /LER
--Provider Edge Router / Label edge router - Exchange IPv4 routes from Provider to Customer.
Connects to Customer Edge (CE) devices
Receives unlabeled packets and adds label
-AKA label push or label imposition -- Ads labels to normal IP packet
In L3VPN performs both IP routing & MPLS lookups

Once in the Provider network

P / LSR devices
-Provider Router / Label Switch Routers (not attached to any customers)
Connects to Pes and / or other P routers
Switches traffic based only on MPLS label

Key:
Provider routers only switch traffic based on MPLS label.
Design – the advantage of running MPLS from the Service provider’s perspective, it reduces the load in the Control Plane of the SP core.

Label Push / Pop / Swap:
PE and P routers perform three major operations

Label push – Done by Provider edge – Adding label on packet on inbound packet
--AKA add label to incoming packet
--AKA label imposition

Label Swap - Normally done by the P router in the core of the SP network. Where we receive a packet inbound that already has a label assigned
-Replace a label on an incoming packet – the adding a new label as it’s sent out another interface.

Label POP - Where the packet exit’s the network – removes label and sends to customer.
-Remove a label from an outgoing packet
-AKA label disposition

Label Distribution:

In order for the routers to do the label switching, they first must agree on what the mappings are between the label numbers and the IP Prefixes. This is what’s considered the FEC. Label values are only locally significant so we don’t need information about the entire topology.
Most LDP will rely on underlying loop preventions like IGP – to know about the topology and keep it loop free.

The first of the protocols that advertise the Labe distribution are:

Legacy Cisco TDP and the open standard LDP.

Label dist –
Adjacent P/PE’s must agree on label pre FEC.
Label bindings can be dynamic through….
--Tag distribution protocol TDP

--Label Distribution protocol - LDP
Resource reservation Protocol
--used for MPLS traffic Engineering (MPLS TE)
Multiprotocol BGP (MP-BGP)

LDP:
Standard per RFC 30306
Neighbor discovery
--uses UDP port 646 to 224.0.0.2
Neighbor Adjacency – Once the neighbors discover each-other they use TCP
-TCP port 646 to remote LDP router-ID
Note: same logic as BGP using it’s loopback to source the TCP session.
Loopback logic is the same as for EX: OSPF

Label Advertisement
-Advertise FEC for connected IGP interfaces
-Advertise FEC for IGP learned routes.


LDP is an IGP based label dist protocol, this means that LDP will only advertise locally enable for IGP and IGP learned prefixes.
EX: SH IP ROUTE OISPF _ these will be advertised in the FEC


MPLS Config:

Globally - Ip cef
Globally - Mpls label protocol (LDP | TDP)
Interface - Mpls ip
#sh ip mpls ldp interface – interfaces running LDP
#sh mpls ldp Neighbor – shows ADJ status – verify peering
#sh mplds forwarding-table – eq of s hip route
#sh ip cef (internal) – how the router is encapsulation the packet. Label value, etc. Same info as forwarding table.
#debufg mpls packet.

NOTE: MPLS IP ant the interface level will enable the process. The new default is LDP old TDP.

Note: Since LDP is an IGP based Protocol, Once LDP is enabled on the per-link basis, we should see Label bindings for all the routes in the routing table. Any connected interface and learned from the IGP. Locally significant on a hop-by-hop- basis. These means the label will change on a Hop basic as negotiated by the routed and the prefix.

Once LDP is enabled all the – Assuming there’s nothing wrong with eh underlying transport – All the Label announcements should happen automatically

Penultimate Hop Popping (PHP)

Uses to remove labels on CE facing routers and connected routers. This is basically an optimization of the label lookup that says the device that is the next to last hop. Is automatically going to remove the top most label in the stack – before it is sent out to that neighbor.

Penultimate means next to last. (hop)
Normally last hop must….
--lookup MPLS label
--Pop MPLS label
--Lookup IPv4 Destination
PHP avoids extra lookup on last hop
Accomplished through Implicit NULL label advertisement for connected prefixes.

Note: Any time we show the MPLS forward-table, if there is a decimal value under the outgoing label values. This means that the destination is several HOPS away. For any destination that the local router is the next to last hop – we should see the words, “Pop Label” under the outgoing heading.

Note: if we see the “no label” it means that the traffic is being sent on a non LDP enabled interface. Normal IP interface).