Saturday, May 30, 2015

Forwarding Labeled packet in MPLS

  “Forwarding labeled packets is quite different from forwarding IP packets”


We will continue with How labeled packets are forwarded in MPLS networks, how forwarding labeled packets is different from forwarding IP packets, how labeled packets are load-balanced, and what a label switching router (LSR) does with a packet with an unknown label.


IP Lookup Versus Label Lookup

When a router receives an IP packet, the lookup done is an IP lookup. In Cisco IOS, this means that the packet is looked up in the CEF table. When a router receives a labeled packet, the lookup is done in the LFIB of the router.

The router knows that it receives a labeled packet or an IP packet by looking at the protocol field in the Layer 2 header


See IP-to-label forwarding case

R1#sh ip cef 3.3.3.3 detail
3.3.3.3/32, epoch 0
  local label info: global/16
  1 RR source [no flags]
  nexthop 192.168.0.2 FastEthernet1/0 label 16

Here,IP packets that enter the LSR destined for 3.3.3.3/32 go out on interface FastEthernet1/0 after being imposed with the label 16

The next hop of this packet is 192.168.0.2 - R2

The IP-to-label forwarding is done at the imposing LSR

 In Cisco IOS, CEF switching is the only IP switching mode that you can use to label packets



LFIB

This is an example of the label-to-label forwarding case.for 3.3.3.3

R1#sh mpls forwarding-table
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
16         16         3.3.3.3/32       0             Fa1/0      192.168.0.2
17         Pop Label  2.2.2.2/32       0             Fa1/0      192.168.0.2

The local label (or tag) is the label that this LSR assigns and distributes to the other LSRs

Label 16 swap with Label 16..(Label is locally significant)



if this LSR receive   a packet with Top label 17, it will remove all label and forward this as an IP packet.

17         Pop Label  2.2.2.2/32       0             Fa1/0      192.168.0.2

If the detail key word is specified, you can see all the labels that change in the label stack

R1#sh mpls forwarding-table 3.3.3.3 detail
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
16         16         3.3.3.3/32       0             Fa1/0      192.168.0.2
        MAC/Encaps=14/18, MRU=1500, Label Stack{16}
        CA0114D80006CA0014D8001C8847 00010000
        No output feature configured
R1#


Example of an Entry in the LFIB for an MPLS VPN Prefix

R1#sh mpls forwarding-table vrf A
Local      Outgoing   Prefix           Bytes Label   Outgoing   Next Hop
Label      Label      or Tunnel Id     Switched      interface
21         No Label   10.0.0.0/24[V]   1458          aggregate/A
27         No Label   5.5.5.5/32[V]    1068          Fa0/0      10.0.0.5

The CEF adjacency table, however, determines the outgoing data link encapsulation.The
adjacency table provides the necessary Layer 2 information to forward the packet to the next-hop
LSR

R1#sh adjacency  detail

Protocol Interface                 Address
IP       FastEthernet0/0           10.0.0.5(12)
                                   13 packets, 1194 bytes
                                   epoch 0
                                   sourced in sev-epoch 0
                                   Encap length 14
                                   CA040A800008CA0014D800080800
                                   ARP
IP       FastEthernet0/1           10.0.0.4(12)
                                   84 packets, 9760 bytes
                                   epoch 0
                                   sourced in sev-epoch 0
                                   Encap length 14
                                   CA0302C80006CA0014D800060800
                                   ARP
IP       FastEthernet1/0           192.168.0.2(14)
                                   0 packets, 0 bytes
                                   epoch 0
                                   sourced in sev-epoch 0
                                   Encap length 14
                                   CA0114D80006CA0014D8001C0800
                                   ARP
TAG      FastEthernet1/0           192.168.0.2(5)
                                   129 packets, 12446 bytes
                                   epoch 0
                                   sourced in sev-epoch 0
                                   Encap length 14
                                   CA0114D80006CA0014D8001C8847
                                   ARP
R1#
R1#

These are the operation...

■ Pop—The top label is removed. The packet is forwarded with the remaining label stack or as an unlabeled packet.


■ Swap—The top label is removed and replaced with a new label.

■ Push—The top label is replaced with a new label (swapped), and one or more labels are added (pushed) on top of the swapped label.

■ Untagged/No Label—The stack is removed, and the packet is forwarded unlabeled.

■ Aggregate—The label stack is removed, and an IP lookup is done on the IP packet.

..................................................................................

Unknown Label 

In normal operation, an LSR should receive only a labeled packet with a label at the top of the stack that is known to the LSR, because the LSR should have previously advertised that label.However, it is possible for something to go wrong in the MPLS network and the LSR to start receiving labeled packets with a top label that the LSR does not find in its LFIB. The LSR can theoretically try two things: strip off the labels and try to forward the packet, or drop the packet.
The Cisco LSR drops the packet

Reserved Labels

Labels 0 through 15 are reserved labels. An LSR cannot use them in the normal case for forwarding packets. An LSR assigns a specific function to each of these labels. Label 0 is the explicit NULL label, whereas label 3 is the implicit NULL label.



Implicit NULL Label

The implicit NULL label is the label that has a value of 3. An egress LSR assigns the implicit NULL label to a FEC if it does not want to assign a label to that FEC, thus requesting the upstream LSR to perform a pop operation.

In normal operation,Edge LSR will perform two look up one  Label Lookup and second one IP lookup  , The solution for this double lookup is to have the egress LSR signal the last but one (or penultimate) LSR in the label switched path (LSP) to send the packets without a label.


The use of implicit NULL at the end of an LSP is called penultimate hop popping (PHP)

The egress LSR signals the penultimate LSR to use implicit NULL by not sending a regular label, but by sending the special label with value 3.The result is that the egress LSR receives an IP packet and 
only needs to perform an IP lookup to be able to forward the packet

 label 3 will never be seen as a label in the label stack of an MPLS packet

Note:---The use of implicit NULL is widespread and not confined only to the above  example . It  could be that the packets have two or three or more labels in the label stack. Then the implicit  NULL label used at the egress LSR would signal the penultimate hop router to pop one label and  send the labeled packet with one label less to the egress LSR.


Explicit NULL Label

in implicit null label The packet is forwarded with one label less than it was received by the penultimate LSR or unlabeled if it was received with only one label.
Besides the label value, the label also holds the Experimental (EXP) bits. When a label is removed, the EXP bits are also removed.  Because the  EXP bits are exclusively used for quality of service (QoS), the QoS part of the packet is lost when  the top label is removed

The explicit NULL label is the solution to this problem, because the egress LSR signals the IPv4 explicit NULL label (value 0) to the penultimate hop router





The egress LSR then receives labeled packets with a label of value 0 as the top label. The LSR cannot forward the packet by looking up  the value 0 in the LFIB because it can be assigned to multiple FECs. The LSR just removes the  explicit NULL label. After the LSR removes the explicit NULL label, another lookup has to occur,  but the advantage is that the router can derive the QoS information of the received packet by looking at the EXP bits of the explicit NULL label

 EXP bits value can be copied to the precedence or DiffServ bits when performing PHP and thus preserve the QoS information. Or, if the label stack has multiple labels and the top label is popped off, we can copy  EXP bits value to the EXP field of the new top label.


Router Alert Label

The Router Alert label is the one with value 1. This label can be present anywhere in the label stack except at the bottom. When the Router Alert label is the top label, it alerts the LSR that the packet needs a closer look. Therefore, the packet is not forwarded in hardware, but it is looked at by a software process.

Unreserved Labels

Except for the reserved labels of 0 through 15, you can use all the label values for normal packet forwarding. Because the label value has 20 bits, the labels from 16 through 1,048,575 (220 – 1) are used for normal packet forwarding. In Cisco IOS, the default range is 16 through 100,000

R1#show mpls label range 


Downstream Generic label region: Min/Max label: 16/100000



TTL behavior  

Time To Live (TTL) is a well-known mechanism thanks to IP. In the IP header is a field of 8 bits that signifies the time that a packet still has before its life ends and is dropped. 
TTL is usually 255 and is then decremented by 1 at each hop. If the TTL reaches 0, the 

packet is dropped.

In MPLS, the usage of the TTL field in the label is the same as the TTL in the IP header. When an IP packet enters the MPLS cloud—such as on the ingress LSR—the IP TTL value is copied (after being decremented by 1) to the MPLS TTL values of the pushed label(s).
 At the egress LSR, the label is removed, and the IP header is exposed again.

The IP TTL value is copied from the MPLS TTL value in the received top label after decrementing it by 1.



TTL Behavior in the Case of Label-to-Label


If the operation that is performed on the labeled packet is a swap, the TTL of incoming label –1 is copied to the swapped label

If the operation that is performed on the labeled packet is to push one 
or more labels, the received MPLS TTL of the top label –1 is copied to the swapped label and all pushed labels.

If the operation is pop, the TTL of the incoming label –1 is copied to the newly 
exposed label unless that value is greater than the TTL of the newly exposed label, in which case the copy does not happen













































No comments:

Post a Comment