cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4505
Views
15
Helpful
4
Replies

when MPLS Router Push,SWAP the mpls label

Hello freinds

just confused question, when the router will push a label rather than swap, like the case of LDPoRSVP it will push a TE label at the Border,

other case in case of seamless (Unified MPLS), the ABR will push the label and retain the BGP and VC label untouch, thrid case FRR, Pushing the label rather than swap,

When the router will push more label into the stack and when it will swap.

Mohamed.

4 Replies 4

Hello,

In MPLS, there are three operations regarding Labels.

Push simply means adding a label on the top of the IP header or on the top of the existing labels.

Pop means removing a label from the top of label stack.

Swap means exchanging a label with another label. Swap is a pop and a push.

In pure MPLS, when a packet comes from the outside of MPLS network, router will push a label and redirect the packet. The middle routers do swaping(changing one label with another label). When the packets are leaving the MPLS network, MPLS labels will be poped.

When other applications of MPLS such as MPLS VPN or MPLS TE are used, each packet might carriy more than one label. As an example, In MPLS VPN, PE routers push and pop two labels and core routers only swap outer labels.

PE pushes one label which has been assigned to the route inside the VRF and pushes another Label which is used by core routers to transfer the packets to other PEs. Other PEs pop one label and use internal label to direct the packets to proper VRF.

I hope it helps,

Masoud

Hi Masoud,

thanks for your reply, you explain the mpls push/swap/pop process but this is not my question.

my question is when the router understand he should swap or push the label, as mention some application like LDPoRSVP at border , the router push the TE label and leave the LDP underneath untouch, but how the Router understand this, technically how ?

Mohamed.

Hello,

It is a little hard to explain because there are a lot of things involved. I will explain it by using MPLS VPN because I have better understanding of it.

When you activate MPLS and MPLS VPN, each router assigns a unique lablel to each route(unique inside a router). This labels must be propagated to other routers.

LDP propagates lables assigned to each route which is inside the global routing table. In this way, routers in the core and PE routers will get the labels information.

BGP propagates labels inside each VRF, so only BGP neighbors(PE) will learn these labels. Core routers do not have any understanding of these labels.

Why PE needs to push two labels? Because one label is for the route inside the VRF and one label for the nexthop which is the other PE router(usually a loopbak).

Now all routers have all the labels information. Based on these labels, two tables get updated.

FIB and LFIB.

Rule 1- When a packet arrives with no MPLS tag, router uses FIB(cef) to look up. Router uses FIB to push the labels and then route to the nexthop. PE usually pushes two or more labels in MPLS VPN or MPLS TE .

Core routers usually SWAP or POP if all their interfaces are within MPLS network.

*****************

Let me show you the output of FIB table. Destination is a IP which is inside a VRF.

See the topology attached. 192.168.3.1 is located in a VRF on R3. We start from R1.

R1#show ip cef vrf a 192.168.3.1 detail
192.168.3.0/24, version 8, epoch 0, cached adjacency 1.1.1.2
0 packets, 0 bytes
  tag information set
    local tag: VPN-route-head
    fast tag rewrite with Fa0/0, 1.1.1.2, tags imposed: {16 19}
  via 172.16.1.3, 0 dependencies, recursive
    next hop 1.1.1.2, FastEthernet0/0 via 172.16.1.3/32
    valid cached adjacency
    tag rewrite with Fa0/0, 1.1.1.2, tags imposed: {16 19}

First, R1 pushes 19 and then16 at the top(two labels) and forwards it to FastEthernet0/0

19 has been advertised by BGP in R3 and 16 has been advertisd by R2(R2 expects to receive a packet with label 16)

Rule 2- When router receives a packet with a label, It looks up LFIB table. Only checks the label not the destination IP.

Let me show you an exampls.

R2#show mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     172.16.1.3/32     5137       Fa1/0      2.1.1.1

As you see, previous router(R1) pushed 16 on the top, now this router(R2) pops the label 16

because the next router(R3) is the destination.

R3 is the last router. R3 recieves a packet with the label 19 and then routes it to a specific VRF. It should be mentioned, labels in each router are unique, so router exactly know which label belongs to which VRF.


R3#sh mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     1.1.1.0/24        0          Fa0/0      2.1.1.2
17     Pop tag     172.16.1.2/32     0          Fa0/0      2.1.1.2
18     17          172.16.1.1/32     0          Fa0/0      2.1.1.2
19     Aggregate   192.168.3.0/24[V] 520

Hope it helps,

Masoud

Hello Masoud,

thanks alot for your explaning in more details, it's bit more clear.

thanks again.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: