A network interface device provides a fast-path that avoids most host TCP
and IP protocol processing for most messages. The host retains a fallback
slow-path processing capability. In one embodiment, generation of a
response to a TCP/IP packet received onto the network interface device is
accelerated by determining the TCP and IP source and destination
information from the incoming packet, retrieving an appropriate template
header, using a finite state machine to fill in the TCP and IP fields in
the template header without sequential TCP and IP protocol processing,
combining the filled-in template header with a data payload to form a
packet, and then outputting the packet from the network interface device
by pushing a pointer to the packet onto a transmit queue. A transmit
sequencer retrieves the pointer from the transmit queue and causes the
corresponding packet to be output from the network interface device.