In MPLS VPN network, which one is the first thing to do? I mean label tagging is first or VPN encapsulation is first? If you can, please explain about this case.
I think your question is not truly correct. First of all, as explain here
"an MPLS VPN is a VPN that is built on top of an MPLS network, usually from a service provider, to deliver connectivity between enterprise office locations. "
The MPLS is the mechanism that directs data from one network node to the next, based on short path labels instead network addresses. This avoid the routing table complexity. MPLS works in conjunction with IP and its routing protocols.
Based on this, MPLS VPN is a method to harm the power of MPLS to create virtual private networks. There are three different type of MPLS VPN:
- Layer 3 MPLS VPNs
- Layer 2 MPLS VPNs
- Point-to-point (pseudowire)
So, the protocol on the base of all this environment is the Label Distribution Protocol (LDP), which routers, capable of MPLS, exchange label mapping information.
Label tagging is developped to works MPLS network also without VPN. Then, MPLS VPNs born to combine the power of MPLS and the Border Gateway Protocol (BGP) routing protocol: MPLS is used to forward packets over the provider’s network backbone, and BGP is used for distributing routes over the backbone.
The common thing (if you analyze a packet captured in a MPLS network) is the MPLS header that is (in a L3 MPLS) always putted between datalink layer and IP layer.
In a L3 MPLS VPNs, for example, the situation is this:
In details, the MPLS header frame format is:
I think you are confused.
In an MPLS VPN the layer 2 or layer 3 traffic being carried over an Label Switched Path is not encapsulated - MPLS does not provide an encapsulation method - it is a transport method.
MPLS labels are inserted (usually) above say an the Ethernet header and below the IP header, and it provides a transport mechanism across a packet switch network. It does not provide any encapsualtion method.
The "payload" is label switched across the LSP, only a transport service is being provided (in the case of simple layer 2 Ethernet VPN or a layer 3 IP VPN).