A network packet carries data via protocols that the Internet uses, such as Transmission Control Protocol/Internet Protocol/Ethernet Protocol (TCP/IP/Ethernet). A typical switch is able to modify various fields of incoming packets prior to sending the packets out to a destination or to another switch. Incoming packets are modified for various reasons, such as where the packets are being forwarded to, the protocol the destination supports, priority of the packets, incoming format of the protocol header, etc. Since network protocols are evolving, one or more fields of a protocol header can be optional, which complicates the hardware of the switch as a given field within a protocol header may not be always at a fixed offset.
During modification of a packet, the prior art switch linearly processes each protocol layer in the packet. Such processing can create network related performance issues, including latency, which can cause an implementation to overprovision processing resources.