ore) through the notion of a label stack. A label stack can consist of multiple shim labels, as shown in Figure 13.6. The stack can be of arbitrary depth, which allows tunnels to be nested to any (practicable) depth required by a network operator. Note that the S-bit is used to identify the last packet in the stack; it is only 1 for the last (lowest) label. Figure 13.7 shows two packet flows in LSPs that pass through two further nested LSP tunnels. In MPLS terminology this creates a hierarchy of LSP tunnels. As the flow enters a tunnel the label stack has an additional label pushed onto it. For example, packet A will progress to W using label swapping of a single label. As the packet leaves W it enters the first LSP tunnel and SO here it has an additional label pushed onto the stack. This happens again at X. At Y and Z the packet leaves the tunnel and SO the additional label is removed. The scenario in the diagram assumes that the two packet flows can be treated identically as they pass through the tunnels between W and Z, and hence they can be assigned the same topmost Chapter 13 Multiprotocol Label Switching label. This can be seen for packets C and O, where the two topmost labels are the same. The use of more than one label in a label stack is used by both traffic engineering and MPLS VPNs, as discussed later. One of the key points in MPLS is that only the topmost label is used for forwarding and neither the lower-level labels nor the IP header are inspected until the end of an LSP tunnel or egress from the MPLS network, respectively. Forwarding Equivalence Class The notion of an LSP has been introduced and the fact that packets flow through LSPs. However, there needs to be a mechanism for allocating packets to a particular LSP at the LSP ingress. In MPLS, the term for classifying packets at the ingress is called a Forwarding Equivalence Class (FEC). A FEC is any means of uniquely grouping packets based on the contents of the packet. Examples of FECs include Packets with a destination IP address matching an IP