Wednesday, April 11, 2012

MPLS Route Targets


  • MPLS uses Route Targets to determine in which VRFs, a PE places IBGP-learned routes.
  • It is 64-bit extended BGP community.
  • It is attached to a VPNv4 BGP route to indicate its VPN membership
  • Any number of RTs attached to a single route up to the BGP update packet size of 4096 bits.
  • Export RTs
    • Attached to a route when it is converted into a VPN4 route.
    • Identify the VPN membership by associating routes to a VRF
  • Import RTs
    • Used to select VPNv4 routes for insertion into matching VRF tables.
    • On the receiving PE router, a route is imported into a vrf only if at least one RT attached to the route matches at least one import RT configured in that VRF(route map condition must be met if configured).
  • An import or export map allows route control on a per-route basis.

MP-BGP & Routing Distinguishers


  • Routes learned from the CE router are advertised to other PE routers uses the IBGP from all the routes, from all the different VRFs.
  • If use normal BGP is used, may overlapping of prefixes will be occurred.
  • MPLS deals this problem by
    • Add another number in front of the original BGP NLRI.
    • Each different number can represent a different customer.
    • To do this MPLS uses the MultiProtocol BGP.
  • MP BGP  allows re-define the NLRI filed in BGP updates.
  • This re-defination allows for an additional variable-length umber, called Address family
    • This address family added at, in front of the prefix. 
  • MPLS RFC 4363, "BGP/MPLS IP Virtual Private Networks(VPNs)," defines a specific new address family to support IPv4 MPLS VPNs--named as an MP-BGP address family called  Route Distinguishers (RDs)
  • RDs allow BGp to advertise & distinguish between duplicate IPv4 prefixes.
  • The concept is simple:
    • Advertise each NLRI as the traditional IPv4 prefix, but add another number (the RD)
      • RD uniquely identifies the route.
  • In the new NLRI format, called VPN-V4, has 2 parts:
      • 64-bit RD
      • 32-bit IPv4 prefix
    • example: 1:111:10.2.2.0/24
  • Every VRF must be configured with an RD.

PE Role in MPLS


  • PE router:
    • An LSR that shares a link with at least one Customer Edge router, 
    • edge of MPLS VPN, IBGP & VRF tables
  • PE & P routers can together label switch packets from the ingress PE to the egress PE router.
  • PE .have several other duties:
    • Learn customer routes
    • & keep track of which routes belong to which customer.
    • Exchange routes with connected CE routers from various customers.
    • To keep the track of the possibly overlapping prefixes.
  • PE routers do not put the routers in normal IP routing table
    • instead , PEs store routes in separate per-customer routing tables, called VRFs
  • To exchange these customer routes with other PEs use IBGP.
    • never advertise these routes to P routers.
  • PEs advertise Route Targets in BGP updates as BGP Extended Community Path Attributes (PAs)

Feeding the FIB & LFIB


  • LIB: Label Information Base
    • Each LSR store all labels & their related information in Label Information Base.
  • Each LSR must choose the best label & outgoing interface & then populate that information into the FIB & LFIB
  • As a result, the FIB & LFIB having the best currently used LSP.
  • Best route in IP routing table become the best LSP in LIB.
  • LSR makes the following decision:
    • for each route in the routing table
    • find the corresponding label information in LIB
    • based on the outgoing interface & next hop router.
    • Add the corresponding label information to the FIB & LFIB.

MPLS TTL field & It propagation


  • MPLS TTL is similar to IP header's TTL
  • IP header's TTL used for:
    • identifying loops
    • traceroute command to find the ip address of each router in a particular end to end route.
  • MPLS TTL used for same above ip TTL functions.
  • From this we confirmed that, presence or absence of MPLS in a network has no effect on the TTL related processes.
  • When switching LSR will decrement the MPLS TTL but not the IP TTL.
  • TTL in MPLS network:
    • At Ingress E-LSR:
      • It decrements the IP TTL field in unlabeled packet
      • then push a label in unlabeled packet
      • & copy the decremented IP TTL into the new MPLS TTL.
    • At LSR:
      • When LSR swaps a label, MPLS TTL will be decremented 
      • & doesn't effect the IP TTL
    • At Egress E-LSR:
      • After an egress E-LSR decrements the MPLS TTL field, it pops the MPLS label (header)
      • & then copies the MPLS TTL to the IP TTL.
  • A looping packet would decrements to TTL 0 and discarded.

MPLS Label Filtering

  • By default LDP will generate & advertise labels for every prefix in the local routing table.
  • To filter & generate labels only for required prefixes
    • we can use access control lists to select the required prefixes eligible for label generation.
  • example:
    • create access list:
      • """access-list 10 permit 150.1.0.0 0.0.255.255"""
    • Stop automatic assigning of labels to prefixes.
      • """no mpls ldp advertise-labels"""
    • use of access list to filter the label generation
      • """mpls ldp advertise-labels for 10"""
  • Before MPLS label filtering:

  • After MPLS label filtering:






MPLS forwarding using FIB & LFIB


  • To forward packets LSR uses:
        • CEF FIB
        • MPLS LFIB
  • Both the FIB & LFIB hold 
    • necessary label information
    • outgoing interface
    • next-hop 
  • CEF FIB: Forward Information Base
    • Used for incoming unlabeled packets.
    • Router matches the packet's destination IP address to the best prefix in the FIB
    • And forward the packet based on that entry.
  • MPLS LFIB: Labeled Forward Information Base:
    • Used for labeled packets.
    • Router compares the label in the incoming packet to the LFIB's list of label 
    • and forward the packet based on that LFIB entry.
  • Above image taken from Cisco press: ccie R&S certification guide, 4th edition
  • MPLS enable forwarding process based on something other than the destination ip address such as:
    • VPN from which the packet originated
    • forwarding to balance traffic with traffic engineering
    • & forwarding over different links based on QoS goals.