[Contents]
[Prev]
[Next]
[Index]
[Report an Error]
Label Allocation
In the JUNOS software, label values are allocated
per router. The display output shows only the label (for example, 01024). Labels for multicast packets are independent of those
for unicast packets. Currently, the JUNOS software does not support
multicast labels.
Labels are assigned by downstream routers relative
to the flow of packets. A router receiving labeled packets (the next-hop
router) is responsible for assigning incoming labels. A received packet
containing a label that is unrecognized (unassigned) is dropped. For
unrecognized labels, the router does not attempt to unwrap the label
to analyze the network layer header, nor does it generate an Internet
Control Message Protocol (ICMP) destination unreachable message.
A packet can carry a number of labels, organized
as a last-in, first-out stack. This is referred to as a label stack. At a particular router, the decision about
how to forward a labeled packet is based exclusively on the label
at the top of the stack.
Figure 1 shows the encoding
of a single label. The encoding appears after data link layer headers,
but before any network layer header.
Figure 1: Label Encoding

Figure 2 illustrates the
purpose of the class-of-service bits (also known as the EXP or experimental bits). Bits 20 and 21 specify
the queue number. Bit 22 is the packet loss priority (PLP) bit used
to specify the random early detection (RED) drop profile. For more
information about class of service and the class-of-service bits,
see Configuring Class of Service for MPLS.
Figure 2: Class-of-Service Bits

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 and S bits are derived from the IP packet header. The MPLS CoS is
derived from the queue number. If the push operation is performed
on an existing MPLS packet, you will have a packet with two or more
labels. This is called label stacking. The top label must have its S bit set to 0, and might derive CoS and time to live (TTL)
from lower levels. 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. The popped TTL
value from the previous top label is not written back to the new top
label.
- Swap—Replace 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-ttl or no-propagate-ttl statement is configured).
A transit router supports a label stack of any depth.
- Multiple Push—Add multiple labels (up to three)
on top of existing packets. This operation is equivalent to pushing
multiple times.
- Swap and Push—Replace the existing top of the label
stack with a new label, and then push another new label on top.
[Contents]
[Prev]
[Next]
[Index]
[Report an Error]