Wednesday, April 11, 2012

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.



Tuesday, April 10, 2012

VRF: Virtual Routing & Forwarding


  • VRF:
    • VRF tables are the fundamental building block for virtualizing a router, it turn into multiple virtual routers.
    • Technically VRF is a separate RIB(Routing Information Base) & FIB (Forward Information Base)
    • Any interface on the router could be assigned to a VRF.
      • using command "ip vrf forwarding <name>"
      • this command will erase all existing ip address config on the interface (to avoid duplication)
      • After this configuration, all packets recevied on the interface are routed & forwarded using the associated VRF table.
      • VRF enabled interfaces are not showed in global routing table
        • i.e show ip route
      • Each VRF has its own routing table
        • to see this routing table use "show ip vrf "
    • Interfaces showed in global routing table are not in any vrf.
      • i.e. VRF & global routes are separate.
    • VRFs without MPLS is considered as "VRF Lite"
    • If 2 VRFs have same ip prefix but they cannot route to each other.
      • Because they are separately labeled.
    • We cannot manually leak the traffic between VRFs by creating static routes.
      • i.e. interfaces are route with other interfaces which are in same VRF.
    • BGP is enhanced to handle VRF specific routes.
      • A new sepcial MP-BGP address family named "VPN IPv4" has been added to bgp along with new NLRI format.
    • To support multiple customers in MPLS VPN, VRF tables were used.
      • VRF tables are used to store routes separately for different customer VPNs.
      • The use of separate tables solves some problems:
        • Leakage packets from one customer to another due to overlapping prefixes
    • VRF has 3 main components:
      • An IP routing table (RIB)
      • A CEF FIB, populated based on that VRF's RIB
      • A separate process of the routing protocol used to exchange routes with the CE's.

MPLS Laeyer 3 VPNs


  • VPNs:
    • Customers can connect geographically divers sites across the provider's network
  • Traditionally VPN were based on IPsec(layer-3) or TLS(laery-2)
  • These 2 were slow & having less features.
  • By using MPLS we will overcome these problems.
  •  With Layer-3 VPNs the service provider participate in the customer's Layer-3 routing.
    • Service provider's PE router  connect with CE router with L3 protocols
  • Layer 2 VPNs: Provider connect the customer site with layer 2 technologies like ATM, Frame-relay or ethernet.
  • MPLS Layer 3 VPNs:
    • Combines the logic of MPLS tunnels with layer 3 routing information
    •  PE routers learn customer routes from Customer Edge(CE) routers.
    • PE routers advertise customer routes to other PEs via multi-protocol BGP.
    • No need to know about the customer route in the middle of the SP network.
    • BGP next-hops point to MPLS tunnels
      • ex: loopbacks of PE routers
    • MPLS L3 VPNs have 2 basic components
      • Seperation of customer routing information
        • to do this VRF (Virtual Routing & Forwarding) used.
        • VRF used on PE routers to keep track on customer routes on per interface basis.
      • Exchange of customer routing information.
        • to do this MP-BGP is used over the MPLS network.
        • Traffice is label switched towards the BGP next-hops.
    • The idea of MPLS VPN is 
      • establishing a full-mesh of dynamic MPLS LSRs between PE routers.
      • using these PE routers for tunneling VPN packets across the network core.