Method and system for handling connection setup in a network

Certain embodiments of a method and system for handling connection setup in a network may comprise a host that generates connection acceptance criteria and/or a services list that may be transferred to a network interface hardware device for determining whether a remote peer connection request may be accepted. The network interface hardware device may generate connection primitives to complete the network connection setup after accepting the connection request. The network interface hardware device may wait for a response from the host before generating the connection primitives. The network interface hardware device may copy the host during connection setup. The host may provide and indication to the network interface hardware device to deny the connection request or to drop the connection after the connection has been setup. The network interface hardware device may maintain a connection state generated when the connection setup is completed.

FIELD OF THE INVENTION

Certain embodiments of the invention relate to network communication. More specifically, certain embodiments of the invention relate to a method and system for handling connection setup in a network.

BACKGROUND OF THE INVENTION

In some conventional networking systems, a network host may become overwhelmed when handling the processing of setting up and/or tearing down network connections. This is may be particularly true as the number of connections handled by the host increases. This may also be the case when a loaded server is busy with an application processing and has limited free cycles available for servicing new connection set up requests. For example, when a server is flooded with a large number of service requests, such as during a denial of service (DoS) attack, the ability of the server to handle requests on behalf of existing connections and/or to handle new requests on behalf of newly added traffic is diminished and some portion of legitimate requests for new connection set up and/or requests for servicing existing connections may be prevented from being processed. In this regard, the server may need to implement acceptance measures to identify legitimate connection set up and/or servicing requests in order to allocate connection resources to those connection requests that meet the acceptance requirements.

In networking systems that handle transport control protocol/Internet protocol (TCP/IP) connections, for example, the host may utilize a hardware device, such as a network interface card (NIC), to increase the available resources that may be utilized to perform the networking operations and to improve the server performance on the network and application's response time as well as to improve the utilization of the CPU, memory and other server resources. This approach may allow the host to manage a larger number of connections with remote clients by dynamically distributing the networking resources available in the host and the NIC and/or to free up more cycles for application processing. However, while NIC resources may be utilized for moving data on the networking connections, a communication stack may be used to manage the connection setup. For example, the communication stack may maintain a connection state comprising information regarding the connection setup. In this regard, the communication stack may manage the setup of several connection layers associated with a network connection, such as those utilized by the International Standard Organization's Open System Interconnect (ISO/OSI) model. For example, the communication stack may manage layer2or the data link layer information, layer3or the network layer information, and/or layer4or transport layer information, for example.

A connection setup may be initiated when a remote peer or client on a TCP/IP network, which may be referred to as the active side, for example, sends a connection request, such as a TCP synchronization (SYN) segment, to the server, which may be referred to as the passive side, for example. The server's NIC on the passive side may receive the TCP SYN segment and may transfer the TCP SYN segment to the communication stack to process the request. When the request is accepted, the communication stack may generate a SYN with a TCP acknowledge (SYN ACK) segment that may be transferred to the NIC, which may forward it to the remote peer, that is, to the active side. The exemplary handshake for connection set up herein described may be completed when the remote peer or client sends a TCP ACK segment back to the passive side. After receiving the TCP ACK segment from the client, the communication stack may complete the network connection setup process. The connection state associated with that client's network connection, which may comprise the transport, network and data link layer state or parts of it, for example, may reside with the communication stack and may be managed and/or maintained by the communication stack.

After receiving the first SYN segment from a remote peer, the passive side may generally allocate some resources in order to store the parameters of the connection to be established. The allocated resources may be required to allow the passive side to execute the TCP connection setup state machine when the passive side later accepts the TCP ACK completing the connection request. A DoS may be created by consuming a large portions of available resources for storing the pending connection set up request on the host without ever completing the connection handshake.

A similar procedure may be followed to complete a network connection setup when the host issues a connection request to a remote peer and the remote peer responds by accepting the request. In this instance, the communication stack also maintains and/or manages the connection state associated with the client's network connection. While the destination may be known and denial of service concerns may not be as relevant, the acceptance of the connection and/or the execution of the protocol stack connection set up state machine may consume resources of the initiator.

BRIEF SUMMARY OF THE INVENTION

A system and/or method is provided for handling connection setup in a network, that may result in improvements in speed, robustness, and security performance, substantially as shown in and/or described in connection with at least one of the figures, as set forth more completely in the claims.

DETAILED DESCRIPTION OF THE INVENTION

Certain embodiments of the invention may be found in a method and system for handling connection setup in a network. For support of a passive side in a communication between two peers, a host may generate a services list and/or acceptance criteria that may be transferred to a network interface hardware (NIHW) device, such as a network interface card (NIC), for example, for determining whether a remote peer connection request may be handled by the NIHW device.

The services list may comprise, but need not be limited to, Socket Listen( ) call parameters, TPC ports on a particular IP address or a range or a list of IP addresses, and/or level2(L2) parameters, such as virtual local area network (VLAN), for example. The acceptance criteria may comprise additional parameters such as a list or description of qualifying remote IP addresses or subnets, for example. The services list and acceptance criteria need not be limited to these parameters and may comprise additional parameters. In this regard, the U.S. application Ser. No. 11/341,113 , filed on Jan. 27, 2006, discloses a method and system for mitigating denial of service in a communication network, and is hereby incorporated herein by reference in its entirety. The services list and/or acceptance criteria may be transferred to the NIHW by a communication stack, for example.

As a result of the transfer of a services list and/or acceptance criteria, the NIHW device may generate connection primitives on the network based on the specific protocol requirements to complete the network connection setup after accepting the connection request from the remote peer. The NIHW device may utilize at least one of a plurality of schemes. For example, the NIHW device may copy the host during connection setup on requests received from the wire and/or on its intended responses. This may enable use of the screening services utilized by the host today to identify and prevent attacks against its resources. For example, these services may utilize filtering, hash services, for instance, for creating SYN cookies, and/or heuristics, but need not be so limited. The NIHW device may wait for a response from the host before generating the connection primitives or may proceed with generating responses to the connection request. The host may indicate to the NIHW device to drop the connection request or to drop the connection after the connection has been setup. The NIHW device may maintain a connection state generated when the connection setup is progressing or when it is completed.

The NIHW device may minimize its exposure to certain types of attacks, such as a SYN flood, for example, by minimizing the amount of state maintained for connections not fully established, such as TCP Half Open connections, for example. Using SYN cookies or other mechanisms may minimize the amount of state maintained, for example. The NIHW device may allow a limited number of connections to be established in an expeditious way before it turns on more defensive mechanisms, for example, SYN cookies. Moreover, the NIHW device may wait for the host approval before allocating space for state and/or other resources or before replying to the remote peer connection request. The NIHW device may also employ additional criteria, that may have been received from the host as part of the acceptance criteria or not, before replying to a connection request. The additional criteria may comprise, for example, limiting the scope of remote clients to be serviced expeditiously or in general by using remote IP source address filtering. The additional criteria may also comprise limiting the scope of services, such as TCP ports, for example, and/or limiting the number of outstanding requests per time unit and/or per remote client or per a group of remote clients, such as a remote IP subnet, for example. The NIHW device need not be limited to these defensive mechanisms. In this regard, the NIHW device may be enabled to support at least the defensive and DoS prevention capabilities of the communication stack that it services.

A similar approach may be followed to complete a network connection setup when the host issues a connection request to a remote peer and the remote peer responds to the request. While the active side exposure, that is, the host exposure, to such attacks may be lower in such instances, the NIHW device may consult with the host before completing the connection request or after the connection has been completed as described above.

FIG. 1Ais a block diagram illustrating a host with a separate network interface hardware (NIHW) block, in accordance with an embodiment of the invention. Referring toFIG. 1A, there is shown a networking system100, such as a server, a client, or a similar network machine, for example, that may comprise a host102and a network interface hardware (NIHW) device104. The host102may comprise a central processing unit (CPU)106, a memory108, and a chipset110. The CPU106, the memory108, and the chipset110may be communicatively coupled. For example, the chipset110may be communicatively coupled to the CPU106via the bus112aand the CPU106may be communicatively coupled to the memory108via the bus112b.

The networking system100may be adapted to operate or support various networking protocols. For example, the networking system100may be adapted to support transport control protocol/Internet protocol (TCP/IP) connections or stream control transmission protocol (SCTP). In this regard, the networking system100may be adapted to support Internet control message protocol (ICMP), address resolution protocol (ARP), and/or path maximum transmission unit (PMTU) discovery protocol, for example. The ICMP protocol may refer to an ISO/OSI layer3protocol that may allow routers, for example, to send error and/or control messages about packet processing on IP networks. The ARP protocol may refer to a low-level protocol within the TCP/IP suite that may map IP addresses to corresponding Ethernet addresses. The SCTP may support the transport of public switched telephone networks (PSTN) signaling messages over connectionless packet networks such as IP networks, for example. The PMTU may refer to a maximum unit of data that may be sent given a physical network medium. In other embodiments, SCTP may be used as the transport protocol rather than TCP.

The host102may be adapted to setup parameters for network connections. For example, the host102may setup transport layer parameters comprising information that support time stamping, window scaling, delayed acknowledgment policy, flow control scheme to be used, congestion handling, selective acknowledgement (SACK), buffers to be used, and/or other transport related parameters. The host102may also setup network layer parameters comprising information that supports IPv4 or IPv6, for example, and options such as no fragments and/or hop limit. The host102may also setup data link layer parameters comprising information that supports virtual local area networks (VLAN) and source address to be used, for example.

The CPU106may comprise suitable logic, circuitry, and/or code that may be adapted to support the management and/or performance of networking operations associated with remote peers or clients on a network. The CPU106may also be adapted to support the management and/or performance of service applications that may be provided to the remote clients on the network.

The memory108may comprise suitable logic, circuitry, and/or code that may be adapted to store information regarding the networking operations and/or service applications supported by the CPU106. The chipset110may comprise suitable logic, circuitry, and/or code that may be adapted to provide services in support of the CPU106operations. For example, the CPU106and/or the chipset110may be adapted to support memory management. In another embodiment of the invention, the chipset110may be directly connected to the memory110, unlike the architecture shown inFIG. 1A, and the CPU106may access the memory108by using the chipset110services. For example the chipset110may be adapted to support PCI master and arbitrator, graphics interface, I/O master for USB, audio, and/or peripheral devices, for example. In this regard, the chipset110may comprise at least one integrated circuit (IC) that provides services in support of the CPU106operations. In some instances, the services provided by the chipset110may be implemented in separate ICs. The choice of one or more ICs for implementing the chipset110may be based on the number and/or type of services provided. In some instances, at least some of the functionality of the chipset110may be integrated within the operations supported by the CPU106and/or the memory108, for example.

The NIHW device104may comprise suitable logic, circuitry, and/or code that may be adapted to support the performance of networking operations associated with remote peers or clients on a network. The resources provided by the NIHW device104may support the networking operations of a maximum number remote peers or clients on a network. The NIHW device104may be adapted to communicate with the host102. In this regard, the NIHW device104may be adapted to communicate with the CPU106, the memory108, and/or the chipset110. In some instances, the number of network connections that may be supported by the NIHW device104may be different than the number of network connections that may be supported by the host102. For example, when the host102may support 10,000 connections and the NIHW device104may support 1,000 connections, then a connection ratio of 10:1 is supported by the networking system100. In another example, the host102may support 2,000 connections and the NIHW device104may support 1,000 connections, then a connection ratio of 2:1 is supported by the networking system100. The connection ratio of a networking system that comprises a host and an NIHW device may be utilized when determining a connection setup model for a particular application. In some instances, the NIHW device104may support a large enough number of connections that may practically be larger than the requirements and/or capacity that may have been provided by the host102.

FIG. 1Bis a block diagram illustrating a host with a network interface hardware block integrated within a chipset, in accordance with an embodiment of the invention. Referring toFIG. 1B, there is shown a networking system101that may differ from the networking system100inFIG. 1Ain that the NIHW device104inFIG. 1Ais integrated into the chipset110. In this regard, the NIHW device104may be adapted to communicate with other portions of the chipset110, and with the CPU106via the bus112a, and/or the memory108via the bus112b. While the CPU106, the chipset110, the memory108, and the NIHW device104are described as separate blocks, they may also be integrated into a smaller number of devices and/or into a single integrated device.

FIG. 2Ais a block diagram illustrating exemplary simplified software diagram for host comprising packet screening and security and/or cryptography services, in accordance with an embodiment of the invention. Referring toFIG. 2A, there is shown a simplified software diagram for host200, the host102the CPU106, the memory108, the chipset110, and the NIHW device104described with respect toFIG. 1A. The simplified software diagram for host200may comprise an application or consumer (AC)204, a communication stack (CS)202, a packet screening block203, and a security and cryptography (security/crypto) service block205. The AC204may correspond to a service that may be provided by a networking system to a remote client, for example. The CS202may correspond to a networking or communication support operation provided by a networking system. The packet screening block203may correspond to packet screening services such as netfilter in Linux that may enable firewall protection based on packet filtering, for example. It may also use and/or comprise security services that may comprise, but need not be limited to, hash services for generation of SYN cookies. The security/crypto service block205may correspond to security and/or cryptographic operations that may be provided for verifying whether a network connections may be established or for providing a hash or other crypto services that may be used by the NIHW device104. For example, the NIHW device104may use a hash service to assist in creating a SYN cookie on the NIHW device104.

The AC204, the CS202, the packet screening block203, and/or the security/crypto service block205may be controlled by an operating system (OS) running on the CPU106, for example. In this regard, the AC204, the CS202, the packet screening block203, and/or the security/crypto service block205may correspond to computer programs that may be stored in a machine-readable storage medium, such as memory108. Each of the computer programs may comprise at least one code section for processing information. The code section may be executable by a machine such as the CPU106. The AC204, the CS202, the packet screening block203, and/or the security/crypto service block205may communicate with the NIHW device104. The AC204may utilize an application programming interface (API) to communicate with the CS202, for example, using a sockets API or another API for control of network. The AC204may also utilize an API to communicate with the NIHW device104. This operation is similar to a remote direct memory access (RDMA) operation where a hardware device communicates directly with an application for low latency data transfer and the communication stack is involved in the set up and in other control aspects of the connection.

In operation, the host102may determine a services list and/or acceptance criteria that may be transferred to the NIHW device104via the CS202. In one embodiment of the invention, the NIHW device104may engage in connection setup for the services list provided by the host102, but the host102may perform the final acceptance of the connection. This approach may comprise engaging services provided by the packet screening block203, for example, to determine that no attack is under way before the CS202and/or the AC204may provide the final decision regarding acceptance of the connection. The packet screening block203may also be utilized after the connection has been accepted.

In another embodiment of the invention, the NIHW device104may receive the final acceptance criteria and may utilize the acceptance criteria to accept or reject the connection, not precluding the NIHW device104interaction with a host service, such as the packet screening block203, for example, for further admission control. In another embodiment of the invention, the NIHW device104may use a security service on the host, such as the security/crypto service block205, for example, to assist the NIHW device104in providing denial of service and/or other services related to connection acceptance on the NIHW device104.

The services list and/or acceptance criteria may be utilized when a remote peer requests a connection with the host102. The connection setup may then occur in the NIHW device104. For example, a remote peer or client on a TCP/IP network may send a connection request, such as a TCP synchronization (SYN) segment, to the NIHW device104. The NIHW device104may receive the TCP SYN segment and may process the request. The NIHW device104may utilize the host resident packet filtering services, such as the packet screening block203, for example, and/or the host resident security and cryptography services, such as the security/crypto service block205, for example. For example, the NIHW device104may be adapted to perform SYN cookies in order to limit the state it keeps for a connection request before it verifies it is not related to an attack. The security/crypto service block205may be utilized to compute the hash associated with a SYN cookie, for example. The NIHW device104may now utilize acceptance criteria to decide whether to provide the request. When the NIHW device104determines to engage in the next step in the connection setup, the NIHW device104may generate a TCP synchronization and acknowledge (SYN ACK) segment that may be transferred to the remote peer. The remote peer or client may complete the connection by sending a TCP ACK segment back to the NIHW device104. After receiving the TCP ACK segment from the client, the NIHW device104may complete the network connection with the remote peer. Completing the connection may involve additional processing on the NIHW device104, such as engaging directly or indirectly, that is, via the CS202, with packet filtering services, security and cryptography services, and/or with the AC204before the connection may be established and accepted.

A similar operation may occur when the host102requests a connection setup with a remote peer via the NIHW device104. In this regard, the NIHW device104may communicate with the remote peer or client to complete the network connection.

Once the connection is setup, the AC204may provide a service to a remote client via the NIHW device104. The host102or the communication stack202may perform a connection tear down. In that case, the connection state handled by the NIHW device104may be placed in a shared memory, that is if not in shared memory already, or in another location accessible to the host102where the host102may engage in executing the connection tear down primitives. A connection teardown may also occur in the NIHW device104. Connection tear down may occur as a result of at least one of a plurality of events such as a fatal error on the link, a signal form the remote peer, for example a TCP RST signal or a TCP FIN signal, a remote application tear down, and/or local application tear down, for example. During the connection setup operation and/or the connection teardown operation, the NIHW device104may communicate with the CS202. In some instances, the host102may determine that a connection setup request from a remote client should be denied or that a current connection should be terminated. In those instances, the host102, via the CS202, may provide an indication to the NIHW device104specifying that the connection request should be denied or that an existing connection should be torn down. In one embodiment of the invention, the teardown request passed from the CS202to the NIHW104may involve socket-like parameters, such as IP address pair for the local and remote peers as well as TCP port pair for the remote and the local peers, for example.

A maximum or cap on the total number of network connections that may be setup by the NIHW device104may be established per unit of time and/or as a general cap. When the number of connection requests exceeds the established maximum number, the additional connection requests may then be handled by the CS202, may be dropped, and/or may be queued up by the NIHW device104for processing at a later time by the NIHW device104. This queuing may be provided by utilizing local resources on the NIHW device104and/or by utilizing resources on the host102, such as the host memory108, for example. In this regard, a portion of the host memory108may be shared between the NIHW device104and the CPU106or may be made accessible by the NIHW device104only.

FIG. 2Bis a block diagram illustrating the exemplary simplified software diagram for host inFIG. 2Awith a connection state maintained by the network interface hardware block, in accordance with an embodiment of the invention. Referring toFIG. 2B, there is shown the simplified software diagram for host200, the host102, and the NIHW device104inFIG. 2A, where the NIHW device104maintains a connection state206. The connection state206may comprise information regarding the connection setups currently managed and/or maintained by the NIHW device104, such as Half Open TCP connections, for example, and/or fully established connections, such as TCP connections, for example. The connection state206or a subset of the connection state206or at least a portion of the primitives may be made available by being in a memory accessible by the CS202e.g. shared memory or copied to the CS202. In this regard, information in the connection state206may be copied to the CS202at specified instances and/or when certain events occur. The host102may utilize a name associated with a network connection to communicate via, for example, the CS202with the NIHW device104who may store it in the connection state206. The network connection name may comprise a portion of the information and/or parameters associated with the network connection in the connection state206. The connection name may be utilized for the NIHW device communication with the host102as well. The name may consist of a pair of network address e.g. IP address and a Transport address e.g. TCP port or 2 pairs of a local and a remote network address e.g. IP address and a Transport address e.g. TCP port. In this regard, the connection state information and/or parameters associated with the network connection remained managed and/or maintained by the NIHW device104.

FIG. 2Cis a block diagram illustrating exemplary networking software model inFIG. 2Awith connection state maintained by the network interface hardware block and a shared memory in the host, in accordance with an embodiment of the invention. Referring toFIG. 2C, there is shown the simplified software diagram for host200, the host102, and the NIHW device104inFIG. 2A, where the NIHW device104shows the connection state206and the memory108shows a shared memory208. The shared memory208may correspond to a portion of the memory108that may be utilized to store and/or retrieve information that may be utilized by the host102and/or the NIHW device104for networking operations. For example, the NIHW device104may copy a portion or all state for connections it manages to the shared memory208. Using shared memory, a load balance and fail over (LBFO) software210that may be executed by the host102—may be able to move connections from one NIHW device104to another when multiple NIHW devices are utilized. The host CS202may use the LBFO software210to collect all the data it may need for generating statistics or for other similar needs. The CS202may also use the LBFO software210to manage the connections and/or move connections to the NIHW device104, to another NIHW device or to the CS202itself, for example.

The AC204and/or the CS202may need to obtain information on the connection state206for their operation and/or may need to allocate resources, such as buffers, to the NIHW device104. In this regard, at least a portion of the connection state206may be copied to the shared memory208. The host102may post additional resources, such as general resources or per connection resources, in the shared memory208for the NIHW device104to access. The NIHW device104may post additional information, such as errors, exceptions, and/or statistics, in the shared memory208for the host102to access.

The CS202and/or the NIHW device104may be adapted to maintain updates to, for example, the routing table in ARP, to the MTU, and/or to other maintenance messages provided by ICMP, for example. In this regard, updates may be communicated via the shared memory208or may be communicated directly.

FIG. 3is a flow chart illustrating a first connection setup model for passive side peer, in accordance with an embodiment of the invention. Referring toFIG. 3, there is shown a flow process300. The first connection setup model for passive side peer described by the flow process300may be referred to as an independent connection setup model with full observability by the host102described inFIGS. 1A-2C. After start step302, in step304, the AC204, and/or the CS202, and/or the operating system (OS) executing on the host102, and/or a management entity operating in the host102may provide a service list and/or acceptance criteria to the NIHW device104. The service list and/or acceptance criteria may comprise information regarding what applications or services to support, such as, TCP ports in combination with local IP address(es) and/or layer parameters, for example, VLAN, which remote peers to support, the number of connections that may be accepted, and/or the initial allocation of resources for the connections, for example. In this regard, the host102may update this information over time. In step306, the CS202may provide and/or allocate initial resources for the NIHW device104. For example, the CS202or an NIHW device driver in the host102may allocate generic transport buffers in accordance with the applications supported. The generic buffers may be utilized for storage of, for example, data received from the network, file and block information, or for storage of networking information. In this regard, the CS202or NIHW device driver in the host102may update this buffer information over time.

In step308, the NIHW device104may be in a waiting state where it waits to receive a connection request from a remote peer on the network before proceeding to step310. In step310, the NIHW device104may utilize the acceptance criteria transferred from the host102, may utilize its own denial of service prevention capabilities, may utilize a host resident security/crypto service, packet filtering, connection accommodation, firewall, or any other service the host may employ to identify attacks and mitigate attacks and/or additional criteria to accept the connection request. The response from the host102need not comprise any transport layer state information. The NIHW device104may utilize any denial of service prevention measures that may be available. Moreover, security measures such as authentication out-of-band, may be utilized for providing credentials for authorized and/or authenticated remote machines or connections to be accepted.

In step312, the NIHW device104may determine whether the connection is accepted. When the NIHW device104in step312does not accept the connection, the flow process300may proceed to step314. In step314, the NIHW device104may drop the connection request or may forward or transfer the connection request to the CS202to process the connection request. In this regard, the CS202may determine whether the connection request is accepted or denied and may proceed to establish the connection with the remote peer. The NIHW device104may maintain statistics and/or other information on connection request rejected and may share the information with the host102, for example.

In step316, when the NIHW device104accepts the connection request, the NIHW device104may copy the connection request to the CS202. The NIHW104may copy the transport segment as received from the wire, for example, a TCP SYN or may just make select information available to the CS202, for example, a 4-tuple of remote and local IP addresses and remote and local TCP ports and/or additional parameters such as TCP options and/or remote TCP window size, for example. The NIHW device104may wait for the CS202to respond to the connection request. In step318, the CS202may determine whether the connection request should be granted or not. The CS202may utilize some heuristics, for example, the host102acceptance criteria and/or additional criteria, when determining whether the connection request should be granted. The CS202may utilize packet filtering, connection accommodation control, and/or DoS services like netfilter. The CS202may also consult with the AC204, for example. When the CS202, the AC204, and/or the host102determines that the connection request should not be granted, the flow process300may proceed to step320.

In step320, the CS202may send a response to the NIHW device104indicating that the connection request should be denied. The indication may comprise the connection identifier, such as local and remote IP addresses and TCP ports, for example, but need not comprise any transport state information. The indication may include information form the packet filtering, connection accommodation control, and/or DoS services used by the NIHW device104to enable the NIHW device104to update its tables for better handling of future connection requests. The NIHW104may not reply to the connection request or may reset the connection and remove any state it may have for that connection request. When the CS202determines that the connection request should be granted, the flow process300may proceed to step322.

In step322, the CS202may send a response to the NIHW device104indicating that the connection request should be granted. The indication may comprise the connection identifier, such as local and remote IP addresses and TCP ports, but need not comprise any transport state information. However, the indication may comprise some additional information, such as results of the processing performed by, for example, the security/crypto service block205, by the packet screening block203, by connection accommodation control, and/or by DoS. In step324, the NIHW device104may generate transport level primitives to complete the connection setup with the remote peer on the network. For example, for TCP/IP networks, the NIHW device104may generate a TCP ACK signal to be sent to the remote peer and may receive a TCP ACK signal from the remote peer to complete the connection setup. In step326, the NIHW device104may copy packets, segments, and/or other state or data information related to the connection setup in the shared memory208and/or in another location that may be accessible and shared by the host102. The step326may be skipped and/or may be optional in some embodiments of the invention. After step324, in step328, the connection state206may be generated when the connection setup is completed and may be managed and/or maintained by the NIHW device104. In step330, the NIHW device104may copy the connection state206or may just copy the socket parameters describing it, such as a 4-tuple, for example, to the shared memory208and/or to another location that may be accessible by the host102. In another embodiment of the invention, the step330may be skipped and/or may be optional.

After step328, in step332, post connection setup operations may occur. For example, the host102may send a message to the NIHW device104to terminate a connection. In another example, the NIHW device104may post messages to the buffers allocated by the host102and may notify the host102of events in accordance with policies relevant to the connection type. In another example, additional resources may be communicated to the NIHW device104from the AC204and/or from the host102. In another example the CS202or the AC204may request transmission of data to the remote peer. In some instances, the host102may direct the NIHW device104to move the connection state206and pending data to the host102, into the shard memory108. The NIHW device104may perform a connection teardown without direction from the host102as a result of a link event or when determining that a connection may be involved in attacking the host102or the NIHW device104or for another reason. Moreover, the NIHW device104may utilize directions acquired from the host102to close a connection or to move a connection state206to the host102so that the host102may teardown the connection. After step332, the flow process300may proceed to end step334.

Since there may be a maximum number of connections supported or maintained by the NIHW device104, certain criteria may be needed to determine what steps to take with connections requests in excess of those that may be handled by the NIHW device104. When determining what connections may be handled by, for example, the CS202in the host102, static criteria or dynamic criteria may be utilized. The static criteria may be based on the type of application supported by the host102. For example, when the host102operates as an email server, connections not related to that service or application may be handled to the host102. In addition, consideration may be given to the varying needs of the host102in such applications. The dynamic criteria may be based on having the NIHW device104set up the network connection. In this regard, the host102may decide to keep a connection state in the NIHW device104or move the connection state to the host102, for example, for load balancing reasons. When connection states are moved to the host102, the NIHW device104may be able to handle new connection requests. In case of a failover, the NIHW device104may move the connection state to the shared memory208and the LBFO software210operating on the host can move the connection state to the CS202or to another NIHW device, for example.

FIG. 4is a flow chart illustrating a second connection setup model for passive side peer, in accordance with an embodiment of the invention. Referring toFIG. 4, there is shown a flow process400. The second connection setup model for passive side peer described by the flow process400may be referred to as an independent connection setup model with partial observability by the host102as described inFIGS. 1A-2C. The steps402through414in the flow process400may be substantially similar to steps302through314in the flow process300inFIG. 3. After start step402, in step404, the AC204, and/or the CS202, and/or the operating system (OS) executing on the host102, and/or a management entity operating in the host102may provide a service list and/or acceptance criteria to the NIHW device104. The service list and/or acceptance criteria may comprise information regarding what applications or services to support, such as, TCP ports in combination with local IP address(es) and/or layer parameters, for example, VLAN, which remote peers to support, the number of connections that may be accepted, and/or the initial allocation of resources for the connections, for example. In this regard, the host102may update this information over time. In step406, the host102may provide and/or allocate initial resources for the NIHW device104. For example, the CS202or the NIHW driver may allocate generic transport buffers in accordance with the applications supported. The generic buffers may be utilized for storage of, for example, data received from the network, file and block information, or for storage of networking information. In this regard, the CS202or the NIHW device driver in the host102may update this buffer information over time.

In step408, the NIHW device104may be in a waiting state where it waits to receive a connection request from a remote peer on the network before proceeding to step410. In step410, the NIHW device104may utilize the acceptance criteria transferred from the host102, may utilize its own denial of service prevention capabilities, may utilize a host resident security/crypto service, packet filtering, connection accommodation, firewall, or any other service the host may employ to identify attacks and mitigate attacks and/or additional criteria to accept the connection request. The NIHW device104may utilize any denial of service prevention measures that may be available. Moreover, security measures such as authentication out-of-band, may be utilized for providing credentials for authorized and/or authenticated remote machines or connections to be accepted.

In step412, the NIHW device104may determine whether the connection is accepted. When the NIHW device104in step410does not accept the connection, the flow process400may proceed to step414. In step414, the NIHW device104may drop the connection request or may forward or transfer the connection request to the CS202to process the connection request. In this regard, the CS202may determine whether the connection request is accepted or denied and may proceed to establish the connection with the remote peer. The NIHW device104may maintain statistics and/or other information on connection request rejected and may share the information with the host102, for example.

In step416, when the NIHW device104accepts the connection request, the NIHW device104may copy the connection request to the CS202. The NIHW104may copy the transport segment as received from the wire, for example, a TCP SYN or may just make select information available to the CS202, for example, a 4-tuple of remote and local IP addresses and remote and local TCP ports and/or additional parameters such as TCP options and/or remote TCP window size, for example. In this regard, the NIHW device104need not wait for the CS202to respond to the connection request. In step418, the NIHW device104may generate transport level primitives to complete the connection setup with the remote peer on the network. In step420, the NIHW device104may copy packets, segments, and/or other state or data information related to the connection setup to the shared memory208and/or to another location that may be accessible by the host102. The CS202may utilize packet filtering, connection accommodation control, and/or DoS services like netfilter or it may consult with the AC204, for example. As described inFIG. 3, some of the steps, such as the steps416,420, and/or428, may be skipped and/or may be optional.

In step422, the CS202may determine, based on the information provided by the NIHW device104, and/or by consulting with the AC204, whether the connection request should be granted or not by utilizing some heuristics as packet filtering, connection accommodation control, and/or DoS services like netfilter, for example, the host102acceptance criteria and/or additional criteria while the NIHW device104completes the connection setup and generates the connection state206to be managed and/or maintained by the NIHW device104. Post connection setup operations may also occur and may be substantially similar to the operations described in step332in the flow process300inFIG. 3.

In step424, the CS202may send a signal or indication to the NIHW device104to drop or terminate the connection request when the CS202determines that the request should not be granted. The indication may comprise the connection identifier, for example, the local and remote IP addresses and TCP ports, but need not include any transport state information. However, the indication may comprise some additional information, such as results of the processing performed by the security/crypto service block205or by the packet screening block203, by connection accommodation control, and/or DoS. The NIHW device104may utilize the information to update its tables for future reference in handling new connection requests. In step428, the NIHW device104may copy the connection state206or may copy just the socket parameters describing it, for example, the 4-tuple, to the shared memory208and/or to another location that may be accessible by the host102. After step422, the flow process400may proceed to end step432.

FIG. 5is a flow chart illustrating a third connection setup model for passive side peer, in accordance with an embodiment of the invention. Referring toFIG. 5, there is shown a flow process500. The third connection setup model for passive side peer described by the flow process500may be referred to as an independent connection setup model with post setup control by the host102. The steps502through514in the flow process500may be substantially similar to the steps302through314in the flow process300inFIG. 3and the steps402through414in the flow process400inFIG. 4, for example.

In step516, NIHW device104may copy or transfer the connection request to the CS202. The NIHW device104may copy the transport segment as received from the wire, for example, a TCP SYN, or may just make select information available to the CS202, such as the 4-tuple of remote and local IP addresses and remote and local TCP ports, and/or additional parameters like TCP options and/or remote TCP window size, for example. In some embodiments of the invention, the step516and/or the step522may be skipped and/or may be optional. In this regard, the NIHW device104need not wait for the CS202to respond to the connection request. In step518, the NIHW device104may generate transport level primitives to complete the connection setup with the remote peer on the network. The NIHW device104need not copy packets, segments, and/or other state or data information related to the connection setup to the shared memory208and/or to another location that may be accessible by the host102. The connection state206may be generated when the connection setup is completed and may be managed and/or maintained by the NIHW device104. Moreover, post connection setup operations may occur and may correspond to the operations described in step332in the flow process300inFIG. 3. For example, the operating system in the host102may be utilized to terminate a connection. In another example, the NIHW device104may post messages to the buffers allocated by the host102and may notify the host102of events in accordance with policies relevant to the connection type.

In another example, additional resources may be communicated to the NIHW device104from the AC204and/or from the host102. In another example, the CS202or the AC204may request transmission of data to the remote peer. In some instances, the host102may direct the NIHW device104to move the connection state206to the host102, into the shared memory208. Moreover, the NIHW device104may perform a connection teardown without direction from the host102as a result of a link event or determining a connection may be involved in attacking the host or the NIHW or for another reason or may utilize directions acquired from the host102to close a connection or to move a connection state206to the host102so that the host102may teardown the connection. In this regard, the CS202may generate a signal or indication to the NIHW device104to terminate a connection during the post connection setup operations in step524. In step522, the NIHW device104may copy the connection state206to the shared memory208and/or to another location that may be accessible by the host102. After step518, the flow process400may proceed to end step526. The CS202may utilize packet filtering, connection accommodation control, and/or DoS services like netfilter or may consult with the AC204. The host102may later send a message or signal to the NIHW device104to terminate the connection based on its analysis of the connection information provided. The indication may comprise the connection identifier, for example, local and remote IP addresses and TCP ports, but need not comprise any transport state information. However, the indication may comprise additional information, such as results of the processing performed by the security/crypto service block205, by the packet screening block205, by connection accommodation control, and/or DoS. The NIHW device104may utilize this information to better handle future connection set up requests.

In addition to passive side operations, a networking system where a connection state is maintained by a network interface hardware device may also be utilized for active side networking connection set up requests. For example, referring toFIG. 2B, the host102may provide a connection setup request to the NIHW device104. The connection setup request may comprise information regarding the application or service requested and/or the initial allocated resources, such as socket connect( ) request, for example. The host102may also provide connection parameters, such as IP address of local and remote peers, transport ports, for example, TCP ports or SCTP ports for local and remote peers, and/or layer2parameters, such as source address, destination address, VLAN and/or quality of service (QoS) parameters. In another embodiment, the NIHW device104may be adapted to query a table comprising connection request parameters, where the table may be located in the host102. An active role may be required for clustering applications, for example. In a clustering application, servers may need to communicate with each other. A server may then generate a socket-style connection request to the NIHW device104in order to establish a connection with another server.

In some networks, peers may exchange so called “private data”. In some instances this exchange may occur after the connection is established by the transport service. However, in other cases, such “private data” may be piggy-backed on one or more of the transport connection set up primitives. For example, MPA request and reply may be an upper layer protocol carrying and exchanging such “private data” that may be piggy-backed for speeding up connection setup, for better interoperability, and/or for other reasons. When “private data” is present, for the passive or the active side, the NIHW device104may process it completely and/or partially or may transfer it to host102. After receiving “private data,” the NIHW device104may wait for further indications from the entity processing it, before sending the next connection setup primitive.

FIG. 6is a flow chart illustrating a connection setup model for active side request, in accordance with an embodiment of the invention. Referring toFIG. 6, there is shown a flow diagram600. In step604, after start step602, the CS202on the host102or the host102may provide a connection setup request to the NIHW device104, accompanied by parameters that may be similar to socket connect( ) parameters, for example. In step606, the NIHW device104may issue a connection request to a remote peer or client. In step608, the NIHW device104may utilize the latest DoS preventions available such as authentication in-band or an out-of-band method such as providing credentials for authorized and/or authenticated remote machines.

The NIHW device104may provide credentials to the passive side either in-band or out-of-band to facilitate a successful connection set up. In step610, the connection is established between the remote client and the NIHW device104via a proper exchange of signals or segments. The NIHW device104may place segments related to the connection setup that were received from the network or wire and/or generated by the NIHW device104in the shared memory208or in another location accessible by the host102. In this regard, the NIHW device104may also place connection state data or other similar data in the shared memory208or in another location accessible by the host102. The NIHW104may copy the transport segment as received from the wire, such as, TCP SYN ACK, for example, or may just make select information available to the CS202, such as 4-tuple of remote and local IP addresses and remote and local TCP ports an/or additional parameters like TCP options and/or remote TCP window size, for example.

In step612, all connection states are maintained by the NIHW device104, including some initial buffers and, in some instances, additional buffers. In step614, the NIHW device104may notify the OS in the host102of the new connection, either during the process of setting up the connection by indicating every segment reception or transmission event or after the connection step is completed. Step616may correspond to an action by the host to terminate the connection after the connection setup is complete or in real time during the process of setting up the connection. Termination during the process of setting up the network connection may result from information in at least one of the segments received or transmitted by the NIHW device104, or from information posted be the NIHW device104to the host102or to the shared memory208. The CS202may utilize packet filtering, connection accommodation control, and/or DoS services like netfilter or consult with the AC204, for example. The indication to drop a connection may comprise the connection identifier, for example, local and remote IP addresses and TCP ports, but need not comprise any transport state information. However, the indication may comprise additional information, for example, results of the processing performed by the security/crypto service block205or by the packet screening block203, by connection accommodation control, and/or DoS. The NIHW device104may utilize information provided to better handle future connection set up requests.

In step618, the NIHW device104may post messages to a buffer allocated by the host OS, such as in the CS202, for example, according to policies that may be relevant to the connection type, for example. Step620may result when additional resources, such as buffers, for example, may be needed and may be communicated directly from the AC204or provided by the host102. In step622, the connection state associated with the network connection requested by the active side may stay in the NIHW device104during the duration of the connection or may be moved to the host102. In step624, the NIHW device104may perform a connection teardown autonomously or directed by the host102. The OS in the host102may also direct the NIHW device104to move the connection state to the host102for the host102to teardown the connection. Moreover, either the host102or the NIHW device104may initiate moving the connection state to the host102. After step624, the process may proceed to end step626.

The approach described herein for handling connection setup in a network may also be implemented in instances when a server, a client, and/or any network attached device, for example, utilizes multiple operating systems running concurrently as is common in virtualization for instance, to so that each operating system supports a different application or applications or a completely different environment and OS, for example. The multiple operation systems may be referred to as guest operating systems (GOSs). This approach maintains the level of protection provided when server operations are not consolidated while also enabling the optimization of the usage of the processing resources available to the server. The use of multiple guest operating systems may be referred to as OS virtualization because each GOS perceives to have full access to the server's hardware resources, such as a network interface hardware (NIHW) device or network interface card (NIC), for example. In this regard, a GOS may or may not be aware of the presence of any other GOS running on the server. In order to implement OS virtualization, a software layer may be needed to arbitrate access to the server's hardware resources. This software layer may be referred to as a hypervisor or virtual machine (VMM) monitor, for example. The hypervisor may enable the multiple GOSs to access the hardware resources in a time-sharing manner. The hypervisor or VM monitor may enable creating a software representation of a NIHW device that may be utilized by a GOS. This software representation of the NIHW device may be referred to as a “virtual NIHW device.”

FIG. 7is a block diagram illustrating operating system (OS) virtualization that handles network connection setup, in accordance with an embodiment of the invention. Referring toFIG. 7, there is shown a first GOS702a, a second GOS702b, a third GOS702c, a hypervisor704, a host system706, a transmit (TX) queue708a, a receive (RX) queue708b, and a NIHW device710. The NIHW device710may comprise an NIHW memory716. A connection state724maintained by the NIHW device710may be stored in the NIHW memory716, for example. The host system706may comprise a host processor722and a host memory720. In another embodiment a Tx queue and Rx queue or multiple such queues may be associated with a GOS enabling direct interaction of that GOS with the NIHW device710.

The host system706may comprise suitable logic, circuitry, and/or code that may enable data processing and/or networking operations, for example. In some instances, the host system706may also comprise other hardware resources such as a graphics card and/or a peripheral sound card, for example. The host system706may support the operation of the first GOS702a, the second GOS702b, and the third GOS702cvia the hypervisor704. The number of GOSs that may be supported by the host system706by utilizing the hypervisor704need not be limited to the exemplary embodiment described inFIG. 7. For example, two or more GOSs may be supported by the host system706. The host system706may perform substantially similar operations related to handling connection setup in a network as the host102inFIGS. 1A-2C, for example.

The hypervisor704may operate as a software layer that may enable OS virtualization of hardware resources in the host system706and/or virtualization of hardware resources communicatively connected to the host system106, such as the NIHW device710, for example. The hypervisor704may also enable data communication between the GOSs and hardware resources in the host system706and/or hardware resources communicatively connected to the host system706. For example, the hypervisor704may enable packet or segment communication between GOSs supported by the host system706and the NIHW device710via the TX queue708aand/or the RX queue708b. In other embodiments of the invention, a virtualization system at may comprise least one of privileged GOS with a dedicated queue or queues to the NIHW device710, while other GOSs in the system may communicate with the privileged GOS in order to access the NIHW services or some of the NIHW services.

The host processor722may comprise suitable logic, circuitry, and/or code that may enable control and/or management of the data processing and/or networking operations associated with the host system706. The host processor722may correspond to the CPU106in the host102, for example. The host memory720may comprise suitable logic, circuitry, and/or code that may enable storage of data utilized by the host system706. The host memory720may be partitioned into a plurality of memory portions. For example, each GOS supported by the host system706may have a corresponding memory portion in the host memory720. Moreover, the hypervisor704may have a corresponding memory portion in the host memory720. In this regard, the hypervisor704may enable data communication between GOSs by controlling the transfer of data from a portion of the memory720that corresponds to one GOS to another portion of the memory120that corresponds to another GOS. At least portions of the host memory720may correspond to the memory108and/or the shared memory208, for example.

The NIHW device710may comprise suitable logic, circuitry, and/or code that may enable communication of data with a network. The NIHW device710may correspond to the NIHW device104described inFIGS. 1A-2C, for example. The NIHW device710may enable basic level2(L2) switching operations, for example. The TX queue708amay comprise suitable logic, circuitry, and/or code that may enable posting of data for transmission via the NIHW device710. The RX queue708bmay comprise suitable logic, circuitry, and/or code that may enable posting of data received via the NIHW device710for processing by the host system706. In this regard, the NIHW device710may post data received from the network in the RX queue708band may retrieve data posted by the host system706in the TX queue708afor transmission to the network. At least some portions of the TX queue708aand the RX queue708bmay be in the host memory720and/or some portions of it may be integrated into the NIHW device710, for example. The NIHW memory716may comprise suitable logic, circuitry, and/or code that may enable storage of data utilized by the NIHW device710. The connection state724may be substantially similar to the connection state206described inFIGS. 2B-2Cfor handling network connection setups.

The first GOS702a, the second GOS702b, and the third GOS702cmay each correspond to an operating system that may enable the running or execution of operations or services such as applications, email server operations, database server operations, and/or web server operations, for example. The first GOS702amay comprise a virtual NIHW device712a, an application of the consumer (AC)726a, and a communication stack (CS)728a. The second GOS702bmay comprise a virtual NIHW device712b, an AC726b, and a CS728b. The third GOS702cmay comprise a virtual NIHW device712c, an AC726c, and a CS728c. The virtual NIHW device712a, the virtual NIHW device712b, and the virtual NIHW device712cmay correspond to software representations of the NIHW device710resources, for example. In this regard, the NIHW device710resources may comprise the TX queue708aand the RX queue708b. The AC726a, the AC726b, and the AC726cmay operate substantially as the AC204described inFIGS. 2A-2Cfor handling network connection setups.

Similarly, the CS728a, the CS728b, and the CS728cmay operate substantially as the CS202described inFIGS. 2A-2Cfor handling network connection setups.

Virtualization of the NIHW device710resources via the virtual NIHW device712a, the virtual NIC device712b, and the virtual NIC device712cmay enable the hypervisor704to provide L2switching support provided by the NIHW device710to the first GOS702a, the second GOS702b, and the third GOS702.

The approach described herein for handling connection setup in a network may enable a network interface hardware device to manage and/or maintain a network connection via a local connection state in instances when a connection request is received from the network and in instances when a connection request is generated or requested by a host system.