A method, device, apparatus and storage medium for data synchronization of a switch
Patent Information
- Application Number
- CN202310096852.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-18
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-01-18
AI Technical Summary
这种数据同步方式配置繁琐,对各台交换机之间的连通性要求较高
[0020]用于存储处理器可执行指令的存储器;
Smart Images

Figure CN116032410B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this application relate to the field of computers, and more particularly to a method, apparatus, device and storage medium for data synchronization of a switch. Background Technology
[0002] In an NVMe over RoCEv2 network, there are three main roles: initiator (also known as host), switch, and target (also known as storage). Initiators and targets are also called endpoint devices. The initiator is responsible for using storage services, while the target is responsible for providing those services. Initiators and targets transmit data across the network using the NVMe over RoCEv2 protocol, thus providing high-performance storage services.
[0003] Control optimization for NVMe over RoCEv2 networks requires the joint implementation of hosts, switches, and storage to achieve two functions: plug-and-play and rapid fault detection. The plug-and-play function requires that when a device connects to the network, the access switch can automatically discover the device, then synchronize this access information to other switches in the network and notify hosts subscribed to notification messages within the IP service domain. This allows the hosts to recognize the access device and automatically establish a service connection between the access device and the storage according to the IP service domain configuration. The rapid fault detection function requires that when a network failure occurs, the switch can quickly detect the fault status, then synchronize this information to other switches in the network and notify hosts subscribed to notification messages within the IP service domain. This allows the hosts to identify whether the network failure affects the storage device; if so, they quickly disconnect the service connection from the storage and rapidly switch the corresponding services to redundant paths using multi-path software.
[0004] Therefore, achieving data synchronization between multiple switches is crucial. In related technologies, the access switch synchronizes data to each switch via a one-to-one unicast method. This data synchronization method is cumbersome to configure and requires high connectivity between the switches. Furthermore, when expanding the network, the synchronization links of the switches need to be reconfigured, making the operation quite complex. Summary of the Invention
[0005] This application provides a method for data synchronization of a switch to address the shortcomings of related technologies.
[0006] According to a first aspect of one or more embodiments of this application, a method for synchronizing switch data is provided, the method being applied to a switch network including access switches and ordinary switches, the access switches being connected to access devices, and the ordinary switches being connected to the access switches or other ordinary switches, the method comprising:
[0007] The access switch generates a synchronization message and sends the synchronization message through a port other than the port connected to the access device, so as to send the synchronization message to the ordinary switch connected to the other port. The synchronization message contains information to be synchronized.
[0008] When a regular switch receives the synchronization message through any port, it sends the synchronization message through a port other than the port mentioned above, so as to send the synchronization message to another regular switch connected to the port other than the port mentioned above.
[0009] Optionally, the synchronization message includes a first message segment and / or a second message segment; wherein, the value of the first message segment is used to represent IP service domain configuration information, the IP service domain configuration information including: adding an IP service domain, modifying an IP service domain, or deleting an IP service domain; the value of the second message segment is used to represent access device status information, the access device status information including: access device online or access device offline.
[0010] Optionally, the access switch generates a synchronization message, comprising: the access switch configuring itself in response to received IP service domain configuration information, and generating the first message segment according to the received IP service domain configuration information; the access switch generating the second message segment according to received LLDP notification messages or LLDP timeout aging messages; wherein the LLDP notification messages are used to indicate that the access device is online, and the LLDP timeout aging messages are used to indicate that the access device is offline; and the synchronization message is generated according to the first message segment and / or the second message segment.
[0011] Optionally, the method further includes: the ordinary switch extracting the information to be synchronized from the received synchronization message and storing the information to be synchronized.
[0012] Optionally, the synchronization message includes a timestamp added by the access switch during the generation of the synchronization message. The method further includes: the ordinary switch extracting the information to be synchronized and the timestamp from the received synchronization message, and comparing the timestamp with the timestamps corresponding to the stored synchronization information; if the comparison result shows that the timestamp is consistent with the timestamp corresponding to any stored synchronization information, terminating the transmission operation of the synchronization message; if the comparison result shows that the timestamp is inconsistent with the timestamp corresponding to the stored synchronization information, storing the information to be synchronized, and maintaining the transmission operation of the synchronization message.
[0013] Optionally, the method further includes: the ordinary switch determining whether the other port, which is different from any of the ports, is connected to the other ordinary switch; if the determination result is yes, the synchronization message is sent through the other port, which is different from any of the ports, to send the synchronization message to the other ordinary switch connected to the other port, which is different from any of the ports; if the determination result is no, the sending operation of the synchronization message is terminated.
[0014] According to a second aspect of one or more embodiments of this application, an apparatus for synchronizing switch data is provided. The apparatus is applied to a switch network including access switches and general-purpose switches. The access switches are connected to access devices, and the general-purpose switches are connected to the access switches or other general-purpose switches. The apparatus includes:
[0015] A generation unit is used for the access switch to generate a synchronization message and send the synchronization message through a port other than the port connected to the access device to send the synchronization message to a regular switch connected to the other port. The synchronization message contains information to be synchronized.
[0016] A receiving unit is configured to, when the ordinary switch receives the synchronization message through any port, send the synchronization message through a port other than any port, so as to send the synchronization message to another ordinary switch connected to the other port other than any port.
[0017] Optionally, the device further includes a storage unit, used by the ordinary switch to extract the information to be synchronized from the received synchronization message and store the information to be synchronized.
[0018] According to a third aspect of one or more embodiments of this application, an electronic device is provided, comprising:
[0019] processor;
[0020] Memory used to store processor-executable instructions;
[0021] The processor executes the executable instructions to implement the method described in the embodiments of the first aspect above.
[0022] According to a fourth aspect of one or more embodiments of this application, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the embodiments of the first aspect above.
[0023] As can be seen from the above technical solutions, in one or more embodiments of this application, a hop-by-hop transmission method is adopted. The access switch sends the information to be synchronized to the ordinary switch connected to it, and then the ordinary switch sends the information to be synchronized to other ordinary switches connected to it. Thus, data synchronization of the entire network of switches can be achieved simply by specifying the data synchronization transmission interface on the switch. The configuration is simple and the network expansion operation is also simple.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0026] Figure 1 This is a flowchart of a method for synchronizing switch data according to an exemplary embodiment of this application.
[0027] Figure 2 This is an architecture diagram of an NVMe over RoCEv2 network provided according to an exemplary embodiment of this application.
[0028] Figure 3 This is a synchronization message format provided according to an exemplary embodiment of this application.
[0029] Figure 4 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this application.
[0030] Figure 5 This is a block diagram illustrating an apparatus for synchronizing switch data according to an exemplary embodiment of this application. Detailed Implementation
[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this application as detailed in the appended claims.
[0032] It should be noted that the steps of the corresponding methods in other embodiments are not necessarily performed in the order shown and described in this application. In some other embodiments, the methods may include more or fewer steps than those described in this application. Furthermore, a single step described in this application may be broken down into multiple steps in other embodiments; and multiple steps described in this application may be combined into a single step in other embodiments.
[0033] In related technologies, access switches synchronize data to each switch via a one-to-one unicast method. This data synchronization method is cumbersome to configure and requires high connectivity between switches. Furthermore, when expanding the network, the synchronization links of the switches need to be reconfigured, which is a complex operation.
[0034] This application provides a simple method for configuring switch data synchronization. Data synchronization of the entire network of switches can be achieved by specifying the data synchronization transmission interface on the switch, and network expansion can be achieved by specifying the data synchronization transmission interface on a new access device. The operation is simple.
[0035] Figure 1 This is a flowchart illustrating a method for synchronizing data on a switch, as provided in an exemplary embodiment. Figure 1 As shown, this method is applied to a switch network, which includes access switches and general-purpose switches. The access switches are connected to access devices, and the general-purpose switches are connected to access switches or other general-purpose switches. The method may include the following steps:
[0036] S101: The access switch generates a synchronization message and sends the synchronization message through a port other than the port connected to the access device to send the synchronization message to the ordinary switch connected to the other port. The synchronization message contains information to be synchronized.
[0037] Figure 2 This is an exemplary embodiment of an NVMe over RoCEv2 network architecture diagram. Figure 2 As shown, an NVMe over RoCEv2 network includes hosts, switches, and storage. The hosts are access devices, and switch 1, connected to the hosts, is an access switch. Switches 2, 3, 4, and 5 are all ordinary switches. Each switch has multiple ports for receiving or sending data.
[0038] Combination Figure 2Access switch 1 is connected to the host via port 1-1 and to switch 2 via port 1-2. After access switch 1 generates a synchronization message based on the information to be synchronized, it sends the synchronization message to switch 2 via port 1-2 to achieve data synchronization between switch 2 and access switch 1.
[0039] In one embodiment, the switch, as the network core, needs to implement IP service domain management functions to manage access device information and monitor network status. Therefore, the various switches in the network need to synchronize IP service domain configuration information and device status information to promptly notify nodes subscribing to changes in network device status information within the IP service domain and take appropriate countermeasures. An IP service domain refers to a set of service IPs for hosts and storage, which includes at least one host IP and one storage IP.
[0040] In this embodiment, the information to be synchronized includes IP service domain configuration information and device status information. Accordingly, the synchronization message may include a first message segment and / or a second message segment. The value of the first message segment represents the IP service domain configuration information. IP service domain configuration refers to the user configuring IP service domains according to service plans to enable data transmission between devices within the same IP service domain. Therefore, IP service domain configuration information includes: adding an IP service domain, modifying an IP service domain, or deleting an IP service domain. The value of the second message segment represents the access device status information, which includes whether the access device is online or offline. The synchronization message may include only the first message segment, only the second message segment, or both.
[0041] In one embodiment, when a user configures an IP service domain on the access switch, the access switch generates a first message segment based on the received IP service domain configuration information. Meanwhile, the access device status information is sent by the access device to the access switch based on the LLDP protocol. The LLDP protocol enables devices from different vendors within the same network to discover each other and exchange their configuration information.
[0042] When the access switch receives an LLDP notification message, it parses the message to obtain the access device status information, indicating that the access device is online. When the access switch receives an LLDP timeout aging message, it parses the message to obtain the access device status information, indicating that the access device is offline. Based on the parsed access device status information, the access switch generates a second message segment, and then generates a synchronization message based on the first and / or second message segments to transmit the information to be synchronized.
[0043] Figure 3 This is an exemplary embodiment providing a format for a synchronization message. For example... Figure 3 As shown, the synchronization message includes the destination MAC address, source MAC address, ETH type, notification message header, first message segment, second message segment, etc. The information to be synchronized contained in the first and second message segments is encapsulated in TLV message format, allowing the sending of one or multiple messages to be synchronized simultaneously. Specifically, the TLV message includes TLV type, TLV message length, and TLV message content, as shown in Table 1:
[0044]
[0045] Table 1
[0046] Referring to Table 1, when the IP service domain configuration information indicates "Add IP service domain," the value of the first message segment should be 11. Similarly, when the access device status information indicates "Access device online," the value of the second message segment should be 21. When there are several IP service domain configuration information entries, multiple first message segments can be used to represent different IP service domain configuration information entries; similarly, when there are several access device status information entries, multiple second message segments can be used to represent different access device status information entries.
[0047] S102: When the ordinary switch receives the synchronization message through any port, it sends the synchronization message through a port other than the port to another ordinary switch connected to the port other than the port.
[0048] Combination Figure 2 As shown, after switch 2 receives the synchronization message sent by access switch 1 through port 2-1, it sends the synchronization message to switch 3 and switch 4 through ports 2-2 and 2-3 respectively. Similarly, switches 3 and 4 receive the synchronization messages sent by switch 2 through ports 3-1 and 4-1 respectively. Then, switch 4 sends the synchronization message to switch 5 through port 4-2, allowing switch 5 to receive the synchronization message sent by switch 4 through port 5-1. This completes the data synchronization of the entire network of switches.
[0049] The above embodiments describe the switch data synchronization method of this application. By specifying the information synchronization transmission interface of each switch, data synchronization of the entire network of switches can be achieved in a hop-by-hop manner, avoiding the huge traffic pressure on access switches caused by one-to-one unicast data synchronization. Furthermore, when network expansion is required, the information synchronization transmission interface can be specified on the new access device, making the operation simple.
[0050] In one embodiment, after receiving a synchronization message, a regular switch parses the message to obtain the information to be synchronized, and then stores this information locally. During the process of generating the synchronization message, the access switch adds a timestamp to the notification header of the synchronization message. Therefore, when a regular switch receives a synchronization message, it can obtain not only the information to be synchronized but also the timestamp by parsing the message.
[0051] By comparing the timestamp parsed from the current synchronization message with the timestamps corresponding to the synchronization information already stored locally on the ordinary switch, if the comparison result shows that the current timestamp is inconsistent with the timestamps corresponding to all the synchronization information already stored locally, then the information to be synchronized obtained from the parsed current synchronization message needs to be stored, while the sending operation of the current synchronization message continues to synchronize the information to be synchronized in the current synchronization message to other ordinary switches. If the comparison result shows that the current timestamp is consistent with the timestamp corresponding to any of the synchronization information already stored locally, it means that the synchronization information corresponding to the current timestamp has been synchronized, then the sending operation of the current synchronization message can be terminated, and there is no need to continue sending the current synchronization message to other ordinary switches, thereby achieving the purpose of preventing data loop transmission.
[0052] In one embodiment, a regular switch can determine whether its other ports, besides the port used to receive synchronization messages, are connected to other regular switches. If any of its other ports are connected to other regular switches, then the synchronization message is sent to the other connected regular switches through that port. If none of its other ports are connected to other regular switches, it indicates that the current switch is the last link in the network-wide switch data synchronization process, and the transmission of synchronization messages can be terminated.
[0053] by Figure 2 Taking switches 2 and 5 as examples, switch 2 determines that besides port 2-1, which receives synchronization messages, port 2-2 is connected to switch 3, and port 2-3 is connected to switch 4. Therefore, it needs to send synchronization messages to switches 3 and 4 through ports 2-2 and 2-3 respectively to achieve data synchronization between switches 3 and 4. Switch 5, however, determines that besides port 5-1, which receives synchronization messages, it has no other ports connected to any other ordinary switches. Therefore, after receiving the synchronization message, switch 5 does not need to send it out.
[0054] Corresponding to the above method embodiments, this application also provides an embodiment of an apparatus.
[0055] Figure 4 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment of this application. (Reference) Figure 4 At the hardware level, the electronic device includes a processor 402, an internal bus 404, a network interface 406, memory 408, and non-volatile memory 410, and may also include other hardware required for business operations. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into memory 408 and then runs it. Of course, in addition to software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.
[0056] Figure 5 This is a block diagram illustrating a switch data synchronization apparatus according to an exemplary embodiment of this application. (Refer to...) Figure 5 The device includes a generating unit 502 and a receiving unit 504, wherein:
[0057] The generation unit 502 is configured to generate a synchronization message for the access switch and send the synchronization message through a port other than the port connected to the access device to send the synchronization message to a regular switch connected to the other port. The synchronization message contains information to be synchronized.
[0058] The receiving unit 504 is configured to, when the ordinary switch receives the synchronization message through any port, send the synchronization message through a port other than the port to another ordinary switch connected to the port other than the port.
[0059] Optionally, the synchronization message includes a first message segment and / or a second message segment; wherein, the value of the first message segment is used to represent IP service domain configuration information, the IP service domain configuration information including: adding an IP service domain, modifying an IP service domain, or deleting an IP service domain; the value of the second message segment is used to represent access device status information, the access device status information including: access device online or access device offline.
[0060] Optionally, the generation unit 502 is specifically used for:
[0061] The access switch configures itself in response to the received IP service domain configuration information and generates the first message segment based on the received IP service domain configuration information; the access switch generates the second message segment based on the received LLDP notification message or LLDP timeout aging message; wherein the LLDP notification message is used to indicate that the access device is online, and the LLDP timeout aging message is used to indicate that the access device is offline; the synchronization message is generated based on the first message segment and / or the second message segment.
[0062] Optionally, the device further includes:
[0063] Storage unit 506 is configured to allow the ordinary switch to extract the information to be synchronized from the received synchronization message and store the information to be synchronized.
[0064] Optionally, the synchronization message includes a timestamp added by the access switch during the generation of the synchronization message, and the device further includes:
[0065] The comparison unit 508 is configured to: extract the information to be synchronized and the timestamp from the received synchronization message, and compare the timestamp with the timestamps corresponding to the stored synchronization information; if the comparison result shows that the timestamp matches the timestamp corresponding to any stored synchronization information, terminate the transmission operation of the synchronization message; if the comparison result shows that the timestamp does not match the timestamp corresponding to the stored synchronization information, store the information to be synchronized, and maintain the transmission operation of the synchronization message.
[0066] Optionally, the device further includes:
[0067] The judgment unit 510 is configured to determine whether the other port, which is different from any of the ports, is connected to the other ordinary switch; if the judgment result is yes, the synchronization message is sent through the other port, which is different from any of the ports, to send the synchronization message to the other ordinary switch connected to the other port, which is different from any of the ports; if the judgment result is no, the sending operation of the synchronization message is terminated.
[0068] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0069] The apparatus or unit described in the above embodiments can be implemented by a computer chip or physical entity, or by a product with a certain function. A typical implementation device is a computer, which can be a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0070] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0071] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0072] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0073] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for synchronizing data on a switch, characterized in that, The method is applied to a switch network, which includes access switches and ordinary switches. The access switches are connected to access devices, and the ordinary switches are connected to the access switches or other ordinary switches. The method includes: The access switch generates a synchronization message and sends the synchronization message through a port other than the port connected to the access device to send the synchronization message to the ordinary switch connected to the other port. The synchronization message contains information to be synchronized and a timestamp added by the access switch during the generation of the synchronization message. When the ordinary switch receives the synchronization message through any port, the ordinary switch extracts the information to be synchronized and the timestamp from the received synchronization message, and compares the timestamp with the timestamp corresponding to the stored synchronization information. If the comparison results show that the timestamp is consistent with the timestamp corresponding to any stored synchronization information, the sending operation of the synchronization message is terminated. If the comparison results show that the timestamp is inconsistent with the timestamp corresponding to the stored synchronization information, the information to be synchronized is stored. If it is determined that other ports, distinct from any of the aforementioned ports, are connected to other ordinary switches, then the synchronization message is sent through these other ports to the other ordinary switches connected to those other ports.
2. The method according to claim 1, characterized in that, The synchronization message includes a first message segment and / or a second message segment; wherein... The value of the first message segment is used to represent IP service domain configuration information, which includes: adding an IP service domain, modifying an IP service domain, or deleting an IP service domain; The value of the second message segment is used to characterize the access device status information, which includes: access device online or access device offline.
3. The method according to claim 2, characterized in that, The access switch generates a synchronization message, including: The access switch configures itself in response to the received IP service domain configuration information and generates the first message segment based on the received IP service domain configuration information. The access switch generates the second message segment based on the received LLDP notification message or LLDP timeout aging message; wherein the LLDP notification message is used to indicate that the access device is online, and the LLDP timeout aging message is used to indicate that the access device is offline. The synchronization message is generated based on the first message segment and / or the second message segment.
4. The method according to claim 1, characterized in that, Also includes: The ordinary switch extracts the information to be synchronized from the received synchronization message and stores the information to be synchronized.
5. The method according to claim 1, characterized in that, Also includes: If a regular switch receives the synchronization message through any of its ports, and determines that other ports, distinct from those ports, are not connected to other regular switches, then it terminates the transmission of the synchronization message.
6. A device for synchronizing data on a switch, characterized in that, The device is applied to a switch network, which includes access switches and general-purpose switches. The access switches are connected to access devices, and the general-purpose switches are connected to the access switches or other general-purpose switches. The device includes: A generation unit is used for the access switch to generate a synchronization message and send the synchronization message through a port other than the port connected to the access device to send the synchronization message to a regular switch connected to the other port. The synchronization message contains information to be synchronized and a timestamp added by the access switch during the generation of the synchronization message. A receiving unit is configured to, when the ordinary switch receives the synchronization message through any port, extract the information to be synchronized and the timestamp from the received synchronization message, and compare the timestamp with the timestamp corresponding to the stored synchronization information; if the comparison result shows that the timestamp matches the timestamp corresponding to any stored synchronization information, terminate the transmission operation of the synchronization message; if the comparison result shows that the timestamp does not match the timestamp corresponding to the stored synchronization information, store the information to be synchronized; if it is determined that other ports different from any port are connected to other ordinary switches, then the synchronization message is sent through the other ports different from any port to send the synchronization message to the other ordinary switches connected to the other ports different from any port.
7. The apparatus according to claim 6, characterized in that, Also includes: The storage unit is used by the ordinary switch to extract the information to be synchronized from the received synchronization message and store the information to be synchronized.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-5 by executing the executable instructions.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Ethernet switch configuration persistence method and device
CN113347035A
Information synchronization method and device
CN114006910A
Information configuration method and device, switch and readable storage medium
CN115426258A