Method, system, and article of manufacture for network protocols

Provided are a method, system, and article of manufacture. A network communication request is received at an offload application, wherein the offload application interfaces with a first network stack implemented in an operating system and a second network stack implemented in a hardware device. A determination is made if the network communication request can be processed by the second network stack. If the network communication request can be processed by the second network stack, then the network communication request is offloaded for processing to the hardware device.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a method, system, and an article of manufacture for network protocols.

2. Description of the Related Art

A host system may have a network adapter coupled to the host system for network communications. In certain implementations, the network communications may require the processing of commands related to the Transmission Control Protocol/Internet Protocol (TCP/IP) or any other protocol implemented over IP. A protocol is a set of rules, data formats, and conventions that regulates the transfer of data between communicating processes.

The TCP/IP protocol may be implemented in software as a TCP/IP protocol stack as part of the operating system that is resident on the host system. In such a case, the central processing unit of the host system processes commands that are related to the TCP/IP protocol.

Some network adapters may provide hardware support for processing commands related to the TCP/IP protocol. Drivers for such network adapters may provide new interfaces for applications that use the TCP/IP protocol for network communications. Applications that work with network adapters that do not provide hardware support for the TCP/IP protocol stack may have to be rewritten to use the new interfaces. Furthermore, if the network adapter provides hardware support for the TCP/IP protocol stack, changes may be required to the existing TCP/IP protocol stack on the host system for offloading processing related to the TCP/IP protocol stack to the network adapter.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The embodiments describe an offloading application in a host system that supports network protocol offloading to a network interface card hardware. The offloading application can co-exist with the host operating system's network stack.

FIG. 1illustrates a block diagram of a computing environment, in accordance with certain described aspects of the invention. A host system100may comprise at least one CPU102, an operating system104, a network interface card (NIC)106, a hardware driver108, at least one socket application110, and an offload application112.

The host system100may be any computational device known in the art, such as a personal computer, a workstation, a server, a mainframe, a hand held computer, a palm top computer, a laptop computer, a telephony device, a network appliance, etc. The operating system104may be any operating system known in the art, such as, the UNIX* operating system, the Microsoft Windows* operating system, the LINUX operating system, etc. The operating system104includes an implementation of an operating system network stack105that can process commands related to the Internet protocol in software. * Microsoft Windows is a trademark of Microsoft corp.; UNIX is a trademark of the Open Group.; AppleTalk is a trademark of Apple Computer, Inc.

The NIC106may include any network adapter known in the art that includes hardware support for processing at least some commands related to at least one IP protocol, such as, the TCP/IP protocol. For example, the NIC106may include a TCP offload engine adapter that implements a network stack in hardware or software. The hardware driver108provides a software interface for the NIC106such that the operating system104and applications resident on the host100can use the NIC106.

The socket application110uses socket interfaces for network communications. The socket application may include Internet protocol based applications, such as, the File Transfer Protocol (FTP), TELNET etc. The socket application110generates socket calls for network communications to the offload application112.

The offload application112includes an offload protocol switch114and one or more offload protocol drivers116a,116b, . . .116nthat support various networking protocols. The offload protocol switch114determines if the NIC106provides hardware support for processing the network communications related to a socket call. If so, the offload protocol switch114forwards the socket call to the appropriate offload protocol driver116a. . .116nfor processing. The offload protocol driver116a. . .116nuses the hardware driver108to send the socket call to the NIC106for processing. If the offload protocol switch114determines that the NIC106does not provide support for processing the network communications related to the socket call, then the offload protocol switch114sends the socket call for processing via the operating system network stack105that is resident in the operating system104. Embodiments may implement the offload application in software, hardware, or in both software and hardware.

ThereforeFIG. 1illustrates how the offload application112offloads socket calls for processing to the NIC106, when the NIC106provides hardware support for processing of commands related to the Internet Protocol. When the socket calls are processed by the NIC106the load on the CPU102is reduced because the CPU102does not have to process the socket calls.

FIG.2,illustrates a block diagram of interactions related to the offload application112, in accordance with certain embodiments of the invention. Socket based network programming is supported by a socket driver200that transmits socket calls from the socket application110to the offload application112.

The operating system network stack105includes the Internet (INET) address family202and the ARPA stack204. Sockets created by different programs use names to refer to one another. To be used, these names generally must be translated into addresses. The space that an address is drawn from is referred to as a domain. There are several domains for sockets of which the Internet address domain (AF_INET) is the UNIX implementation of the ARPA Internet standard protocols IP, TCP, and User Datagram Protocol (UDP). The INET address family202is the interface to the AF_INET domain.

The ARPA stack204comprises the TCP layer206and UDP layer208implemented over the IP layer210and the framing layer212. The ARPA stack204implements the TCP/IP and the UDP/IP protocols in software. The TCP layer206implements the TCP protocols and the UDP layer208implements the UDP protocols. The IP layer210implements the IP protocols.

The offload application112includes the offload protocol switch114, an offload device manager216, a TCP/IP offload protocol driver218, a socket direct offload protocol driver220, and other protocol drivers222.

The offload protocol switch114may handle multiple protocols in IP and routes sockets calls received from the socket application110via the socket driver200to the appropriate protocol. The offload protocol switch114may provide support both for protocols supported and not supported by the operating system network stack105. For example, the offload protocol switch may provide hardware support for the TCP/IP protocol by directing calls to the TCP/IP offload protocol driver218, where the TCP/IP protocol is also supported in software by the operating system network stack105. Additionally, the offload protocol switch114may provide support to the socket direct offload protocol by directing socket calls related to the socket direct offload protocol to the socket direct offload protocol driver220. The socket direct offload protocol may allow for remote direct memory access (RDMA) that is not supported by the operating system network stack105. The offload protocol switch114may support still further IP protocols by directing socket calls to the other offload protocol drivers222besides the TCP/IP offload protocol drivers218and the socket direct offload protocol driver220.

The offload device manager216interacts with the operating system network stack105and the offload protocol switch114. The offload device manager216registers devices capable of providing hardware support for IP protocols. The offload device manager216may classify a received network event as an event that may be processed by the NIC106and generates corresponding events for offload transport drivers such as a IP transport offload driver224or an RDMA transport offload driver226. The protocol drivers, such as, the TCP/IP offload protocol driver218and the socket direct offload protocol driver220, may also transfer socket calls to corresponding transport drivers, such as, the IP transport offload driver224and the RDMA transport offload driver226. The transport drivers, such as, the IP transport offload driver224and the RDMA transport offload driver226communicate with the NIC106via the hardware driver108.

Additionally, the embodiments may include direct hardware access interfaces228that allow direct communication of applications resident on the host100with the NIC106via the hardware driver108.

Therefore,FIG. 2illustrates how the offload application112implemented in the host100supplements the operating system network stack105and provides hardware support of IP protocols via the NIC106. Changes are not required to the operating system network stack105for implementing the offload application112.

FIG. 3illustrates logic for configuring the offload application112implemented in the host system100, in accordance with certain embodiments of the invention.

The process starts at block300where the host100is configured with the list of offload protocol drivers, such as, the TCP/IP offload protocol driver218and the socket direct offload protocol driver220, that need to be loaded on startup. Control proceeds to block302, where during the startup of the host100, the operating system104loads the operating system network stack105. Along with the loading of the operating system network stack105, the operating system104loads the offload protocol switch114, the offload device manager216and the configured offload protocol drivers218,220,222.

Control proceeds to block304, where the offload protocol switch114registers with the socket driver200as handling the AF_INET address family. As a result, any socket based requests for the INET address family are forwarded to the offload protocol switch114by the socket driver200. In alternative embodiments, the offload protocol switch114may handle additional address families besides the AF_NET address family.

Control proceeds to block306, where the offload device manager216registers with the operating system network stack105for all network events in the system. At block308, the offload protocol drivers218,220,222register with the offload protocol switch114and specify the supported protocol types to the offload protocol switch114. The offload protocol drivers218,220,222may support protocols that are supported by the operating system network stack105and also support protocols that are not supported by the operating system network stack105.

Control proceeds to block310, where the operating system104discovers the NIC106and loads the appropriate hardware driver108configured for the NIC106. The NIC106is initialized at this time to function as a network adapter that does not support any protocol stack offload. In alternative embodiments, a plurality of NICs or other hardware devices may be discovered by the operating system104.

Control proceeds to block312where the hardware driver108registers with the offload device manager216and provides hardware dispatch table information, etc. At block314the operating system104loads the transport offload drivers224,226for the NIC106. Control proceeds to block316, where the transport offload drivers224,226register with the offload device manager216and specify the hardware adapter type supported. The transport offload drivers224,226uses the offload device manager216to obtain the hardware dispatch table information.

Control proceeds to block318, where the transport offload drivers224,226register the supported interfaces with the offload protocol drivers218,220,222and the offload protocol drivers218,220,222register the supported interfaces with the offload protocol switch114. At the completion of block318, the IP interface is available over the offloaded stack for the socket application110. The offload protocol switch114can use the NIC106for offloading a newly created socket. In alternative embodiments, the offload protocol switch114can use a plurality of NICs or other hardware devices for offloading one or more sockets.

Therefore, the logic ofFIG. 3illustrates how the IP interface at the NIC106is made available to the socket application110by the offload application112.

FIG. 4illustrates logic for offloading the protocol stack that may be implemented in part via the offload application112, in accordance with certain embodiments of the invention.

The process starts at block400where the socket application110generates a network communication request to the socket driver200. The socket calls related to the network communication request may be from the AF_INET family. The AF_INET address family is for handling Internet protocols. Control proceeds to block402, where the socket driver200forwards the network communication request to the offload protocol switch114that handles the AF_INET address family (the offload protocol switch114had registered with the socket driver200in block304).

Control proceeds to block404where the offload protocol switch114determines whether offload processing is possible for the network communication request. If so, control proceeds to block406where offload application112attempts to connect to the NIC106for offloading the network communication request. For example, for a TCP/IP network communication request, the connection may be established from the offload application112to the NIC106, via the offload protocol switch114, the TCP/IP offload protocol driver218, the IP transport offload driver224and the hardware driver106. At block408, the offload application112determines if the offloading of the network communication request is successful, i.e., the NIC106has processed the network communication request. If so, control is returned (at block412) to the socket application110.

If at block408, the offload application112determines that the offloading of the communication request is unsuccessful, then control proceeds to block410where the network communication request is processed by the operating system network stack105. Therefore, if for any reason the NIC106is unable to process the network communication request, such as, by generating a fault, then the operating system network stack105processes the network communication request in software by using the CPU102.

If at block404, the offload protocol switch114determines that offload processing is not possible for the network communication request then control proceeds to block410where the network communication request is processed by using the operating system network stack105.

Therefore, the logic ofFIG. 4ensures that the socket application110does not have to be aware as to whether socket calls for network communication requests are processed by the NIC106or the operating system network stack105. If a network communications request is capable of being processed by the NIC106, then an acceleration of system performance may be expected when compared to the case where the network communication request is processed by the operating system network stack105.

The embodiments, allow the offloading of network protocol processing to a hardware component, such as, a network interface card, thereby saving computational resources on the central processing unit of a host system. No changes are required to the existing network stack present in operating systems that reside on the host system. Socket application that run by using the operating system network stack105can run unchanged while using the hardware implementations of the network stack on the NIC106. New capabilities like RDMA that are not supported by the ARPA stack may be supported by the embodiments. Furthermore, the embodiments may expose the same IP addresses on the operating system network stack105and the network stack on the NIC106.

The embodiments preserve protocol port space across protocol processing modules in the NIC106and the host100. Applications and network management utilities that run on the host100appear to interact with a single network stack even though two separate network stacks are maintained by the embodiments. The embodiments also provide support for session setup and connection control.

Additional Embodiment Details

The described techniques may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, micro-code, hardware or any combination thereof The term “article of manufacture” as used herein refers to code or logic implemented in hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.) or a computer readable medium (e.g., magnetic storage medium, such as hard disk drives, floppy disks, tape), optical storage (e.g., CD-ROMs, DVD-ROMs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, flash, firmware, programmable logic, etc.). Code in the computer readable medium is accessed and executed by a processor. The code in which embodiments are made may further be accessible through a transmission media or from a file server over a network. In such cases, the article of manufacture in which the code is implemented may comprise a transmission media, such as a network transmission line, wireless transmission media, signals propagating through space, radio waves, infrared signals, etc. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the embodiments, and that the article of manufacture may comprise any information bearing medium known in the art.

FIG. 5illustrates a block diagram of a computer architecture in which certain aspects of the invention are implemented.FIG. 5illustrates one embodiment of the host system100. The host system100may implement a computer architecture500having a processor502(such as the CPU102), a memory504(e.g., a volatile memory device), and storage506. The storage506may include non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, flash, firmware, programmable logic, etc.), magnetic disk drives, optical disk drives, tape drives, etc. The storage506may comprise an internal storage device, an attached storage device or a network accessible storage device. Programs in the storage506may be loaded into the memory504and executed by the processor502in a manner known in the art. The architecture may further include a network card508(such as the NIC106) to enable communication with a network. The architecture may also include at least one input510, such as a keyboard, a touchscreen, a pen, voice-activated input, etc., and at least one output512, such as a display device, a speaker, a printer, etc.

In certain implementations, the embodiments may be implemented in a computer system including a video controller to render information to display on a monitor coupled to the computer system including the offload application, such as a computer system comprising a desktop, workstation, server, mainframe, laptop, handheld computer, etc. Alternatively, the embodiments may be implemented in a computer system that does not include a video controller, such as a switch, router, etc.

While the embodiments have been described with respect to IP based protocols, other network protocols, such as, AppleTalk, etc.,. may also be supported by alterative embodiments. Furthermore, in additional embodiments more than one NIC may be used by the offload protocol switch for processing commands related to network communications.

The logic ofFIG. 3andFIG. 4describes specific operations occurring in a particular order. Further, the operations may be performed in parallel as well as sequentially. In alternative embodiments, certain of the logic operations may be performed in a different order, modified or removed and still implement embodiments of the present invention. Morever, steps may be added to the above described logic and still conform to the embodiments. Yet further steps may be performed by a single process or distributed processes.

Furthermore, many of the software and hardware components have been described in separate modules for purposes of illustration. Such components may be integrated into fewer number of components or divided into larger number of components. Additionally, certain operations described as performed by a specific component may be performed by other components.

The data structures and components shown or referred to inFIGS. 1-5are described as having specific types of information. In alternative embodiments, the data structures and components may be structured differently and have fewer, more or different fields or different functions than those shown or referred to in the figures.