By default, which MPLS operation is performed by the penultimate router in an LSP on the transport label?
In a Multiprotocol Label Switching (MPLS) environment, label operations are categorized into three primary actions: Push (adding a label), Swap (replacing a label), and Pop (removing a label). The specific behavior described in the question refers to a mechanism called Penultimate Hop Popping (PHP).
According to Juniper Networks technical documentation, the goal of PHP is to improve forwarding efficiency at the egress point of a Label-Switched Path (LSP). The Egress Label Edge Router (LER), which is the final destination for the LSP, would normally have to perform two lookups if it received a labeled packet: first, it would look up the label in its MPLS table to see it is the destination, and second, it would look up the underlying IP payload in its IP routing table (inet.0) to forward the packet.
To alleviate this burden, the Egress LER signals a special label value called Implicit Null (Label 3) to its upstream neighbor (the penultimate router) during the signaling process (RSVP or LDP). When the penultimate router receives a packet destined for that egress LER, it sees the instruction to pop the transport label. Consequently, the penultimate router performs a Pop operation, stripping away the outer MPLS label and sending the raw IP packet (or the remaining inner service label) to the Egress LER.
This allows the Egress LER to perform only a single lookup. If the transport label was the only label, the Egress LER simply performs a standard IP lookup. If there is a VPN label remaining, it performs a single MPLS lookup for the VRF. This 'default' behavior in Junos OS optimizes the performance of the egress router by offloading the final label removal to the penultimate hop. Note that if Ultimate Hop Popping (UHP) were configured (via the explicit-null command), the penultimate router would perform a Swap to Label 0 instead of a Pop.