WO2017008641A1 - Method of switching redundancy port and device utilizing same - Google Patents

Method of switching redundancy port and device utilizing same Download PDF

Info

Publication number
WO2017008641A1
WO2017008641A1 PCT/CN2016/087987 CN2016087987W WO2017008641A1 WO 2017008641 A1 WO2017008641 A1 WO 2017008641A1 CN 2016087987 W CN2016087987 W CN 2016087987W WO 2017008641 A1 WO2017008641 A1 WO 2017008641A1
Authority
WO
WIPO (PCT)
Prior art keywords
port
switching
redundant
data
switched
Prior art date
Application number
PCT/CN2016/087987
Other languages
French (fr)
Chinese (zh)
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 WO2017008641A1 publication Critical patent/WO2017008641A1/en

Links

Images

Classifications

    • 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

Definitions

  • This application relates to, but is not limited to, the field of computer technology.
  • all hosts in the LAN internal network set an identical default route to the egress gateway to implement communication between the host and the external network.
  • the egress gateway fails, communication between the host and the external network is interrupted. Therefore, configuring multiple egress gateways is a common method to improve system reliability.
  • one of the egress gateways has a problem, it will quickly switch to another egress gateway. To ensure the user's access to the external network.
  • the implementation of the above-mentioned system to improve the reliability of the system introduces another problem, that is, the switching between the egress gateways, and the protocol for processing the two-layer redundancy switching in the related art, for example, the virtual router redundancy protocol (Virtual Router Redundancy Protocol, referred to as: VRRP)+Multiple Spanning Tree Protocol (MSTP), or VRRP+Bidirectional Forwarding Detection (BFD) protocol.
  • VRRP Virtual Router Redundancy Protocol
  • MSTP Multiple Spanning Tree Protocol
  • BFD Bidirectional Forwarding Detection
  • the media access control (Media Access Control, MAC address) on the port cannot be processed in time, or the next hop generated by the Address Resolution Protocol (ARP) cannot be processed in time. This causes MAC drift and data interruption, making the processing port unable to switch in time.
  • ARP Address Resolution Protocol
  • the present invention provides a method and a device for switching a redundant port, so as to solve the problem that the MAC on the port cannot be processed in time in the process of switching the port in the related art, or the ARP cannot be processed in time.
  • the next hop causes MAC drift and data interruption, and the problem that the processing port cannot be switched in time.
  • a method for switching redundant ports includes the steps of:
  • the acquiring the handover message corresponding to the redundant port switching instruction, and parsing the handover message, and determining, according to the parsed handover message, that the primary port to be switched includes:
  • the database is searched according to the instance number, and a set of redundant ports corresponding to the same instance number and the to-be-switched primary port are found.
  • the obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, and configuring the acquired data for the to-be-switched primary port includes:
  • the method further includes:
  • the method before the receiving the redundant port switching instruction sent by the redundant switching server, the method further includes:
  • a switching device for a redundant port comprising:
  • the receiving module is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server;
  • An acquiring module configured to: acquire a switching message corresponding to the redundant port switching instruction received by the receiving module;
  • a parsing module configured to: parse the switching message obtained by the acquiring module
  • a determining module configured to: determine, according to the parsed switching message parsed by the parsing module, the main port to be switched;
  • the switching module is configured to: obtain the data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, configure the acquired data for the to-be-switched primary port, and The remaining port is switched to the to-be-switched primary port.
  • the parsing module is configured to: parse the switching message obtained by the acquiring module to obtain the parsed switching message, where the parsed switching message includes an instance number;
  • the determining module is configured to: according to the instance number search database obtained by the parsing module, find a set of redundant ports corresponding to the same instance number and the to-be-switched main port.
  • the switching module includes:
  • Delete the unit set to: delete the data of the redundant port
  • a switching unit configured to: obtain data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, and add the acquired data to the to-be-switched primary port, and The primary port to be switched is configured.
  • the switching module further includes:
  • the configuration unit is set to: pre-configure the processing function
  • the switching unit is further configured to perform deletion and addition of port data by calling back the processing function configured by the configuration unit.
  • the device further includes: a backup module
  • the configuration unit is further configured to: configure a binding protocol
  • the obtaining module is further configured to: obtain a key segment to be backed up;
  • the determining module is further configured to: determine data corresponding to the key segment acquired by the acquiring module;
  • the backup module is configured to: back up data corresponding to the key segment determined by the determining module to the database.
  • the method and device for switching a redundant port provided by the embodiment of the present invention, when detecting the redundancy protocol, receiving a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switching, Acquiring the switching message corresponding to the redundant port switching instruction, determining the to-be-switched primary port by parsing the switching message, and acquiring the data of the to-be-switched primary port from the redundant port data pre-backuped by the database, thereby configuring the primary port to be switched Obtaining the data, and performing the operation of switching from the current redundant port to the primary port to be switched; in the embodiment of the present invention, by backing up the data in the redundant networking, when the redundant switching occurs, the faulty port can be The information is quickly synchronized to the new primary port, enabling Layer 2 redundancy and high quality fast switching.
  • FIG. 1 is a schematic flowchart of a method for switching a redundant port according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart diagram of still another method for switching a redundant port according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of still another method for switching a redundant port according to an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a working principle of a method for switching a redundant port according to an embodiment of the present disclosure
  • FIG. 6 is a schematic structural diagram of a device for switching a redundant port according to an embodiment of the present disclosure
  • FIG. 7 is a schematic structural diagram of a switching module in a switching device for a redundant port according to the embodiment shown in FIG. 6; FIG.
  • FIG. 8 is a schematic structural diagram of another apparatus for switching a redundant port according to an embodiment of the present invention.
  • the main solution of the embodiment of the present invention is: when detecting that the redundancy protocol enters the active/standby switchover, receiving a redundant port switching instruction sent by the redundant switching server; acquiring a switching message corresponding to the redundant port switching instruction, and The switchover message is parsed, and the master port to be switched is determined according to the parsed switch message; the data of the master port to be switched is obtained from the redundant port data that is backed up by the database, and the acquired data is configured for the master port to be switched, and the slave data is executed.
  • the current redundant port switches to the operation of the to-be-switched primary port.
  • the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high quality of the Layer 2 redundancy. Quickly switch.
  • the MAC address on the port cannot be processed in time or the next hop generated by the ARP cannot be processed in time, resulting in failure to timely drift and data interruption, and the problem that the processing port cannot be switched in time.
  • the present invention provides a method of switching redundant ports.
  • FIG. 1 is a schematic flowchart diagram of a method for switching a redundant port according to an embodiment of the present invention.
  • the method for switching a redundant port provided in this embodiment may include the following steps, that is, S110 to S130:
  • S110 Receive a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switchover.
  • a Layer 2 redundancy system is provided.
  • the Layer 2 redundancy system is used to manage device ports in the network.
  • the network in this embodiment may be a local area network or other network.
  • the Layer 2 redundancy system of the device can work normally. It can be divided into Layer 2 redundancy protocol, path detection protocol, and MAC or ARP learning.
  • the Layer 2 redundancy protocol is used to handle redundancy detection.
  • the link detection can be used to quickly detect the link status and notify the redundancy protocol processing module to perform fast switching. After the port is switched, the MAC address or the corresponding ARP processing is re-learned on the backup port.
  • the main implementation manner of the handover method of the redundant port provided by the embodiment of the present invention is the processing of the MAC or ARP learning part.
  • a redundant switching client configured on the primary device, or on another access device, to perform data switching on the redundant port;
  • the redundant switching server is configured on the primary device to perform an active/standby switchover.
  • the information is delivered; the redundancy fast switches the database, provides the interface of the database, and performs creation, addition, and deletion operations to save the redundant data of the backup.
  • the redundancy protocol finds that there is a problem with the link, the link switching operation needs to be performed.
  • the redundancy protocol needs to perform the active/standby switchover.
  • the redundant switch server sends the redundant port switch command to notify the port to switch.
  • the redundant switch client Receiving a redundant port switching instruction sent by the redundant switching server, triggering data switching on the redundant port after receiving the redundant port switching instruction.
  • the switching message may include a primary port number and a virtual local area network (Virtual Local Area) Network, referred to as: VLAN).
  • VLAN Virtual Local Area Network
  • the port fast switching function may be pre-configured, configured on the redundant port and the port connected to the master device, and the same instance is configured on the redundant switching server and the redundant switching client. It is used to distinguish between different fast handovers.
  • the redundant handover server can find the location of the redundant handover client according to the instance. When the redundant handover server delivers the handover message, it carries the specified instance number and the location information of the redundant handover client.
  • the switching client performs switching of multiple redundant ports in the same instance according to the instance number.
  • the data of the primary port to be switched is obtained from the redundant port data pre-backed up by the database, and the acquired data is configured for the primary port to be switched, and is currently redundant.
  • the remaining ports are switched to the primary port to be switched.
  • the port switching is performed by acquiring the pre-backup data from the database for the primary port to be switched, so that the port switching speed is improved and the efficiency is improved.
  • FIG. 2 it is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention.
  • S120 may include the following steps, that is, S121 to S122:
  • the instance number is obtained, and the instance number includes, for example, a new port number and a VLAN, so that the database can be searched according to the instance number, and a set of redundant ports corresponding to the same instance number are found.
  • FIG. 3 it is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention.
  • S130 may include the following steps, that is, S131 to S132:
  • the processing function may also be pre-configured, and the deletion and addition of the port data is performed by calling back the processing function.
  • the processing function in this embodiment includes, for example, an add function and a delete function, and may also include other functions required in the port switching process, which will not be exemplified herein.
  • the switching method of the redundant port is to delete the data of the redundant port when the port is switched, and obtain the data of the primary port to be switched from the data backed up by the database, and add the Obtain the data and configure the primary port to be switched.
  • the data of the primary port to be switched in this embodiment is the configuration data of the failed port. By obtaining the data, the port switching process is simple and fast.
  • FIG. 4 it is a schematic flowchart of a method for switching a redundant port according to an embodiment of the present invention.
  • the method for switching the redundant port provided in this embodiment may further include the following steps, that is, S100 to S101 before S110:
  • the binding protocol is configured on the redundancy switching client, and the key segment to be backed up is specified, for example, the ZESR (ZTE Ethernet Switch Ring), which can be The MAC address of the port is backed up. If it is VRRP, you can back up the ARP entries.
  • the database is initialized and the database is initialized according to the command line configuration.
  • the key fields include but are not limited to the instance number, the VLAN, the redundant port list, the main port number, and the data specified by the command line.
  • the callback function that is sent is switched, and the corresponding processing function is hooked according to the information configured by the client. When the redundant port data is switched, the callback is called to complete the deletion of the related data.
  • the MAC maintenance processing function provided by the MAC module.
  • it is determined whether to listen to the protocol packet or synchronize the current device entry. Listens to the protocol packets before and after the master and backup, and parses the key fields in the packets and writes them to the database.
  • VRRP VRRP
  • ARP ARP packets between the master and the backup.
  • FIG. 5 it is a schematic diagram of a working principle of a method for switching a redundant port according to an embodiment of the present invention.
  • the working principle of the switching method of the redundant port provided in this embodiment is:
  • the redundancy switching server is enabled on the downlink port of the device configured with the Layer 2 redundancy protocol. As shown in Figure 5, the downlink port includes port1_1, port2_1, and port3_1 on the uplink port of the Layer 2 access device D.
  • the redundancy switching client is enabled.
  • the uplink port of the Layer 2 access device D includes: port1_2, port2_2, port3_2, and the entry on the redundant switching port or the received packet on the Layer 2 access device D. After the file is parsed, it is saved to the fast switch database. Because device A, device B and device C are redundant, only one device is the master device and can be connected to the external network.
  • the BFD can discover the link problem within a few milliseconds.
  • the selected new master device sends a switch message to the Layer 2 access device D.
  • Device D clears the information of the other two ports, and then restores the redundant information of the backup from the database to the new primary port.
  • the method for switching redundant ports provided by the embodiments of the present invention accelerates the process of re-learning on the new primary port, avoiding MAC drift and data interruption.
  • the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
  • the invention also provides a switching device for a redundant port.
  • FIG. 6 is a schematic structural diagram of a switching device for a redundant port according to an embodiment of the present invention.
  • the switching device of the redundant port provided by this embodiment may include: a receiving module 10, an obtaining module 20, a parsing module 30, a determining module 40, and a switching module 50.
  • the receiving module 10 is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server.
  • a Layer 2 redundancy system is provided.
  • the Layer 2 redundancy system is used to manage device ports in the network.
  • the network in this embodiment may be a local area network or other network.
  • the Layer 2 redundancy system of the device can work normally. It can be divided into Layer 2 redundancy protocol, path detection protocol, and MAC or ARP learning.
  • the Layer 2 redundancy protocol is used to handle redundancy detection and active/standby switching.
  • the path detection can quickly detect the link status, notify the redundancy protocol processing module, and perform fast switching. After the port is switched, the MAC address or the corresponding ARP processing is re-learned on the backup port.
  • the main implementation manner of the handover method of the redundant port provided by the embodiment of the present invention is the processing of the MAC or ARP learning part.
  • a redundant switching client configured on the primary device, or on another access device, to perform data switching on the redundant port;
  • the redundant switching server is configured on the primary device to perform an active/standby switchover.
  • the information is delivered; the redundancy fast switches the database, provides the interface of the database, and performs creation, addition, and deletion operations to save the redundant data of the backup.
  • the redundancy protocol finds that there is a problem with the link, the link switching operation needs to be performed.
  • the redundancy protocol needs to perform the active/standby switchover.
  • the redundant switch server sends the redundant port switch command to notify the port to switch.
  • the redundant switch client Receiving a redundant port switching instruction sent by the redundant switching server, triggering data switching on the redundant port after receiving the redundant port switching instruction.
  • the obtaining module 20 is configured to: acquire a switching message corresponding to the redundant port switching instruction received by the receiving module 10.
  • the parsing module 30 is configured to: parse the switching message acquired by the obtaining module 20;
  • the determining module 40 is configured to: determine, according to the parsed switching message parsed by the parsing module 30, the main port to be switched.
  • the switching message corresponding to the redundant port switching instruction is obtained, and the switching message may include a primary port number and a VLAN.
  • the redundant switching server When the redundant switching client and the redundant switching server are not on the same device, the redundant switching server generates a data switching message, and the instance number is included in the data switching message. : Whether the primary flag is sent to the specified port, VLAN, where the port and VLAN are specified when configuring the server.
  • the port fast switching function may be pre-configured, configured on the redundant port and the port connected to the master device, and the same instance is configured on the redundant switching server and the redundant switching client. It is used to distinguish between different fast handovers.
  • the redundant handover server can find the location of the redundant handover client according to the instance. When the redundant handover server delivers the handover message, it carries the specified instance number and the location information of the redundant handover client.
  • the switching client performs switching of multiple redundant ports in the same instance according to the instance number.
  • the switching module 50 is configured to: obtain data of the primary port to be switched determined by the determining module 40 from the redundant port data that is backed up by the database, configure the acquired data for the primary port to be switched, and switch from the current redundant port to the current redundant port.
  • the primary port to be switched is configured to: obtain data of the primary port to be switched determined by the determining module 40 from the redundant port data that is backed up by the database, configure the acquired data for the primary port to be switched, and switch from the current redundant port to the current redundant port. The primary port to be switched.
  • the data of the primary port to be switched is obtained from the redundant port data pre-backed up by the database, and the acquired data is configured for the primary port to be switched, and is currently redundant.
  • the remaining ports are switched to the primary port to be switched.
  • the port switching is performed by acquiring the pre-backup data from the database for the primary port to be switched, so that the port switching speed is improved and the efficiency is improved.
  • the parsing module 30 in the embodiment of the present invention is configured to: the parsing message obtained by the parsing obtaining module 20 is parsed, and the parsed switching message includes an instance number.
  • the determining module 40 in the present example is configured to: according to the instance number search database obtained by the parsing module 30, find a set of redundant ports corresponding to the same instance number and the main port to be switched.
  • the instance number is obtained, and the instance number includes, for example, a new port number and a VLAN, so that the database can be searched according to the instance number, and a set of redundant ports corresponding to the same instance number are found.
  • FIG. 7 is a schematic structural diagram of a switching module in a switching device of a redundant port according to an embodiment of the present invention.
  • the switching module 50 in this embodiment may include: a deleting unit 51 and a switching unit 52;
  • the deleting unit 51 is configured to: delete data of the redundant port
  • the switching unit 52 is configured to: obtain the data of the primary port to be switched determined by the determining module 40 from the redundant port data that is backed up by the database, add the acquired data to the primary port to be switched, and configure the primary port to be switched. .
  • the switching module in the embodiment may further include: a configuration unit 53 configured to: pre-configure a processing function;
  • the switching unit 52 in this embodiment is further configured to perform deletion and addition of port data by the processing function configured by the callback configuration unit 53.
  • the processing function in this embodiment includes, for example, an add function and a delete function, and may also include other functions required in the port switching process, which will not be exemplified herein.
  • the switching device of the redundant port provided by this embodiment, when the switching module 50 performs port switching, The data of the redundant port is deleted, and the data of the primary port to be switched is obtained from the data that is backed up by the database, and the acquired data is added to the primary port to be switched, and the primary port to be switched is configured.
  • the data of the primary port to be switched in this embodiment is the configuration data of the failed port. By obtaining the data, the port switching process is simple and fast.
  • FIG. 8 it is a schematic structural diagram of another switching device for a redundant port according to an embodiment of the present invention.
  • the switching device of the redundant port provided by this embodiment may further include a backup module 60;
  • the configuration unit 53 is further configured to: configure a binding protocol
  • the obtaining module 20 is further configured to: obtain a key segment to be backed up;
  • the determining module 40 is further configured to: determine data corresponding to the key segment acquired by the obtaining module 20;
  • the backup module 60 is configured to: back up the data corresponding to the key segment determined by the determining module 40 into the database.
  • the binding protocol is configured on the redundancy switching client, and the key segment to be backed up is specified.
  • the key segment is “ZESR”, and the MAC address on the port can be backed up. If it is VRRP, it can be ARP entries are backed up.
  • the database is initialized and the database is initialized according to the command line configuration.
  • the key fields include but are not limited to the instance number, the VLAN, the redundant port list, the main port number, and the data specified by the command line.
  • the callback function that is sent is switched, and the corresponding processing function is hooked according to the information configured by the client. When the redundant port data is switched, the callback is called to complete the deletion of the related data.
  • the MAC maintenance processing function provided by the MAC module.
  • it is determined whether to listen to the protocol packet or synchronize the current device entry. Listens to the protocol packets before and after the master and backup, and parses the key fields in the packets and writes them to the database.
  • VRRP VRRP
  • ARP ARP packets between the master and the backup.
  • the redundancy switching server is enabled on the downlink port of the device configured with the Layer 2 redundancy protocol. As shown in Figure 5, the downlink port includes port1_1, port2_1, and port3_1 on the uplink port of the Layer 2 access device D.
  • the redundancy switching client is enabled.
  • the uplink port of the Layer 2 access device D includes: port1_2, port2_2, port3_2, and the entry on the redundant switching port or the received packet on the Layer 2 access device D. After the file is parsed, it is saved to the fast switch database. Because device A, device B and device C are redundant, only one device is the master device and can be connected to the external network.
  • the BFD can discover the link problem within a few milliseconds.
  • the selected new master device sends a switch message to the Layer 2 access device D.
  • Device D clears the information of the other two ports, and then restores the redundant information of the backup from the database to the new primary port.
  • the method for switching redundant ports provided by the embodiments of the present invention accelerates the process of re-learning on the new primary port, avoiding MAC drift and data interruption.
  • the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
  • the embodiment of the present invention further provides a terminal, where the terminal includes a processor, and the processor is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server; Redundant port switching instruction corresponding to the switching message, and parsing the switching message, determining the to-be-switched primary port according to the parsed switching message; obtaining the data of the to-be-switched primary port from the redundant port data pre-backed up by the database, Switch the data acquired by the primary port configuration and switch from the current redundant port to the primary port to be switched.
  • the terminal provided by the embodiment of the present invention includes but is not limited to an electronic device such as a computer.
  • the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • the device/function module/functional unit in the above embodiment When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the redundant port switching instruction sent by the redundant switching server is received, and the switching message corresponding to the redundant port switching instruction is obtained.
  • the main port to be switched is determined by parsing the switching message, and the data of the main port to be switched is obtained from the redundant port data pre-backuped by the database, thereby configuring the acquired data for the main port to be switched, and performing current redundancy.
  • the operation of the port is switched to the operation of the primary port to be switched.
  • the data in the redundant network is backed up, and the information on the faulty port can be quickly synchronized to the new primary port when the redundant switchover occurs. Thereby achieving a high-quality fast switching of the two-layer redundancy.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

A method of switching a redundancy port and a device utilizing the same. The method comprises: when detecting a master-slave switchover command compliant with a redundancy protocol, receiving a redundancy port switchover command transmitted from a redundancy switchover server; obtaining a switching message corresponding to the redundancy port switchover command, parsing the switching message, determining, according to the parsed switching message, a master port to be switched; acquiring, from redundant port information backed up in a database, data of the master port to be switched; assigning the acquired data to the master port to be switched, and switching from the present redundancy port to the master port to be switched.

Description

冗余端口的切换方法及装置Redundant port switching method and device 技术领域Technical field
本申请涉及但不限于计算机技术领域。This application relates to, but is not limited to, the field of computer technology.
背景技术Background technique
随着互联网(Internet)的发展,人们对网络可靠性的要求越来越高。例如,以局域网为例,对于局域网用户来说,能够时刻与外部网络保持联系是非常重要的。With the development of the Internet, people are increasingly demanding network reliability. For example, taking a local area network as an example, it is very important for LAN users to be able to keep in touch with the external network at all times.
通常情况下,局域网内部网络中的所有主机都设置一条相同的缺省路由,指向出口网关,实现主机与外部网络的通信。当出口网关发生故障时,主机与外部网络的通信就会中断,因此,配置多个出口网关是提高系统可靠性的常见方法,当其中一个出口网关出现问题时,会快速切换到别一个出口网关,保证用户对外网的访问。上述提高系统可靠性的实现方式引入另一个问题,即出口网关之间的切换,相关技术中处理二层冗余切换的协议,例如包括:虚拟路由冗余协议(Virtual Router Redundancy Protocol,简称为:VRRP)+多生成树协议(Multiple Spanning Tree Protocol,简称为:MSTP),或VRRP+双向转发检测(Bidirectional Forwarding Detection,简称为:BFD)协议等,虽然可以实现协议上的快速切换,但在实际应用中,由于端口的切换,不能及时处理端口上的媒体访问控制(Media Access Control,简称为:MAC)或不能及时处理由地址解析协议(Address Resolution Protocol,简称为:ARP)生成的下一跳,导致MAC漂移和数据中断,使得处理端口无法及时切换。Generally, all hosts in the LAN internal network set an identical default route to the egress gateway to implement communication between the host and the external network. When the egress gateway fails, communication between the host and the external network is interrupted. Therefore, configuring multiple egress gateways is a common method to improve system reliability. When one of the egress gateways has a problem, it will quickly switch to another egress gateway. To ensure the user's access to the external network. The implementation of the above-mentioned system to improve the reliability of the system introduces another problem, that is, the switching between the egress gateways, and the protocol for processing the two-layer redundancy switching in the related art, for example, the virtual router redundancy protocol (Virtual Router Redundancy Protocol, referred to as: VRRP)+Multiple Spanning Tree Protocol (MSTP), or VRRP+Bidirectional Forwarding Detection (BFD) protocol. Although it can implement fast switching on the protocol, it is actually applied. The media access control (Media Access Control, MAC address) on the port cannot be processed in time, or the next hop generated by the Address Resolution Protocol (ARP) cannot be processed in time. This causes MAC drift and data interruption, making the processing port unable to switch in time.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本文提供一种冗余端口的切换方法及装置,以解决相关技术中在进行端口的切换过程中,不能及时处理端口上的MAC或不能及时处理由ARP生成的 下一跳,而导致MAC漂移和数据中断,以及处理端口无法及时切换的问题。The present invention provides a method and a device for switching a redundant port, so as to solve the problem that the MAC on the port cannot be processed in time in the process of switching the port in the related art, or the ARP cannot be processed in time. The next hop causes MAC drift and data interruption, and the problem that the processing port cannot be switched in time.
一种冗余端口的切换方法,包括步骤:A method for switching redundant ports includes the steps of:
当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;Receiving a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switchover;
获取所述冗余端口切换指令对应的切换消息,并解析所述切换消息,根据解析后的切换消息确定待切换主端口;Obtaining a handover message corresponding to the redundant port switching instruction, and parsing the handover message, and determining, according to the parsed handover message, a primary port to be switched;
从数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,并从当前冗余端口切换至所述待切换主端口。Obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, configuring the acquired data for the to-be-switched primary port, and switching from the current redundant port to the to-be-switched primary port.
可选地,所述获取所述冗余端口切换指令对应的切换消息,并解析所述切换消息,根据解析后的切换消息确定待切换主端口,包括:Optionally, the acquiring the handover message corresponding to the redundant port switching instruction, and parsing the handover message, and determining, according to the parsed handover message, that the primary port to be switched, includes:
获取所述冗余端口切换指令对应的所述切换消息,并解析所述切换消息得到所述解析后的切换消息,所述解析后的切换消息包括实例号;Acquiring the handover message corresponding to the redundant port switching instruction, and parsing the handover message to obtain the parsed handover message, where the parsed handover message includes an instance number;
根据所述实例号查找数据库,查找出相同实例号对应的一组冗余端口和所述待切换主端口。The database is searched according to the instance number, and a set of redundant ports corresponding to the same instance number and the to-be-switched primary port are found.
可选地,所述从数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,包括:Optionally, the obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, and configuring the acquired data for the to-be-switched primary port includes:
删除所述冗余端口的数据;Deleting data of the redundant port;
从所述数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口添加所获取的数据,并对所述待切换主端口进行配置。Obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, adding the acquired data to the to-be-switched primary port, and configuring the to-be-switched primary port.
可选地,所述方法还包括:Optionally, the method further includes:
预先配置处理函数;Pre-configured handlers;
通过回调所述处理函数执行端口数据的删除和添加。The deletion and addition of port data is performed by calling back the processing function.
可选地,所述接收冗余切换服务端发送的冗余端口切换指令之前,所述方法还包括:Optionally, before the receiving the redundant port switching instruction sent by the redundant switching server, the method further includes:
配置绑定协议,并获取待备份的关键字段; Configure a binding protocol and obtain the key fields to be backed up.
确定所述关键字段对应的数据,并将所述关键字段对应的数据备份到所述数据库中。Determining data corresponding to the key field, and backing up data corresponding to the key field to the database.
一种冗余端口的切换装置,包括:A switching device for a redundant port, comprising:
接收模块,设置为:当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;The receiving module is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server;
获取模块,设置为:获取所述接收模块接收的所述冗余端口切换指令对应的切换消息;An acquiring module, configured to: acquire a switching message corresponding to the redundant port switching instruction received by the receiving module;
解析模块,设置为:解析所述获取模块获取的所述切换消息;a parsing module, configured to: parse the switching message obtained by the acquiring module;
确定模块,设置为:根据所述解析模块解析得到的解析后的切换消息确定待切换主端口;a determining module, configured to: determine, according to the parsed switching message parsed by the parsing module, the main port to be switched;
切换模块,设置为:从数据库预先备份的冗余端口数据中获取所述确定模块确定出的所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,并从当前冗余端口切换至所述待切换主端口。The switching module is configured to: obtain the data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, configure the acquired data for the to-be-switched primary port, and The remaining port is switched to the to-be-switched primary port.
可选地,所述解析模块,是设置为:解析所述获取模块获取的所述切换消息得到所述解析后的切换消息,所述解析后的切换消息包括实例号;Optionally, the parsing module is configured to: parse the switching message obtained by the acquiring module to obtain the parsed switching message, where the parsed switching message includes an instance number;
所述确定模块,是设置为:根据所述解析模块得到的所述实例号查找数据库,查找出相同实例号对应的一组冗余端口和所述待切换主端口。The determining module is configured to: according to the instance number search database obtained by the parsing module, find a set of redundant ports corresponding to the same instance number and the to-be-switched main port.
可选地,所述切换模块包括:Optionally, the switching module includes:
删除单元,设置为:删除所述冗余端口的数据;Delete the unit, set to: delete the data of the redundant port;
切换单元,设置为:从所述数据库预先备份的冗余端口数据中获取所述确定模块确定出的所述待切换主端口的数据,为所述待切换主端口添加所获取的数据,并对所述待切换主端口进行配置。a switching unit, configured to: obtain data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, and add the acquired data to the to-be-switched primary port, and The primary port to be switched is configured.
可选地,所述切换模块,还包括:Optionally, the switching module further includes:
配置单元,设置为:预先配置处理函数;The configuration unit is set to: pre-configure the processing function;
所述切换单元,还设置为:通过回调所述配置单元配置的所述处理函数执行端口数据的删除和添加。The switching unit is further configured to perform deletion and addition of port data by calling back the processing function configured by the configuration unit.
可选地,所述装置还包括:备份模块; Optionally, the device further includes: a backup module;
所述配置单元,还设置为:配置绑定协议;The configuration unit is further configured to: configure a binding protocol;
所述获取模块,还设置为:获取待备份的关键字段;The obtaining module is further configured to: obtain a key segment to be backed up;
所述确定模块,还设置为:确定所述获取模块获取的所述关键字段对应的数据;The determining module is further configured to: determine data corresponding to the key segment acquired by the acquiring module;
所述备份模块,设置为:将所述确定模块确定出的所述关键字段对应的数据备份到所述数据库中。The backup module is configured to: back up data corresponding to the key segment determined by the determining module to the database.
本发明实施例提供的冗余端口的切换方法及装置,通过对冗余协议的检测,在侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令,获取该冗余端口切换指令对应的切换消息,通过解析该切换消息确定待切换主端口,并从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,从而为待切换主端口配置所获取的数据,并执行从当前冗余端口切换至待切换主端口的操作;本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速的同步到新的主端口上,从而实现了二层冗余高质量的快速切换。The method and device for switching a redundant port provided by the embodiment of the present invention, when detecting the redundancy protocol, receiving a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switching, Acquiring the switching message corresponding to the redundant port switching instruction, determining the to-be-switched primary port by parsing the switching message, and acquiring the data of the to-be-switched primary port from the redundant port data pre-backuped by the database, thereby configuring the primary port to be switched Obtaining the data, and performing the operation of switching from the current redundant port to the primary port to be switched; in the embodiment of the present invention, by backing up the data in the redundant networking, when the redundant switching occurs, the faulty port can be The information is quickly synchronized to the new primary port, enabling Layer 2 redundancy and high quality fast switching.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本发明实施例提供的一种冗余端口的切换方法的流程示意图;FIG. 1 is a schematic flowchart of a method for switching a redundant port according to an embodiment of the present disclosure;
图2为本发明实施例提供的另一种冗余端口的切换方法的流程示意图;2 is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention;
图3为本发明实施例提供的又一种冗余端口的切换方法的流程示意图;FIG. 3 is a schematic flowchart diagram of still another method for switching a redundant port according to an embodiment of the present disclosure;
图4为本发明实施例提供的再一种冗余端口的切换方法的流程示意图;FIG. 4 is a schematic flowchart of still another method for switching a redundant port according to an embodiment of the present disclosure;
图5为本发明实施例提供的冗余端口的切换方法的一种工作原理示意图;FIG. 5 is a schematic diagram of a working principle of a method for switching a redundant port according to an embodiment of the present disclosure;
图6为本发明实施例提供的一种冗余端口的切换装置的结构示意图;FIG. 6 is a schematic structural diagram of a device for switching a redundant port according to an embodiment of the present disclosure;
图7为图6中所述实施例提供的冗余端口的切换装置中一种切换模块的结构示意图;FIG. 7 is a schematic structural diagram of a switching module in a switching device for a redundant port according to the embodiment shown in FIG. 6; FIG.
图8为本发明实施例提供的另一种冗余端口的切换装置的结构示意图。 FIG. 8 is a schematic structural diagram of another apparatus for switching a redundant port according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
下文中将结合附图对本发明的实施方式进行详细说明。需要说明的是,在不冲突的情况下,本文中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments herein may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸根据一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system in accordance with a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
本发明实施例的主要解决方案是:当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;获取该冗余端口切换指令对应的切换消息,并解析该切换消息,根据解析后的切换消息确定待切换主端口;从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为待切换主端口配置所获取的数据,并执行从当前冗余端口切换至所述待切换主端口的操作。本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速的同步到新的主端口上,从而实现了二层冗余高质量的快速切换。The main solution of the embodiment of the present invention is: when detecting that the redundancy protocol enters the active/standby switchover, receiving a redundant port switching instruction sent by the redundant switching server; acquiring a switching message corresponding to the redundant port switching instruction, and The switchover message is parsed, and the master port to be switched is determined according to the parsed switch message; the data of the master port to be switched is obtained from the redundant port data that is backed up by the database, and the acquired data is configured for the master port to be switched, and the slave data is executed. The current redundant port switches to the operation of the to-be-switched primary port. In the embodiment of the present invention, the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high quality of the Layer 2 redundancy. Quickly switch.
由于相关技术中在进行端口切换的过程中,不能及时处理端口上的MAC或不能及时处理由ARP生成的下一跳,而导致不能及时漂移和数据中断,以及处理端口无法及时切换的问题。In the related art, in the process of performing port switching, the MAC address on the port cannot be processed in time or the next hop generated by the ARP cannot be processed in time, resulting in failure to timely drift and data interruption, and the problem that the processing port cannot be switched in time.
基于上述相关技术中的问题,本发明提供一种冗余端口的切换方法。Based on the above problems in the related art, the present invention provides a method of switching redundant ports.
如图1所示,为本发明实施例提供的一种冗余端口的切换方法的流程示意图。本实施例提供的冗余端口的切换方法可以包括如下步骤,即S110~S130:FIG. 1 is a schematic flowchart diagram of a method for switching a redundant port according to an embodiment of the present invention. The method for switching a redundant port provided in this embodiment may include the following steps, that is, S110 to S130:
S110,当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令。S110: Receive a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switchover.
在本实施例中,提供一种设备的二层冗余系统,该二层冗余系统用于管理网络中的设备端口,本实施例中的网络可以为局域网,也还可以是其他网络。设备的二层冗余系统可以正常工作,通常可以分为二层冗余协议,路径检测协议,以及MAC或ARP的学习,例如通过二层冗余协议来处理冗余检测 和主备倒换,通过路径检测可以快速检测链路状态,通知冗余协议处理模块,做到快速切换;端口切换后,在备份端口重新学习MAC或对应的ARP处理。本发明实施例提供的冗余端口的切换方法的主要实现方式是对MAC或ARP学习部分的处理。In this embodiment, a Layer 2 redundancy system is provided. The Layer 2 redundancy system is used to manage device ports in the network. The network in this embodiment may be a local area network or other network. The Layer 2 redundancy system of the device can work normally. It can be divided into Layer 2 redundancy protocol, path detection protocol, and MAC or ARP learning. For example, the Layer 2 redundancy protocol is used to handle redundancy detection. With the active/standby switchover, the link detection can be used to quickly detect the link status and notify the redundancy protocol processing module to perform fast switching. After the port is switched, the MAC address or the corresponding ARP processing is re-learned on the backup port. The main implementation manner of the handover method of the redundant port provided by the embodiment of the present invention is the processing of the MAC or ARP learning part.
在本实施例,提供冗余切换客户端,配置在主设备上,或者其他接入设备上,执行冗余端口上数据的切换;冗余切换服务端,配置在主设备上,执行主备倒换信息的下发;冗余快速切换数据库,提供数据库的接口,执行创建、添加和删除操作,用来保存备份的冗余数据。In this embodiment, a redundant switching client is provided, configured on the primary device, or on another access device, to perform data switching on the redundant port; the redundant switching server is configured on the primary device to perform an active/standby switchover. The information is delivered; the redundancy fast switches the database, provides the interface of the database, and performs creation, addition, and deletion operations to save the redundant data of the backup.
当冗余协议发现链路有问题时,需要执行链路切换操作,冗余协议需要发生主备倒换,由冗余切换服务端发送冗余端口切换指令,通知端口的切换;冗余切换客户端接收冗余切换服务端发送的冗余端口切换指令,在接收到冗余端口切换指令后,触发冗余端口上数据的切换。When the redundancy protocol finds that there is a problem with the link, the link switching operation needs to be performed. The redundancy protocol needs to perform the active/standby switchover. The redundant switch server sends the redundant port switch command to notify the port to switch. The redundant switch client. Receiving a redundant port switching instruction sent by the redundant switching server, triggering data switching on the redundant port after receiving the redundant port switching instruction.
S120,获取冗余端口切换指令对应的切换消息,并解析该切换消息,根据解析后的切换消息确定待切换主端口。S120. Acquire a handover message corresponding to the redundant port switching instruction, and parse the handover message, and determine, according to the parsed handover message, the primary port to be switched.
在本实施例中,在接收到冗余切换服务端发送的冗余端口切换指令后,获取该冗余端口切换指令对应的切换消息,该切换消息可以包括主端口号和虚拟局域网(Virtual Local Area Network,简称为:VLAN)。当冗余切换客户端和冗余切换服务端不在同一个设备上时,冗余切换服务端要组包生成一个数据切换报文,该数据切换报文中制定了实例号,该实例号中包括:是否为主的标志位,向指定端口,VLAN发送,这里的端口和VLAN在配置服务端时是指定好的。In this embodiment, after receiving the redundant port switching instruction sent by the redundant switching server, acquiring a switching message corresponding to the redundant port switching instruction, the switching message may include a primary port number and a virtual local area network (Virtual Local Area) Network, referred to as: VLAN). When the redundant switching client and the redundant switching server are not on the same device, the redundant switching server generates a data switching message, and the instance number is included in the data switching message. : Whether the primary flag is sent to the specified port, VLAN, where the port and VLAN are specified when configuring the server.
可选地,在本发明实施例中,可以预先配置端口快速切换功能,配置在冗余端口和与主设备连接的端口上,在冗余切换服务端与冗余切换客户端配置相同的实例,用来区分不同的快速切换,冗余切换服务端根据实例可以找到冗余切换客户端的位置,当冗余切换服务端下发切换消息后,携带指定实例号和冗余切换客户端的位置信息,冗余切换客户端会根据该实例号执行相同实例中的多个冗余端口的切换。Optionally, in the embodiment of the present invention, the port fast switching function may be pre-configured, configured on the redundant port and the port connected to the master device, and the same instance is configured on the redundant switching server and the redundant switching client. It is used to distinguish between different fast handovers. The redundant handover server can find the location of the redundant handover client according to the instance. When the redundant handover server delivers the handover message, it carries the specified instance number and the location information of the redundant handover client. The switching client performs switching of multiple redundant ports in the same instance according to the instance number.
S130,从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为该待切换主端口配置所获取的数据,并从当前冗余端口切换至该待切换主 端口。S130. Obtain the data of the to-be-switched primary port from the redundant port data that is backed up by the database, configure the acquired data for the to-be-switched primary port, and switch from the current redundant port to the to-be-switched master. port.
在本实施例中,在获取到待切换主端口后,从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为该待切换主端口配置所获取的数据,并从当前冗余端口切换至待切换主端口。本实施例通过为待切换主端口从数据库获取预先备份的数据,来执行端口的切换,使得端口切换速度提升,且效率提高。In this embodiment, after acquiring the primary port to be switched, the data of the primary port to be switched is obtained from the redundant port data pre-backed up by the database, and the acquired data is configured for the primary port to be switched, and is currently redundant. The remaining ports are switched to the primary port to be switched. In this embodiment, the port switching is performed by acquiring the pre-backup data from the database for the primary port to be switched, so that the port switching speed is improved and the efficiency is improved.
可选地,如图2所示,为本发明实施例提供的另一种冗余端口的切换方法的流程示意图。在图1所示实施例的基础上,本实施例提供的冗余端口的切换方法中,S120可以包括如下步骤,即S121~S122:Optionally, as shown in FIG. 2, it is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention. On the basis of the embodiment shown in FIG. 1 , in the method for switching a redundant port provided by this embodiment, S120 may include the following steps, that is, S121 to S122:
S121,获取冗余端口切换指令对应的切换消息,并解析该切换消息得到解析后的切换消息,该解析后的切换消息包括实例号;S121. Acquire a handover message corresponding to the redundant port switching instruction, and parse the handover message to obtain a parsed handover message, where the parsed handover message includes an instance number.
S122,根据该实例号查找数据库,查找出相同实例号对应的一组冗余端口和待切换主端口。S122. Search for the database according to the instance number, and find a set of redundant ports corresponding to the same instance number and the primary port to be switched.
在本实施例中,在接收到切换消息后,解析得到实例号,该实例号例如包括新端口号和VLAN,从而可以根据实例号查找数据库,查找出相同实例号对应的一组冗余端口和待切换主端口。In this embodiment, after receiving the handover message, the instance number is obtained, and the instance number includes, for example, a new port number and a VLAN, so that the database can be searched according to the instance number, and a set of redundant ports corresponding to the same instance number are found. The primary port to be switched.
可选地,如图3所示,为本发明实施例提供的又一种冗余端口的切换方法的流程示意图。在图1所示实施例的基础上,本实施例提供的冗余端口的切换方法中,S130可以包括如下步骤,即S131~S132:Optionally, as shown in FIG. 3, it is a schematic flowchart of another method for switching a redundant port according to an embodiment of the present invention. On the basis of the embodiment shown in FIG. 1 , in the method for switching a redundant port provided by this embodiment, S130 may include the following steps, that is, S131 to S132:
S131,删除冗余端口的数据;S131, deleting data of the redundant port;
S132,从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为该待切换主端口添加所获取的数据,并对该待切换主端口进行配置。S132. Obtain the data of the to-be-switched primary port from the redundant port data that is backed up by the database, add the acquired data to the to-be-switched primary port, and configure the to-be-switched primary port.
可选地,在本实施例中,还可以预先配置处理函数,通过回调所述处理函数执行端口数据的删除和添加。本实施例中的处理函数例如包括添加函数和删除函数,也还可以包括其他在端口切换过程中需要的函数,在此不再一一举例说明。 Optionally, in this embodiment, the processing function may also be pre-configured, and the deletion and addition of the port data is performed by calling back the processing function. The processing function in this embodiment includes, for example, an add function and a delete function, and may also include other functions required in the port switching process, which will not be exemplified herein.
本实施例提供的冗余端口的切换方法,在进行端口切换时,将冗余端口的数据删除,从数据库预先备份的数据中,获取待切换主端口的数据,为该待切换主端口添加所获取的数据,并对该待切换主端口进行配置。本实施例中的待切换主端口的数据为出现故障的端口的配置数据,通过获取到这部分数据,使得端口切换过程简单,快速。The switching method of the redundant port provided in this embodiment is to delete the data of the redundant port when the port is switched, and obtain the data of the primary port to be switched from the data backed up by the database, and add the Obtain the data and configure the primary port to be switched. The data of the primary port to be switched in this embodiment is the configuration data of the failed port. By obtaining the data, the port switching process is simple and fast.
可选地,如图4所示,为本发明实施例提供的再一种冗余端口的切换方法的流程示意图。在图1所示实施例的基础上,本实施例提供的冗余端口的切换方法,在S110之前还可以包括如下步骤,即S100~S101:Optionally, as shown in FIG. 4, it is a schematic flowchart of a method for switching a redundant port according to an embodiment of the present invention. On the basis of the embodiment shown in FIG. 1 , the method for switching the redundant port provided in this embodiment may further include the following steps, that is, S100 to S101 before S110:
S100,配置绑定协议,并获取待备份的关键字段;S100: Configure a binding protocol, and obtain a key segment to be backed up;
S101,确定该关键字段对应的数据,并将该关键字段对应的数据备份到数据库中。S101. Determine data corresponding to the key field, and back up data corresponding to the key field to a database.
在本实施例中,在冗余切换客户端配置绑定协议,指定待备份的关键字段,该关键字段例如为“ZESR”(即中兴以太网交换环,ZTE Ethernet Switch Ring),可以对端口上的MAC做备份,如果是VRRP,可对ARP表项做备份。在实际应用中,初始化快速切换数据库,根据命令行配置来完成数据库的初始化,关键字段包括但不限于实例号、VLAN、冗余端口链表、主端口号和命令行指定的数据等,初始化数据切换下发的回调函数,根据客户端配置的信息,挂接相应的处理函数,当进行冗余端口数据切换时,调用回调完成相关数据的删除添加。例如,要修改MAC表,可以挂接MAC模块提供的MAC维护处理函数。根据命令行配置,判断是侦听协议报文,还是同步当前设备表项。侦听主备之前的协议报文,解析出报文中的关键字段,写入数据库,例如为VRRP,主备之间的ARP报文。还可以将当前设备上的现有表项同步到数据库中,如将冗余端口上的MAC同步到数据库中。通过预先将端口数据备份至数据库,使得在端口切换时,只需发送切换消息,就可以完成流量的切换,使得端口切换过程中数据无需主设备向其他设备同步N条MAC或ARP报文,不会导致报文丢失的情况。In this embodiment, the binding protocol is configured on the redundancy switching client, and the key segment to be backed up is specified, for example, the ZESR (ZTE Ethernet Switch Ring), which can be The MAC address of the port is backed up. If it is VRRP, you can back up the ARP entries. In the actual application, the database is initialized and the database is initialized according to the command line configuration. The key fields include but are not limited to the instance number, the VLAN, the redundant port list, the main port number, and the data specified by the command line. The callback function that is sent is switched, and the corresponding processing function is hooked according to the information configured by the client. When the redundant port data is switched, the callback is called to complete the deletion of the related data. For example, to modify the MAC table, you can attach the MAC maintenance processing function provided by the MAC module. According to the command line configuration, it is determined whether to listen to the protocol packet or synchronize the current device entry. Listens to the protocol packets before and after the master and backup, and parses the key fields in the packets and writes them to the database. For example, VRRP, ARP packets between the master and the backup. It is also possible to synchronize existing entries on the current device to the database, such as synchronizing the MAC on the redundant port to the database. By backing up the port data to the database in advance, you can switch the traffic when the port is switched, so that the data does not need to be synchronized by the master device to other devices to synchronize N MAC or ARP packets. This can result in loss of messages.
为了更好的理解本发明实施例提供的冗余端口的切换方法,如图5所示,为本发明实施例提供的冗余端口的切换方法的一种工作原理的示意图。本实施例提供的冗余端口的切换方法的工作原理为: For a better understanding of the method for switching the redundant port provided by the embodiment of the present invention, as shown in FIG. 5, it is a schematic diagram of a working principle of a method for switching a redundant port according to an embodiment of the present invention. The working principle of the switching method of the redundant port provided in this embodiment is:
在配置了二层冗余协议的设备的下行端口上使能冗余切换服务端,如图5所示,该下行端口包括:port1_1,port2_1,port3_1,在二层接入设备D的上行端口上使能冗余切换客户端,该二层接入设备D的上行端口包括:port1_2,port2_2,port3_2,该二层接入设备D上,对冗余切换端口上的表项或是收到的报文解析后保存到快速切换数据库中,因为设备A,设备B和设备C这三个设备是做冗余的,所以只有一个是主设备,可以连接外网。当冗余协议发现链路有问题需要做链路切换时,通常地,BFD可以在几毫秒内发现链路问题,被选出的新主设备会向二层接入设备D发送切换消息,最后,设备D将其它两个端口的信息清除,然后,从数据库中将备份的冗余信息恢复到新的主端口上。显然地,本发明实施例提供的冗余端口的切换方法加速了新的主端口上重新学习的过程,避免了MAC漂移和数据中断。The redundancy switching server is enabled on the downlink port of the device configured with the Layer 2 redundancy protocol. As shown in Figure 5, the downlink port includes port1_1, port2_1, and port3_1 on the uplink port of the Layer 2 access device D. The redundancy switching client is enabled. The uplink port of the Layer 2 access device D includes: port1_2, port2_2, port3_2, and the entry on the redundant switching port or the received packet on the Layer 2 access device D. After the file is parsed, it is saved to the fast switch database. Because device A, device B and device C are redundant, only one device is the master device and can be connected to the external network. When the redundancy protocol finds that there is a problem with the link and needs to perform link switching, the BFD can discover the link problem within a few milliseconds. The selected new master device sends a switch message to the Layer 2 access device D. Finally, Device D clears the information of the other two ports, and then restores the redundant information of the backup from the database to the new primary port. Obviously, the method for switching redundant ports provided by the embodiments of the present invention accelerates the process of re-learning on the new primary port, avoiding MAC drift and data interruption.
本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速同步到新的主端口上,从而实现了二层冗余高质量的快速切换。In the embodiment of the present invention, the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
本发明还提供一种冗余端口的切换装置。The invention also provides a switching device for a redundant port.
如图6所示,为本发明实施例提供的一种冗余端口的切换装置的结构示意图。本实施例提供的冗余端口的切换装置可以包括:接收模块10、获取模块20、解析模块30、确定模块40和切换模块50。FIG. 6 is a schematic structural diagram of a switching device for a redundant port according to an embodiment of the present invention. The switching device of the redundant port provided by this embodiment may include: a receiving module 10, an obtaining module 20, a parsing module 30, a determining module 40, and a switching module 50.
其中,接收模块10,设置为:当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令。The receiving module 10 is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server.
在本实施例中,提供一种设备的二层冗余系统,该二层冗余系统用于管理网络中的设备端口,本实施例中的网络可以为局域网,也还可以是其他网络。设备的二层冗余系统可以正常工作,通常可以分为二层冗余协议,路径检测协议,以及MAC或ARP的学习,例如通过二层冗余协议来处理冗余检测和主备倒换,通过路径检测可以快速检测链路状态,通知冗余协议处理模块,做到快速切换;端口切换后,在备份端口重新学习MAC或对应的ARP处理。本发明实施例提供的冗余端口的切换方法的主要实现方式是对MAC或ARP学习部分的处理。 In this embodiment, a Layer 2 redundancy system is provided. The Layer 2 redundancy system is used to manage device ports in the network. The network in this embodiment may be a local area network or other network. The Layer 2 redundancy system of the device can work normally. It can be divided into Layer 2 redundancy protocol, path detection protocol, and MAC or ARP learning. For example, the Layer 2 redundancy protocol is used to handle redundancy detection and active/standby switching. The path detection can quickly detect the link status, notify the redundancy protocol processing module, and perform fast switching. After the port is switched, the MAC address or the corresponding ARP processing is re-learned on the backup port. The main implementation manner of the handover method of the redundant port provided by the embodiment of the present invention is the processing of the MAC or ARP learning part.
在本实施例,提供冗余切换客户端,配置在主设备上,或者其他接入设备上,执行冗余端口上数据的切换;冗余切换服务端,配置在主设备上,执行主备倒换信息的下发;冗余快速切换数据库,提供数据库的接口,执行创建、添加和删除操作,用来保存备份的冗余数据。In this embodiment, a redundant switching client is provided, configured on the primary device, or on another access device, to perform data switching on the redundant port; the redundant switching server is configured on the primary device to perform an active/standby switchover. The information is delivered; the redundancy fast switches the database, provides the interface of the database, and performs creation, addition, and deletion operations to save the redundant data of the backup.
当冗余协议发现链路有问题时,需要执行链路切换操作,冗余协议需要发生主备倒换,由冗余切换服务端发送冗余端口切换指令,通知端口的切换;冗余切换客户端接收冗余切换服务端发送的冗余端口切换指令,在接收到冗余端口切换指令后,触发冗余端口上数据的切换。When the redundancy protocol finds that there is a problem with the link, the link switching operation needs to be performed. The redundancy protocol needs to perform the active/standby switchover. The redundant switch server sends the redundant port switch command to notify the port to switch. The redundant switch client. Receiving a redundant port switching instruction sent by the redundant switching server, triggering data switching on the redundant port after receiving the redundant port switching instruction.
获取模块20,设置为:获取接收模块10接收的冗余端口切换指令对应的切换消息。The obtaining module 20 is configured to: acquire a switching message corresponding to the redundant port switching instruction received by the receiving module 10.
解析模块30,设置为:解析获取模块20获取的切换消息;The parsing module 30 is configured to: parse the switching message acquired by the obtaining module 20;
确定模块40,设置为:根据解析模块30解析得到的解析后的切换消息确定待切换主端口。The determining module 40 is configured to: determine, according to the parsed switching message parsed by the parsing module 30, the main port to be switched.
在本实施例中,在接收到冗余切换服务端发送的冗余端口切换指令后,获取该冗余端口切换指令对应的切换消息,该切换消息可以包括主端口号和VLAN。当冗余切换客户端和冗余切换服务端不在同一个设备上时,冗余切换服务端要组包生成一个数据切换报文,该数据切换报文中制定了实例号,该实例号中包括:是否为主的标志位,向指定端口,VLAN发送,这里的端口和VLAN在配置服务端时是指定好的。In this embodiment, after receiving the redundant port switching instruction sent by the redundant switching server, the switching message corresponding to the redundant port switching instruction is obtained, and the switching message may include a primary port number and a VLAN. When the redundant switching client and the redundant switching server are not on the same device, the redundant switching server generates a data switching message, and the instance number is included in the data switching message. : Whether the primary flag is sent to the specified port, VLAN, where the port and VLAN are specified when configuring the server.
可选地,在本发明实施例中,可以预先配置端口快速切换功能,配置在冗余端口和与主设备连接的端口上,在冗余切换服务端与冗余切换客户端配置相同的实例,用来区分不同的快速切换,冗余切换服务端根据实例可以找到冗余切换客户端的位置,当冗余切换服务端下发切换消息后,携带指定实例号和冗余切换客户端的位置信息,冗余切换客户端会根据该实例号执行相同实例中的多个冗余端口的切换。Optionally, in the embodiment of the present invention, the port fast switching function may be pre-configured, configured on the redundant port and the port connected to the master device, and the same instance is configured on the redundant switching server and the redundant switching client. It is used to distinguish between different fast handovers. The redundant handover server can find the location of the redundant handover client according to the instance. When the redundant handover server delivers the handover message, it carries the specified instance number and the location information of the redundant handover client. The switching client performs switching of multiple redundant ports in the same instance according to the instance number.
切换模块50,设置为:从数据库预先备份的冗余端口数据中获取确定模块40确定出的待切换主端口的数据,为待切换主端口配置所获取的数据,并从当前冗余端口切换至待切换主端口。 The switching module 50 is configured to: obtain data of the primary port to be switched determined by the determining module 40 from the redundant port data that is backed up by the database, configure the acquired data for the primary port to be switched, and switch from the current redundant port to the current redundant port. The primary port to be switched.
在本实施例中,在获取到待切换主端口后,从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为该待切换主端口配置所获取的数据,并从当前冗余端口切换至待切换主端口。本实施例通过为待切换主端口从数据库获取预先备份的数据,来执行端口的切换,使得端口切换速度提升,且效率提高。In this embodiment, after acquiring the primary port to be switched, the data of the primary port to be switched is obtained from the redundant port data pre-backed up by the database, and the acquired data is configured for the primary port to be switched, and is currently redundant. The remaining ports are switched to the primary port to be switched. In this embodiment, the port switching is performed by acquiring the pre-backup data from the database for the primary port to be switched, so that the port switching speed is improved and the efficiency is improved.
可选地,本发明实施例中的解析模块30,是设置为:解析获取模块20获取的切换消息4得到解析后的切换消息,该解析后的切换消息包括实例号。Optionally, the parsing module 30 in the embodiment of the present invention is configured to: the parsing message obtained by the parsing obtaining module 20 is parsed, and the parsed switching message includes an instance number.
相应地,本实例中的确定模块40,是设置为:根据解析模块30得到的实例号查找数据库,查找出相同实例号对应的一组冗余端口和待切换主端口。Correspondingly, the determining module 40 in the present example is configured to: according to the instance number search database obtained by the parsing module 30, find a set of redundant ports corresponding to the same instance number and the main port to be switched.
在本实施例中,在接收到切换消息后,解析得到实例号,该实例号例如包括新端口号和VLAN,从而可以根据实例号查找数据库,查找出相同实例号对应的一组冗余端口和待切换主端口。In this embodiment, after receiving the handover message, the instance number is obtained, and the instance number includes, for example, a new port number and a VLAN, so that the database can be searched according to the instance number, and a set of redundant ports corresponding to the same instance number are found. The primary port to be switched.
可选地,如图7所示,为本发明实施例提供的冗余端口的切换装置中一种切换模块的结构示意图。本实施例中的切换模块50可以包括:删除单元51和切换单元52;Optionally, FIG. 7 is a schematic structural diagram of a switching module in a switching device of a redundant port according to an embodiment of the present invention. The switching module 50 in this embodiment may include: a deleting unit 51 and a switching unit 52;
其中,删除单元51,设置为:删除冗余端口的数据;The deleting unit 51 is configured to: delete data of the redundant port;
切换单元52,设置为:从数据库预先备份的冗余端口数据中获取确定模块40确定出的待切换主端口的数据,为该待切换主端口添加所获取的数据,并对待切换主端口进行配置。The switching unit 52 is configured to: obtain the data of the primary port to be switched determined by the determining module 40 from the redundant port data that is backed up by the database, add the acquired data to the primary port to be switched, and configure the primary port to be switched. .
可选地,本实施例中的切换模块还可以50包括:配置单元53,设置为:预先配置处理函数;Optionally, the switching module in the embodiment may further include: a configuration unit 53 configured to: pre-configure a processing function;
相应地,本实施例中的切换单元52,还设置为:通过回调配置单元53配置的处理函数执行端口数据的删除和添加。本实施例中的处理函数例如包括添加函数和删除函数,也还可以包括其他在端口切换过程中需要的函数,在此不再一一举例说明。Correspondingly, the switching unit 52 in this embodiment is further configured to perform deletion and addition of port data by the processing function configured by the callback configuration unit 53. The processing function in this embodiment includes, for example, an add function and a delete function, and may also include other functions required in the port switching process, which will not be exemplified herein.
本实施例提供的冗余端口的切换装置,在切换模块50进行端口切换时, 将冗余端口的数据删除,从数据库预先备份的数据中,获取待切换主端口的数据,为该待切换主端口添加所获取的数据,并对该待切换主端口进行配置。本实施例中的待切换主端口的数据为出现故障的端口的配置数据,通过获取到这部分数据,使得端口切换过程简单,快速。The switching device of the redundant port provided by this embodiment, when the switching module 50 performs port switching, The data of the redundant port is deleted, and the data of the primary port to be switched is obtained from the data that is backed up by the database, and the acquired data is added to the primary port to be switched, and the primary port to be switched is configured. The data of the primary port to be switched in this embodiment is the configuration data of the failed port. By obtaining the data, the port switching process is simple and fast.
可选地,如图8所示,为本发明实施例提供的另一种冗余端口的切换装置的结构示意图。在图6所示装置的结构基础上,本实施例提供的冗余端口的切换装置还可以包括备份模块60;Optionally, as shown in FIG. 8 , it is a schematic structural diagram of another switching device for a redundant port according to an embodiment of the present invention. The switching device of the redundant port provided by this embodiment may further include a backup module 60;
其中,配置单元53,还设置为:配置绑定协议;The configuration unit 53 is further configured to: configure a binding protocol;
获取模块20,还设置为:获取待备份的关键字段;The obtaining module 20 is further configured to: obtain a key segment to be backed up;
确定模块40,还设置为:确定获取模块20获取的关键字段对应的数据;The determining module 40 is further configured to: determine data corresponding to the key segment acquired by the obtaining module 20;
备份模块60,设置为:将确定模块40确定出的关键字段对应的数据备份到数据库中。The backup module 60 is configured to: back up the data corresponding to the key segment determined by the determining module 40 into the database.
在本实施例中,在冗余切换客户端配置绑定协议,指定待备份的关键字段,该关键字段例如为“ZESR”,可以对端口上的MAC做备份,如果是VRRP,可对ARP表项做备份。在实际应用中,初始化快速切换数据库,根据命令行配置来完成数据库的初始化,关键字段包括但不限于实例号、VLAN、冗余端口链表、主端口号和命令行指定的数据等,初始化数据切换下发的回调函数,根据客户端配置的信息,挂接相应的处理函数,当进行冗余端口数据切换时,调用回调完成相关数据的删除添加。例如,要修改MAC表,可以挂接MAC模块提供的MAC维护处理函数。根据命令行配置,判断是侦听协议报文,还是同步当前设备表项。侦听主备之前的协议报文,解析出报文中的关键字段,写入数据库,例如为VRRP,主备之间的ARP报文。还可以将当前设备上的现有表项同步到数据库中,如将冗余端口上的MAC同步到数据库中。通过预先将端口数据备份至数据库,使得在端口切换时,只需发送切换消息,就可以完成流量的切换,使得端口切换过程中数据无需主设备向其他设备同步N条MAC或ARP报文,不会导致报文丢失的情况。In this embodiment, the binding protocol is configured on the redundancy switching client, and the key segment to be backed up is specified. For example, the key segment is “ZESR”, and the MAC address on the port can be backed up. If it is VRRP, it can be ARP entries are backed up. In the actual application, the database is initialized and the database is initialized according to the command line configuration. The key fields include but are not limited to the instance number, the VLAN, the redundant port list, the main port number, and the data specified by the command line. The callback function that is sent is switched, and the corresponding processing function is hooked according to the information configured by the client. When the redundant port data is switched, the callback is called to complete the deletion of the related data. For example, to modify the MAC table, you can attach the MAC maintenance processing function provided by the MAC module. According to the command line configuration, it is determined whether to listen to the protocol packet or synchronize the current device entry. Listens to the protocol packets before and after the master and backup, and parses the key fields in the packets and writes them to the database. For example, VRRP, ARP packets between the master and the backup. It is also possible to synchronize existing entries on the current device to the database, such as synchronizing the MAC on the redundant port to the database. By backing up the port data to the database in advance, you can switch the traffic when the port is switched, so that the data does not need to be synchronized by the master device to other devices to synchronize N MAC or ARP packets. This can result in loss of messages.
为了更好的理解本发明实施例提供的冗余端口的切换方法,同样可以参 考图5所示工作原理示意图。本实施例提供的冗余端口的切换装置的工作原理为:In order to better understand the switching method of the redundant port provided by the embodiment of the present invention, the same can be referred to. Take a schematic diagram of the working principle shown in Figure 5. The working principle of the switching device of the redundant port provided in this embodiment is:
在配置了二层冗余协议的设备的下行端口上使能冗余切换服务端,如图5所示,该下行端口包括:port1_1,port2_1,port3_1,在二层接入设备D的上行端口上使能冗余切换客户端,该二层接入设备D的上行端口包括:port1_2,port2_2,port3_2,该二层接入设备D上,对冗余切换端口上的表项或是收到的报文解析后保存到快速切换数据库中,因为设备A,设备B和设备C这三个设备是做冗余的,所以只有一个是主设备,可以连接外网。当冗余协议发现链路有问题需要做链路切换时,通常地,BFD可以在几毫秒内发现链路问题,被选出的新主设备会向二层接入设备D发送切换消息,最后,设备D将其它两个端口的信息清除,然后,从数据库中将备份的冗余信息恢复到新的主端口上。显然地,本发明实施例提供的冗余端口的切换方法加速了新的主端口上重新学习的过程,避免了MAC漂移和数据中断。The redundancy switching server is enabled on the downlink port of the device configured with the Layer 2 redundancy protocol. As shown in Figure 5, the downlink port includes port1_1, port2_1, and port3_1 on the uplink port of the Layer 2 access device D. The redundancy switching client is enabled. The uplink port of the Layer 2 access device D includes: port1_2, port2_2, port3_2, and the entry on the redundant switching port or the received packet on the Layer 2 access device D. After the file is parsed, it is saved to the fast switch database. Because device A, device B and device C are redundant, only one device is the master device and can be connected to the external network. When the redundancy protocol finds that there is a problem with the link and needs to perform link switching, the BFD can discover the link problem within a few milliseconds. The selected new master device sends a switch message to the Layer 2 access device D. Finally, Device D clears the information of the other two ports, and then restores the redundant information of the backup from the database to the new primary port. Obviously, the method for switching redundant ports provided by the embodiments of the present invention accelerates the process of re-learning on the new primary port, avoiding MAC drift and data interruption.
本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速同步到新的主端口上,从而实现了二层冗余高质量的快速切换。In the embodiment of the present invention, the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
本发明实施例还提出一种终端,该终端包括处理器,该处理器设置为:当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;获取冗余端口切换指令对应的切换消息,并解析该切换消息,根据解析后的切换消息确定待切换主端口;从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,为该待切换主端口配置所获取的数据,并从当前冗余端口切换至该待切换主端口。本发明实施例提供的终端包括但不限于计算机等电子设备。本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速同步到新的主端口上,从而实现了二层冗余高质量的快速切换。The embodiment of the present invention further provides a terminal, where the terminal includes a processor, and the processor is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server; Redundant port switching instruction corresponding to the switching message, and parsing the switching message, determining the to-be-switched primary port according to the parsed switching message; obtaining the data of the to-be-switched primary port from the redundant port data pre-backed up by the database, Switch the data acquired by the primary port configuration and switch from the current redundant port to the primary port to be switched. The terminal provided by the embodiment of the present invention includes but is not limited to an electronic device such as a computer. In the embodiment of the present invention, the data in the redundant networking is backed up, and when the redundant switching occurs, the information on the faulty port can be quickly synchronized to the new primary port, thereby realizing the high-quality fastness of the Layer 2 redundancy. Switch.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(根据系统、设备、装置、器件等)执 行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium on a corresponding hardware platform (according to Systems, equipment, devices, devices, etc.) The lines, when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve.
上述实施例中的装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When the device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性Industrial applicability
本发明实施例通过对冗余协议的检测,在侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令,获取该冗余端口切换指令对应的切换消息,通过解析该切换消息确定待切换主端口,并从数据库预先备份的冗余端口数据中获取该待切换主端口的数据,从而为待切换主端口配置所获取的数据,并执行从当前冗余端口切换至待切换主端口的操作;本发明实施例通过对冗余组网中的数据进行备份,在发生冗余切换时,可以将故障端口上的信息快速的同步到新的主端口上,从而实现了二层冗余高质量的快速切换。 In the embodiment of the present invention, when detecting that the redundancy protocol enters the active/standby switchover, the redundant port switching instruction sent by the redundant switching server is received, and the switching message corresponding to the redundant port switching instruction is obtained. The main port to be switched is determined by parsing the switching message, and the data of the main port to be switched is obtained from the redundant port data pre-backuped by the database, thereby configuring the acquired data for the main port to be switched, and performing current redundancy. The operation of the port is switched to the operation of the primary port to be switched. In the embodiment of the present invention, the data in the redundant network is backed up, and the information on the faulty port can be quickly synchronized to the new primary port when the redundant switchover occurs. Thereby achieving a high-quality fast switching of the two-layer redundancy.

Claims (10)

  1. 一种冗余端口的切换方法,包括:A method for switching redundant ports includes:
    当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;Receiving a redundant port switching instruction sent by the redundant switching server when detecting that the redundancy protocol enters the active/standby switchover;
    获取所述冗余端口切换指令对应的切换消息,并解析所述切换消息,根据解析后的切换消息确定待切换主端口;Obtaining a handover message corresponding to the redundant port switching instruction, and parsing the handover message, and determining, according to the parsed handover message, a primary port to be switched;
    从数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,并从当前冗余端口切换至所述待切换主端口。Obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, configuring the acquired data for the to-be-switched primary port, and switching from the current redundant port to the to-be-switched primary port.
  2. 根据权利要求1所述的冗余端口的切换方法,其中,所述获取所述冗余端口切换指令对应的切换消息,并解析所述切换消息,根据解析后的切换消息确定待切换主端口,包括:The method for switching a redundant port according to claim 1, wherein the acquiring a handover message corresponding to the redundant port switching instruction, and parsing the handover message, determining, according to the parsed handover message, a primary port to be switched, include:
    获取所述冗余端口切换指令对应的所述切换消息,并解析所述切换消息得到所述解析后的切换消息,所述解析后的切换消息包括实例号;Acquiring the handover message corresponding to the redundant port switching instruction, and parsing the handover message to obtain the parsed handover message, where the parsed handover message includes an instance number;
    根据所述实例号查找数据库,查找出相同实例号对应的一组冗余端口和所述待切换主端口。The database is searched according to the instance number, and a set of redundant ports corresponding to the same instance number and the to-be-switched primary port are found.
  3. 根据权利要求1所述的冗余端口的切换方法,其中,所述从数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,包括:The method for switching a redundant port according to claim 1, wherein the data of the to-be-switched primary port is obtained from the redundant port data pre-backed up by the database, and the acquired data is configured for the to-be-switched primary port. ,include:
    删除所述冗余端口的数据;Deleting data of the redundant port;
    从所述数据库预先备份的冗余端口数据中获取所述待切换主端口的数据,为所述待切换主端口添加所获取的数据,并对所述待切换主端口进行配置。Obtaining the data of the to-be-switched primary port from the redundant port data that is backed up by the database, adding the acquired data to the to-be-switched primary port, and configuring the to-be-switched primary port.
  4. 根据权利要求3所述的冗余端口的切换方法,还包括:The method for switching a redundant port according to claim 3, further comprising:
    预先配置处理函数;Pre-configured handlers;
    通过回调所述处理函数执行端口数据的删除和添加。The deletion and addition of port data is performed by calling back the processing function.
  5. 根据权利要求1至4任一项所述的冗余端口的切换方法,其中,所述接 收冗余切换服务端发送的冗余端口切换指令之前,所述方法还包括:The method for switching a redundant port according to any one of claims 1 to 4, wherein said Before receiving the redundant port switching instruction sent by the redundant switching server, the method further includes:
    配置绑定协议,并获取待备份的关键字段;Configure a binding protocol and obtain the key fields to be backed up.
    确定所述关键字段对应的数据,并将所述关键字段对应的数据备份到所述数据库中。Determining data corresponding to the key field, and backing up data corresponding to the key field to the database.
  6. 一种冗余端口的切换装置,包括:A switching device for a redundant port, comprising:
    接收模块,设置为:当侦测到冗余协议进入主备倒换时,接收冗余切换服务端发送的冗余端口切换指令;The receiving module is configured to: when detecting that the redundancy protocol enters the active/standby switchover, receive a redundant port switching instruction sent by the redundant switching server;
    获取模块,设置为:获取所述接收模块接收的所述冗余端口切换指令对应的切换消息;An acquiring module, configured to: acquire a switching message corresponding to the redundant port switching instruction received by the receiving module;
    解析模块,设置为:解析所述获取模块获取的所述切换消息;a parsing module, configured to: parse the switching message obtained by the acquiring module;
    确定模块,设置为:根据所述解析模块解析得到的解析后的切换消息确定待切换主端口;a determining module, configured to: determine, according to the parsed switching message parsed by the parsing module, the main port to be switched;
    切换模块,设置为:从数据库预先备份的冗余端口数据中获取所述确定模块确定出的所述待切换主端口的数据,为所述待切换主端口配置所获取的数据,并从当前冗余端口切换至所述待切换主端口。The switching module is configured to: obtain the data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, configure the acquired data for the to-be-switched primary port, and The remaining port is switched to the to-be-switched primary port.
  7. 根据权利要求6所述的冗余端口的切换装置,其中,所述解析模块,是设置为:解析所述获取模块获取的所述切换消息得到所述解析后的切换消息,所述解析后的切换消息包括实例号;The apparatus for switching redundant ports according to claim 6, wherein the parsing module is configured to: parse the switching message acquired by the acquiring module to obtain the parsed switching message, and the parsed The switching message includes an instance number;
    所述确定模块,是设置为:根据所述解析模块得到的所述实例号查找数据库,查找出相同实例号对应的一组冗余端口和所述待切换主端口。The determining module is configured to: according to the instance number search database obtained by the parsing module, find a set of redundant ports corresponding to the same instance number and the to-be-switched main port.
  8. 根据权利要求6所述的冗余端口的切换装置,其中,所述切换模块包括:The switching device of the redundant port according to claim 6, wherein the switching module comprises:
    删除单元,设置为:删除所述冗余端口的数据;Delete the unit, set to: delete the data of the redundant port;
    切换单元,设置为:从所述数据库预先备份的冗余端口数据中获取所述确定模块确定出的所述待切换主端口的数据,为所述待切换主端口添加所获取的数据,并对所述待切换主端口进行配置。a switching unit, configured to: obtain data of the to-be-switched primary port determined by the determining module from the redundant port data that is backed up by the database, and add the acquired data to the to-be-switched primary port, and The primary port to be switched is configured.
  9. 根据权利要求8所述的冗余端口的切换装置,其中,所述切换模块, 还包括:The switching device of the redundant port according to claim 8, wherein the switching module, Also includes:
    配置单元,设置为:预先配置处理函数;The configuration unit is set to: pre-configure the processing function;
    所述切换单元,还设置为:通过回调所述配置单元配置的所述处理函数执行端口数据的删除和添加。The switching unit is further configured to perform deletion and addition of port data by calling back the processing function configured by the configuration unit.
  10. 根据权利要求9所述的冗余端口的切换装置,还包括:备份模块;The switching device of the redundant port according to claim 9, further comprising: a backup module;
    所述配置单元,还设置为:配置绑定协议;The configuration unit is further configured to: configure a binding protocol;
    所述获取模块,还设置为:获取待备份的关键字段;The obtaining module is further configured to: obtain a key segment to be backed up;
    所述确定模块,还设置为:确定所述获取模块获取的所述关键字段对应的数据;The determining module is further configured to: determine data corresponding to the key segment acquired by the acquiring module;
    所述备份模块,设置为:将所述确定模块确定出的所述关键字段对应的数据备份到所述数据库中。 The backup module is configured to: back up data corresponding to the key segment determined by the determining module to the database.
PCT/CN2016/087987 2015-07-10 2016-06-30 Method of switching redundancy port and device utilizing same WO2017008641A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510404728.5 2015-07-10
CN201510404728.5A CN106341249A (en) 2015-07-10 2015-07-10 Redundant port switching method and device

Publications (1)

Publication Number Publication Date
WO2017008641A1 true WO2017008641A1 (en) 2017-01-19

Family

ID=57758352

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/087987 WO2017008641A1 (en) 2015-07-10 2016-06-30 Method of switching redundancy port and device utilizing same

Country Status (2)

Country Link
CN (1) CN106341249A (en)
WO (1) WO2017008641A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109787790A (en) * 2017-11-10 2019-05-21 中兴通讯股份有限公司 Communication means, equipment and storage medium based on dual link management mouth
CN110572318A (en) * 2019-09-29 2019-12-13 迈普通信技术股份有限公司 Main/standby switching method and router
CN114745352A (en) * 2022-03-31 2022-07-12 新华三技术有限公司合肥分公司 Message forwarding method and device
CN115134213A (en) * 2021-03-25 2022-09-30 中国移动通信集团安徽有限公司 Disaster recovery method, device, equipment and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110635928B (en) * 2018-06-21 2022-09-30 中兴通讯股份有限公司 Control method, control device and computer storage medium
CN110661702B (en) * 2018-06-28 2022-09-13 中兴通讯股份有限公司 Link backup method and device and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006011689A1 (en) * 2004-07-30 2006-02-02 Nec Corporation Network system, node, node control program, and network control method
CN101001165A (en) * 2006-01-11 2007-07-18 大唐移动通信设备有限公司 Network failure recovery method with redundancy port
CN102006268A (en) * 2009-08-28 2011-04-06 华为技术有限公司 Method, equipment and system for switching main interface and standby interface
CN102025476A (en) * 2009-09-23 2011-04-20 中兴通讯股份有限公司 Method for realizing user port positioning in BRAS (Broadband Remote Access Server) multicomputer backup scene and network system
CN103441938A (en) * 2013-08-28 2013-12-11 南车株洲电力机车研究所有限公司 Port switching method and communication equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100407619C (en) * 2003-11-18 2008-07-30 中兴通讯股份有限公司 Method for implementing switching between main and standby port by network processor
CN1848841A (en) * 2005-04-05 2006-10-18 华为技术有限公司 Route equipment backup method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006011689A1 (en) * 2004-07-30 2006-02-02 Nec Corporation Network system, node, node control program, and network control method
CN101001165A (en) * 2006-01-11 2007-07-18 大唐移动通信设备有限公司 Network failure recovery method with redundancy port
CN102006268A (en) * 2009-08-28 2011-04-06 华为技术有限公司 Method, equipment and system for switching main interface and standby interface
CN102025476A (en) * 2009-09-23 2011-04-20 中兴通讯股份有限公司 Method for realizing user port positioning in BRAS (Broadband Remote Access Server) multicomputer backup scene and network system
CN103441938A (en) * 2013-08-28 2013-12-11 南车株洲电力机车研究所有限公司 Port switching method and communication equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109787790A (en) * 2017-11-10 2019-05-21 中兴通讯股份有限公司 Communication means, equipment and storage medium based on dual link management mouth
CN109787790B (en) * 2017-11-10 2022-04-15 中兴通讯股份有限公司 Communication method, device and storage medium based on double-link management port
CN110572318A (en) * 2019-09-29 2019-12-13 迈普通信技术股份有限公司 Main/standby switching method and router
CN115134213A (en) * 2021-03-25 2022-09-30 中国移动通信集团安徽有限公司 Disaster recovery method, device, equipment and storage medium
CN115134213B (en) * 2021-03-25 2023-09-05 中国移动通信集团安徽有限公司 Disaster recovery method, device, equipment and storage medium
CN114745352A (en) * 2022-03-31 2022-07-12 新华三技术有限公司合肥分公司 Message forwarding method and device
CN114745352B (en) * 2022-03-31 2024-02-09 新华三技术有限公司合肥分公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN106341249A (en) 2017-01-18

Similar Documents

Publication Publication Date Title
US10567340B2 (en) Data center system
WO2017008641A1 (en) Method of switching redundancy port and device utilizing same
US9143444B2 (en) Virtual link aggregation extension (VLAG+) enabled in a TRILL-based fabric network
US9036638B2 (en) Avoiding unknown unicast floods resulting from MAC address table overflows
US9716616B2 (en) Active IP forwarding in an event driven virtual link aggregation (vLAG) system
WO2021088808A1 (en) Method for dual-homing device access traffic forwarding, device, and storage medium
EP3367619A1 (en) Synchronizing multicast state between multi-homed routers in an ethernet virtual private network
CN111865779B (en) Route synchronization method and cross-device link aggregation group
US9525591B2 (en) Relay system and switching device
EP2996287B1 (en) Method for notifying information of pe device and pe device
US10764119B2 (en) Link handover method for service in storage system, and storage device
US9385944B2 (en) Communication system, path switching method and communication device
CN112565046B (en) Synchronizing multicast router capabilities
CN108173691B (en) Cross-device aggregation method and device
EP3316555B1 (en) Mac address synchronization method, device and system
US8976644B2 (en) Multicast traffic forwarding on pruned interface
CN103118148A (en) Method and device for updating ARP (address resolution protocol) cache
CN102647304A (en) Synchronizing method of address resolution protocols and device
JP2021529454A (en) Loop avoidance communication method, loop avoidance communication device and loop avoidance communication system
WO2016124117A1 (en) Method, switching device and network controller for protecting links in software-defined network (sdn)
US9372708B2 (en) Synchronizing multicast groups
US9036634B2 (en) Multicast route entry synchronization
US20150055662A1 (en) Internet group management protocol (igmp) leave message processing synchronization
JP2007208502A (en) Communication system, backup router, redundant processing program thereof, and redundant processing method thereof
Weibel Tutorial on parallel redundancy protocol (PRP)

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: 16823788

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16823788

Country of ref document: EP

Kind code of ref document: A1