US 20080288647 A1
An application programming interface for translation of transport-layer sessions is presented. The system includes kernel-mode support for application-controlled network address translation and user-mode implementation of the redirect API routines. An application process may request that a network gateway modify the source and/or destination of a given network session in a manner transparent to the original source host and/or the replacement destination host. With the generalized NAT (gNAT) of the instant invention and its associated API, both the source and the destination addresses of message packets may be changed. The address changes are mapped in the gNAT, and may result in apparent sessions between different clients and servers. Depending on the protocol in use (e.g. TCP or UDP), the address translation may be made dynamically by the gNAT, under the command of the application, and take place at the kernel level.
1. A method for facilitating message packet communication between a first application having an internal address valid in an internal address realm and one or more applications in an external address realm, said internal address realm having available to it a set of addresses valid for use in the external address realm, comprising:
providing the internal address realm with a network address translation device having an address translator for translating addresses included in the headers of message packets incoming to and outgoing from the internal address realm in accordance with translation rules that resolve the incompatibility of the internal and external address realms;
providing an address manager for establishing and storing the translation rules, said address manager having access to the set of available addresses valid for use in the external address realm; and
providing a control channel communicating with the address manager for receiving from the first application a service request message for establishing in response to the first application's service request a translation rule specified by the first application,
wherein the address manager transmits to the first application in response to the service request a first address valid for use in the external address realm and wherein the first application causes the first address to be transmitted to the external address realm in an SIP message.
2. The method of
3. The method of
4. The method of
5. The method of
6. The method of
7. The method of
8. The method of
This application is a divisional of U.S. patent application Ser. No. 10/858,754, filed Jun. 2, 2004, entitled “APPLICATION PROGRAMMING INTERFACE AND GENERALIZED NETWORK ADDRESS TRANSLATOR FOR TRANSLATION OF TRANSPORT-LAYER SESSIONS”, which is a continuation of U.S. patent application Ser. No. 09/519,287, filed Mar. 6, 2000, entitled “APPLICATION PROGRAMMING INTERFACE AND GENERALIZED NETWORK ADDRESS TRANSLATOR FOR TRANSLATION OF TRANSPORT-LAYER SESSIONS”, which issued as U.S. Pat. No. 6,779,035 on Aug. 17, 2004. The entireties of the aforementioned applications are incorporated herein by reference.
This invention relates generally to network address translation and, more particularly, relates to generalized network address translation under application program control.
As the number of computers that needed or wanted to be connected to the Internet continued to grow, it soon became obvious that this number could not be accommodated by the number of available IP addresses, known as dotted-quads. In response to this address depletion problem, a method as illustrated in
This gateway computer 66 runs a program called a network address translator (NAT) that has both a private IP address 62 and a public IP address 68. As computers on the private network attempt to establish sessions with a server on a public network (or another private network), the NAT changes the source address 70 of the message packets 72 from the private address of the client computer to its public IP address. In this way, the private IP address is not communicated on the public network. The messages all appear to have come from the public IP address of the NAT machine. The NAT maintains a mapping 74 of the translation from the private to the public IP address so that when messages are received from the public network in response as illustrated by line 76, the NAT can forward them to the proper client machine. This operation of the NAT is completely transparent to the client computers on the private network, i.e. they each believe that they are communicating directly with the public servers.
While the NAT has greatly alleviated the address depletion problem, especially for home and small business networks, its translation of source addresses is fixed within its programming. That is, the traditional NAT does not allow any application control of the address translations that it performs. Additionally, since the address translation is performed on the message packets at such a low level within the kernel 84, the NAT can add almost no value, other than providing the raw source address translation. The NAT cannot even provide any destination address translations. If added value is desired, such as centralized virus scanning, site blocking, white listing, etc., a proxy must be used instead.
Traditional proxies, as illustrated in
The instant invention overcomes these and other problems by providing an application programming interface for translation of transport-layer sessions. Specifically, the inventive concepts of the instant invention relate to a generalized network address translator (gNAT) and associated application programming interface (API) that allow both source and destination address translations to be made under application program control. This allows value to be added to the address translation. Additionally, it significantly increases the data flow speed over a traditional proxy since there is no longer a requirement that all information received at the kernel-mode be passed to the user-mode, copied to a second session, and passed back to the kernel-mode for transmission.
With the generalized NAT (gNAT) of the instant invention and its associated API, both the source and the destination addresses of message packets may be changed. The address changes are mapped in the gNAT, and may result in apparent sessions between different clients and servers. Depending on the protocol in use (e.g. TCP or UDP), the address translation may be made dynamically by the gNAT, under the command of the application, and take place at the kernel level. This significantly improves the data flow of the system by short-circuiting previously required data transfer between the kernel and user modes.
As discussed above, data transfer through a traditional proxy (a user-mode application) requires that the incoming messages from a client on a first session be transferred from the kernel-mode to the user-mode so that the proxy can deal with them. The proxy then would copy the message to a second session, and pass it back down to the kernel-mode for transmission to the server. Likewise, information from the server would arrive at the kernel level, be transmitted up to the user-mode for processing by the proxy, be copied to the other session, and be transmitted back down to the kernel-mode for transmission back to the client. Significant transmission delays were incurred as a result of all of these kernel-to-user-mode transitions.
The system of the instant invention eliminates, or at least greatly reduces, this overhead performance degradation while still adding value to the communication. Specifically, once the application, in this case a proxy, determines that a second session will be established (or a data session), it can command the generalized NAT through the API to perform an address translation at the transmission layer (kernel-mode), and therefore eliminate the transitions between kernel and user modes. The generalized NAT receives the incoming message from the client, confirms that it has a mapped translation, performs the address translation, and passes the message along to the server. Since this translation occurs at the kernel level, the data transfer performance is greatly improved.
Since the generalized NAT and associated API of the instant invention allows for destination address translation of a message packet, another advantage provided by the instant invention is server load balancing. This balancing is achieved by a server load control application that utilizes the gNAT through its associated API to command address translations away from heavily loaded servers to servers with more available capacity. Dynamic load balancing is also possible, dependent on the communication protocol used for the session. That is, a TCP session continues to address all message packets to a server once assigned thereto since the TCP protocol is connection oriented. UDP messages, on the other hand, may be dynamically redirected to an available server at the time of message delivery since UDP is message oriented.
Additional features and advantages of the invention will be made apparent from the following detailed description of illustrative embodiments that proceeds with reference to the accompanying figures.
While the appended claims set forth the features of the present invention with particularity, the invention, together with its objects and advantages, may be best understood from the following detailed description taken in conjunction with the accompanying drawings of which:
Turning to the drawings, wherein like reference numerals refer to like elements, the invention is illustrated as being implemented in a suitable computing environment. Although not required, the invention will be described in the general context of computer-executable instructions, such as program modules, being executed by a personal computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations, including hand-held devices, multi-processor systems, microprocessor based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, and the like. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.
With reference to
The hard disk drive 27, magnetic disk drive 28, and optical disk drive 30 are connected to the system bus 23 by a hard disk drive interface 32, a magnetic disk drive interface 33, and an optical disk drive interface 34, respectively. The drives and their associated computer-readable media provide nonvolatile storage of computer readable instructions, data structures, program modules and other data for the personal computer 20. Although the exemplary environment described herein employs a hard disk, a removable magnetic disk 29, and a removable optical disk 31, it will be appreciated by those skilled in the art that other types of computer readable media which can store data that is accessible by a computer, such as magnetic cassettes, flash memory cards, digital video disks, Bernoulli cartridges, random access memories, read only memories, and the like may also be used in the exemplary operating environment.
A number of program modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24 or RAM 25, including an operating system 35, one or more applications programs 36, other program modules 37, and program data 38. A user may enter commands and information into the personal computer 20 through input devices such as a keyboard 40 and a pointing device 42. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 21 through a serial port interface 46 that is coupled to the system bus, but may be connected by other interfaces, such as a parallel port, game port or a universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface, such as a video adapter 48. In addition to the monitor, personal computers typically include other peripheral output devices, not shown, such as speakers and printers.
The personal computer 20 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 49. The remote computer 49 may be another personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the personal computer 20, although only a memory storage device 50 has been illustrated in
When used in a LAN networking environment, the personal computer 20 is connected to the local network 51 through a network interface or adapter 53. When used in a WAN networking environment, the person computer 20 typically includes a modem 54 or other means for establishing communications over the WAN 52. The modem 54, which may be internal or external, is connected to the system bus 23 via the serial port interface 46. In a networked environment, program modules depicted relative to the personal computer 20, or portions thereof, may be stored in the remote memory storage device. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.
In the description that follows, the invention will be described with reference to acts and symbolic representations of operations that are performed by one or more computer, unless indicated otherwise. As such, it will be understood that such acts and operations, which are at times referred to as being computer-executed, include the manipulation by the processing unit of the computer of electrical signals representing data in a structured form. This manipulation transforms the data or maintains it at locations in the memory system of the computer, which reconfigures or otherwise alters the operation of the computer in a manner well understood by those skilled in the art. The data structures where data is maintained are physical locations of the memory that have particular properties defined by the format of the data. However, while the invention is being described in the foregoing context, it is not meant to be limiting as those of skill in the art will appreciate that various of the acts and operation described hereinafter may also be implemented in hardware.
In accordance with the invention, generalized network address translation functionality is provided to application processes 104 by the architecture illustrated in
By generalizing the operation of network address translation and putting that operation under application 104 control, the system of the instant invention allows network applications 104 to achieve a number of benefits. For instance, server applications 104 can use the application programming interface 108 to make a group of servers appear to clients as a single server at a single IP address as will be described more fully below with reference to
Further, as described above with reference to the traditional proxy, network applications that transfer information between separate network sessions typically suffer performance degradation. As discussed, this is because the network data must be received from the network for one of the network application's sessions, delivered to the user-mode network application by the kernel-mode network transport, read by the network application, written to the network application's other session, transferred to the kernel-mode driver, and transmitted to the network for the network application's other session. Instead of taking the above steps to copy data from one network session to another, the application programming interface 108 allows such network applications 104 to instruct the network gateway or generalized NAT (gNAT) 106 to translate one network session into another.
As may be seen from the architectural diagram of
Each application-requested translation is recorded by the kernel-mode translation module 106 as a redirect. Such a redirect consists of a description of the session to be translated, along with a description of the translation to be performed. For example, the description of the translation may state that when a session is detected with source address S and destination address D, translate it so that the source address becomes S′ and the destination address becomes D′. When the module 106 detects any new network session, it determines whether there is a redirect that applies to the session. If the module 106 determines that there is a redirect for this session, the redirect is activated. The network session is automatically translated and a mapping is created to ensure that the same translation is done for all packets in the session. The normal processing is then continued on the session's translated packets, causing them to be delivered locally or forwarded depending on the new source and destination.
The user-mode application programming module 108 is also preferably implemented as a Windows 2000 library that is loaded by network applications 104. As with the above, the invention is not so limited to a particular operating system, but is applicable to any operating system which allows network communication. Therefore, the exemplary embodiments described herein are by way of illustration and not by way of limitation. A network application 104 calls the library 108 to initialize the kernel-mode translation module 106, and then creates one or more redirects for the network sessions to be translated.
In a preferred embodiment, the library 108 provides routines to perform at least the initializing and shutting down of the library. The initialization ensures that the kernel-mode translation module 106 is loaded and registered in preparation for translating network sessions. The shutting down of the library concludes the application's use of the kernel-mode translation module, which may be unloaded if it has no other clients. Further, the library 108 also includes routines for creating a redirect for a network session. This operation supplies information identifying a network session, along with information describing the translation to be done for the network session. A network session is identified by its protocol, its source IP address, its source port, its destination IP address, and its destination port. The protocol indicates the transport-layer protocol of the network session, which may be either TCP or UDP. The source IP address indicates the IP address of the network session's source host, and the source port indicates the port number of the network session's source host. The destination IP address indicates the IP address of the network session's destination host, and its destination port indicates the port number of the network session's destination host. The translation to be done for the network session may replace any of the last four parameters, however the transport-layer protocol cannot be changed. Finally, the library provided routines to cancel a redirect for a network session. This operation revokes a previous translation-request issued by the application 104.
The operation of translating network sessions at the transport-layer is illustrated in
Once the network application 104 has determined that a dynamic redirect is appropriate and such has been commanded of the gNAT 106, it establishes a dynamic redirect mapping 118. All network data that is received from the network for the proper network application's session (as determined by the gNAT 106 in accordance with its commanded dynamic redirect 118) is automatically translated by the gNAT 106 so that its transport-layer address matches the network application's other session. This data is then transmitted to the network for the network application's other session. Graphically, this dynamic redirection at the transport layer is illustrated by line 120. As may be seen from line 120, the communication of the data to the network server no longer requires that the data go through two kernel-user mode translations, i.e. the trip to the application 104 is short circuited. Likewise, return data on line 122 may also be dynamically redirected to the client if so commanded by the network application 104. The approach allows such applications to achieve a considerable improvement in their performance.
This performance improvement becomes vividly apparent if the initial communication on line 112 opens an ftp control session carrying an ftp get file request. Under a traditional proxy scenario, the ftp data channel created to receive the file requested would first be passed from the kernel-mode to the user-mode to the proxy, and then would be passed back down to the kernel-mode to be forwarded to the client. As may well be imagined, this process incurs significant performance degradation, especially if the file is quite large. Under the system of the instant invention, however, the network application 104 may open a data session which does not require any transitions to the user-mode by commanding a dynamic redirection at the transport-layer. Now, as the data is received from the ftp server, the gNAT 106 performs the dynamic redirection in accordance with the application's command. The destination address of the data is simply translated and passed to the client as indicated by line 122. Significant performance improvement is achieved in this way.
The system of the instant invention also allows session payload editing. Certain applications include addressing information within the data streams of their sessions. For instance, many streaming applications use a control session to establish a secondary data session similar to that described above. This poses a problem for a traditional NAT in its primary application, i.e. transparent sharing of a single Internet connection among multiple machines. When running on clients that are sharing a connection, such applications would send private, unreachable addressing information to remote peers, and the latter would be unable to respond to the clients' requests. To solve this problem, the system of the instant invention supports an extensible means of modifying a session's application-layer data in flight, beyond the modifications made to the session's network-layer and transport-layer addressing information. Extensibility is achieved by allowing third-party drivers to inspect the application-layer data in each packet received for a session, and to edit the application data in each packet. These editors register themselves with the gNAT of the instant invention as handlers for a specific TCP/UDP port number, and are henceforth invoked for each message translated in matching sessions.
In operational terms, the dynamic redirection made available by the system of the instant invention is illustrated in
An application of this transparent redirection of destination addresses is illustrated in
By using the term balance it is not meant that perfect equality of processing capacity be maintained among all servers. Indeed, it may not be possible to achieve perfect equality, e.g. in a situation where there is one heavy user, and a two light users on a network with four or more servers. In this situation, at least one server will be basically unloaded, one will be heavily loaded, and one or two will be servicing the light users. However, even in this situation, if the dynamic redirection is operating to prevent all of the requests from going to one server, the system is performing server load balancing as used herein. In the illustration of
All of the references cited herein, including patents, patent applications, and publications, are hereby incorporated in their entireties by reference.
In view of the many possible embodiments to which the principles of this invention may be applied, it should be recognized that the embodiment described herein with respect to the drawing figures is meant to be illustrative only and should not be taken as limiting the scope of invention. For example, those of skill in the art will recognize that the elements of the illustrated embodiment shown in software may be implemented in hardware and vice versa or that the illustrated embodiment can be modified in arrangement and detail without departing from the spirit of the invention. Therefore, the invention as described herein contemplates all such embodiments as may come within the scope of the following claims and equivalents thereof.