The invention relates to the field of network communications, and in particular, to a method and device for implementing active and standby gateway devices in a network.
With the development of Internet technologies, a large number of hosts (a host may be a computer, or any other device) are required to connect to Internet, to be served by other hosts or to provide services to other hosts.
A gateway device is necessary for connecting a host to Internet. A fault appearing in the Gateway device may result in a communication interrupt between the host and Internet. In such a situation, the host can not be served by other devices over Internet, and is incapable of providing services to other devices over Internet.
Some important hosts each are required to connect to two or more gateway devices at the same time, so as to prevent the communication interrupt between the hosts and Internet due to faults in the gateway devices. As shown in
Generally, Virtual Router Redundancy Protocol (VRRP) is utilized to implement a redundancy backup between a host and two gateways.
Two interfaces 211 and 212 are provided in the host 210 for connections to two gateway devices 221 and 222. The interface 211 is an active interface and the interface 212 is a standby interface. In normal conditions, only one interface 211 (active interface) is capable of the reception and transmission of data packets, while the other interface 212 (standby interface) which is in standby status can not receive and transmit data packets. When one interface has a fault, the other interface is activated.
In a VRRP-based solution, VRRP runs over the two gateway devices, a virtual Internet Protocol (IP) address is provided. The address of the gateway devices known by the host 210 is a virtual IP address. As shown in
During startup, information is exchanged between the two gateway devices 221 and 222, to determine which is the active or standby gateway. In normal operation, timed status synchronization is required between the two gateway devices 221 and 222. The standby gateway determines whether the active gateway is working normally according to synchronization information. If the standby gateway does not receive synchronization messages from the active gateway, the standby gateway determines that the active gateway has a fault and takes over, i.e. the standby gateway becomes the active gateway.
In the above solution, faults of the active and standby gateways are detected in accordance with a heartbeat protocol of VRRP. The time period of the heartbeat protocol is 1 second. Usually a fault can not be determined before the detection has been performed three times. Therefore, it takes a relatively long time, i.e. usually more than 3 seconds, to detect a fault.
Furthermore, VRRP does not allow the two gateway devices 221 and 222 to be in active status at the same time. The situation that the two gateway devices serve as active gateways at the same time may result in uncontrollable errors. As shown in
Embodiments of the invention provide a method and device for implementing active and standby gateway devices in a network, to avoid an error switchover between the active and standby gateways, and improve the switchover speed efficiently.
A method for implementing active and standby gateway devices in a network includes:
According to another aspect of the invention, an apparatus for processing status of a gateway device is provided. The apparatus is configured in a host, and includes:
According to a further aspect of the invention, a gateway device is provided. The gateway device includes:
As can be seen, in the above technical solutions, the switchover speed between active and standby gateway devices is relatively fast. In other words, the switchover in the invention is faster than that in the prior art. The switchover time required may be reduced to 50 milliseconds, compared with the 3 seconds required in the prior art.
Furthermore, the switchover speed between active and standby gateway devices is controlled by a host in the invention, without any need of running heartbeat protocol between the active and standby gateway devices, and thereby the possibility that two gateway devices become active gateways at the same time may be avoided. As a result, an error switchover between the active and standby gateway devices may be avoided, and thereby the switchover may be not only faster, but also more accurate and reliable.
In the embodiments of the invention, a host determines whether two gateway devices connected to the host should be in an active or standby status, and notifies the gateway devices of information of the determined active or standby status of the gateway devices. Each of the two gateway devices determines its own status, i.e. the active or standby status, according to the information notified by the host, and processes accordingly. With the invention, the two gateway devices may switch between the active and standby status without the need of running any heartbeat protocol between the two gateway devices.
Furthermore, in the embodiments of the invention, a corresponding route priority may be configured for each of the active and standby gateway devices, and route information with the priority information may be propagated. In this way, the active or standby gateway device may be chosen according to the route priorities in the communication network, so as to implement switchover between the active and standby gateway devices.
Particularly, a notification message notifying the active or standby status of interfaces is transmitted between a host and gateway devices. Each of the gateway devices determines the active or standby status of interfaces according to the notification message from the host, to determine the route priorities of interfaces connected to the host. The route priority of a standby interface is lower than priorities of other routes. When publishing a route of an interface connected to the host, the gateway device determines the priority of the route according to the status of the interface. If the status of the interface is active, the route to be published has a higher priority. If the status of the interface is standby, the route to be published has a lower priority. As a result, a proper active gateway device may be chosen for a packet destined for the host from a router on Internet.
A method according to an embodiment of the invention is described in detail below in conjunction with the drawings.
In block 41, interfaces, connected to a host, on two gateway devices are configured with a common IP address.
As shown in
In block 42, the host chooses one gateway device as an active gateway, and the other gateway device as a standby gateway. In other words, the host chooses one interface of two interfaces, connected to the gateway devices, on the host as an active interface, and the other interface as a standby interface.
When both the two gateway devices are normal, the host chooses any one of the two gateway devices as the active gateway. When one of the two gateway devices has a fault, the host chooses the other one of the two gateway devices as the active gateway.
In block 43, the host sends a notification message via interfaces connected to the gateway devices, notifying whether the interfaces are active interface or standby interface.
For example, when discovering that the active interface has a fault, the host sends a notification message notifying the gateway device connected to the standby interface, and changes the status of the standby interface so that the standby interface becomes the active, to assure, thereby, that one, and only one, interface serves as an active interface at a time.
The notification message may be directly encapsulated over a link layer protocol, or may be carried over IP layer, and should not be limited to a particular form.
The format of the active/standby interface information carried in the notification message may be a field having one and only one bit. The value 1 of the bit indicates that the interface is an active interface, and the value 0 f the bit represents that the interface is a standby interface, and vice versa.
The interface information may be in other formats.
In block 44, the gateway devices receive the notification messages sent from the host, and determine whether the interfaces, via which the gateway devices are connected to the host, are an active interface or a standby interface, to implement corresponding functions, i.e. the functions to be implemented by each of the active and standby gateway devices.
When the active or standby status of each of the gateway devices is determined, the gateway devices adopt different route publishing policies and message forwarding policies according to their status.
(1) Route Publishing Policy
In addition, when the two gateway devices are determined to be an active or standby gateway, each of the two gateway devices publishes a route of an interface connected to the host according to its active or standby status. If the interface is an active interface, the priority of the published route is relatively higher; otherwise, the priority of the published route is relatively lower. Of course, the standby gateway device may not publish a route of an interface connected to the host.
Packets destined for the host sent from a router on Internet is transmitted preferentially by the active gateway device connected to the active interface, because the route priority of the active gateway device is higher.
(2) Message Forwarding Policy
The active gateway device is adapted to directly send a message, from the network, to the host. When receiving a message destined for the host from the network, the standby gateway device forwards the message to the active gateway device, and the active gateway device transmits the message to the host.
As shown in
Usually, a router (a gateway device is also a router) considers the priority of a direct route to be higher than that of an indirect route. In addition, in an embodiment of the invention, the route of an interface has a lower priority than other routes if the interface is a standby interface. Therefore, normally a packet destined for the host is sent from the network directly to the active gateway device, which forwards the packet to the host. However, when a path between the network and the active gateway device has a fault, the network may send a packet destined for the host to the standby gateway device. When receiving the packet destined for the host from, for example, Internet, the standby gateway device forwards the packet to the other gateway device, i.e. the active gateway device, and the active gateway device forwards the packet to the host.
A process after a fault occurs in an active gateway device is described below in conjunction with the drawings.
As shown in
In the invention, the switchover speed between active and standby gateway devices depends on the time for detecting an interface fault between a host and a gateway device. Usually it takes different time for detecting different interfaces. For some interfaces, the interface fault detection time may be within 50 milliseconds. In general, the interface fault detection time is shorter than the time taken by heartbeat protocol to detect a gateway fault. Therefore, a switchover between active and standby gateway devices may be completed within 50 milliseconds at the soonest in the invention, which is much speedier than that in VRRP.
In summary, the time for switchover between an active gateway device and a standby gateway device may be reduced to 50 milliseconds in the invention, compared with the 3 seconds in the prior art. Furthermore, switchover between active and standby gateway devices is controlled by a host, without any need of running heartbeat protocol between the two gateway devices. As a result, the two gateway devices are impossible to become active gateways at the same time. In this way, the switchover protection of the gateway devices may be more accurate and reliable.
An apparatus for processing status of a gateway device according to the invention is configured in a host. The apparatus includes:
a status determination unit, adapted to determine active or standby status of an interface via which the host is connected to the gateway device;
a status notification unit, adapted to notify the gateway device, connected to the host, of the determined active or standby status of the interface.
Optionally, the apparatus may further include an interface detection unit, adapted to detect working status of the interface via which the host is connected to the gateway device, and provide a result of the detection to the status determination unit.
Optionally, the apparatus may further include a packet construction unit, adapted to construct a notification message required by the status notification unit to notify the active or standby status of the interface.
A gateway device according to the invention includes:
a status notification receiving unit, adapted to receive active or standby status information of an interface from a host;
a status adjustment unit, adapted to set the gateway device into status corresponding to the active or standby status information of the interface.
Though some preferred embodiments of the invention have been described above, the protection scope of the invention is not intended to be limited to these. Any modifications and substitutions readily recognized by those skilled in the art within the scope of the invention shall be covered within the protection scope of the invention, which shall be defined by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
200510077395.6 | Jun 2005 | CN | national |
This application is a Continuation Application of PCT/CN2006/001363 submitted on Jun. 26, 2006, claiming the priority from a Chinese patent application No. 200510077395.6 submitted on Jun. 23, 2005, the contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2006/001363 | Jun 2006 | US |
Child | 11962283 | Dec 2007 | US |