0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Label | Exp |S| TTL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Label | Exp |S| TTL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Label | Exp |S| TTL |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload |
| ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The MPLS stack header consists of one or more 4-byte fields, called “labels”, followed by a “payload” field. Each label field contains several subfields:
- Label: A 20-bit value used to identify the label-switched path (LSP) that the packet should follow.
- Exp: A 3-bit field used for experimental purposes, such as quality of service (QoS) or differentiated services.
- S: A 1-bit “bottom of stack” (BoS) flag. If set to 1, it indicates that this label is the last one in the stack.
- TTL: An 8-bit time-to-live (TTL) field, similar to the TTL in IP packets.
The payload field can contain any type of data, such as an IP packet, Ethernet frame, or MPLS packet (in the case of MPLS over MPLS).
Note that the example above shows a stack of three labels, but MPLS stacks can be of varying lengths depending on the requirements of the network.
source: chatGPT