Operations on Labels
The router supports the following label operations:
- Push—Add a new label to the top of the packet. For IPv4 packets, the new label is the first label. The TTL, S, and CoS fields are derived from the IP packet header. If the Push operation is performed on an existing MPLS packet, you will have a packet with 2 or more labels. This is called label stacking. The top label must have its S field set to 0, and might derive CoS and TTL from lower levels. Note that in JUNOS software Release 4.2 and later, the new top label in a label stack always initializes its TTL to 255, regardless of the TTL value of lower labels.
- Pop—Remove the label from the beginning of the packet. Once the label is removed, the TTL is copied from the label into the IP packet header, and the underlying IP packet is forwarded as a native IP packet. In the case of multiple labels in a packet (label stacking), removal of the top label yields another MPLS packet. The new top label might derive CoS and TTL from a previous top label. Note that in JUNOS software Release 4.2 and later, the popped TTL value from the previous top label is not written back to the new top label.
- Swap—Replaces the label at the top of the label stack with a new label. The S and CoS bits are copied from the previous label, and the TTL value is copied and decremented (unless the
no-decrement-ttlorno-propagate-ttlstatements are configured). A transit router supports a label stack of any depth.- Multiple Push—Add multiple labels (up to 3) on top of existing packets. This is equivalent to doing Push multiple times.
- Swap and Push—Replace the existing top of the label stack with a new label, followed by pushing another new label on top.