IBM® is a registered trademark of International Business Machines Corporation, Armonk, N.Y., U.S.A. Other names used herein may be registered trademarks, trademarks or product names of International Business Machines Corporation or other companies.
1. Field of the Invention
This invention relates to TCP/IP stacks, and particularly to systems, methods and computer products for a TCP/IP stack to notify an application of a state change made to all routes over a single IPV4 interface.
2. Description of Background
TCP/IP (i.e., Internet Protocol Version 4 (IPV4)) networks are growing, resulting in route tables that can sometimes contain thousands of routes. In addition, the routes in the route table that use any single TCP/IP stack interface can also be very large in number. When an application has obtained the route table contents from the TCP/IP stack, it is likely that the application needs to maintain those route table contents by learning of subsequent changes made to the route table by the TCP/IP stack. One such change is the activation or deactivation of all routes that use a particular TCP/IP stack interface, due to the activation or deactivation of the interface itself. The application must then currently learn of these route changes using several methods. For example, the application can re-obtain the contents of the route table from the TCP/IP stack. This method has the disadvantage that both the application and the TCP/IP stack must process the entire route table, even when only a small percentage of the routes have changed. In another example, the TCP/IP stack can notify the application of each of the routes in the route table that was updated due to the activation or deactivation of the interface. This method has the disadvantage that a large number of routes must be communicated when there are many routes in the route table that use that interface.
Exemplary embodiments include a method in a TCP/IP stack having a plurality of IPV4 interfaces, to notify an application of a state change made to all routes over a single IPV4 interface, the method including creating a master socket to the TCP/IP stack, obtaining all IPV4 active and inactive home interfaces from the TCP/IP stack, building and maintaining a home interface hash table of the obtained home interfaces, wherein an associated active and inactive state is maintained in a respective home interface entry of the home interface hash table, obtaining all the IPV4 host and network routes from the TCP/IP stack, wherein each respective route entry includes the respective route's home interface, building and maintaining a route hash table of obtained host and network routes, determining that a route is active when the route's home interface is active, receiving a notification via the master socket from the TCP/IP stack in response to a state change occurring in a home interface, wherein the notification identifies the home interface and the state change of the home interface and changing a respective state entry of the home interface in the home interface hash table.
Further exemplary embodiments include an article of manufacture, including a set of program interfaces embodies on a computer readable medium for execution on a computer in conjunction with an application program that notifies an application of a state change made to all routes over a single IPV4 interface in a TCP/IP stack, the set of program interfaces for creating a master socket to the TCP/IP stack, obtaining all IPV4 active and inactive home interfaces from the TCP/IP stack, building and maintaining a home interface hash table of the obtained home interfaces, wherein an associated active and inactive state is maintained in a respective home interface entry of the home interface hash table, obtaining all the IPV4 host and network routes from the TCP/IP stack, wherein each respective route entry includes the respective route's home interface, building and maintaining a route hash table of obtained host and network routes, determining that a route is active when the route's home interface is active, including locating the respective route in the route hash table prior to sending a routing request to the TCP/IP stack, wherein the route entry in the route hash table identifies the route's home interface, locating the route's home interface in the home interface hash table, sending a request to the TCP/IP stack in response to the home interface being active, thus indicating that the route is active, receiving a notification via the master socket from the TCP/IP stack in response to a state change occurring in a home interface, wherein the notification identifies the home interface and the state change of the home interface and changing a respective state entry of the home interface in the home interface hash table.
System and computer program products corresponding to the above-summarized methods are also described and claimed herein.
Additional features and advantages are realized through the techniques of the present invention. Other embodiments and aspects of the invention are described in detail herein and are considered a part of the claimed invention. For a better understanding of the invention with advantages and features, refer to the description and to the drawings.
As a result of the summarized invention, technically we have achieved a solution in which a TCP/IP stack notifies an application of a state change made to all routes over a single IPV4 interface.
The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other objects, features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
The detailed description explains the preferred embodiments of the invention, together with advantages and features, by way of example with reference to the drawings.
In exemplary embodiments, the systems and methods described herein route IPV4 traffic to the correct instance of TCP/IP on a processing system having multiple instances of TCP/IP. The correct instance of TCP/IP may be selected by establishing a master routing table, which contains the network interface and route information for each instance of TCP/IP in the configuration. In exemplary embodiments, a new notification type to be sent by the TCP/IP stack to the application when an interface is activated or deactivated. The notification contains the identification of the interface as well as the new interface state (active or inactive). On receipt of this notification, the application can make the appropriate modification to the routes in the route table that use that interface. Performance improvements are realized. The activation or deactivation of a TCP/IP stack interface may result in the modification of a small percentage of the routes in the route table or it may result in the modification of a large number of routes in the route table. In both cases, the application is notified of the change with a single, small notification sent by the TCP/IP stack to the application. The processing required in both the stack and the application involves only the interface in question and the associated routes.
Turning now to the drawings in greater detail, it will be seen that in
As described herein, a new notification type to be sent by the TCP/IP stack 100 to the application via the application layer 170 when an interface is activated or deactivated. The notification contains the identification of the interface as well as the new interface state (active or inactive). On receipt of this notification, the application can make the appropriate modification to the routes in the route table that use that interface. Performance improvements are realized.
The capabilities of the present invention can be implemented in software, firmware, hardware or some combination thereof.
As one example, one or more aspects of the present invention can be included in an article of manufacture (e.g., one or more computer program products) having, for instance, computer usable media. The media has embodied therein, for instance, computer readable program code means for providing and facilitating the capabilities of the present invention. The article of manufacture can be included as a part of a computer system or sold separately.
Additionally, at least one program storage device readable by a machine, tangibly embodying at least one program of instructions executable by the machine to perform the capabilities of the present invention can be provided.
The flow diagrams depicted herein are just examples. There may be many variations to these diagrams or the steps (or operations) described therein without departing from the spirit of the invention. For instance, the steps may be performed in a differing order, or steps may be added, deleted or modified. All of these variations are considered a part of the claimed invention.
While the preferred embodiment to the invention has been described, it will be understood that those skilled in the art, both now and in the future, may make various improvements and enhancements which fall within the scope of the claims which follow. These claims should be construed to maintain the proper protection for the invention first described.