[IP Adventure] A Packet's Adventures on Routers - 10

EchoW
EchoW  Senior  (1)
5 years 11 months ago  View: 5200  Reply: 5
1F

MPLS Forwarding Process

Processing on the Ingress

After a data packet enters an MPLS network, the ingress analyzes it and adds a label to the packet. Transit LSRs forward the packet based on labels carried in the packet. The egress removes the label from the packet before sending the packet out of the MPLS network.

  1. The uplink packet forwarding engine (PFE) parses a received packet and determines the forwarding type. The process is the same as the Layer 2 or Layer 3 IP forwarding process for handling an incoming packet. Layer 2 forwarding is performed for an incoming packet in a VPLS, VLL, or PWE3 scenario, and Layer 3 IP forwarding in an MPLS VPN scenario.

    • MPLS L3VPN scenario: Layer 3 IP forwarding is performed for incoming packets. The ingress searches the forwarding information base (FIB) table for a matching entry. If the tunnel ID is 0x0, common IP forwarding is performed. If the tunnel ID is not 0x0, MPLS L3VPN forwarding is performed.

      Destination/Mask  Nexthop   Flag   TimeStamp  Interface   TunnelID
      1.1.1.1/32        10.0.0.1   DGU   t[347299]  GE1/0/0     0x0
      10.0.0.0/24       10.0.0.1   U     t[257502]  GE1/0/0     0x0 
      192.0.0.0/24      10.0.0.1   DGHUT t[670625]  GE1/0/0     0x2000001 
      127.0.0.0/8       127.0.0.1  U     t[102]     InLoop0     0x0
      

      VPN packets are transparently transmitted along LSPs in an MPLS domain. The outbound interface of VPN packets on the ingress connects to an LSP. To provide a uniform interface for upper-layer applications (such as VPN and route management) that use tunnels, the ingress automatically assigns an ID to each tunnel. Such ID is called a tunnel ID that is valid only on a local node. The following figure shows the format of a tunnel ID.

      The LSP Token field is used to search the MPLS forwarding table for matching entries. The LSP token value is merely an index used in MPLS forwarding entry lookup.

    • VPLS: The ingress performs Layer 2 bridge forwarding for incoming packets. The ingress searches the MAC entry table based on the destination MAC address and VLAN ID in a packet and finds a matching outbound interface name and LSP token. The following figure shows an example of a MAC entry table:

      MAC Address      VLAN/    PEVLAN CEVLAN Port         Type      LSP/LSR-ID
                       VSI/SI                                        MAC-Tunnel
      -------------------------------------------------------------------------
      0005-0005-0005   b        -      -      GE3/1/6      static    3/-
      
    • VLL/PWE3: Layer 2 VPN forwarding is performed for incoming packets. The ingress searches the L2VPN forwarding table and finds the matching control word, outbound interface information, and LSP token.
  2. The ingress performs common processing and uses a switch fabric unit (SFU) to an outbound interface.
  3. The downlink packet forwarding engine (PFE) searches for the next hop label forwarding entry (NHLFE) based on the LSP token. The NHLFE table is used to guide MPLS forwarding.

    NHLFE:
    LSR Type         : Ingress
    Tunnel id        : 0x2000001
    Out interface    : GigabitEthernet1/0/0
    Nexthop          : 10.0.0.1
    Out label        : 4096
    Label operation  : PUSH

    The NHLFE entry contains an inner label value, an outer label value, a label operation type, an outbound name, and a next-hop IP address.

  4. The ingress performs common downlink processing.
  5. The outbound interface module encapsulates the recently processed information into the packet. The module pushes two labels into the packet. The S field value in the inner label is 1, indicating the stack bottom label. The S field value in the outer label is 0. If VLL or PWE3 is used, the module determines whether to add a control word between the inner label and payload based on the control word before encapsulating data link layer information. If the Ethernet type is used at the data link layer, the Eth-Type field value is 0x8847. The module forwards the packet to a physical interface card (PIC), and the PIC converts the packet into electrical or optical signals and forwarding them.

Processing on a Transit LSR

Packets in MPLS L3VPN, VPLS, VLL, and PWE3 scenarios are processed in the same way on a transit LSR.

  1. The transit LSR parses the received packet and finds its protocol type is MPLS. The transit LSR uses the stack top label to look for a match in the incoming label mapping (ILM) table and obtain an entry that contains the tunnel ID and outbound interface information. The outbound interface information contains the target blade (TB) and target port (TP).

    If load balancing is used, multiple ILM entries are found. The transit LSR uses a hash algorithm to select one ILM entry. The following figure shows an example of an ILM entry.

    If fast reroute (FRR) is used, the transit LSR determines the active and standby routes based on the LSP status and outbound interface status. If the primary LSP and its outbound interface are working properly, the transit LSR selects the primary LSP. If not, the FRR LSP (backup LSP) is selected.

    ILM:
    In Label          : Ingress
    Swap label        : --
    Load-balance Count: 2
    Tunnel id [0]     : 0x2000002
    Out interface [0] : GigabitEthernet2/0/0
    Nexthop [0]       : 20.2.1.2
    Tunnel id [1]     : 0x2000003
    Out interface [1] : GigabitEthernet2/0/1
    Nexthop [1]       : 20.2.2.2
    Has FRR LSP       : No
    FRR inner label   : --
    FRR tunnel id     : 0
    FRR out interface : no
    FRR nexthop       : no 
  2. If a trunk interface is used as an outbound interface, the transit LSR uses a trunk hash algorithm to select a trunk member interfaces as the outbound interface.
  3. The transit LSR performs common processing and uses an SFU to forward the packet downstream based on target board information.
  4. The downstream PFE searches for an NHLFE entry based on the tunnel ID and LSP token. The matching NHLFE entry contains outbound interface information, a next-hop IP address, an outgoing label value, and a label operation type. The label operation type is "swap" for a label with value non-3 or "pop" for a label with value 3.

    NHLFE:
    LSR Type         : Transit
    Tunnel id        : 0x2000002
    Out interface    : GigabitEthernet2/0/0
    Nexthop          : 20.2.1.2
    Out label        : 3
    Label operation  : SWAP
    
  5. If the outgoing label value is not 3, the transit LSR swaps the outer incoming label for another outgoing label value, reduces the TTL value by one, and encapsulates data link layer information into the packet. If Ethernet is used at the data link layer, the Eth-Type value is 0x8847. If the outgoing label value is 3 (implicit null label), the transit LSR removes the outer label, sets the MPLS TTL carried in the inner label to the outer MPLS TTL value minus one, and encapsulates data link layer information into the packet.
  6. The transit LSR performs common processing, such as implementing the committed access rate (CAR).
  7. The downlink PFE uses the traffic classification QoS policy to re-set the EXP value in the MPLS header of the packet and checks the packet with the outbound interface. The transit LSR forwards the packet to the PIC, and the PIC converts the packet into electrical or optical signals and forwards them.

Processing on the Egress

  1. The egress searches the ILM table for an entry matching the outer label in the packet. If the label operation type is "pop" in the entry, the egress removes the label from the packet.
  2. The egress checks the S field in the removed label.

    • If the S field is 0, the egress repeats Step 1 to remove the label from the stack.
    • If the S field is 1, the egress then performs Layer 2 or Layer 3 forwarding based on payload. 
    ”.
Related subjects:

[IP Adventure] A Packet's Adventures on Routers - 09

[IP Adventure] A Packet's Adventures on Routers - 08

[IP Adventure] A Packet's Adventures on Routers - 07

[IP Adventure] A Packet's Adventures on Routers - 06

[IP Adventure] A Packet's Adventures on Routers - 05

[IP Adventure] A Packet's Adventures on Routers - 04

[IP Adventure] A Packet's Adventures on Routers - 03

[IP Adventure] A Packet's Adventures on Routers - 02

[IP Adventure] A Packet's Adventures on Routers - 01

[IP Adventure] A Packet's Adventures on Routers - Introduction

Comment
nklsureshkumar nklsureshkumar  5 years 5 months ago

glorious data doc 

jejrodriguez
jejrodriguez  Junior 
5 years 11 months ago
2F
interesting knowledge
thanks
Saravanan.S
Saravanan.S  Gold 
5 years 5 months ago
3F
Thanks for sharing MPLS forwarding Process
Saravanan.S
Saravanan.S  Gold 
5 years 5 months ago
4F
Very useful information
nklsureshkumar
nklsureshkumar  Platinum 
5 years 5 months ago
5F
pretty PPT