A network device for processing data packets includes input logic, a
register, route lookup logic and output processing logic. The input logic
receives a data packet having at least one multi-protocol label switching
(MPLS) tag, stores the packet and forwards a portion of the packet
including the MPLS tag. The route lookup logic receives the portion of
the packet, generates next hop information based on the MPLS tag and
determines whether at least one MPLS tag is to be removed from the packet
before the packet is to be output by the network device. The route lookup
logic also modifies a start offset value in the register for each MPLS
tag that is to be removed and forwards the start offset. The output
processing logic receives the start offset and begins processing the data
packet for output at a location identified by the start offset.