# Patent

## Title
Transferring control of TCP connections between hierarchy of processing mechanisms

## Abstract

In one embodiment, a system for communicating over a network is disclosed, the system comprising: a processor running a protocol processing stack to control a TCP connection; a first offload engine that receives control of the TCP connection from the stack to perform a first task corresponding to the TCP connection; and a second offload engine that receives control of the TCP connection from the first offload engine to perform a second task corresponding to the TCP connection. For example, the first offload engine can be protocol software such as an intermediate driver that can handle tasks such as teaming and/or reassembly of out-of-order data segments. As another example, the second offload engine can be a network interface card that provides hardware that accelerates data transfer.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
The present application claims the benefit under 35 U.S.C. §119 of U.S. Provisional Patent Application Ser. No. 60/617,384, filed by the present inventors on Oct. 8, 2004, which is incorporated by reference herein.


BACKGROUND
Traditional network protocol processing was software and CPU intensive, as multiple protocol layers needed to be processed in multiple CPU cycles for each packet that was sent or received over a network. Because of the variety of networks, networking protocols, routers, interface devices, computer operating systems and applications, it appeared necessary that such CPU intensive protocol processing was required. In addition to processing multiple protocol layers for each network packet, popular protocols such as TCP required further processing, including establishing and maintaining a TCP connection in order to ensure reliable communication, with the state of the TCP connection represented by a complicated block of information.
Such CPU intensive protocol processing became a bottleneck, because even as CPU speeds advanced dramatically, the faster CPUs could not keep up with increases in network speeds and traffic that caused increases in CPU protocol processing. Alacritech, Inc. solved this dilemma by splitting protocol processing tasks into repetitive data packet processing, which could be quickly and efficiently processed by specialized protocol processing hardware, and more complicated tasks that benefited from a CPU running a protocol stack. In addition, for protocols such as TCP, Alacritech, Inc. developed means for transferring control of connections such as TCP connections between a CPU running a protocol processing stack and protocol processing hardware for repetitive data packet processing.
Disclosure of these inventions can be found in various Alacritech patents and applications, including U.S. Patent Application No. 60/061,809, filed Oct. 14, 1997; U.S. Pat. No. 6,226,680, filed Apr. 27, 1998, issued May 1, 2001; U.S. Patent Application No. 60/098,296, filed Aug. 27, 1998; U.S. Pat. No. 6,389,479, filed Aug. 28, 1998, issued May 14, 2002; U.S. Pat. No. 6,434,620, filed Aug. 27, 1999, issued Aug. 13, 2002; U.S. Pat. No. 6,470,415, filed Oct. 13, 1999, issued Jan. 29, 2002; U.S. Pat. No. 6,247,060, filed Nov. 12, 1999, issued Jun. 12, 2001; U.S. Pat. No. 6,427,173, filed Dec. 15, 1999, issued Jul. 30, 2002; U.S. Pat. No. 6,427,171, filed Feb. 28, 2000, issued Jul. 30, 2002; U.S. patent application Ser. No. 09/675,484, filed Sep. 29, 2000; U.S. patent application Ser. No. 09/675,700, filed Sep. 29, 2000; U.S. patent application Ser. No. 09/692,561, filed Oct. 18, 2000; U.S. Pat. No. 6,334,153, filed Dec. 26, 2000, issued Dec. 25, 2001; U.S. Pat. No. 6,757,746, filed Feb. 20, 2001, issued Jun. 29, 2004; U.S. Pat. No. 6,687,758, filed Mar. 7, 2001, issued Feb. 3, 2004; U.S. patent application Ser. No. 09/802,551, filed Mar. 9, 2001; U.S. Pat. No. 6,658,480, filed Mar. 9, 2001, issued Dec. 2, 2003; U.S. Pat. No. 6,393,487, filed Mar. 12, 2001, issued May 21, 2002; U.S. patent application Ser. No. 09/855,979, filed May 14, 2001; U.S. patent application Ser. No. 09/970,124, filed Oct. 2, 2001; U.S. patent application Ser. No. 10/005,536, filed Nov. 7, 2001; U.S. patent application Ser. No. 10/023,240, filed Dec. 15, 2001; U.S. patent application Ser. No. 10/085,802, filed Feb. 26, 2002; U.S. patent application Ser. No. 10/093,042, filed Mar. 6, 2002; U.S. Pat. No. 6,591,302, filed Mar. 6, 2002, issued Jul. 8, 2003; U.S. patent application Ser. No. 10/098,694, filed Mar. 12, 2002; U.S. Patent Application No. 60/374,788, filed Apr. 22, 2002; U.S. Pat. No. 6,697,868, filed Jul. 29, 2002, issued Feb. 24, 2004; U.S. patent application Ser. No. 10/229,564, filed Aug. 27, 2002; U.S. patent application Ser. No. 10/246,820, filed Sep. 17, 2002; U.S. patent application Ser. No. 10/260,878, filed Sep. 27, 2002; U.S. patent application Ser. No. 10/260,959, filed Sep. 27, 2002; U.S. patent application Ser. No. 10/260,112, filed Sep. 27, 2002; U.S. patent application Ser. No. 10/261,051, filed Sep. 30, 2002; U.S. patent application Ser. No. 10/277,604, filed Oct. 18, 2002; U.S. patent application Ser. No. 10/289,977, filed Nov. 6, 2002; U.S. patent application Ser. No. 10/367,147, filed Feb. 12, 2003; U.S. patent application Ser. No. 10/369,902, filed Feb. 19, 2003; U.S. patent application Ser. No. 10/413,256, filed Apr. 14, 2003; U.S. patent application Ser. No. 10/420,364, filed Apr. 22, 2003; U.S. patent application Ser. No. 10/427,862, filed Apr. 30, 2003; U.S. patent application Ser. No. 10/438,719, filed May 14, 2003; U.S. patent application Ser. No. 10/601,237, filed Jun. 19, 2003; U.S. patent application Ser. No. 10/634,062, filed Aug. 4, 2003; U.S. patent application Ser. No. 10/639,810, filed Aug. 11, 2003; U.S. patent application Ser. No. 10/678,336, filed Oct. 3, 2003; U.S. patent application Ser. No. 10/706,398, filed Nov. 12, 2003; U.S. patent application Ser. No. 10/724,588, filed Nov. 28, 2003; U.S. patent application Ser. No. 10/729,111, filed Dec. 5, 2003; and U.S. patent application Ser. No. 10/881,271, filed Jun. 29, 2004. All of the above-referenced patents and applications are hereby incorporated by reference herein.
SUMMARY
The present inventors realized that network protocol processing could benefit from systems and methods that subdivide protocol processing such as TCP processing into several units, between which control of a TCP connection can be transferred, with the processing being performed by the unit that controls TCP connection.
In one embodiment, a system for communicating over a network is disclosed, the system comprising: a processor running a protocol processing stack to control a TCP connection; a first offload engine that receives control of the TCP connection from the stack to perform a first task corresponding to the TCP connection; and a second offload engine that receives control of the TCP connection from the first offload engine to perform a second task corresponding to the TCP connection. For example, the first offload engine can be protocol software such as an intermediate driver that can handle tasks such as teaming and/or reassembly of out-of-order data segments. As another example, the second offload engine can be a network interface card that provides hardware that accelerates data transfer.
In one embodiment, a system for communicating over a network is disclosed, the system comprising: a first processing mechanism that establishes a TCP connection; a second processing mechanism that receives control of the TCP connection from the first processing mechanism and performs a first task corresponding to the TCP connection; and a third processing mechanism that receives control of the TCP connection from the second processing mechanism and performs a third task corresponding to the TCP connection. For example, the first processing mechanism can be a CPU running a protocol processing stack, the second processing mechanism can be software such as an intermediate driver running on a processor, and the third processing mechanism can be a network interface card.
In one embodiment, a method for communicating over a network is disclosed, the method comprising: performing, by a first processing mechanism, a first task that corresponds to a TCP connection; transferring control of the TCP connection from the first processing mechanism to a second processing mechanism; performing, by the second processing mechanism, a second task that corresponds to the TCP connection; transferring control of the TCP connection from the second processing mechanism to a third processing mechanism; and performing, by the third processing mechanism, a third task that corresponds to the TCP connection. For example, the first task can include establishing or terminating the TCP connection, the second task can include reassembling out-of-order data segments for the TCP connection or switching a network port for the TCP connection from a first port to a second port, and the third task can include receive processing of packets corresponding to the TCP connection, prepending headers to data segments for the TCP connection, or parsing received packet headers corresponding to the TCP connection.



BRIEF DESCRIPTION OF THE FIGURES
FIG. 1 is a schematic view of local host having a system for communicating over a network with a remote host.
FIG. 2 is a schematic view of local host that can transfer control of a TCP connection between a protocol stack, a software driver and a network interface card or storage adapter.
FIG. 3 is a schematic view of local host that can transfer control of a TCP connection between a protocol stack, a communication processor and protocol processing hardware.
FIG. 4 is a schematic view of local host that can transfer control of a TCP connection between a protocol stack, a port aggregation driver and plural network interface ports.
FIG. 5 is a schematic view of local host that can transfer control of a TCP connection between a protocol stack, a port aggregation driver, a reassembly engine and plural network interface ports.
FIG. 6 is a schematic view of local host that can transfer control of a TCP connection between a protocol stack, a port aggregation driver, and reassembly engines and protocol engines contained in plural network interface devices.



DETAILED DESCRIPTION
FIG. 1 shows a schematic view of a local host 20 that can communicate with a remote host 22 via a network 25. The network 25 in this embodiment can operate in accordance with Ethernet or related protocols, such as Fast-Ethernet, Gigabit-Ethernet or 10-Gigabit-Ethernet, and is designed to carry information packets (sometimes called frames) that can be directed over the network by nodes such as routers in accordance with networking protocols such as Internet Protocol (IP). The local host 20 and the remote host 22 can also be considered to be nodes on the network 25, but hosts 20 and 22 are distinguished from routers by their ability to process higher level protocols such as Transport Layer Protocol (TCP) and User Datagram Protocol (UDP) on behalf of applications running on the hosts. For example, the remote host 22 in this embodiment includes transport layer processing capabilities such as a TCP processing mechanism 28. The TCP protocol provides error-free delivery of data between the network hosts, in part by establishing a TCP connection on each of the hosts that governs that data delivery, the TCP connection implementing multiple rules and maintaining status information regarding the data delivery and other variables to transfer the data between specified applications on the hosts. Local host 20 and remote host 22 each also include many other conventional elements which are not shown, such as a CPU and memory.
The local host 20 includes first processing mechanism 30, second processing mechanism 33, and third processing mechanism 35, each of which can control a TCP connection. Controlling a TCP connection includes owning a block of memory that describes the current state of the TCP connection. Control of a TCP connection can be passed between the first processing mechanism 30 and the second processing mechanism 33, as shown by arrow 40. Control of the TCP connection can also be passed between the second processing mechanism 33 and the third processing mechanism 35, as shown by arrow 44. Moreover, control of the TCP connection may optionally be passed between the first processing mechanism 30 and the third processing mechanism 35, without the second processing mechanism 33 ever acquiring control of the connection. The second processing mechanism 33 may sometimes be called a first offload engine, and the third processing mechanism 35 may sometimes be called a second offload engine.
In one embodiment, the third processing mechanism 35 can perform a task or set of tasks that is a subset of the tasks that can be performed by the second processing mechanism 33 or the first processing mechanism, and the second processing mechanism 33 can perform a set of tasks that is a subset of the tasks that can be performed by the first processing mechanism 30. As an example, the third processing mechanism 35 can perform a task or set of tasks that is a subset of the tasks that can be performed by the second processing mechanism 33, and the second processing mechanism 33 can perform a set of tasks that is a subset of the tasks that can be performed by the first processing mechanism 30. Alternatively, one or all of the task or set of tasks performed by the third processing mechanism 35 may not be a task or set of tasks performed by the second processing mechanism 33 or the first processing mechanism. Similarly, one or all of the task or tasks performed by the second processing mechanism 35 may not be a task or set of tasks performed by the third processing mechanism 33 or the first processing mechanism.
For example, as shown in FIG. 2, the first processing mechanism 30 can be a CPU running a protocol processing stack 52 that can establish and terminate network connections such as TCP connections, handle error conditions and data reassembly for packets received out-of-order from a network, process received packets to place data from the packets in a destination such as a file cache and encapsulate data in network packets to transmit the data from local host 50 to a remote host. The second processing mechanism 33 in this example may be a software driver 55 that handles data reassembly for out-of-order received packets, and manages switching network ports for the connection, which may be known as teaming, trunking, failover or port aggregation. The third processing mechanism 35 in this example may be an intelligent network interface card (INIC) 58 or storage adapter that is coupled to the CPU by a host bus such as an input/output bus, the INIC including protocol processing hardware, software and/or firmware that is configured for straightforward processing of network packets, but which does not by itself establish and terminate TCP connections or handle error conditions. For example, the INIC may be able to process TCP and IP checksums and analyze received packet headers in hardware, place the data from received packets in an appropriate memory location of the host 20 and segment and encapsulate transmit data for transmission over the network.
For instance, control of a TCP connection may be transferred between protocol stack 52 and software driver 55 as a block of memory across a first host bus 60 such as a memory bus, or a block of memory representing the current state of the TCP connection can be remapped between a protocol stack domain and a software driver domain, or an ownership bit can be flipped to transfer ownership of the memory representing the TCP connection. Similarly, control of a TCP connection may be transferred between protocol stack 52 or software driver 55 and INIC 58 as a block of memory across a second host bus 60 such as a input/output bus, for example a PCI bus. Details of methods for handing out or offloading a TCP connection can be found in various Alacritech patents and applications referenced above. As one example, a first signal can be sent from the software driver 55 to the INIC 58, the first signal indicating an intention to transfer control of the TCP connection from the software driver to the INIC; with the INIC responding to the first signal by sending a second signal to the software driver, the second signal indicating that the INIC is able to receive control of the TCP connection; followed by sending a third signal from the software driver to the INIC, the third signal responsive to the second signal and transferring control of the TCP connection from the software driver to the INIC.
Alternatively, as shown in FIG. 3, the first processing mechanism 30 can be a central processing unit (CPU) running a protocol processing stack 82 that can establish and terminate network connections such as TCP connections, handle error conditions and data reassembly for out-of-order packets, and process network packets to place data from the packets in a destination such as a file cache and encapsulate data in network packets to transmit the data from local host 80 to a remote host. The second processing mechanism 33 in this example may be a communication processor 85 on an adapter such as an INIC or storage adapter that is coupled to the CPU by a host bus such as an input/output bus 90, the processor 85 running a TCP/IP stack that has most of the capabilities of the protocol processing stack 82, but which does not establish or terminate TCP connections for local host 80. The third processing mechanism 35 in this example may be protocol processing hardware 88, software and/or firmware on the INIC or storage adapter that is coupled to the communication processor 85 by host bus 92, and is configured for straightforward processing of network packets, but which cannot by itself establish and terminate TCP connections or handle error conditions. For example, the protocol hardware 88 may be able to place the data from received packets in an appropriate memory location of the host 90 and to segment and encapsulate transmit data for transmission over the network.
In this example, the protocol stack 82 may establish a TCP connection for host 80, after which the connection can be handed out (sometimes called offloaded) to the communication processor 85. The communication processor 88 can then handle the TCP connection, including transferring data corresponding to the connection to and from host memory, handling errors and reassembling out-of-order TCP packets. Once the TCP connection is stable, the communication processor 85 can transfer control of the connection to the protocol hardware 88, which in this example is specialized to provide accelerated data path processing of network packets corresponding to the TCP connection. Should an exception condition occur while the protocol processing hardware 85 is processing data corresponding to the TCP connection, control of the connection can be flushed (sometimes called uploading the connection) back to the communication processor 85. For example, data from out-of-order received packets may be reassembled by the communication processor 85. Should another exception condition occur while the communication processor 88 is controlling the connection, such as receipt of a packet indicating the session is to be terminated, the communication processor 88 can upload or flush the connection to the protocol stack 82.
FIG. 4 shows another example of a local host 100 for which a first processing mechanism may be a CPU running a protocol processing stack 102 that can establish and terminate network connections such as TCP connections, handle error conditions and data reassembly for out-of-order packets, and process network packets to receive and transmit data in the packets, although the first processing mechanism may do more or less than this. A second processing mechanism in this example may be a port aggregation (PAG) driver 103 that manages logical connections such as TCP connections for a plurality of network ports and which can, for example, switch the network ports that are utilized by such connections. An example of a port aggregation driver can be found in Alacritech's U.S. patent application Ser. No. 10/229,564, filed Aug. 22, 2002, entitled TCP Offload Device That Load Balances And Fails-Over Between Aggregated Ports Having Different MAC Addresses. A third processing mechanism in this example may be INIC 105 and/or INIC 108, each of which may have one or more of the network ports that provide interconnection with one or more networks. As an example, INIC 105 and INIC 108 may have essentially identical functionality and both contain hardware, software and/or firmware configured for straightforward processing of network packets, but do not in this example establish and terminate TCP connections or handle error conditions. For instance, INIC 105 may be able to place the data from received packets in an appropriate memory location of the host 100 and to segment and encapsulate transmit data for transmission over a network, including checksum calculation for both transmit and receive. A device driver may be included in the host 100 to communicate between protocol stack 102 and/or PAG driver 103 and the INICs 105 and 108. In this example, INIC 105 is connected to network 25 via port 121 and is connected to network 125 via port 131. Similarly, INIC 108 is connected to network 25 via port 122 and is connected to network 125 via port 132.
Should an error or other exception condition occur for a logical connection such as a TCP connection that is controlled by INIC 105, INIC 105 may flush (or upload) the connection to PAG driver 103, as shown by arrow 112. PAG driver 153 will then look at the exception condition to determine whether to upload (or flush) the TCP connection to protocol stack 102 as shown by arrow 110, or to hand the connection out to INIC 105 or INIC 108 as shown by arrow 112 or arrow 116, respectively. For example, should the exception condition be the receipt of a FIN packet for the connection from network 25, PAG driver 103 will upload (or flush) the TCP connection to protocol stack 102 as shown by arrow 110, and protocol stack 102 will use the FIN packet to terminate the connection. In one example, this upload (or flush) may be requested by the PAG driver 103, and the upload (or flush) can be handled by the protocol stack 102. On the other hand, should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 121 to another port that is connected to network 25, PAG driver 103 may handout the connection, as shown by arrow 116, to INIC 108, with instructions to use port 122 for that logical connection. Should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 121 to a port that is connected to network 125, PAG driver 103 may choose whether to handout the logical connection to INIC 105, with instructions to use port 131 for that connection, or to INIC 108, with instructions to use port 132 for that connection.
FIG. 5 shows another example of a local host 200 for which a first processing mechanism may be a CPU running a protocol processing stack 202 that can establish and terminate network connections such as TCP connections, handle error conditions and data reassembly for out-of-order packets, and process network packets to receive and transmit data in the packets, although the first processing mechanism may do more or less than this. A second processing mechanism in this example may be a port aggregation (PAG) driver 203 that manages logical connections such as TCP connections for a plurality of network ports and which can, for example, switch the network ports that are utilized by such connections. A third processing mechanism in this example may be a reassembly engine 244 that handles data reassembly for packets that were received out-of-order from a network. A fourth processing mechanism in this example may be INIC 205 and/or INIC 208, each of which may have one or more of the network ports that provide interconnection with one or more networks. As an example, INIC 205 and INIC 208 may have essentially identical functionality and both contain hardware, software and/or firmware configured for straightforward processing of network packets, but do not in this example establish and terminate TCP connections or handle error conditions. For instance, INIC 205 may be able to place the data from received packets in an appropriate memory location of the host 200 and to segment and encapsulate transmit data for transmission over a network, including checksum calculation for both transmit and receive. In this example, INIC 205 is connected to network 25 via port 221 and is connected to network 125 via port 231. Similarly, INIC 208 is connected to network 25 via port 222 and is connected to network 125 via port 232.
Should an error or other exception condition occur for a logical connection such as a TCP connection that is controlled by INIC 205, INIC 205 may flush (or upload) the connection to reassembly engine 244, as shown by arrow 212, which will determine whether the exception condition is simply the receipt of an out-of-order packet for the TCP connection, in which case the reassembly engine 244 will reassemble data from that connection. If the connection becomes stable and all packets corresponding to the connection are received in order the connection may be passed back or offloaded to INIC 205 for fast-path data processing. Should the exception condition involve something beside the receipt of an out-of-order packet, reassembly engine 244 may pass control of the connection to PAG driver 203, as shown by arrow 240. PAG driver 203 will then look at the exception condition to determine whether to upload (or flush) the TCP connection to protocol stack 202 as shown by arrow 210, or to hand the connection out (or offload) to INIC 205 or INIC 208, as shown by arrow 212 or arrow 216, respectively. Note that receipt of an out-of-order packet may also be a signal that a connection should be migrated to a different network port. For this reason there may be efficiencies in having a processing mechanism such as a driver that handles both port aggregation and reassembly of out-of-order packets.
As another example, should the exception condition be the receipt of a FIN packet for the connection from network 25, PAG driver 203 will upload (or flush) the TCP connection to protocol stack 202 as shown by arrow 210, and protocol stack 202 will use the FIN packet to terminate the connection. On the other hand, should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 221 to another port that is connected to network 25, PAG driver 203 may handout (or offload) the connection, as shown by arrow 216, to INIC 208, with instructions to use port 222 for that logical connection. Should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 221 to a port that is connected to network 125, PAG driver 203 may choose whether to handout (or offload) the logical connection to INIC 205, with instructions to use port 231 for that connection, or to INIC 208, with instructions to use port 232 for that connection.
FIG. 6 shows another example of a local host 300 for which a first processing mechanism may be a CPU running a protocol processing stack 302 that can establish and terminate network connections such as TCP connections, handle error conditions and data reassembly for out-of-order packets, and process network packets to receive and transmit data in the packets, although the first processing mechanism may do more or less than this. A second processing mechanism in this example may be a port aggregation (PAG) driver 303 that manages logical connections such as TCP connections for a plurality of network ports and which can, for example, switch the network ports that are utilized by such connections. A third processing mechanism in this example may be reassembly engines 344 and 346 contained in INICs 305 and 308, respectively. Reassembly engines 344 and 346 may be hardware, software or firmware that handles data reassembly for packets that were received out-of-order from a network. A fourth processing mechanism in this example may be protocol engine 355 and/or protocol engine 358, each of which may have essentially identical functionality and both of which contain hardware, software and/or firmware configured for straightforward processing of network packets, but do not in this example establish and terminate TCP connections or handle error conditions. For instance, INIC 305 may be able to place the data from received packets in an appropriate memory location of the host 300 and to segment and encapsulate transmit data for transmission over a network, including checksum calculation for both transmit and receive. In this example, INIC 305 is connected to network 25 via port 321 and is connected to network 125 via port 331. Similarly, INIC 308 is connected to network 25 via port 322 and is connected to network 125 via port 332.
Should an error or other exception condition occur for a logical connection such as a TCP connection that is controlled by INIC 305, INIC 305 may flush (or upload) the connection to reassembly engine 344, as shown by arrow 312, which will determine whether the exception condition is simply the receipt of an out-of-order packet for the TCP connection, in which case the reassembly engine 344 will reassemble data from that connection. If the connection becomes stable and all packets corresponding to the connection are received in order the connection may be passed back to INIC 305 for fast-path data processing. Should the exception condition involve something beside the receipt of an out-of-order packet, reassembly engine 344 may pass control of the connection to PAG driver 303, as shown by arrow 340. PAG driver 303 will then look at the exception condition to determine whether to upload (or flush) the TCP connection to protocol stack 302 as shown by arrow 310, or to hand the connection out (or offload) to INIC 305 or INIC 308, as shown by arrow 312 or arrow 316, respectively. For example, should the exception condition be the receipt of a FIN packet for the connection from network 25, PAG driver 303 will upload (or flush) the TCP connection to protocol stack 302 as shown by arrow 310, and protocol stack 302 will use the FIN packet to terminate the connection. On the other hand, should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 321 to another port that is connected to network 25, PAG driver 303 may handout (or offload) the connection, as shown by arrow 316, to INIC 308, with instructions to use port 322 for that logical connection. Should the exception condition be the receipt of a packet from a network switch indicating that the connection should be migrated from port 321 to a port that is connected to network 125, PAG driver 303 may choose whether to handout (or offload) the logical connection to INIC 308, with instructions to use port 331 for that connection, or to INIC 305, with instructions to use port 332 for that connection.
Appendix A provides a more detailed description of one example of a system and method including three processing mechanisms between which control of a TCP connection can be transferred, with the processing being performed by the unit that controls TCP connection. The example of Appendix A focuses on a software driver that can control a TCP connection to perform port aggregation for host having a protocol stack and at least one INIC, and which can transfer control of the TCP connection between the stack and the INIC. Although this application has focused on a few embodiments having various processing mechanisms between which control of a logical connection can be transferred, systems having additional connection-controlling processing mechanisms can be provided for enhanced functionality.

## Claims

1. A system for communicating over a network, the system comprising:
a processor running a protocol processing stack to establish and control a Transmission Control Protocol TCP connection, the TCP connection having a state and being identified at least in part by an Internet Protocol (IP) address and TCP port of the host, and an IP address and TCP port of a remote host;
a first offload engine that receives control of the TCP connection from the stack to perform a first task corresponding to the TCP connection; and
a second offload engine that receives the TCP connection from the first offload engine to perform a second task corresponding to the TCP connection,
wherein the first and second offload engines are part of the same host.

2. The system of claim 1, wherein the first offload engine cannot perform the second task.

3. The system of claim 1, wherein the second offload engine cannot perform the first task.

4. The system of claim 1, wherein the first task includes changing a network port for the TCP connection from a first network port to a second network port.

5. The system of claim 1, wherein the first task includes reassembly of out-of-order data for the TCP connection.

6. The system of claim 1, wherein the second task includes receive processing of packets corresponding to the TCP connection.

7. The system of claim 1, wherein the second task includes prepending headers to data segments for the TCP connection.

8. The system of claim 1, wherein the second task includes parsing received packet headers corresponding to the TCP connection.

9. A method for communicating over a network, the method comprising:
establishing a Transmission Control Protocol (TCP) connection, the TCP connection having a state and being identified at least in part by an Internet Protocol (IP) address and TCP port of the host, and an IP address and TCP port of a remote host;
performing, by a first processing mechanism, a first task that corresponds to a TCP connection;
transferring control of the TCP connection from the first processing mechanism to a second processing mechanism;
performing, by the second processing mechanism, a second task that corresponds to the TCP connection;
transferring the TCP connection from the second processing mechanism to a third processing mechanism; and
performing, by the third processing mechanism, a third task that corresponds to the TCP connection;
wherein control of the TCP connection is held by the first, second or third processing mechanism that controls a block of memory representing the current state of the TCP connection, and the processing mechanisms are part of the same host.

10. The method of claim 9, wherein the first task includes establishing the TCP connection.

11. The method of claim 9, wherein the second task includes reassembling out-of-order data segments for the TCP connection.

12. The method of claim 9, wherein the third task includes reassembling out-of-order data segments for the TCP connection.

13. The method of claim 9, wherein the second task includes switching a network port for the TCP connection from a first port to a second port.

14. The method of claim 9, wherein the second task includes switching a network port for the TCP connection from a first network interface device to a second network interface device.

15. The method of claim 9, wherein the third task includes receive processing of packets corresponding to the TCP connection.

16. The method of claim 9, wherein the third task includes prepending headers to data segments for the TCP connection.

17. The method of claim 9, wherein the third task includes parsing received packet headers corresponding to the TCP connection.

18. The method of claim 9, further comprising transferring control of the TCP connection from the third processing mechanism to the second processing mechanism.

19. The method of claim 9, further comprising transferring control of the TCP connection from the second processing mechanism to the first processing mechanism.

20. A system for communicating over a network, the system comprising:
a first processing mechanism that establishes a transmission control protocol (TCP) connection, the TCP connection having a state and being identified at least in part by an Internet Protocol (IP) address and TCP port of the host, and an IP address and TCP port of a remote host;
a second processing mechanism that receives control of the TCP connection from the first processing mechanism and performs a first task corresponding to the TCP connection; and
a third processing mechanism that receives the TCP connection from the second processing mechanism and performs a third task corresponding to the TCP connection;
wherein control of the TCP connection is held by the first, second or third processing mechanism that controls a block of memory representing the current state of the TCP connection, and the processing mechanisms are part of the same host.

21. The system of claim 20, wherein the second processing mechanism includes software running on a processor.

22. The system of claim 20, wherein the third processing mechanism includes a network interface card.

23. The system of claim 20, wherein the second processing mechanism is separated from the third processing mechanism by an input/output bus.

24. The system of claim 20, wherein the first processing mechanism is separated from the second processing mechanism by an input/output bus.

25. The system of claim 20, wherein at least one of the second and third processing mechanisms is an offload engine.

26. The system of claim 20, wherein the second task includes port aggregation, and the third task does not include port aggregation.

27. The system of claim 20, wherein the second set of tasks includes reassembly of out-of-order segments, and the third set of tasks does not include reassembly of out-of-order segments.

28. The system of claim 20, wherein the first set of tasks includes establishment of the network connection.