Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

What determines the order of label in a label stack?

Suppose there is a PE router,take part in igp mpls,bgp ipv4 with label,vpnv4 and TE.Then when a packet pass the LSR from CE,the LSR will put several label on the packet.Then comes the question:How can the router determine the order of these labels when puting them on the packet.

I think there's two possibal answers:

first,it is define by some document,that's an arbitrary answer;

second,it is relate to the packet process flow.

I wonder what is the truth.I need some detailed explain or document.thanks!


Re: What determines the order of label in a label stack?


The whole idea is that the label stack is ordered.

For example:

In ordinary MPLS VPN, a label stack of 2 labels is attached to the packet. The Top label should be the LDP label for the egress PE router (for the packet to reach the Egress PE router). The second label should be the VPN label assigned by the egress PE router (for the packet to go to the right VRF or the outgoing interface).

Note: The second label will point to the outgoing interface in the case that the next-hop of the route is the CE router (most common), and it will point to the VRF for aggregate VPN routes.

The P routers do label swapping based on the Top label (LDP egress PE label)The PE router do label switching based on the second label (which it has original assigned).

The Egress PE router is the only router aware of the VPN label (exchanged between PE routers via MPBGP).

I hope that i've been informative.

HTH, please do rate all helpful replies,

Mohammed Mahmoud.

Re: What determines the order of label in a label stack?

The idea behind the stack is derived by the need to have multiple forwarding tables for the under lying forwarding planes.

1) What this means is each router as pointed by you can have multiple protocols which may be utilizing MPLS labels for data forwarding. MPLS TE will have labels of its own via RSVP to forward data on TE tunnels, VPNs will have VPN labels to forward VPN data across via MPBGP, Global routes would have labels allocated by LDP to forward data between LSR's.

2) This essentially creates multiple forwarding tables. Now where and how does the label stack come into picture, this can be answered by answering a simple question.

3) Where did the MPBGP get the label from for the VPN, from the IBGP nexthop, now is there any label to reach the next hop yes, there is via LDP, hence you get a label stack.

So whenever you build a forwarding table for any plane through a existing LSP then you have a label stack.

For eg: if you have a VPN label learnt via a LDP LSP which in turn is built via a MPLS TE LSP then you have a 3 label stack. (the lowermost being VPN since it was learnt through a next hop reachable via LDP label, which in turn was connected till the next hop via multiple TE tunnels.)

On the converse if you have a MPLS TE tunnel running between the PE's end-to-end you need not run LDP at all and the label stack to forward data across would be consiting of a VPN label and a TE label only.



New Member

Re: What determines the order of label in a label stack?

Thanks for you explaination.

I think you have solved my problem。

CreatePlease login to create content