Label Stack Operations and PHP
What this domain tests
Label Stack Operations and PHP tests exact stack behavior: push, swap, pop, bottom-of-stack, implicit-null, explicit-null, and how service labels sit inside transport labels. You need to predict the label stack at each hop.
Core rules
- Push adds a new top label; swap replaces the top label; pop removes the top label. The bottom-of-stack bit is set on the last label in the stack.
- Labels are ordered outer to inner. The outer label is the transport label used to reach the egress PE; the inner label is often the VPN or pseudowire service label.
- PHP is an agreement in which the penultimate router pops the transport label. The egress PE then receives an unlabeled packet or a packet with explicit-null label 0.
- Implicit-null is advertised as a label binding but is never sent on the wire. Explicit-null is sent as label 0 and is popped by the egress.
- PHP reduces label operations at the egress and can simplify egress forwarding, but it can also hide the egress transport label from some hop-by-hop diagnostics.
Worked example
PE1 has a VPN packet for PE2. It pushes VPN label 300, then transport label 900. P1 swaps 900 to 700. P2 is the penultimate router and has been told by PE2 to use implicit-null for the transport LSP. P2 pops 700 and forwards a packet with only label 300 to PE2. PE2 pops 300, identifies the VRF, and routes the IP packet. If PE2 had advertised explicit-null, P2 would send label 0 on top of 300, and PE2 would pop 0 first.
Traps
Do not say PHP removes all labels; it removes the transport label, not necessarily the service label. Do not put implicit-null on the wire. Do not confuse label 0 with a reset or invalid label. Do not reverse inner and outer labels.