Thursday, November 3, 2016

Encoding of MPLS

Where does this label stack reside? The label stack sits in front of the Layer 3 packet—that is,
before the header of the transported protocol, but after the Layer 2 header. Often, the MPLS label

stack is called the shim header because of its placement.

Q: How we can know if the next address is L2 Header or MPLS Label ?
the label stack is present after the PPP
header but before the IPv4 header. Because the label stack in the Layer 2 frame is placed before
the Layer 3 header or other transported protocol, you must have new values for the Data Link
Layer Protocol field, indicating that what follows the Layer 2 header is an MPLS labeled packet.
The Data Link Layer Protocol field is a value indicating what payload type the Layer 2 frame is

carrying

Example :
R1 loopback try to ping R3 loopback using R1# ping 3.3.3.3 source loopback 0
Topology and advertised labels as shown :


Result : there’s new filed in L2 Header called type that to notify the router the next header will be MPLS stack label using this Hex number as shown in above in table and below packet capture.



Note : Where does MPLS fit in? MPLS is not a Layer 2 protocol because the Layer 2 encapsulation is
still present with labeled packets. MPLS also is not really a Layer 3 protocol because the Layer 3
protocol is still present, too. Therefore, MPLS does not fit in the OSI layering too well. Perhaps
the easiest thing to do is to view MPLS as the 2.5 layer and be done with it.