MPLS LDP (Label Distribution Protocol)

Hello Jack

The case you are describing in your post is penultimate hop popping (PHP), which is a function performed by Label Switch Routers (LSR) before sending the packet to an adjacent Label Edge Router (LER). PHP is achieved because the LER advertises a label with a value of 3 to its neighbors. This is called an implicit-null and it is used for the LERs to inform the LSRs to perform PHP. Rene writes more about this in this post:

I hope this has been helpful!

Laz