Sunday, April 8, 2012

MPLS Header & Label


  • The MPLS header is 4-byte header,
    • located immediately before the IP header
    • also referred as MPLS shim header 
  • MPLS label is actually a 20-bit field in the MPLS header.
  • MPLS Label or MPLS Label Stack (specifically)
  • Fields in MPLS Header are:
    • Label:
      • length is 20-bits,with 
      • identifies the potion of a LSP
    • EXP(Experiment):
      • 3-bits in length
      • Used to map the standard IP packet Type Of Service (TOS) into the Experimental field fro MPLS Class Of Service(COS)
      • only used for experimental purpose only
    • S(Stack bit):
      • MPLS labels are stacked one on other label.
      • to indicate last MPLS header before ip header
    • TTL(Time To Live)
      • The TTl field from the IP TTL is decremented by 1 & then copied into the MPLS label TTL field.
      • When exiting from the MPLS network, MPLS label TTL value is copied back to the IP TTL field
      • If this field is set to 0, the packet will be discarded
      • this field length is 8-bits
  • MPLS label stack Placement:
    • It is placed between Layer 2 header & Layer 3 header.
    • For this some times MPLS labels stack referred as shim header
    • Router forward packets based on the MPLS label header because it comes before the Layer 3 header.
    • In MPLS, ip packets are switched instead of routed.
  • "Labels are bound to routes in the routing table"
  • In label stack, the outer label is used to forward the packet along the LSP, inner label is used to identify the VPN site. 
  • This beneath label called as the VPN label

TERMS

  • Overlay Model:
    • In which the routers are connected in a full mesh through virtual circuits.
  • Forward Equivalence Class (FEC):
    • FEC is group of IP packets that are treated in same way(based on a number of criteria, like ip protocol id, port numbers, etc.
  • CE: Customer Edge device
    • Router that connect to the customer network & a service provider
    • CE devices are not LSRs & can handle regular unlabeled IP packets
  • PE: Provider Edge device
    • This is a service provider equipment
    • It connects to a customer & into the Provider(P) Network.
  • P: Provider Device:
    • Service provider equipment
    • It exist in Provider network & connect to another service provider device not the customer
  • LSR: Label Switch Router
    • A router/switch that is capable of forwarding packets based on labels
  • Edge-LSR: 
    • More specific term for the PE router
    • Also an LSR
    • Push/Pop the label  to/from the ip packet and forward to next hop.
    • A PE device is an Edge-LS in MPLS based networks.
  • RIB: Routing Information Base:
    • A router's unicast ip forwarding control plane uses routing protocols, static routes and connected routes to create a Routing Information Base.
  • FIB: Forward Information Base:
    • adding a FIB entry for each destination IP prefix in the routing table
    • it will be possible after enabling the CEF.
    • FIB entry has detailed information needed for forwarding:
      • next-hop router
      • outgoing interface
    • Used for incoming unlabeled packets
  • LFIB:

MPLS LDP


  • LSRs uses LDP to send messages to their neighbors.
  • By advertising an IP prefix & label in the update, the LSR says:
    • if you want to send packets to this prefix, send them(packets) to me"
  • Stand for RFC 3036 "LDP specification"
  • Neighbor discovery:
    • send via UDP port 646 to 224.0.0.5
  • Neighbor adjacency
    • uses tcp port 646 to remote LDP router-id
  • Label advertisement 
    • Advertise FEC for
          • connected IGP interfaces
          • IGP learned routes
  • For MPLS unicast ip routing:
    • LDP simply advertises labels for each prefix listed in the IP routing table.
  • New ip route in the unicast ip routing table triggers the LDP advertisement.
  • To learn the new route LSR allocates a label called a local label
  • Local Label:
    • which represent the ip prefix just added to the routing table.

MPLS Commands


  • ip cef
  • mpls label protocol [LDP/TDP]
    • LDP is default for new version ios
    • TDP is default for old version ios
  • mpls ip
  • sh mpls ldp inerface
  • sh mpls ldp neighbour
  • sh mpls ldb bindings (local/remote)
  • sh mpls forwarding-table
  • sh ip cef
  • config)# mpls ldp advertise-labels for 20 to 30
    • advertise labels only 20 to 30 to its neighbors.
  • sh control-plane host open-ports
  • sh ip cef a.b.c.d  255.255.255.0
  • sh mpls ldp parameters
  • sh mpls ldp discovery
  • mpls ldp router-id <interface> force
  • mpls ldp discovery transport-address interface
    • if some reasons loopback ip address is not reachable, tcp connection will not establish.
    • then ldp to establish a tcp connection using physical interface ip address use above command under the interface level.
  • mpls ldp neighbor <ip> password <password>
    • ip-neighbor's ldp router-id
  • mpls ldp password required
    • to make use of password mandatory use the above command globally.

MPLS Traffic Engineering

  • Traffic Engineering: Manipulating traffic to fit to the available network resources. 
  • In Traffic Engineering, simply tweaking the IP metrics on interfaces.
  • Traffic engineering with MPLS is the best of connection-oriented traffic engineering techniques (such as ATM PVC placement) & merge them with IP routing.
  • MPLS is an integration of Layer2 & Layer 3 technologies.
  • MPLS enables Traffic Engineering, by making Layer 2 feature available to Layer 3.

MPLS & Routing


  • A label represent a set of packets but not the particular path in network.
  • Routing path is choosen by the existing layer 3 routing protocols

Distribution of LABEL BINDING


  • Each LSR in network have independent & local  decision when forwarding ip packet.
  • Label Binding:
    • Each LSR in the network makes an independent, local decision as to which label value to use to represent a Forwarding Equivalence Class (different or same ip packets with same forwarding function).
  • Each LSR informs its neighbors of the label bindings it has made.
  • For this following protocols are used:
    • TDP: Tag Distribution Protocol
      • MPLS forwarding along normally routed path
      • Cisco proprietorial and legacy 
    • RSVP: Resource Reservation Protocol
      • To support MPLS traffic engineering.
    • BGP: Border Gateway Protocol
      • Used to support MPLS VPNs
  • Label value changes as the ip packet traverse the network.

Label Switching Functions

  • In label switching, analysis of the layer 3 header is done only once.
    • After this analysis, add a fixed length, unstructured value called a label.
  • Many different header add to the same label (those headers are have same next hop)
    • i.e. a label represents a forwarding equivalence class
    • Means a set of packets which are different but they are indistinguishably by the forwarding function.
  • The initial choice of label may not depend upon the content of layer 3 packet header
    • Ex: Forwarding decisions at subsequent hops can also be based on routing policies.
  • The packet header need not be reanalysis  during packet transit through the network.
    • Because the label is fixed length and unstructured.
    • So the MPLS forwarding table lookup process is straight forward & fast