Patent ID: 8798047

Claim:
A machine implemented method, comprising: receiving a tunneled packet at a network device, the tunneled packet having a tunnel header, the tunnel header encapsulating a packet, the packet having a packet header and a payload; determining an offset value for the packet header by comparing the tunnel header to a plurality of entries stored at a data structure maintained by the network device, wherein the data structure is used for obtaining the offset value associated with the tunnel header; if the tunnel header matches one of the stored tunnel header entries, providing a pointer corresponding to the matched tunnel header entry, wherein the pointer points to the offset value that is equal to a packet offset of the tunneled packet; sending, by a loopback module of the network device, the tunneled packet to a header parser of the network device with the offset value; parsing, by the loopback module, the packet header; using the offset value for pre-processing the packet; and a hardware based offload module performing an offload function.