WO2019200728A1 - 虚拟网关主备切换方法、装置及计算机可读存储介质 - Google Patents

虚拟网关主备切换方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2019200728A1
WO2019200728A1 PCT/CN2018/094718 CN2018094718W WO2019200728A1 WO 2019200728 A1 WO2019200728 A1 WO 2019200728A1 CN 2018094718 W CN2018094718 W CN 2018094718W WO 2019200728 A1 WO2019200728 A1 WO 2019200728A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual gateway
virtual
primary path
gateway
path corresponding
Prior art date
Application number
PCT/CN2018/094718
Other languages
English (en)
French (fr)
Inventor
匡光彩
易仁杰
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019200728A1 publication Critical patent/WO2019200728A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Definitions

  • the present application relates to the field of network technologies, and in particular, to a virtual gateway active/standby switching method and apparatus, and a computer readable storage medium.
  • NAT Network Address Translation
  • IP address is a private network address.
  • the virtual gateway is used to perform NAT processing on packets sent by the virtual machine.
  • the virtual gateway processes a large number of packets at the same time, and the virtual gateway performance requirements are very high.
  • the virtual gateway may become a communication bottle and is prone to single failure.
  • High The availability, HA high The availability, HA technology ensures that the virtual gateway successfully forwards the packets sent by the virtual machine.
  • HA refers to improving the downtime caused by daily maintenance operations (plans) and sudden system crashes (unplanned).
  • the primary virtual gateway and the backup virtual gateway device are usually configured to perform NAT processing at the same time.
  • the primary virtual gateway usually provides external services. When the primary virtual gateway is abnormal, it automatically switches to the backup virtual gateway instead of the primary virtual network.
  • the gateway completes the packet forwarding operation sent by the virtual machine.
  • an address resolution protocol is usually used. Resolution Protocol, ARP, or active/standby routing mode, for active/standby switchover of virtual gateways.
  • ARP Active/standby routing mode
  • the present invention provides a virtual gateway active/standby switching method and device, and a computer readable storage medium, which is mainly capable of realizing that the primary and backup virtual gateways are in a working state at the same time, thereby preventing the virtual gateway from being idle, thereby saving network bandwidth resources. And server resources.
  • a method for switching between active and standby virtual gateways including:
  • the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or the primary path corresponding to the second virtual gateway If the fault occurs, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway;
  • a virtual gateway active/standby switching device including:
  • a determining unit configured to determine, by the SDN controller, whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state
  • a switching unit configured to: if the primary path corresponding to the first virtual gateway fails, switch the backup path corresponding to the first virtual gateway to the primary path of the second virtual gateway, or if the second virtual If the primary path corresponding to the gateway fails, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway;
  • the forwarding unit is configured to forward the packet sent by the virtual machine by using the switched backup path.
  • a computer readable storage medium having stored thereon computer readable instructions that, when executed by a processor, implement the following steps:
  • the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or the primary path corresponding to the second virtual gateway If the fault occurs, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway;
  • a virtual gateway active/standby switching apparatus comprising: a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor executing the computer The following steps are implemented when the instructions are readable:
  • the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or the primary path corresponding to the second virtual gateway If the fault occurs, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway;
  • the present invention provides a virtual gateway active/standby switching method, device and computer readable storage medium, and currently utilizes an address resolution protocol (Address Resolution In the protocol, the ARP or the active/standby routing mode, the active/standby switchover of the virtual gateway is performed.
  • an address resolution protocol Address Resolution In the protocol, the ARP or the active/standby routing mode
  • the SDN controller can determine whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are respectively And in a normal state; and when the primary path corresponding to the first virtual gateway fails, the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or can be in the second When the primary path corresponding to the virtual gateway fails, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway; thus, mutual backup of the first virtual gateway and the second virtual gateway can be implemented.
  • the primary and backup virtual gateways can be in a working state at the same time, avoiding the virtual gateway from being idle, and providing a virtual gateway function of the virtual gateway, thereby saving Bandwidth resources and server resources of the network.
  • FIG. 1 is a flowchart of a method for switching between active and standby virtual gateways according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a network structure provided by an embodiment of the present application.
  • FIG. 3 is a flowchart of another method for switching between active and standby virtual gateways according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a virtual gateway active/standby switching apparatus according to an embodiment of the present disclosure
  • FIG. 5 is a schematic structural diagram of another virtual gateway active/standby switching apparatus according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic diagram showing the physical structure of a virtual gateway active/standby switching device according to an embodiment of the present application.
  • the active/standby switchover of the virtual gateway is usually performed by using the ARP protocol or the active/standby route mode.
  • the active/standby switchover is performed in the above two modes, when the primary virtual gateway works, the backup virtual gateway is usually idle, causing the network bandwidth resources and server resources to be extremely wasted.
  • the embodiment of the present application provides a method for switching between active and standby virtual gateways. As shown in FIG. 1 , the method includes:
  • the SDN controller determines whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state.
  • SDN Software Defined
  • Networking is a new type of network architecture that separates the control function from the data forwarding function.
  • the controller in SDN is dedicated to the collection of network information, and in turn, the policy for the switch is issued.
  • SDN's centralized controllers monitor the performance of the network and have the advantage of reprogramming to different needs when necessary.
  • the controller can accurately monitor the running status of the entire network and observe the characteristics of each data stream, such as throughput, delay, and packet loss rate.
  • the embodiment of the present application provides a schematic diagram of a network structure. As shown in FIG.
  • each virtual network outlet includes a first gateway and a second gateway, and the gateway may be a physical switch and a router. Or a virtual switch, a virtual router, etc., the first virtual gateway and the second virtual gateway are connected to the SDN controller, and the physical server is connected to the external IP network through a forwarding network (Underlay network) of the network infrastructure.
  • a forwarding network Underlay network
  • the active and active virtual gateway switching device of the embodiment of the present application may be an SDN controller.
  • the SDN controller may determine whether the primary path corresponding to the first virtual gateway and the second virtual gateway are in a normal state by periodically sending the data packets sent to the primary path corresponding to the first virtual gateway and the second virtual gateway respectively. Specifically, if the response information of the first virtual gateway or the second virtual gateway about the data packet is not received, the main path of the first virtual gateway or the second virtual gateway is determined to be faulty, for example, if If the response information of the primary path fed back by the first virtual gateway is not received in the two timing cycles, it is determined that the primary path of the first virtual gateway is faulty. Similarly, if the response information fed back through the primary path of the second virtual gateway is not received in the two timing cycles, it is determined that the primary path of the second virtual gateway is faulty.
  • the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or if the second virtual gateway corresponds to If the primary path fails, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway.
  • the primary path of the first virtual gateway and the backup path of the second virtual gateway are the same, and the primary path of the second virtual gateway and the backup path of the first virtual gateway are the same.
  • the external virtual IP address of the first virtual gateway is 192.168.1.219, and the corresponding physical address is: 00:21:5A:DB:7F:C2;
  • the primary path of the first virtual gateway is the real IP address (192.168.1.217) of the external service, and the corresponding physical address is: 00:21:5A:DB:7F:C2;
  • the backup path of the first virtual gateway is: IP address (192.168.1.218), and the corresponding physical address is: 00:21:5A:DB:68:E8;
  • the external virtual IP address of the second virtual gateway is 192.168.1.220, and the corresponding physical address is: 00:21:5A:DB:68:E8;
  • the primary path of the second virtual gateway is the real IP address (192.168.1.218) of the external service, and the corresponding physical address is: 00:21:5A:DB:68:E8; and the backup path of the first virtual gateway is the same;
  • the backup path of the second virtual gateway is: IP address (192.168.1.217), and the corresponding physical address is: 00:21:5A:DB:7F:C2, and is the same as the primary path of the second virtual gateway.
  • the first virtual gateway and the second virtual gateway can be backed up to each other without being the first virtual virtual network.
  • the gateway and the second virtual gateway respectively set up separate backup virtual gateways, and at the same time, the primary and backup virtual gateways are in a working state at the same time, and the virtual gateway is in an idle state, providing a virtual gateway function of the virtual gateway, thereby saving network bandwidth resources. And server resources.
  • the first virtual gateway forwards the virtual machine through the IP address (192.168.1.218).
  • the packet is forwarded by the gateway with the physical address of 00:21:5A:DB:68:E8.
  • the second virtual gateway forwards the packet sent by the virtual machine through the IP address (192.168.1.217), that is, the physical address is 00:21. :5A:DB:7F:
  • the gateway of C2 forwards the packet sent by the virtual machine.
  • the active/standby switchover method of the virtual gateway provided by the embodiment of the present application can be judged to be in the same virtual network by using the SDN controller, compared with the active/standby switchover of the virtual gateway by using the ARP protocol or the active/standby route mode.
  • the primary path corresponding to the first virtual gateway and the second virtual gateway are in a normal state; and when the primary path corresponding to the first virtual gateway fails, the backup path corresponding to the first virtual gateway is switched to The primary path of the second virtual gateway, or the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway when the primary path corresponding to the second virtual gateway fails; Thereby, mutual backup of the first virtual gateway and the second virtual gateway can be achieved.
  • the primary and backup virtual gateways can be in a working state at the same time, avoiding the virtual gateway from being idle, and providing a virtual gateway function of the virtual gateway, thereby saving Bandwidth resources and server resources of the network.
  • the embodiment of the present application provides another active/standby switchover method for the virtual gateway, as shown in FIG.
  • the method includes:
  • the SDN controller may send a mainstream table and a backup flow table to the first virtual gateway and the second virtual gateway, where the mainstream table may be used to configure a primary path of the first virtual gateway or the second virtual gateway.
  • the backup flow table may be configured to configure a backup path of the first virtual gateway or the second virtual gateway, that is, a path configuration of the first virtual gateway and the second gateway may be implemented by sending a mainstream table and a backup flow table, where
  • the mainstream table has a priority greater than the backup flow table, and the mainstream table and the backup flow table may belong to a static flow table.
  • the static flow table there are fields such as a priority, a cache, and a timeout.
  • the Priority field itself can provide a certain routing decision basis, and different paths can be determined by different priorities.
  • the switch receives the new flow table and stores it. When the link occurs, the switch finds that the current high-priority flow table cannot be sent. First, it tries to forward according to the low-priority flow table, and continuously checks the high-priority path status. Variety. If the forwarding paths of the current two flow tables are invalid, the packet input will be sent to the SDN controller (Packet). In) information to obtain a new forwarding path to meet the fluency of data transmission.
  • the SDN controller can implement active flow table insertion through the OpenFlow protocol, which inserts the corresponding flow table before the data packet arrives at the switch. Usually when the switch sends a packet to the SDN controller, usually through Packet In information transmission; when the SDN controller sends a packet to the switch, it is usually sent through the Packet out message.
  • the method may further include: if the first virtual gateway and the second If the primary paths of the virtual gateways are in the normal state, and the corresponding backup paths are in the normal state, the forwarding traffic corresponding to the first virtual gateway and the second virtual gateway is respectively counted; when new packets are received When the virtual gateway with less forwarding traffic is selected, the new packet is forwarded.
  • new connection requests, sessions, or data flows can be forwarded by forwarding virtual gateways with less traffic.
  • the SDN controller forwards the new connection through the first virtual gateway when receiving the new connection request, session, data flow, or packet.
  • Request, session, data flow, or message if the forwarding traffic of the second virtual gateway is less than the forwarding traffic of the first virtual gateway, the SDN controller passes the new connection request, session, data flow, or packet.
  • the second virtual gateway forwards a new connection request, session, data stream, or message.
  • the primary path corresponding to the first virtual gateway is faulty, switch the backup path corresponding to the first virtual gateway to the primary path of the second virtual gateway, or if the second virtual gateway corresponds to the second virtual gateway. If the primary path fails, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway.
  • step 203 The example and process of implementing mutual backup of the first virtual gateway and the second virtual gateway in step 203 are described in detail in step 102, and details are not described herein.
  • the method further includes: if the primary path corresponding to the first virtual gateway fails, identifying a fault type of the primary path corresponding to the first virtual gateway; or If the primary path corresponding to the second virtual gateway fails, the fault type of the primary path corresponding to the second virtual gateway is identified.
  • the SDN controller may periodically send the data packet to the primary path corresponding to the first virtual gateway, and if the response information corresponding to the data packet is not received within the preset timing period, the IMS controller may continue to detect each of the first virtual network.
  • the fault type of the primary path corresponding to the first virtual gateway is determined to be Determining that the first virtual gateway has a network fault in the first virtual gateway; if the network node other than the first virtual gateway does not receive the response information, determining that the fault type of the primary path corresponding to the first virtual gateway is For the network faults other than the first virtual gateway, the fault type of the primary path corresponding to the second virtual gateway may be identified in the foregoing manner, and details are not described herein.
  • the step 204 may be specifically: if the fault type of the primary path corresponding to the first virtual gateway is the network fault of the first virtual gateway, then the second virtual The gateway sends a gratuitous ARP packet to change the gateway, so that the second virtual gateway sends the gratuitous ARP packet to the virtual machine, so that the virtual machine modifies the packet forwarded by the virtual device according to the gratuitous ARP packet.
  • the second virtual gateway is configured to forward the packet sent by the virtual machine by using the backup flow table corresponding to the second virtual gateway if the fault type is a network fault other than the first virtual gateway.
  • the step 204 may be: if the fault type of the primary path corresponding to the second virtual gateway is the network fault of the second virtual gateway, sending a change gateway to the first virtual gateway for free An ARP packet, so that the first virtual gateway sends the gratuitous ARP packet to the virtual machine, so that the virtual machine modifies the packet forwarded by the virtual device according to the gratuitous ARP packet to the first virtual gateway; If the fault type is a network fault other than the second virtual gateway, the packet sent by the virtual machine is forwarded by using the backup flow table corresponding to the first virtual gateway.
  • the SDN controller may encapsulate the gratuitous ARP packet sent to the first virtual gateway or the second virtual gateway by using a packet-out message in the Openflow.
  • the SDN controller detects that the primary path of the first virtual gateway is faulty, and is a network fault in the first virtual gateway. The gateway cannot send any information. Therefore, the SDN controller can send the free ARP packet of the change gateway to the second virtual gateway in the packet-out message, and the second virtual gateway sends the free ARP to the virtual machine, so that the second virtual gateway sends the free ARP to the virtual machine.
  • the virtual machine modifies the next hop, and the second virtual gateway forwards the packet 1 and sends the packet 1 to the second virtual gateway for forwarding to the corresponding switch.
  • the packet sent by the virtual machine is forwarded by using the backup flow table corresponding to the second virtual gateway. It is possible to determine the backup path in advance and configure it in the relevant switch in advance. When the fault occurs, it is only necessary to switch the packet or data flow to the backup path without the participation of the SDN controller.
  • Step 205 which is in parallel with step 203, if the primary path corresponding to the first virtual gateway or the primary path corresponding to the second virtual gateway is in a normal state, the packet sent by the virtual machine is forwarded through the primary path in the normal state.
  • the step 205 may be specifically: if the primary path corresponding to the first virtual gateway is in a normal state, the primary path corresponding to the primary path corresponding to the first virtual gateway may be used.
  • the packet sent by the virtual machine is forwarded to the corresponding switch, or if the primary path corresponding to the second virtual gateway is in a normal state, the primary path corresponding to the primary path corresponding to the second virtual gateway may be used.
  • the packets sent by the VM are forwarded to the corresponding switch.
  • the active/standby switchover method of the virtual gateway provided by the embodiment of the present application can be judged to be in the same virtual state by the SDN controller, compared with the active/standby switchover of the virtual gateway by using the ARP protocol or the active/standby route mode. Whether the primary path corresponding to the first virtual gateway and the second virtual gateway of the network are in a normal state; and when the primary path corresponding to the first virtual gateway fails, the backup path corresponding to the first virtual gateway is switched. When the primary path of the second virtual gateway is faulty, or the primary path corresponding to the second virtual gateway is faulty, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway. Thereby, mutual backup of the first virtual gateway and the second virtual gateway can be realized.
  • the primary and backup virtual gateways can be in a working state at the same time, avoiding the virtual gateway from being idle, and providing a virtual gateway function of the virtual gateway, thereby saving Bandwidth resources and server resources of the network.
  • the embodiment of the present application provides another virtual gateway active/standby switching device.
  • the device includes: a determining unit 31, a switching unit 32, and a forwarding unit 33.
  • the determining unit 31 may be configured to determine, by the SDN controller, whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state.
  • the determining unit 31 is a main functional module in the device that determines whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state by the SDN controller.
  • the switching unit 32 may be configured to: if the primary path corresponding to the first virtual gateway fails, switch the backup path corresponding to the first virtual gateway to the primary path of the second virtual gateway, or If the primary path corresponding to the second virtual gateway fails, the backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway; the switching unit is the first virtual device in the device. If the primary path corresponding to the gateway fails, the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or if the primary path corresponding to the second virtual gateway fails, The backup function path corresponding to the second virtual gateway is switched to the main function module of the primary path of the first virtual gateway, and is also a core module.
  • the forwarding unit 33 can be configured to forward the packet sent by the virtual machine by using the switched backup path.
  • the forwarding unit is a main functional module of the device that forwards the packet sent by the virtual machine through the switched backup path in the device.
  • the device further includes: a configuration unit 34, as shown in FIG. 5.
  • the configuration unit 34 may be configured to configure the same path for the primary path of the first virtual gateway and the backup path of the second virtual gateway, and be the primary path of the second virtual gateway and the first The backup path of the virtual gateway is configured with the same path.
  • the configuration unit 34 is configured to configure the same path for the primary path of the first virtual gateway and the backup path of the second virtual gateway, and is the primary path of the second virtual gateway and the first The backup path of the virtual gateway configures the main functional modules of the same path.
  • the forwarding unit 33 may be further configured to: if the primary path corresponding to the first virtual gateway or the primary path corresponding to the second virtual gateway is in a normal state, forward the virtual machine by using the primary path in a normal state. Message.
  • the apparatus in order to reselect the backup path of the first virtual gateway and the second virtual gateway, the apparatus further includes: an identifying unit 35.
  • the identifying unit 35 may be configured to identify a fault type of the primary path corresponding to the first virtual gateway if the primary path corresponding to the first virtual gateway fails, or if the primary virtual gateway corresponds to the primary If the path fails, the fault type of the primary path corresponding to the second virtual gateway is identified.
  • the identification unit 35 is configured to identify a fault type of the primary path corresponding to the first virtual gateway if the primary path corresponding to the first virtual gateway fails, or if the primary virtual gateway corresponds to the primary If the path fails, the fault type of the primary path corresponding to the second virtual gateway is identified.
  • the forwarding unit 33 corresponding to the identifying unit 35 may be specifically configured to: if the fault type of the primary path corresponding to the first virtual gateway is the network in the first virtual gateway The fault is sent to the second virtual gateway to change the gratuitous ARP packet of the gateway, so that the second virtual gateway sends the gratuitous ARP packet to the virtual machine, so that the virtual machine is configured according to the gratuitous ARP packet. Modifying the gateway forwarded by the packet to the second virtual gateway;
  • the fault type is a network fault other than the first virtual gateway, forwarding, by using the backup flow table corresponding to the second virtual gateway, the packet sent by the virtual machine; or
  • the packet sent by the virtual machine is forwarded by using the backup flow table corresponding to the first virtual gateway.
  • the device in order to alleviate the NAT translation load pressure, implement load balancing, and improve the speed and reliability of NAT conversion, the device further includes: a statistics unit 36.
  • the statistic unit 36 may be configured to: if the primary path corresponding to the first virtual gateway and the second virtual gateway are in a normal state, and the corresponding backup paths are in a normal state, the first The virtual gateway and the second virtual gateway respectively correspond to forwarding traffic.
  • the statistic unit 36 is configured to: if the primary path corresponding to the first virtual gateway and the second virtual gateway are in a normal state, and the corresponding backup paths are in a normal state, the first The virtual gateway and the second virtual gateway respectively correspond to forwarding traffic.
  • the forwarding unit 33 may be further configured to: when receiving a new packet, select a virtual gateway that forwards less traffic to forward the new packet.
  • the forwarding unit 33 also selects, when receiving a new packet, the virtual gateway that has less forwarding traffic to forward the new packet.
  • the embodiment of the present application further provides a computer readable storage medium, which may be a non-volatile readable storage medium; a read command, when the readable instruction is executed by the processor, the following steps are performed: determining, by the SDN controller, whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state; If the primary path corresponding to the virtual gateway fails, the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or if the primary path corresponding to the second virtual gateway fails, The backup path corresponding to the second virtual gateway is switched to the primary path of the first virtual gateway, and the packet sent by the virtual machine is forwarded through the switched backup path.
  • a computer readable storage medium which may be a non-volatile readable storage medium
  • a read command when the readable instruction is executed by the processor, the following steps are performed: determining, by the SDN controller, whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network
  • the embodiment of the present application further provides a physical structure diagram of a virtual gateway active/standby switching device.
  • the device includes: The processor 41, the memory 42, and computer readable instructions stored on the memory 42 and operable on the processor, wherein the memory 42 and the processor 41 are both disposed on the bus 43.
  • the processor 41 executes the computer readable instructions And determining, by the SDN controller, whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state; if the primary path corresponding to the first virtual gateway fails, The backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or if the primary path corresponding to the second virtual gateway fails, the backup path corresponding to the second virtual gateway is switched. The primary path of the first virtual gateway is forwarded, and the packet sent by the virtual machine is forwarded through the switched backup path.
  • the SDN controller can determine whether the primary path corresponding to the first virtual gateway and the second virtual gateway in the same virtual network are in a normal state, and can be in the primary path corresponding to the first virtual gateway.
  • the backup path corresponding to the first virtual gateway is switched to the primary path of the second virtual gateway, or the second virtual virtual network can be faulty when the primary path corresponding to the second virtual gateway fails.
  • the backup path corresponding to the gateway is switched to the primary path of the first virtual gateway; thereby enabling mutual backup of the first virtual gateway and the second virtual gateway.
  • the primary and backup virtual gateways can be in a working state at the same time, avoiding the virtual gateway from being idle, and providing a virtual gateway function of the virtual gateway, thereby saving Bandwidth resources and server resources of the network.
  • modules or steps of the present application can be implemented by a general computing device, which can be concentrated on a single computing device or distributed in a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the application is not limited to any particular combination of hardware and software.

Abstract

本申请公开了一种虚拟网关主备切换方法、装置及计算机可读存储介质,涉及网络技术领域。所述方法包括:通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;通过切换后的备份路径,转发虚拟机发送的报文。

Description

虚拟网关主备切换方法、装置及计算机可读存储介质
本申请要求于2018年4月20日提交中国专利局、申请号为201810370086.5、发明名称为“基于SDN控制器的虚拟网关主备切换方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及网络技术领域,尤其是涉及一种虚拟网关主备切换方法、装置及计算机可读存储介质。
背景技术
随着网络技术的不断发展,网络地址转换技术(Network Address Translation,NAT)随之出现。由于虚拟机发出的报文通常为网络报文,网络报文的源互联网协议(Internet Protocol,IP)地址为私网地址,通常需要通过虚拟网关对虚拟机发出的报文进行NAT处理。在实际应用中,虚拟网关在同一时间内处理的报文数量很多,对虚拟网关性能要求非常高,虚拟网关可能成为通讯瓶劲,容易出现单点故障。通过高可用性(High Availability,HA)技术,能够保证虚拟网关成功转发虚拟机发出的报文,HA是指通过尽量缩短因日常维护操作(计划)和突发的系统崩溃(非计划)所导致的停机时间,以提高系统和应用的可用性,即通常设置主虚拟网关和备份虚拟网关设备同时完成NAT处理,主虚拟网关通常对外提供服务,在主虚拟网关发生异常的时候,自动切换到备份虚拟网关,以代替主虚拟网关完成虚拟机发出的报文转发的操作。目前,在对虚拟网关的主备切换时,通常利用地址解析协议(Address Resolution Protocol,ARP)协议或者主备路由模式,进行虚拟网关的主备切换。然而,通过上述两种方式进行主备切换时,在主虚拟网关工作时,备份虚拟网关通常处于闲置状态,造成网络的带宽资源和服务器资源极大浪费。
发明内容
本申请提供了一种基于虚拟网关主备切换方法、装置及计算机可读存储介质,主要在于能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,从而能够节省网络的带宽资源和服务器资源。
根据本申请的第一个方面,提供一种虚拟网关主备切换方法,包括:
通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
通过切换后的备份路径,转发虚拟机发送的报文。
根据本申请的第二个方面,提供一种虚拟网关主备切换装置,包括:
判断单元,用于通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
切换单元,用于若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
转发单元,用于通过切换后的备份路径,转发虚拟机发送的报文。
根据本申请的第三个方面,提供一种计算机可读存储介质,其上存储有计算机可读指令,该可读指令被处理器执行时实现以下步骤:
通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
通过切换后的备份路径,转发虚拟机发送的报文。
根据本申请的第四个方面,提供一种虚拟网关主备切换装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
通过切换后的备份路径,转发虚拟机发送的报文。
本申请提供的一种虚拟网关主备切换方法、装置及计算机可读存储介质,与目前利用地址解析协议(Address Resolution Protocol,ARP)协议或者主备路由模式,进行虚拟网关的主备切换相比,本申请能够通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;并能够在所述第一虚拟网关对应的主路径发生故障时,将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者能够在所述第二虚拟网关对应的主路径发生故障时,将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;从而能够实现第一虚拟网关和第二虚拟网关的互相备份。与此同时,通过切换后的备份路径,转发虚拟机发送的报文,能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,提供多活的虚拟网关NAT机制,从而能够节省网络的带宽资源和服务器资源。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种虚拟网关主备切换方法流程图;
图2示出了本申请实施例提供的一种网络结构示意图;
图3示出了本申请实施例提供的另一种虚拟网关主备切换方法流程图;
图4示出了本申请实施例提供的一种虚拟网关主备切换装置的结构示意图;
图5示出了本申请实施例提供的另一种虚拟网关主备切换装置的结构示意图;
图6示出了本申请实施例提供的一种虚拟网关主备切换装置的实体结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
如背景技术,目前,在对虚拟网关的主备切换时,通常利用ARP协议或者主备路由模式,进行虚拟网关的主备切换。然而,通过上述两种方式进行主备切换时,在主虚拟网关工作时,备份虚拟网关通常处于闲置状态,造成网络的带宽资源和服务器资源极大浪费。
为了解决上述问题,本申请实施例提供一种虚拟网关主备切换方法,如图1所示,所述方法包括:
101、通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态。
其中,所述SDN(Software Defined Networking,软件定义网络)是一种将控制功能与数据转发功能分离的新型网络架构,SDN中的控制器专门用于网络信息的收集,依次为交换机的请求下发策略。与传统网络架构不同,SDN的集中式控制器可以监控网络的性能,且具有在必要时根据不同的需求重新编程的优势。控制器可以精确的监控整个网络的运行状况,观察每条数据流的特性,如吞吐量、时延、丢包率等。本申请实施例提供一种网络结构示意图,如图2所示,物理服务器中设有多个虚拟网络,每个虚拟网络出口都包括第一网关和第二网关,网关可以为实体的交换机、路由器或虚拟交换机、虚拟路由器等,第一虚拟网关和第二虚拟网关与SDN控制器连接,物理服务器通过网络基础架构的转发网络(Underlay网络)与外部IP网络连接。
需要说明的是,本申请实施例的执行主体虚拟网关主备切换装置可以为SDN控制器。所述SDN控制器可以通过定时向第一虚拟网关和第二虚拟网关分别对应的主路径发送的数据包,来确定第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态。具体地,若几个定时周期内,未接收第一虚拟网关或者第二虚拟网关关于所述数据包的响应信息,则确定第一虚拟网关或者第二虚拟网关的主路径发生故障,例如,若2个定时周期未接收到通过第一虚拟网关的主路径反馈的响应信息,则确定所述第一虚拟网关的主路径发生故障。同理,若2个定时周期未接收到通过第二虚拟网关的主路径反馈的响应信息,则确定所述第二虚拟网关的主路径发生故障。
102、若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径。
其中,所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径相同,且所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径相同。
例如,第一虚拟网关对外的虚IP地址为:192.168.1.219,且对应的物理地址为:00:21:5A:DB:7F:C2;
第一虚拟网关的主路径为对外提供服务的真实IP地址(192.168.1.217),且对应的物理地址为:00:21:5A:DB:7F:C2;
第一虚拟网关的备份路径为:IP地址(192.168.1.218),且对应的物理地址为:00:21:5A:DB:68:E8;
第二虚拟网关对外的虚IP地址为:192.168.1.220,且对应的物理地址为:00:21:5A:DB:68:E8;
第二虚拟网关的主路径为对外提供服务的真实IP地址(192.168.1.218),对应的物理地址为:00:21:5A:DB:68:E8;且与第一虚拟网关的备份路径相同;
第二虚拟网关的备份路径为:IP地址(192.168.1.217),且对应的物理地址为:00:21:5A:DB:7F:C2,且与第二虚拟网关的主路径相同。
当第一虚拟网关所对应的主路径192.168.1.217发生故障时,会自动向虚拟网络发送一个ARP数据包,告诉虚拟机192.168.1.219这个IP地址对应的物理地址为:00:21:5A:DB:68:E8,这样虚拟机就会将报文发送到192.168.1.218这个IP地址。同理,当第二虚拟网关所对应的主路径192.168.1.217发生故障时,会自动向虚拟网络发送一个ARP数据包,告诉虚拟机192.168.1.220这个IP地址对应的物理地址为:00:21:5A:DB:7F:C2,这样虚拟机就会将报文发送192.168.1.217这个IP地址,因此,能够实现第一虚拟网关与第二虚拟网关互相备份,无需在同一虚拟网络中为第一虚拟网关和第二虚拟网关分别设置单独的备份虚拟网关,同时能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,提供多活的虚拟网关NAT机制,从而能够节省网络的带宽资源和服务器资源。
103、通过切换后的备份路径,转发虚拟机发送的报文。
对于本申请实施例,基于步骤102所涉及的例子,在所述第一虚拟网关的主路径(192.168.1.217)发生故障后,第一虚拟网关会通过IP地址(192.168.1.218)转发虚拟机发送的报文,即实现通过物理地址为:00:21:5A:DB:68:E8的网关转发虚拟机发送的报文。在所述第二虚拟网关的主路径(192.168.1.218)发生故障后,第二虚拟网关会通过IP地址(192.168.1.217)转发虚拟机发送的报文,即实现通过物理地址为:00:21:5A:DB:7F:C2的网关转发虚拟机发送的报文。
本申请实施例提供的一种虚拟网关主备切换方法,与目前利用ARP协议或者主备路由模式,进行虚拟网关的主备切换相比,本申请实施例能够通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;并能够在所述第一虚拟网关对应的主路径发生故障时,将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者能够在所述第二虚拟网关对应的主路径发生故障时,将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;从而能够实现第一虚拟网关和第二虚拟网关的互相备份。与此同时,通过切换后的备份路径,转发虚拟机发送的报文,能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,提供多活的虚拟网关NAT机制,从而能够节省网络的带宽资源和服务器资源。
进一步的,为了更好的说明上述虚拟网关主备切换的过程,作为对上述实施例的细化和扩展,本申请实施例提供了另一种虚拟网关主备切换方法,如图3所示,所述方法包括:
201、为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。
对于本申请实施例,SDN控制器可以向第一虚拟网关和第二虚拟网关发送主流表和备份流表,所述主流表可以用于配置所述第一虚拟网关或第二虚拟网关的主路径,所述备份流表可以用于配置所述第一虚拟网关或第二虚拟网关的备份路径,即可以通过发送主流表和备份流表实现第一虚拟网关和第二网关的路径配置,所述主流表的优先级大于备份流表,所述主流表和所述备份流表可以属于静态流表,在静态流表中,有着优先级(Priority)、缓存(Cookie)、超时(TimeOut)等字段,Priority字段本身就能提供一定的路由决策依据,可以通过Priority的不同来决定不同的路径。交换机接收到新的流表将会存储,当链路发生状况,交换机发现按现在高优先级流表无法发送,则首先尝试按照低优先级的流表进行转发,并不断查看高优先级路径状态变化。如果当前两张流表的转发路径均失效,那么将向SDN控制器发送数据包输入(Packet in)信息,以获取新的转发路径,来满足数据传输的流畅性。SDN控制器可以通过开放流(OpenFlow)协议实现主动式流表插入,主动式插入是在数据包到达交换机之前就插入相应的流表。通常当交换机向SDN控制器发送数据包时,通常通过Packet in信息发送;当SDN控制器向交换机发送数据包时,通常通过Packet out信息发送。
202、通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态。
对于本申请实施例,为了减轻NAT转换负载压力,实现负载均衡,提升NAT转化的速度和可靠行,在步骤202之前,所述方法还可以包括:若所述第一虚拟网关和所述第二虚拟网关分别对应的主路径均处于正常状态,且分别对应的备份路径均处于正常状态,则统计所述第一虚拟网关和所述第二虚拟网关分别对应的转发流量;当接收到新报文时,选择转发流量较少的虚拟网关转发所述新报文。此外,可以通过转发流量较少的虚拟网关转发新的连接请求、会话或数据流。例如,若第一虚拟网关的转发流量少于第二虚拟网关的转发流量,则SDN控制器在接收到新的连接请求、会话、数据流或者报文时,通过第一虚拟网关转发新的连接请求、会话、数据流或者报文;若第二虚拟网关的转发流量少于第一虚拟网关的转发流量,则SDN控制器在接收到新的连接请求、会话、数据流或者报文时,通过第二虚拟网关转发新的连接请求、会话、数据流或者报文。
203、若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径。
其中,关于步骤203中第一虚拟网关和第二虚拟网关实现互相备份的例子和过程在步骤102已进行了详细的描述,在此不进行赘述。
204、通过切换后的备份路径,转发虚拟机发送的报文。
对于本申请实施例,在步骤204之前,所述方法还包括:若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。具体地,SDN控制器可以定时向第一虚拟网关对应的主路径发送数据包,若在预设的定时周期内未接收到数据包所对应的响应信息,则可以继续检测第一虚拟网络的各个节点接收所述响应信息的情况,若在所述第一虚拟网关以其内的网络节点,就未接收到所述响应信息,则确定所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以其内的网络故障;若在所述第一虚拟网关以外的网络节点,未接收到所述响应信息,则确定所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以外的网络故障,同理地,也可以通过上述方式识别所述第二虚拟网关对应的主路径的故障类型,在此不进行赘述。
在具体的应用场景中,所述步骤204具体可以为:若所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以其内的网络故障,则向所述第二虚拟网关发送更改网关的免费ARP报文,以便所述第二虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第二虚拟网关;若所述故障类型为所述第一虚拟网关之外的网络故障,则通过所述第二虚拟网关所对应的备份流表,转发虚拟机发送的报文。
或者所述步骤204具体可以为:若所述第二虚拟网关对应的主路径的故障类型为所述第二虚拟网关以其内的网络故障,则向所述第一虚拟网关发送更改网关的免费ARP报文,以便所述第一虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第一虚拟网关;若所述故障类型为所述第二虚拟网关之外的网络故障,则通过所述第一虚拟网关所对应的备份流表,转发虚拟机发送的报文。
对于本申请实施例,所述SDN控制器可以通过在Openflow的数据包输出(packet-out)消息里封装发送给所述第一虚拟网关或者所述第二虚拟网关的免费ARP报文。
例如,虚拟机发出报文1后,指定由第一虚拟网关转发报文1,SDN控制器在检测第一虚拟网关的主路径发生故障,且为第一虚拟网关内的网络故障,第一虚拟网关无法实现发送任何信息,因此,SDN控制器可以在packet-out消息中写入更改网关的免费ARP报文发送给第二虚拟网关,第二虚拟网关将所述免费ARP发送给虚拟机,使得虚拟机修改下一跳,指定第二虚拟网关转发报文1,并将报文1发送给第二虚拟网关转发给对应的交换机。
此外,在第一虚拟网关发生故障,且所述故障类型为所述第一虚拟网关以外的网络故障时,通过所述第二虚拟网关所对应的备份流表,转发虚拟机发送的报文,能够实现提前确定备份路径并提前在相关交换机中进行配置,在故障发生时只需将报文或者数据流切换到备份路径,无需SDN控制器的参与。
与步骤203并列的步骤205、若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
对于本申请实施例,所述步骤205具体可以为:若所述第一虚拟网关对应的主路径处于正常状态,则可以通过处于所述第一虚拟网关对应的主路径对应的主路径将所述虚拟机发送的报文转发给对应的交换机中,或者若所述第二虚拟网关对应的主路径处于正常状态,则可以通过处于所述第二虚拟网关对应的主路径对应的主路径将所述虚拟机发送的报文转发给对应的交换机中。
本申请实施例提供的另一种虚拟网关主备切换方法,与目前利用ARP协议或者主备路由模式,进行虚拟网关的主备切换相比,本申请实施例能够通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;并能够在所述第一虚拟网关对应的主路径发生故障时,将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者能够在所述第二虚拟网关对应的主路径发生故障时,将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;从而能够实现第一虚拟网关和第二虚拟网关的互相备份。与此同时,通过切换后的备份路径,转发虚拟机发送的报文,能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,提供多活的虚拟网关NAT机制,从而能够节省网络的带宽资源和服务器资源。
进一步地,作为图1的具体实现,本申请实施例提供了另一种虚拟网关主备切换装置,如图4所示,所述装置包括:判断单元31、切换单元32和转发单元33。
所述判断单元31,可以用于通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态。所述判断单元31是本装置中通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态的主要功能模块。
所述切换单元32,可以用于若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;所述切换单元是本装置中若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径的主要功能模块,也是核心模块。
所述转发单元33,可以用于通过切换后的备份路径,转发虚拟机发送的报文。所述转发单元是本装置中通过切换后的备份路径,转发虚拟机发送的报文的主要功能模块。
对于本申请实施例,所述装置还包括:配置单元34,如图5所示。
所述配置单元34,可以用于为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。所述配置单元34是本装置中为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径的主要功能模块。
所述转发单元33,还可以用于若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
对于本申请实施例,为了重新选择所述第一虚拟网关和所述第二虚拟网关的备份路径,所述装置还包括:识别单元35。
所述识别单元35,可以用于若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。所述识别单元35是本装置中若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。
需要说明的是,与所述识别单元35对应的,所述转发单元33,具体可以用于若所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以其内的网络故障,则向所述第二虚拟网关发送更改网关的免费ARP报文,以便所述第二虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第二虚拟网关;
若所述故障类型为所述第一虚拟网关之外的网络故障,则通过所述第二虚拟网关所对应的备份流表,转发虚拟机发送的报文;或者
若所述第二虚拟网关对应的主路径的故障类型为所述第二虚拟网关以其内的网络故障,则向所述第一虚拟网关发送更改网关的免费ARP报文,以便所述第一虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第一虚拟网关;
若所述故障类型为所述第二虚拟网关之外的网络故障,则通过所述第一虚拟网关所对应的备份流表,转发虚拟机发送的报文。
对于本申请实施例,为了减轻NAT转换负载压力,实现负载均衡,提升NAT转化的速度和可靠行,所述装置还包括:统计单元36。
所述统计单元36,可以用于若所述第一虚拟网关和所述第二虚拟网关分别对应的主路径均处于正常状态,且分别对应的备份路径均处于正常状态,则统计所述第一虚拟网关和所述第二虚拟网关分别对应的转发流量。所述统计单元36是本装置中若所述第一虚拟网关和所述第二虚拟网关分别对应的主路径均处于正常状态,且分别对应的备份路径均处于正常状态,则统计所述第一虚拟网关和所述第二虚拟网关分别对应的转发流量。
所述转发单元33,还可以用于当接收到新报文时,选择转发流量较少的虚拟网关转发所述新报文。所述转发单元33还是本装置中当接收到新报文时,选择转发流量较少的虚拟网关转发所述新报文。
需要说明的是,本申请实施例提供的一种虚拟网关主备切换装置所涉及各功能模块的其他相应描述,可以参考图1所示方法的对应描述,在此不再赘述。
基于上述如图1所示方法,相应的,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可以为非易失性可读存储介质;其上存储有计算机可读指令,该可读指令被处理器执行时实现以下步骤:通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;通过切换后的备份路径,转发虚拟机发送的报文。
基于上述如图1所示方法和如图4所示装置的实施例,本申请实施例还提供了一种虚拟网关主备切换装置的实体结构图,如图6所示,该装置包括:处理器41、存储器42、及存储在存储器42上并可在处理器上运行的计算机可读指令,其中存储器42和处理器41均设置在总线43上所述处理器41执行所述计算机可读指令时实现以下步骤:通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;通过切换后的备份路径,转发虚拟机发送的报文。
通过本申请的技术方案,能够通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;并能够在所述第一虚拟网关对应的主路径发生故障时,将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者能够在所述第二虚拟网关对应的主路径发生故障时,将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;从而能够实现第一虚拟网关和第二虚拟网关的互相备份。与此同时,通过切换后的备份路径,转发虚拟机发送的报文,能够实现主、备份虚拟网关同时处于工作状态,避免虚拟网关处于闲置状态,提供多活的虚拟网关NAT机制,从而能够节省网络的带宽资源和服务器资源。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (20)

  1. 一种虚拟网关主备切换方法,其特征在于,包括:
    通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
    若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
    通过切换后的备份路径,转发虚拟机发送的报文。
  2. 根据权利要求1所述的方法,其特征在于,所述判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态之前,所述方法还包括:
    为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。
  3. 根据权利要求1所述的方法,其特征在于,所述判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态之后,所述方法还包括:
    若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
  4. 根据权利要求1所述的方法,其特征在于,所述通过切换后的备份路径,转发虚拟机发送的报文之前,所述方法还包括:
    若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。
  5. 根据权利要求4所述的方法,其特征在于,所述通过切换后的备份路径,转发虚拟机发送的报文,包括:
    若所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以其内的网络故障,则向所述第二虚拟网关发送更改网关的免费ARP报文,以便所述第二虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第二虚拟网关;
    若所述故障类型为所述第一虚拟网关之外的网络故障,则通过所述第二虚拟网关所对应的备份流表,转发虚拟机发送的报文;或者
    若所述第二虚拟网关对应的主路径的故障类型为所述第二虚拟网关以其内的网络故障,则向所述第一虚拟网关发送更改网关的免费ARP报文,以便所述第一虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第一虚拟网关;
    若所述故障类型为所述第二虚拟网关之外的网络故障,则通过所述第一虚拟网关所对应的备份流表,转发虚拟机发送的报文。
  6. 根据权利要求1所述的方法,其特征在于,所述判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态之后,所述方法还包括:
    若所述第一虚拟网关和所述第二虚拟网关分别对应的主路径均处于正常状态,且分别对应的备份路径均处于正常状态,则统计所述第一虚拟网关和所述第二虚拟网关分别对应的转发流量;
    当接收到新报文时,选择转发流量较少的虚拟网关转发所述新报文。
  7. 一种虚拟网关主备切换装置,其特征在于,所述装置包括:
    判断单元,用于通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
    切换单元,用于若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
    转发单元,用于通过切换后的备份路径,转发虚拟机发送的报文。
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    配置单元,用于为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。
  9. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    转发单元,用于若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
  10. 根据权利要求7所述的装置,其特征在于,所述装置还包括:
    识别单元,用于若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。
  11. 根据权利要求10所述的装置,其特征在于,所述转发单元,具体用于:
    若所述第一虚拟网关对应的主路径的故障类型为所述第一虚拟网关以其内的网络故障,则向所述第二虚拟网关发送更改网关的免费ARP报文,以便所述第二虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第二虚拟网关;
    若所述故障类型为所述第一虚拟网关之外的网络故障,则通过所述第二虚拟网关所对应的备份流表,转发虚拟机发送的报文;或者
    若所述第二虚拟网关对应的主路径的故障类型为所述第二虚拟网关以其内的网络故障,则向所述第一虚拟网关发送更改网关的免费ARP报文,以便所述第一虚拟网关将所述免费ARP报文发送给虚拟机,使得所述虚拟机根据所述免费ARP报文将报文转发的网关修改为所述第一虚拟网关;
    若所述故障类型为所述第二虚拟网关之外的网络故障,则通过所述第一虚拟网关所对应的备份流表,转发虚拟机发送的报文。
  12. 根据权利要求10所述的装置,其特征在于,所述装置还包括:
    统计单元,用于若所述第一虚拟网关和所述第二虚拟网关分别对应的主路径均处于正常状态,且分别对应的备份路径均处于正常状态,则统计所述第一虚拟网关和所述第二虚拟网关分别对应的转发流量;
    所述转发单元,还用于当接收到新报文时,选择转发流量较少的虚拟网关转发所述新报文。
  13. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,该可读指令被处理器执行时实现以下步骤:
    通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
    若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
    通过切换后的备份路径,转发虚拟机发送的报文。
  14. 根据权利要求13所述的计算机可读存储介质,其特征在于,该可读指令被处理器执行时还实现以下步骤:
    为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。
  15. 根据权利要求13所述的计算机可读存储介质,其特征在于,该可读指令被处理器执行时还实现以下步骤:
    若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
  16. 根据权利要求13所述的计算机可读存储介质,其特征在于,该可读指令被处理器执行时还实现以下步骤:
    若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。
  17. 一种虚拟网关主备切换装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现以下步骤:
    通过SDN控制器判断处于同一虚拟网络的第一虚拟网关和第二虚拟网关分别对应的主路径是否处于正常状态;
    若所述第一虚拟网关对应的主路径发生故障,则将所述第一虚拟网关对应的备份路径切换为所述第二虚拟网关的主路径,或者若所述第二虚拟网关对应的主路径发生故障,则将所述第二虚拟网关对应的备份路径切换为所述第一虚拟网关的主路径;
    通过切换后的备份路径,转发虚拟机发送的报文。
  18. 根据权利要求17所述的装置,其特征在于,,所述处理器执行所述计算机可读指令时还实现以下步骤:
    为所述第一虚拟网关的主路径和所述第二虚拟网关的备份路径配置相同的路径,并为所述第二虚拟网关的主路径和所述第一虚拟网关的备份路径配置相同的路径。
  19. 根据权利要求17所述的装置,其特征在于,,所述处理器执行所述计算机可读指令时还实现以下步骤:
    若所述第一虚拟网关对应的主路径或者所述第二虚拟网关对应的主路径处于正常状态,则通过处于正常状态的主路径,转发虚拟机发送的报文。
  20. 根据权利要求17所述的装置,其特征在于,,所述处理器执行所述计算机可读指令时还实现以下步骤:
    若所述第一虚拟网关对应的主路径发生故障,则识别所述第一虚拟网关对应的主路径的故障类型;或者若所述第二虚拟网关对应的主路径发生故障,则识别所述第二虚拟网关对应的主路径的故障类型。
PCT/CN2018/094718 2018-04-20 2018-07-06 虚拟网关主备切换方法、装置及计算机可读存储介质 WO2019200728A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810370086.5 2018-04-20
CN201810370086.5A CN108306777B (zh) 2018-04-20 2018-04-20 基于sdn控制器的虚拟网关主备切换方法及装置

Publications (1)

Publication Number Publication Date
WO2019200728A1 true WO2019200728A1 (zh) 2019-10-24

Family

ID=62847639

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094718 WO2019200728A1 (zh) 2018-04-20 2018-07-06 虚拟网关主备切换方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN108306777B (zh)
WO (1) WO2019200728A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109309617A (zh) * 2018-08-08 2019-02-05 华为技术有限公司 容灾切换方法、相关设备及计算机存储介质
CN109298972B (zh) * 2018-09-06 2019-11-15 高盈量化云科技(深圳)有限公司 一种高可用策略引擎
CN110753002B (zh) * 2019-09-29 2023-04-07 北京浪潮数据技术有限公司 流量调度方法及装置
CN111221561A (zh) * 2020-01-14 2020-06-02 平安科技(深圳)有限公司 流表更新方法、装置、系统、计算机设备及存储介质
CN111427259B (zh) * 2020-03-30 2023-05-30 深圳震有科技股份有限公司 一种机框插槽式的主备切换方法、智能设备及存储介质
CN112003748B (zh) * 2020-08-21 2023-01-13 中国建设银行股份有限公司 适用于虚拟网关的故障处理方法、系统、装置和存储介质
CN111970153A (zh) * 2020-08-21 2020-11-20 中国建设银行股份有限公司 基于虚拟网关的故障隔离方法、装置及相关设备
CN112187533B (zh) * 2020-09-18 2023-04-18 北京浪潮数据技术有限公司 一种虚拟网络设备防御方法、装置、电子设备和介质
CN114157606A (zh) * 2021-12-09 2022-03-08 锐捷网络股份有限公司 虚拟网元设备切换方法、设备和存储介质
CN116248581A (zh) * 2022-12-29 2023-06-09 天翼云科技有限公司 一种基于sdn的云场景网关集群主备切换方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141494A (zh) * 2007-10-12 2008-03-12 杭州华三通信技术有限公司 一种解决负载分担情况下资源分配冲突的方法
CN105207902A (zh) * 2015-10-13 2015-12-30 广州西麦科技股份有限公司 一种基于sdn的主备虚拟网关的系统及方法
CN105207824A (zh) * 2015-10-19 2015-12-30 广州西麦科技股份有限公司 一种基于sdn的自动保护倒换的系统及其方法
CN105915400A (zh) * 2016-06-28 2016-08-31 北京神州绿盟信息安全科技股份有限公司 一种数据流切换方法及系统
US20170359310A1 (en) * 2016-06-13 2017-12-14 David D. Jameson Bypassing a firewall for authorized flows using software defined networking

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141494A (zh) * 2007-10-12 2008-03-12 杭州华三通信技术有限公司 一种解决负载分担情况下资源分配冲突的方法
CN105207902A (zh) * 2015-10-13 2015-12-30 广州西麦科技股份有限公司 一种基于sdn的主备虚拟网关的系统及方法
CN105207824A (zh) * 2015-10-19 2015-12-30 广州西麦科技股份有限公司 一种基于sdn的自动保护倒换的系统及其方法
US20170359310A1 (en) * 2016-06-13 2017-12-14 David D. Jameson Bypassing a firewall for authorized flows using software defined networking
CN105915400A (zh) * 2016-06-28 2016-08-31 北京神州绿盟信息安全科技股份有限公司 一种数据流切换方法及系统

Also Published As

Publication number Publication date
CN108306777A (zh) 2018-07-20
CN108306777B (zh) 2021-04-13

Similar Documents

Publication Publication Date Title
WO2019200728A1 (zh) 虚拟网关主备切换方法、装置及计算机可读存储介质
US10686749B2 (en) Packet sending method and network device
US9887902B2 (en) Traffic switching method, device, and system
US7636364B2 (en) Redundant router network
WO2015072709A1 (ko) Sdn에서 네트워크 장애 해소를 위한 컨트롤러 및 스위치의 동작 방법과, 이를 위한 컨트롤러 및 스위치
US9262191B2 (en) Method, apparatus, and system for processing service flow
US7940660B2 (en) Methods, systems, and computer program products for voice over IP (VoIP) traffic engineering and path resilience using media gateway and associated next-hop routers
US20050135233A1 (en) Redundant routing capabilities for a network node cluster
WO2023033585A1 (ko) 분산 게이트웨이 환경에 최적화된 터널링 및 게이트웨이 접속 시스템 및 그에 관한 방법
CN107911291A (zh) Vrrp路由器切换方法、路由器、vrrp主备切换系统及存储介质
US20180123868A1 (en) Indicating a master network controller in a virtual router redundancy protocol
WO2015078008A1 (zh) 一种链路发现的方法、系统及设备
WO2018117279A1 (ko) 네트워크 장치 및 네트워크 장치의 전송 선택 방법
WO2015199340A1 (ko) 다중 경로 통신을 위한 네트워크 장치 및 단말, 이들의 동작 방법, 그리고 동작 방법을 구현한 프로그램
JP2009303090A (ja) 負荷分散サーバ、ネットワーク負荷分散方法および輻輳回避方法
WO2012171378A1 (zh) 解决vpls接入l3故障切换导致断流的方法及路由器
WO2018117280A1 (ko) 네트워크 장치 및 네트워크 장치의 큐 관리 방법
JP2016536906A (ja) ネットワーク保護方法およびネットワーク保護装置、オフリングノード、ならびにシステム
CN113992569A (zh) Sdn网络中多路径业务收敛方法、装置及存储介质
CN113992582A (zh) 一种报文转发方法及设备
WO2012165805A2 (ko) 2 이상의 네트워크 기반 데이터 동시 전송 서비스 방법 및 장치
US20150334019A1 (en) Routing control method and non-transitory computer-readable recording medium storing routing control program
KR100748694B1 (ko) Rtp를 지원하는 네트워크 시스템에서의 네트워크 링크이중화 시스템 및 그 제어방법
WO2015096040A1 (zh) 接入节点、移动管理网元以及寻呼消息处理方法
US11218338B2 (en) Communication system and server switching method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18915247

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/02/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18915247

Country of ref document: EP

Kind code of ref document: A1