A method of generating a fast-path response to a packet received onto a network interface device, the packet being received over a TCP/IP network connection, the TCP/IP network connection being identified at least in part by a TCP source port, a TCP destination port, an IP source address, and an IP destination address, the method comprising:
- on the network interface device examining the packet and determining from the packet the TCP source port, the TCP destination port, the IP source address, and the IP destination address;
- accessing a template header stored on the network interface device, the template header having TCP fields and IP fields;
- employing a finite state machine that implements both TCP protocol processing and IP protocol processing to fill in the TCP fields and IP fields of the template header, wherein the finite state machine does not realize a TCP protocol processing layer and a discrete IP protocol processing layer where the TCP and IP layers are executed one after another in sequence, but rather the finite state machine covers both TCP and IP protocol processing;
- and
- transmitting the fast-path response from the network interface device, the filled in template header forming at least a part of the fast-path response.