Virtual Router Redundancy Protocol Fault Detection Method and Routing Device

Information

  • Patent Application
  • 20170155577
  • Publication Number
    20170155577
  • Date Filed
    February 10, 2017
    8 years ago
  • Date Published
    June 01, 2017
    7 years ago
Abstract
A VRRP fault detection method is applied to a VRRP group including one primary router and one or more secondary routers. The method includes: sending, by the primary router and the secondary router, link detection packets having an echo response function, where a destination address of the link detection packet is a virtual address of the VRRP group. The method also includes determining, by the primary router and the secondary router, whether response packets corresponding to the link detection packets sent by the primary router and the secondary router are received within a predetermined time, and if the primary router and/or the secondary router does not receive the response packet within the predetermined time, determining that the primary router is faulty.
Description
TECHNICAL FIELD

The present application relates to the communications field, and in particular, to a virtual router redundancy protocol fault detection method and a routing device.


BACKGROUND

A virtual router redundancy protocol (VRRP) is an error tolerance protocol. The protocol ensures, by combining several physical routing devices into one virtual routing device and by using a mechanism, to switch a service to another router in time when a next-hop router of a host is faulty, so as to maintain continuity and reliability of communication.


The VRRP allocates routers in a local area network into a group, where the group of routers is referred to as a VRRP backup group (a VRRP group for short). The VRRP group is equivalent to a virtual router. The virtual router has a virtual Internet Protocol (IP) address. The host in the local area network only needs to know a virtual IP address of the virtual router and set the virtual IP address of the virtual router to a next-hop address of a default route, and then the host can communicate with an external network by using the virtual router. The VRRP group includes one primary router and multiple secondary routers. The primary router is elected according to a priority election mechanism, to functions as a gateway, respond to an Address Resolution Protocol (ARP) request for the virtual IP address, and forward a packet whose destination Media Access Control (MAC) address is a MAC address of the virtual router. The virtual IP address of the VRRP group actually points to the primary router. Another router in the VRRP group is a secondary router. When the primary router is faulty, the secondary router replaces, by using the priority election mechanism, the primary router to continue functioning as the gateway, so as to ensure that the host in the network uninterruptedly communicates with the external network.


A conventional VRRP performs fault detection by sending a Hello packet at a scheduled time, and a default time interval of sending a VRRP protocol packet is one second. When the secondary router cannot receive a Hello packet of the primary router for consecutive three times, a new primary router is determined among the secondary routers by means of priority election, so as to perform active/standby switching. Because a minimum time interval of sending the Hello packet is usually one second, a link fault status can be perceived by the secondary router in at least three seconds, which is a relatively long convergence time for a real-time service that needs to rapidly perceive the link fault status.


SUMMARY

An objective of the present application is to provide a virtual router redundancy protocol fault detection method and a routing device.


According to a first aspect, an embodiment of the present application provides a virtual router redundancy protocol fault detection method. The method is applied to a virtual router redundancy protocol (VRRP) group including one primary router and one or more secondary routers. The method includes sending, by the primary router and the secondary router, link detection packets having an echo response function, where a destination address of the link detection packet is a virtual address of the VRRP group. The method also includes determining, by the primary router and the secondary router, whether response packets corresponding to the link detection packets sent by the primary router and the secondary router are received within a predetermined time, and if the primary router and/or the secondary router does not receive the response packet within the predetermined time, determining that the primary router is faulty.


In a first possible implementation manner of the first aspect, the link detection packet is an ECHO-type bidirectional forwarding detection (BFD) packet.


According to a second aspect, an embodiment of the present application provides a routing device. The routing device is applied to a virtual router redundancy protocol (VRRP) group including one primary router and one or more secondary routers. The routing device is one of the primary router or the secondary routers. The routing device includes a sending module, configured to send a link detection packet having an echo response function, where a destination address of the link detection packet is a virtual address of the VRRP group. The routing device also includes a determining module, configured to: determine whether a response packet corresponding to the link detection packet sent by the sending module is received within a predetermined time, and if the response packet is not received within the predetermined time, determine that the primary router is faulty.


In a first possible implementation manner of the second aspect, the link detection packet sent by the sending module is an ECHO-type bidirectional forwarding detection (BFD) packet.


According to a third aspect, an embodiment of the present application provides a virtual router redundancy protocol (VRRP group), where the VRRP group includes one primary router and multiple secondary routers, the primary router and the secondary routers are configured to: send link detection packets having an echo response function, where a destination address of the link detection packet sent by each of the primary router and the secondary routers is a virtual IP address of the VRRP group; and if the primary router and/or the secondary router does not receive a response packet within a predetermined time, determine that the primary router is faulty.


In a first possible implementation manner of the third aspect, the link detection packet is an ECHO-type bidirectional forwarding detection (BFD) packet.


Technical solutions of the embodiments of the present application may implement rapid fault detection on a VRRP group network in a one primary multiple secondaries environment. The reason why in the prior art, configuration of a link detection session by the VRRP group is hard to implement in the one primary multiple secondaries network environment is that the link detection session needs to be established between every two routers of all routers, so as to ensure that after the VRRP group performs active/standby switching, the link detection session can still exist between all secondary routers and a primary router. Therefore, each router in the VRRP group simultaneously receives a link detection packet from a primary router and a link detection packet from another secondary router. However, because a primary router and a secondary router in the VRRP group are dynamically switched, and it cannot be identified, by using the link detection packets, whether a detected faulty link is a link to which the primary router belongs or a link to which the secondary router belongs, the VRRP group cannot be triggered to perform active/standby switching. However, in the technical solutions of the embodiments of the present application, an echo-response-type packet is used as a fault detection packet and a peer IP address is set to a virtual IP address of the VRRP group. Therefore, regardless of whether the active/standby switching is performed or the primary router is changed, the secondary router always detects a status of a link between the secondary router and the primary router by using the echo response packet. In addition, the echo response packet does not need to be configured for a peer end, and therefore, after the active/standby switching is performed, no configuration needs to be performed on the VRRP group, and detection on the link between the primary router and the secondary router may be persistently implemented. Based on this, as long as a router in the VRRP group detects a response packet of an echo response detection packet sent by the router, the router can determine whether the primary router is faulty, thereby achieving an objective of rapidly detecting a fault.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a flowchart of a method according to an embodiment of the present application;



FIG. 2 is a schematic diagram of a network environment according to an embodiment of the present application;



FIG. 3 is a schematic diagram of a network environment according to an embodiment of the present application;



FIG. 4 is a schematic diagram of a network environment according to an embodiment of the present application;



FIG. 5 is a schematic diagram of a network environment according to an embodiment of the present application; and



FIG. 6 is a schematic diagram of a routing device according to an embodiment of the present application.





DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer and more comprehensible, the following further describes the present application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely used to explain the present application but are not intended to limit the present application.


A virtual router redundancy protocol (VRRP) group includes one primary router and multiple secondary routers, where each router in the VRRP group sends a link detection packet having an echo response function, and a destination address of the link detection packet sent by each router in the VRRP group is a virtual IP address of the VRRP group. If the primary router and/or the secondary router does/do not receive a response packet within a predetermined time, it is determined that the primary router is faulty.


Because a rapid detection means includes many technologies such as bidirectional forwarding detection (BFD) and Operation, Administration and Maintenance (OAM), only the BFD is used as an example in a solution mentioned in this application. However, the link detection packet in this solution is not limited to a BFD packet, and another rapid detection means that can implement the echo response function may also be applied to this solution.


Embodiment 1

According to this embodiment, a virtual router redundancy protocol (VRRP) fault detection method is provided. As shown in FIG. 1, in a VRRP group including one primary router and one or more secondary routers, the primary router and the secondary router send link detection packets having an echo response function, where a destination address of the link detection packet is a virtual address of the VRRP group. The primary router and the secondary router detect whether response packets corresponding to the link detection packets sent by the primary router and the secondary router are received within a predetermined time, and if the primary router and/or the secondary router does not receive the response packet within the predetermined time, it is determined that the primary router is faulty.


Optionally, the link detection packet is an ECHO-type bidirectional forwarding detection (BFD) packet.


An application scenario of this embodiment is shown in FIG. 2. A virtual router, that is, a VRRP group includes three routers, which are a primary router RT1 and secondary routers RT2 and RT3. An external network is connected to the primary router RT1 in the VRRP group by using a virtual IP address of the VRRP group. In this scenario, if a conventional link detection means, for example, configuring a bidirectional forwarding detection (BFD) packet to implement rapid detection on a link fault, needs to configure a BFD session between every two routers of the three routers, that is, BFD sessions between the RT1 and the RT2, between the RT1 and the RT3, and between the RT2 and the RT3, as shown in FIG. 3. The BFD session between the RT1 and the RT2 and the BFD session between the RT1 and the RT3 are used to detect a fault of a link between a primary router and a secondary router, so as to trigger the secondary router to perform active/standby switching. Moreover, the BFD session between the RT2 and the RT3 is used to ensure that after the active/standby switching, when either of the secondary routers becomes active, a BFD session that can be used to detect a status of a link between the primary router and the secondary router exists between the secondary router and two other routers. In the scenario, for either of the secondary routers, such as the RT2, two BFD sessions are established. When one of the BFD sessions detects a link fault and a BFD packet whose status is DOWN is returned, because the primary router and the secondary router in the VRRP group are dynamically switched between each other, the router RT2 cannot directly determine, according to the received BFD packet whose status is DOWN, whether the primary router is faulty. Therefore, the active/standby switching cannot be performed.


Specifically, according to this embodiment, as shown in FIG. 4, an ECHO-type BFD detection packet is configured for each of three routers, that is, a primary router RT1 and secondary routers RT2 and RT3, where a peer IP address of the ECHO-type BFD detection packet is configured as a virtual IP address of a current VRRP group. Because only the primary router in the VRRP group responds to an ARP request for an IP address of a virtual router and forwards a packet whose destination MAC address is a MAC address of the virtual router, the primary router always responds to the ECHO-type BFD packet and returns a response packet. The primary router and the secondary router both detect whether the response packets of the ECHO-type BFD packets sent by the primary router and the secondary router are received within a predetermined time. If the response packets are not received within the predetermined time, it is determined that the primary router is faulty. In this case, the BFD detection packet configured for the primary router RT1 detects a local link of the RT1 and does not detect a link fault; and the BFD detection packets configured for the secondary routers RT2 and RT3 detect a status of a link between the primary router and a secondary router. In the scenario, each of all the routers only needs to detect one BFD packet, that is, a response packet of the ECHO-type BFD detection packet. Therefore, the foregoing problem that multiple packets are simultaneously detected when an ordinary BFD session is established does not occur, so as to implement rapid fault detection in a one primary multiple secondaries scenario.


After detecting that the primary router is faulty, the secondary routers RT2 and RT3 separately trigger active/standby switching of the VRRP group, and start to perform priority election according to a VRRP protocol, to determine a new primary router.


In this embodiment, after active/standby switching is performed, an example in which RT2 becomes active is used, an application scenario of which is shown in FIG. 5. After the RT2 becomes active, a virtual IP address of a VRRP group points to the RT2. Before the active/standby switching, the RT2 responds to ECHO-type BFD detection packets configured for RT1, the RT2, and RT3 and returns response packets. Because the ECHO-type BFD packet does not need to be configured for a peer end, after the active/standby switching is performed on routers in the entire VRRP group, the secondary routers RT1 and RT3 in the VRRP group, continue to detect, by detecting response packets of the ECHO-type BFD packets sent by the secondary routers RT1 and RT3, a status of a link between the secondary routers RT1 and RT3 and the primary router RT2, so as to determine whether the primary router is faulty. That is, by using the method, continuous fault detection on a link between a primary router and a secondary router in the VRRP group after the active/standby switching may be implemented without any intervention.


Embodiment 2

Corresponding to the foregoing virtual router redundancy protocol fault detection method, this embodiment of the present application further provides a routing device. FIG. 6 is a schematic structural diagram of the routing device, the routing device is applied to a virtual router redundancy protocol (VRRP) group including one primary router and one or more secondary routers, the routing device is one of the primary router or the secondary routers, and the routing device includes a sending module 601, a determining module 602, and a switching module 603.


The sending module 601 is configured to send a link detection packet having an echo response function, where a destination address of the link detection packet is a virtual IP address of the VRRP group in which the sending module 601 is located.


The determining module 602 is configured to: determine whether a response packet corresponding to the link detection packet sent by the sending module 601 is received within a predetermined time, and if the response packet is not received within the predetermined time, determine that the primary router is faulty.


Optionally, the routing device may further include the switching module 603, which is configured to perform active/standby switching when the primary router is faulty.


Optionally, the link detection packet that has the echo response function and that is sent by the sending module 601 is an ECHO-type BFD packet.


As can be seen from the foregoing embodiment, the device is configured in the VRRP group. In a one primary multiple secondaries case, the device sends the ECHO-type BFD packet to the virtual IP address of the VRRP group in which the device is located, and listens to the response packet of the BFD packet, to detect whether the primary router is faulty. When the primary router is faulty, the VRRP group is triggered to perform active/standby switching.


As described above, the routing device may implement rapid detection on a fault in a one primary multiple secondaries VRRP network environment. After it is detected that the primary router is faulty and the active/standby switching is performed, continuous detection on a status of the primary router after the switching may be implemented by the apparatus without the need of performing extra setting on the apparatus.


It should be noted that a person of ordinary skill in the art may understand that all or a part of the processes of the methods in the embodiments may be implemented by a computer program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program runs, the processes of the methods in the embodiments are performed. The foregoing storage medium may include: a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM).


The virtual router redundancy protocol fault detection method and apparatus that are provided in the present application are described in detail above. The principle and the implementation manners of the present application are described herein through specific embodiments. The description about the embodiments is merely used to help understand the method and core ideas of the present application. In addition, a person of ordinary skill in the art can make variations to the present application in terms of the specific implementation manners and application scopes according to the ideas of the present application. In conclusion, the content of this specification shall not be construed as a limitation to the present application.


While this invention has been described with reference to illustrative embodiments, this description is not intended to be construed in a limiting sense. Various modifications and combinations of the illustrative embodiments, as well as other embodiments of the invention, will be apparent to persons skilled in the art upon reference to the description. It is therefore intended that the appended claims encompass any such modifications or embodiments.

Claims
  • 1. A method applied to a first routing device in a virtual router redundancy protocol (VRRP) group, the VRRP group comprising one primary routing device and one or more secondary routing devices, the method comprising: sending, by a first routing device, a link detection packet having an echo response function, wherein a destination address of the link detection packet is a virtual address of the VRRP group; anddetermining, by the first routing device, that the primary routing device is faulty when the first routing device does not receive a response packet in response to the link detection packet within a predetermined time.
  • 2. The method according to claim 1, wherein the link detection packet is one of: an ECHO-type bidirectional forwarding detection (BFD) packet and an Operation Administration and Maintenance (OAM) packet.
  • 3. The method according to claim 1, wherein the first routing device is the primary routing device.
  • 4. The method according to claim 1, wherein the first routing device is one of the one or more secondary routing devices, and the method further comprises: triggering, by the first routing device, active/standby switching of the VRRP group.
  • 5. The method according to claim 4, wherein a new primary routing device is determined by performing a priority election according to a VRRP, and the new primary routing device is one of the one or more secondary routing devices.
  • 6. A first routing device in a virtual router redundancy protocol (VRRP) group, the VRRP group comprising one primary routing device and one or more secondary routing devices, wherein the first routing device is one of the primary routing and the one or more secondary routing devices, and the first routing device comprises a non-transitory storage medium comprising instructions which, when executed by a processor, cause the processor to: sending a link detection packet having an echo response function, wherein a destination address of the link detection packet is a virtual address of the VRRP group; anddetermining that the primary routing device is faulty when a response packet in response to the link detection packet is not received within a predetermined time.
  • 7. The first routing device according to claim 6, wherein the link detection packet is one of: an ECHO-type bidirectional forwarding detection (BFD) packet and an Operation Administration and Maintenance (OAM) packet.
  • 8. The first routing device according to claim 6, wherein the first routing device is the primary routing device.
  • 9. The first routing device according to claim 6, wherein the first routing device is one of the one or more secondary routing devices, and the instructions further cause the processor to trigger active/standby switching of the VRRP group.
  • 10. The first routing device according to claim 9, wherein the instructions further cause the processor to determine a new primary routing device by performing a priority election according to a VRRP, wherein the new primary routing device is one of the one or more secondary routing devices.
  • 11. A virtual router redundancy protocol (VRRP) group, wherein the VRRP group comprises one primary routing device and multiple secondary routing devices, and a first routing device is one of the primary routing and the one or more secondary routing devices, the first routing device is configured to: send a link detection packet having an echo response function, wherein a destination address of the link detection packet is a virtual IP address of the VRRP group; anddetermine that the primary routing device is faulty when the routing device does not receive a response packet in response to the link detection packet within a predetermined time.
  • 12. The VRRP group according to claim ii, wherein the link detection packet is one of: an ECHO-type bidirectional forwarding detection (BFD) packet and an Operation Administration and Maintenance (OAM) packet.
  • 13. The VRRP group according to claim 11, wherein the routing device is one of: the primary routing device and the one or more secondary routing devices.
  • 14. A non-transitory computer-readable storage medium comprising instructions which, when executed by a computer, cause the computer to carry out steps of: sending a link detection packet having an echo response function, wherein a destination address of the link detection packet is a virtual address of a virtual router redundancy protocol (VRRP) group, and the VRRP group comprises one primary routing device and one or more secondary routing devices; anddetermining that the primary routing device is faulty when a response packet in response to the link detection packet is not received within a predetermined time.
  • 15. The non-transitory computer-readable storage medium according to claim 14, wherein the link detection packet is one of: an ECHO-type bidirectional forwarding detection (BFD) packet and an Operation Administration and Maintenance (OAM) packet.
  • 16. The non-transitory computer-readable storage medium according to claim 14, wherein the instructions further cause the computer to trigger active/standby switching of the VRRP group.
  • 17. The non-transitory computer-readable storage medium according to claim 16, wherein the instructions further cause the computer to determine a new primary routing device by performing a priority election according to the VRRP, and the new primary routing device is one of the one or more secondary routing devices.
Priority Claims (1)
Number Date Country Kind
201410395694.3 Aug 2014 CN national
CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No. PCT/CN2015/086150, filed on Aug. 5, 2015, which claims priority to Chinese Patent Application No. 201410395694.3, filed on Aug. 12, 2014. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.

Continuations (1)
Number Date Country
Parent PCT/CN2015/086150 Aug 2015 US
Child 15429812 US