In an MPLS network, routers are categorized by their role along a Label Switched Path (LSP). In this scenario, the LSP originates onR1 (Ingress LER)and terminates onR5 (Egress LER). Between these two endpoints are the Provider (P) routers, also known as Transit Label Switching Routers (LSRs), which include R2, R3, and R4.
To identify which router performsonlylabel swap operations, we must look at the standard Junos data plane behavior:
R1 (Ingress LER):Performs aPushoperation. It receives native IP traffic from Networks 1 or 2, looks up the destination, and imposes (pushes) an MPLS label onto the packet before sending it to R2.
R2 and R3 (Transit LSRs):These routers perform aSwapoperation. They receive a labeled packet, look up the incoming label in their Label Forwarding Information Base (LFIB), replace it with an outgoing label provided by the downstream neighbor, and forward it.
R4 (Penultimate Hop):By default, Junos usesPenultimate Hop Popping (PHP). Because R4 is the second-to-last router before the egress (R5), the egress router R5 advertises an "implicit-null" label (Label 3) to R4. This instructs R4 to perform aPopoperation—removing the MPLS label entirely—and sending the native IP packet to R5.
R5 (Egress LER):Receives the packet (which is already unlabeled due to PHP) and performs a standard IP route lookup to reach the final destination in Network 3 or 4.
Among the options provided,R3is the only router that is a transit LSR butnotthe penultimate hop. While R2 also performs a swap, it is not an option. R4 performs a Pop (due to PHP), R1 performs a Push, and R5 performs an IP lookup. Therefore, R3 is the correct answer as it solely performs the label swap operation.