Monday, January 30, 2023

MPLS Architecture

MPLS stands for Multiprotocol Label Switching, is a networking technology that switch the network traffic using the shortest path based on “labels”, rather than IP destination addresses, to handle forwarding over a private Wide Area Network.

  • The multiprotocol aspect of MPLS was fulfilled after the initial implementation of MPLS in Cisco IOS. Although at first only IPv4 was being label switched, later more protocols followed. In Cisco IOS, you can now label IPv6 packets, too, and transport Layer 2 frames over an MPLS backbone.
                         
  • Label switching indicates that the packets switched are no longer IPv4 packets, IPv6 packets, or even Layer 2 frames when switched, but they are labelled. The most important item to MPLS is the label.

MPLS used Label switching as below:

          

  • The first device in MPLS network, does an IP routing lookup, and find the destination router instead of next hop, and find and set the pre-determined path from source to destination.
  • Now, the source router (first device) applies a “label” based on the above information from pre-determined path from source to destination.
  • The future router uses the label information to route the traffic and swap label based on the information, without performing any additional IP lookup.
  • At destination router, the label is removed, and packet is delivered via normal IP routing.
  • The main idea to have “Label Switching“ was only that first router do an IP lookup, then all future routes in the network could do exact match “switching” based on a label.
  • This would reduce load on the core routers, where high-performance was the most difficult to achieve, and distribute the routing lookups across lower speed edge routers.

Labels can be based on a variety of parameters:

  • Destination IP network
  • Source IP address
  • QoS parameters
  • VPN destination
  • Outgoing interface
  • Layer-2 circuit

Label Switch Router

A label switch router (LSR) is a router that supports MPLS. It is capable of understanding MPLS labels and of receiving and transmitting a labeled packet on a data link. Three kinds of LSRs exist in an MPLS network:

  • Ingress LSRs—Ingress LSRs receive a packet that is not labeled yet, insert a label (stack) in front of the packet, and send it on a data link. 
  • Egress LSRs—Egress LSRs receive labeled packets, remove the label(s), and send them on a data link. Ingress and egress LSRs are edge LSRs.
                       
  • Intermediate LSRs—Intermediate LSRs receive an incoming labeled packet, perform an operation on it, switch the packet, and send the packet on the correct data link. The primary function of an intermediate LSR is to forward labelled packets. Therefore, every LSR needs a L3 routing protocol (OSPF, EIGRP, IS-IS, etc.) and a label exchange protocol (LDP, TDP, etc.).
                      

An LSR can do the three operations: pop, push, or swap.

  • An LSR that pushes labels onto a packet that was not labeled yet is called an imposing LSR because it is the first LSR to impose labels onto the packet. One that is doing imposition is an ingress LSR.
  • An LSR that removes all labels from the labeled packet before switching out the packet is a disposing LSR. One that does disposition is an egress LSR.

The term P and PE come from the description of VPN services.

  • P-router: It a core/backbone router doing label switching only. It can operate without any customer/internet edge connection. Its a transit node LSR
  • PE-router: its customer facing router which does label popping and imposition. Its a edge  LSR. Typically has various edge features for terminating multiple services like
  • Internet
  • L3VPN
  • L2VPN
  • VPLS
  • CE is the “Customer Edge”, the customer device to which PE router talk to.

LSRs (Label Switching Routers), regardless of the type, perform the following functions:
Control Plane function

  • Exchange routing information
  • Exchange labels
Data Plane function
  • Forward packets (LSRs and edge LSRs)

Label Switched Path

  • A label switched path (LSP) is a sequence of LSRs that switch a labelled packet through an MPLS network or part of an MPLS network.
  • LSP—A label switched path (LSP) is a path through an MPLS network, set up by a signalling protocol, such as LDP, RSVP TE, BGP or CR-LDP. The path is set up based on criteria in the forwarding equivalence class (FEC).
A Forwarding Equivalence Class (FEC) is a group or flow of packets that are forwarded along the
same path and are treated the same with regard to the forwarding treatment. 
All packets belonging to the same FEC have the same label. 
However, not all packets that have the same label belong to the same FEC, because their EXP values might differ; the forwarding treatment could be different, and they could belong to a different FEC. 
The router that decides which packets belong to which FEC is the ingress LSR. 
This is logical because the ingress LSR classifies and labels the packets.

  • One of the most important concepts for the actual use of MPLS is “Label Switched Path (LSP)”
  • It is a unidirectional tunnel between a pair of routers, routed across an MPLS network.
  • An LSP is required for any MPLS forwarding to occur.
  • LSPs are derived from IGP routing information

MPLS Plane

Routers and switches use a conceptual model called planes. Planes describe how packets travel to, from, and through a device.

The control and data planes do not describe data itself. Rather, these planes describe how the device handles the data. For example, does the device process a packet itself, or does it forward it to another device?

MPLS Data Plane: Basically, deals with How MPLS traffic is forwarded IN, OUT and Through the mpls network

  • MPLS data plane indicates how the data will flow from one PE (Provider Edge) router to PE router.
  • The data plane is independent of the type of routing protocol or label exchange protocol being used.
  • The data plane forwards packets to the appropriate interface based on the information in the LFIB or the FIB tables.

  • The data plane (or forwarding plane) is the high-speed path through the router/switch. Packets that pass through the device use the data plane, as opposed to packets directed to the device. For this reason, the data plane is also called the forwarding plane.

Data Plane traffic is forwarded through a device

  • The data plane needs to provide a high speed and low latency path. To achieve this, a lot of data plane implementation is in hardware. This includes performing CEF lookups/caching and using special ASICs. The FIB and LFIB are part of the data plane.

A few quick examples.

  • Passing SSH traffic through to another device; Data Plane
  • Forwarding BGP traffic; Data Plane

MPLS Control Plane: Basically, deals with How the Labels are assigned and exchanged in the mpls network.

  • It contains complex mechanisms to exchange routing information (OSPF, EIGRP, IS-IS, BGP, etc.) and labels (Tag Distribution protocol [TDP], Label Distribution protocol [LDP], BGP, RSVP, etc.).
  • MPLS control plane indicates how the updates are sent from one PE router and to another PE router.
  • MPLS control plane is used to build FIB table from the information of routing information base and LFIB table based upon label exchange protocol
  • The control plane makes use of a label exchange protocol to create and maintain labels internally, and to exchange these labels with other devices.
  • The label exchange protocol binds to networks learned via a routing protocol.
  • Label exchange protocols include MPLS Label Distribution Protocol (LDP), the older Cisco Tag Distribution Protocol (TDP), and BGP (used by MPLSVPN) Resource Reservation Protocol (RSVP) is used by MPLS TE to accomplish label exchange
  • The LFIB table includes label values and association with the outgoing interfaces for every network prefix.

The control plane is generally considered to be where a router or switch makes its decisions. This is software based, and uses the CPU rather than specialized hardware, such as an ASIC.
For this reason, many people call the control plane the ‘slow path’.
Remember how the planes refer to how a device handles traffic? Well, traffic sent to a device or generated on a device is control plane traffic. An example of this is when a router forms neighbor relationship in OSPF or EIGRP. Or, when switches share BPDU’s for spanning-tree.

Control Plane traffic is sent to a device, or generated on a device

  • Another function of the control plane is to assign resources to the data plane. An example of this is using the data from the RIB to populate the FIB.
  • A logical subset of the control plane is the Management Plane. Any management traffic for the local device (such as SSH) is part of the management plane. This is because the destination of the management traffic is the local device.

A few quick examples.

  • SSH to a router; Control Plane
  • BGP neighbor relationship; Control Plane
  • OSPF neighborship and building the LSDB; Control Plane

Will discuss working of both control and data plane in more detail in next chapter...

Basic operation of MPLS

  • Only edge routers must perform a routing lookup
  • Core routers switch packets based on simple label lookups and swap labels
The figure illustrates a situation where the intermediary router does not have to perform a time-consuming routing lookup. Instead, this router simply swaps a label with another label (5 is replaced by 3) and forwards the packet based on the received label (3).
In larger networks the result of MPLS labeling is that only the edge routers perform a routing lookup. All the core routers forward packets based on the labels.

MPLS Introduction

Drawback of Traditional IP Routing

Traditional IP Forwarding

                          

  • In traditional IP networks, routing protocols are used to distribute Layer 3 routing information. 
  • Regardless of the routing protocol, packet forwarding is based on the destination address alone. 
  • Therefore, when a packet is received by the router, it determines the next-hop address using the packet's destination IP address along with the information from its own forwarding/routing table. 
  • This process of determining the next hop is repeated at each hop (router) from the source to the destination.
  • Every router in the path performs a destination-based routing lookup in a large forwarding table.
  • Each router performs an IP lookup (“routing”), determines a next-hop based on its routing table, and forwards the packet to that next-hop.
  • Because of which, every router may need full Internet routing information (i.e., more than 100,000 routes)

IP over ATM

  • The figure illustrates a worst-case scenario where Layer 2 (L2) and Layer 3 (L3) topologies do not overlap.
  • The result is that a single packet could be propagated with three L2 hops but instead requires 7 hops.
  • The reason is that L2 devices have static information about how to interconnect L3 devices.
  • Routers use a routing protocol to propagate L3 routing information through the intermediary router.

Traffic Engineering with Traditional IP Forwarding

  • This figure illustrates a topology with unequal links. Traffic patterns illustrate that most of the traffic goes between sites A and B.
  • Most traffic goes between large sites A and B and only uses the primary link.
  • Destination-based routing does not provide any mechanism for load balancing across unequal paths.
  • Policy-based routing can be used to forward packets based on other parameters, but this is not scalable solution in high volume traffic due to performance limitations.

Definition of MPLS

The MPLS labels are advertised between routers so that they can build a label-to-label mapping.
These labels are attached to the IP packets, enabling the routers to forward the traffic by looking
at the label and not the destination IP address. The packets are forwarded by label switching
instead of by IP switching.       

  • The label switching technique is not new. Frame Relay and ATM use it to move frames or cells
  • throughout a network.
  • In Frame Relay, the frame can be any length, whereas in ATM, a fixed length cell consists of a header of 5 bytes and a payload of 48 bytes.
  • The header of the ATM cell and the Frame Relay frame refer to the virtual circuit that the cell or frame resides on.
  • The similarity between Frame Relay and ATM is that at each hop throughout the network, the “label” value in the header is changed.
  • This is different from the forwarding of IP packets. When a router forwards an IP packet; it does not change a value that pertains to the destination of the packet: that is, it does not change the destination IP address of the packet.
  • The fact that the MPLS labels are used to forward the packets and no longer the destination IP address have led to the popularity of MPLS.

Benefits of MPLS

  • Bogus Benefit: One of the early reasons for a label-swapping protocol was the need for speed. Switching IP packets on a CPU were slower than switching labelled packets by looking up just the label on top of a packet.
  • The use of one unified network infrastructure: With MPLS, the idea is to label ingress packets based on their destination address or other preconfigured criteria and switch all the traffic over a common infrastructure.
  • Better IP over ATM integration
  • Border (BGP)- Gateway Protocol free core
  • The peer-to-peer model for MPLS VPN
  • Optimal traffic flow
  • Traffic engineering

History of MPLS in Cisco IOS

Tag Switching to MPLS

  • Cisco Systems started off with putting labels on top of IP packets in what was then called tag switching. 
                              
  • The first implementation was released in Cisco IOS 11.1(17)CT in 1998. A tag was the name for what is now known as a label. This implementation could assign tags to networks from the routing table and put those tags on top of the packet that was destined for that network. Tag switching built a Tag Forwarding Information Base (TFIB), which is, in essence, a table that stores input-to-output label mappings. Each tag-switching router had to match the tag on the incoming packet, swap it with the outgoing tag, and forward the packet.
  • Later, the IETF standardized tag switching into MPLS. The IETF released the first RFC on MPLS—RFC 2547, “BGP/MPLS VPNs”—in 1999. The result of this was that much of the terminology changed.

Old and New Terminology for Tag Switching/MPLS

Old Terminology

New Terminology

Tag Switching

MPLS

Tag

Label

TDP = Tag Distribution Protocol

LDP = Label Distribution Protocol

TFIB = tag forwarding information base

LFIB = label forwarding information base

TSR = tag switching router

LSR = label switching router

TSC = tag switch controller

LSC = label switch controller

TSP = tag switched path

LSP = label switched path

 MPLS Application

  • The first release of tag switching in Cisco IOS allowed for traffic engineering, but it was first called Routing with Resource Reservation (RRR or R3). The first implementation of traffic engineering in Cisco IOS was static. This meant that you as the operator of the router had to configure all the hops that a certain flow of traffic had to follow through the network. A later implementation made traffic engineering more dynamic by using extensions to the link state routing protocols. The operator no longer had to statically configure the traffic engineering tunnels hop by hop. The link state routing protocol carried extra information, so that the tunnels could be created in a more dynamic way. This greatly reduced the amount of work the operator had to do, which made MPLS traffic engineering more popular.
  • Until the coming of MPLS VPN, tag switching or MPLS was not widespread. When Cisco came out with Cisco IOS Software Release 12.0(5)T, the first Cisco IOS release containing support for MPLS VPN in 1999, it became an instant success because many service providers immediately started to implement MPLS VPN. To date, the MPLS VPN application is still the most popular of all the MPLS applications.
  • The next big addition to the family of MPLS applications was AToM. Cisco implemented AToM in Cisco IOS Release 12.0(10)ST, released in 2000, to carry ATM AAL 5 over an MPLS backbone.

Why MPLS?

  • What we want that forwarding decision should not only based on Destination IP.
  • Needed a single infrastructure that support multitude of applications in a secure manner.
  • Provide a highly scalable mechanism that was a topology driven rather than a flow driven.
  • Load balance traffic to utilize network bandwidth efficiently.
  • Allow core routers/networking devices to switch packet based on some simplified header.

What is MPLS used for?

MPLS is used to create a transport network. It provides an underlay medium for overlay services. 
The main services that we run with the MPLS are:

  • Layer 2 MPLS VPN with Pseudowires (VPWS, VPLS)
  • EVPN
  • Layer 3 MPLS VPN
  • Inter-AS MPLS VPN
  • Carrier Supporting Carrier
  • MPLS Traffic Engineering with RSVP and Segment Routing
  • RSVP-FRR, TI-LFA
  • Seamless MPLS/Unified MPLS

Important Point Regarding MPLS

  • RFC 3031 specifies Tag Switching, which later called as MPLS.
  • Defined by IETF in 1998
  • Multi-Protocol Label Switching is technology for delivery of IP services.
  • MPLS technology switches packet (IP packets, AAL5 frames) instead of routing packets to transport the data.
  • MPLS is a new forwarding mechanism in which packets are forwarded based on labels.
  • MPLS provide high performance forwarding mechanism.
  • MPLS uses best of both: “Switch, if possible, Route if necessary “
  • MPLS is a scalable and protocol-independent solution, that can carry Layer 3 IP and Non-IP and Layer 2 traffic, PPP, HDLC, Frame-Relay, Ethernet, all are possible.
  • MPLS provides transport and can be considered one of the tunneling mechanisms.
  • MPLS transport protocols as of 2022, are LDP, RSVP, Segment Routing and BGP LU.
  • MPLS is globally enabled on cisco routers.
  • By default, MPLS traffic will follow the same path as regular IP traffic
  • By default, all IGP routes (IGP, Connected, Static) will have a label assigned.
  • MPLS is easy and accessible. It means MPLS is simple but also complex. The complexity of MPLS is due to the services/function of the MPLS which add the complexity.