Hosts do not send packets with labels, so labels have to get added to packets at some point. In addition at some point that label will have to be removed, routers that inject, remove, or forward packets based on labels use MPLS forwarding logic.
MPLS relies on CEF while adding logic and data structures as well.
The steps from the figure are explained as follows:
1. Host A generates and sends an unlabeled packet destined to host 10.3.3.3.
2. Router CE1, with no MPLS features configured, forwards the unlabeled packet based on the destination IP address, as normal, without any labels.
3. MPLS Router PE1 receives the unlabeled packet and decides, as part of the MPLS forwarding process, to impose (push) a new label (value 22) into the packet and forwards the packet.
4. MPLS Router P1 receives the labeled packet. P1 swaps the label for a new label value (39)
and then forwards the packet.
5. MPLS Router PE2 receives the labeled packet, removes (pops) the label, and forwards the
packet toward CE2.
6. Non-MPLS Router CE2 forwards the unlabeled packet based on the destination IP address, as normal.