Network switch and dual homing link recovery method thereof
The method for network switches ensures reliable link recovery by comparing packet information to verify device readiness, reducing packet loss and maintaining stable communication.
Patent Information
- Application Number
- JP2023126958
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2023-06-20
- Filing Date
- 2023-08-03
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-08-03
AI Technical Summary
Conventional network switch technologies using dual homing cannot accurately determine if a network device has fully recovered from a link failure, leading to packet loss due to premature link switching.
A method for network switches that involves receiving data packets through both primary and backup ports, comparing packet information, and switching links only when the connected network device is fully operational, as determined by analyzing the source MAC addresses of the packets.
Reduces packet loss by ensuring data transfer resumes only when the network device is fully operational, maintaining communication stability and efficiency.
Smart Images

Figure 0007622325000001 
Figure 0007622325000002 
Figure 0007622325000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a network device and a link recovery method, and more particularly to a network device using dual homing and a link recovery method thereof. [Background technology]
[0002] As the industry continues to place increasing demands on productivity and cost, the trend of connecting production equipment to networks is becoming established. Network connectivity allows data collection and analysis across machines, improving the speed, flexibility and efficiency of manufacturing processes, reducing costs and producing higher quality products. However, as dependency on networks increases, one of the issues that is attracting attention is how to ensure the reliability and stability of network connections.
[0003] In order to ensure the communication stability of devices connected to a network, the prior art has proposed a method of using a route backup mechanism such as dual-homing (also called duplication) to avoid the risk of the network being disconnected due to the failure of a single line or a single network device. The dual-homing mechanism usually connects two different (communication) ports of a network switch to different network interface cards of the same device or to two different devices that back up each other through two physical links. In dual-homing, one port of the network switch is connected to the primary link as a primary port and forwards data packets, and the other port is connected to the backup link as a backup port and is in a standby state. When the primary link connected to the primary port goes down, data packets must be forwarded using the backup link connected to the backup port instead of the primary link until the link-up of the primary link is restored.
[0004] However, in the prior art, the determination of whether the link is restored generally relies only on whether the physical layer (OSI L1) receives an electrical signal, so it is not possible to accurately determine whether the connected network device has fully restored normal operation. In this case, even if the network switch receives the link's electrical signal, the connected network device may not actually start sending and receiving data. Therefore, when the network switch receives the link's electrical signal and immediately switches the link, packet loss occurs, which fails to meet the application requirement of a low packet loss rate. Summary of the Invention [Problem to be solved by the invention]
[0005] Therefore, an object of the present invention is to provide a network switch and method for performing dual homing that ensures full operational recovery of connected network devices before switching links and minimizing packet loss rates. [Means for solving the problem]
[0006] An embodiment of the present invention discloses a dual-homing link recovery method for a network switch, in which a primary port is connected to a first network device by a primary link, and a backup port is connected to a second network device by a backup link. The link recovery method includes the steps of receiving a first plurality of data packets by the backup port to obtain first packet information when the backup port is in a forwarding state, receiving a second plurality of data packets by the primary port to obtain second packet information in response to detection of an electrical signal of the primary link, comparing the first packet information and the second packet information to obtain a comparison result, and switching a link based on the comparison result.
[0007] An embodiment of the present invention further discloses a network switch including a primary port, a backup port, a processing unit, and a storage unit, wherein the primary port is connected to a first network device by a primary link, the backup port is connected to a second network device by a backup link, the processing unit executes a program code, and the storage unit is coupled to the processing unit and stores the program code to instruct the processing unit to execute a link recovery method for dual homing. The link recovery method includes the steps of receiving a first plurality of data packets by the backup port to obtain first packet information when the backup port is in a forwarding state, receiving a second plurality of data packets by the primary port to obtain second packet information in response to detection of an electrical signal of the primary link, comparing the first packet information and the second packet information to obtain a comparison result, and switching a link based on the comparison result. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a schematic diagram of a network system. [Diagram 2] FIG. 1 is a schematic diagram of a network system performing a backup; [Diagram 3] FIG. 1 is a schematic diagram of a network system where link switching occurs too early; [Figure 4] FIG. 2 is a schematic diagram of a link recovery flow according to an embodiment of the present invention; [Diagram 5] FIG. 2 is a schematic diagram of a link recovery flow in a network system according to an embodiment of the present invention. [Figure 6] FIG. 2 is a schematic diagram of a link recovery flow in a network system according to an embodiment of the present invention. [Figure 7] FIG. 2 is a schematic diagram of a network switch according to an embodiment of the present invention as a backup mechanism that performs dual homing on different network interface controllers of the same device. [Figure 8] FIG. 2 is a schematic diagram of a backup device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] In this specification and the claims below, some terms are used to indicate specific components. Those skilled in the art will understand that the same components may have different names depending on the hardware manufacturer. In this specification and the claims below, components are not distinguished by their names, but by their functional differences. The term "including" referred to throughout this specification and the claims below is an open term and should be interpreted as "including, but not limited to." In addition, "coupling" includes direct and indirect electrical connection means. Thus, when a first device is described as being coupled to a second device, it means that the first device is electrically connected to the second device directly or indirectly by other devices or connection means.
[0010] Referring to FIG. 1, FIG. 1 is a schematic diagram of a network system 1. The network system 1 includes a network switch 10 and two network devices 20_1 and 20_2, and the network devices 20_1 and 20_2 are devices that back up each other, and the network switch 10 is a backup mechanism that performs the dual homing function. Specifically, the network switch 10 is connected to the network device 20_1 through a primary link L1 by a primary port P1, and is connected to the network device 20_2 through a primary link L2 by a primary port P2. As shown in FIG. 1, in general, the network device 20_1 transmits and receives data packets as a main (primary) device, and the network device 20_2 stands by as a backup (backup) device for the network device 20_1.
[0011] In a specific operation, the states of the ports P1 and P2 are divided into a blocking state and a forwarding state. Through a port in the forwarding state, the network switch 10 can transmit and receive any type of packet, thereby forwarding the data packet. Meanwhile, a port in the blocking state receives only control packets and discards other types of packets received. As shown in FIG. 1, generally, when the network device 20_1 and the primary link L1 are operating normally, the state of the primary port P1 is in the forwarding state (indicated as F), and the state of the backup port P2 is in the blocking state (indicated as B). In this case, the data packet is transmitted through the route R1 for communication.
[0012] Next, referring to FIG. 2, FIG. 2 is a schematic diagram of the network system 1 performing backup, showing a case where the network device 20_1 fails. In this case, the state of the primary port P1 of the network switch 10 is a blocking state, and the state of the backup port P2 is a forwarding state. In this case, the network device 20_2 performs backup for the network device 20_1, and the backup link L2 transfers data packets in place of the primary link L1. In this case, the data packets are transmitted through the route R2, and communication can be performed. Meanwhile, when the operation of the network device 20_1 is restored, the primary link L1 is resumed and returns to the operating state shown in FIG. 1. That is, the state of the primary port P1 changes again to a forwarding state to resume the transfer of data packets, and the state of the backup port P2 changes again to a blocking state and continues to wait. In this way, the network system 1 can recover to a normal operating mode.
[0013] Generally, the prior art determines whether to resume the primary link L1 and return to a normal operation mode based on whether the electrical signal of the primary link L1 can be received from the port P1. However, in reality, this method cannot accurately determine whether the network device 20_1 has fully recovered to normal operation. Referring to FIG. 3, FIG. 3 is a schematic diagram of a case where the network system 1 switches the link when the network device 20_1 is not yet ready (not yet fully recovered to normal operation). As shown in FIG. 3, in the prior art, when the network switch 101 detects the electrical signal of the primary link L1, it immediately switches the link. At this time, the state of the primary port P1 changes to a forwarding state to forward data packets, and the state of the backup port P2 changes to a blocking state and continues to wait. However, it should be noted that at this time, the network device 20_1 is not yet ready to process data packets, and the operation changeover with the backup network device 20_2 has not been completed, so that the network communication is interrupted. For example, the downlink data is sent to the not-ready network device 20_1 via the path R4 by the primary port P1 and the primary link L1, and is not processed. Meanwhile, the uplink data is sent to the blocking backup port P2 via the path R3 by the backup link L2, and is simply discarded. This results in a significant loss of data packets during this period.
[0014] Therefore, to improve the shortcomings of the prior art, the embodiment of the present invention provides a dual-homing link recovery method, which can detect when the network device 20_1 recovers to a fully operational state, and switch the link accordingly to resume communication on the primary link L1. The link recovery method can be summarized in a link recovery process 40, as shown in Fig. 4. The link recovery process 40 includes the following steps:
[0015] Step 400: Start.
[0016] Step 402: When the backup port P2 is in a forwarding state, receive a first plurality of data packets by the backup port P2 to obtain first packet information.
[0017] Step 404: Determine whether the electrical signal of the primary link L1 is detected. If so (YES), execute step 406; if not (NO), execute step 402.
[0018] Step 406: Convert the primary port P1 into a learning state.
[0019] Step 408: Receive a second plurality of data packets by the primary port P1, and obtain second packet information.
[0020] Step 410: Compare the first packet information and the second packet information to obtain a comparison result.
[0021] Step 412: Based on the comparison result, determine whether to switch the route. If so (if "yes"), execute step 414; if not (if "no"), execute step 408.
[0022] Step 414: Link switching is performed.
[0023] Step 416: End.
[0024] In brief, when the network switch 10 forwards data through the backup link L2, the network switch 10 receives a first plurality of data packets by the backup port P2 and obtains first packet information (step 402). If the network switch 10 detects an electrical signal of the primary link L1, it must further determine whether the network device 20_1 connected to the primary link L1 has fully recovered operation (step 404), and if it does not receive an electrical signal of the primary link L1, it must continue to obtain the first packet information. If the network switch 10 detects an electrical signal of the primary link L1, the network switch 10 must first convert the state of the primary port P1 to a learning state (step 406). In this state, the primary port P1 does not forward data packets but can receive data packets. Thus, the network switch 10 can receive a second plurality of data packets from the network device 20_1 by the primary port P1 and obtain second packet information (step 408). The network switch 10 compares the second packet information with the first packet information (step 412), and determines whether to switch the link (step 414) and resume data transfer through the primary link L1 based on the comparison result, so that the network switch 10 can switch the link after the network device 20_1 has completely resumed operation.
[0025] Specifically, in step 402, the operating state of the network system 1 is as shown in FIG. 5, where the data packets are transmitted between the network switch 10 and the backup network device 20_2 via the backup port P2 and the backup link L2 via the route R2. In this case, the backup port P2 is in a forwarding state, and the network switch 10 can forward the first plurality of data packets DP1 received from the network device 20_1 via the backup port P2. Based on the first plurality of data packets DP1, the network switch 10 can obtain and store first packet information. The first packet information can include the source Media Access Control (MAC) addresses of the first plurality of data packets DP1, so that the network switch 10 can observe which device has which MAC address the data packets forwarded by the network device 20_2 originate from. The network switch 10 can set an aging time for the source MAC address of each packet, and hold only information within the aging time, thereby avoiding an explosion in the data amount of the first packet information.
[0026] At the same time as obtaining the first packet information, in step 404, the network switch 10 continues to monitor the state of the primary link L1. When the network switch 10 detects the electrical signal of the primary link L1, in step 406, the network switch 10 converts the primary port P1 into a learning state. Referring to FIG. 6, FIG. 6 is a schematic diagram when the network system 1 detects the electrical signal of the primary link L1. As FIG. 6 shows, in this state, although the electrical signal of the primary link L1 is detected, the network switch 10 still cannot obtain the working state of the network device 20_1. Therefore, the state of the backup port P2 remains in the forwarding state, the data packet is still forwarded on the route R2, and the primary port P1 is converted into the learning state (shown as L). Compared with the blocking state, the primary port P1 at this time can receive data packets and wait to receive data packets from the network device 20_1. When the network device 20_1 resumes operation and starts to transmit packets, the network switch 10 can receive packets from the network device 20_1 through the primary port P1.
[0027] 6, in step 408, when the network device 20_1 resumes operation, it takes over for the backup network device 20_2 and starts forwarding link-up data. At the same time, the network switch 10 does not know the operation state of the network device 20_1, but can intermittently receive packets from the network device 20_1 via the primary port P1. Thus, the network switch 10 obtains the second plurality of data packets DP2 and obtains second packet information from the second plurality of data packets DP2. The second packet information mainly includes the source MAC addresses of the second plurality of data packets DP2, so that the network switch 10 can observe which device's MAC address the data packets forwarded by the network device 20_1 originate from.
[0028] In step 410, the network switch 10 compares the second packet information intermittently acquired with the first packet information to obtain a comparison result. If the second packet information contains the same source MAC address as the first packet information (in other words, the data stream originally transmitted by the link L2 has been changed to be transmitted by the link L1), the network switch 10 can determine that the network device 20_1 has fully resumed operation. That is, the network device 20_1 has completed the switchover with the network device 20_2 and has started the data forwarding operation. In this way, the network switch 10 can determine whether link switching is necessary based on the comparison result. Conversely, if the second packet information does not contain the same source MAC address as the first packet information, it means that the network device 20_1 is not yet fully prepared. In this case, the link switching is put on hold, and the process returns to step 408 to continue waiting for the reception of the second plurality of data packets DP2.
[0029] Finally, in step 414, the network switch 10 switches the link. At this time, the network switch 10 has already detected that the network device 20_1 has fully resumed operation by observing the source MAC address of the data packet, so it needs to restore the normal state of data forwarding via the primary port P1 and link L1. That is, the network switch 10 needs to change the state of the backup port P2 from forwarding to blocking, change the state of the primary port from learning to forwarding, and forward the data packet again via the route R1, i.e., to the state shown in FIG. 1.
[0030] Thereby, the network switch 10 detects whether the network device 20_1 has completely resumed operation by observing the source MAC address of the data packet, and immediately switches the path when the network device 20_1 has completely resumed operation. In this case, the network switch 10 does not need to transmit an additional control packet to the network device 20_1 for confirmation, so the method of the embodiment of the present invention is applicable to equipment of various different manufacturers. In addition, because of the detection method in the link recovery process 40, the network switch 10 does not need to provide an extra delay time for waiting for the network device 20_1 to completely resume operation, so that the packet loss rate caused by the time difference at the time of restarting the equipment after the equipment failure can be significantly reduced.
[0031] In the network system 1, the network devices 20_1 and 20_2 are mutually backing up devices, and the network switch 10 is a backup mechanism for performing the dual homing. However, the method of the embodiment of the present invention is not limited to the one-to-two device connection mode. For example, the network device 10 can simultaneously perform the dual homing backup mechanism in each of a plurality of pairs of mutually backing up network devices. Furthermore, the method of the embodiment of the present invention can achieve the dual homing backup effect by performing detection only based on the link state and transmitted packets, without interfering with the cooperation mode between the network devices 20_1 and 20_2.
[0032] As another aspect, the network switch 10 can also implement a dual-homing backup mechanism for different network interface controllers (NICs) of the same device. Referring to FIG. 7, FIG. 7 is a schematic diagram of the network switch 10 implementing a dual-homing backup mechanism for different network interface controllers of the same device. As FIG. 7 shows, the network device 20_3 may be a large server including two network interface controllers (not shown) connected to ports P5 and P6, respectively. The primary port P1 of the network switch 10 is connected to the port P5 of the network device 20_3 by a primary link L1, and the backup port P2 is connected to the port P6 by a backup link L2. Generally, a data packet is forwarded through a route R5, and when the network interface controller corresponding to the port P5 fails or becomes disabled, the data packet is changed to be forwarded through a route R6.
[0033] According to the link recovery process 40, when the network interface controller corresponding to the port P5 fails or is disabled, the network switch 10 receives a first plurality of data packets through the backup port P2 to obtain first packet information (step 402). When the network interface controller corresponding to the port P5 may recover operation, the network switch 10 first detects the electrical signal of the primary link L1 through the primary port P1 (step 404), and converts the state of the primary port P1 to a learning state (step 406). Then, the network switch 10 receives a second plurality of data packets through the primary port P1 to obtain second packet information (step 408). After comparing the first packet information with the second packet information (step 410), the network switch 10 determines whether the network interface controller corresponding to the port P5 has fully recovered operation (step 412), and finally switches the link based on this (step 414).
[0034] Further, referring to FIG. 8, there is shown a schematic diagram of a device 8 according to an embodiment of the present invention. The device 8 can realize the network switch 10 according to an embodiment of the present invention. As shown in FIG. 8, the device 8 includes a processing unit 80 and a storage unit 82. The processing unit 80 may be a general-purpose processor, a microprocessor, an application specific integrated circuit (ASIC), or the like, or a combination thereof. The storage unit 82 is any data storage device coupled to the processing unit 80, and can store a program code 820 and read and execute the program code 820 by the processing unit 80. For example, the storage unit 82 may be, but is not limited to, a read only memory (ROM), a flash memory, a random access memory (RAM), a hard disk and an optical data storage device, a non-volatile storage unit, and the like. In addition, the device 8 further includes multiple ports (not shown), each of which is connected to a different device or a different network interface controller that performs dual-homing backup.
[0035] The device 8 represents elements necessary for implementing the embodiment of the present invention, and various modifications and adjustments can be made by those skilled in the art, but are not limited thereto. For example, when the network switch 10 is implemented by the device 8, the link recovery process 40 can be compiled into a program code 820 and stored in the storage unit 82, and the link recovery method can be executed by the processing unit 80. The storage unit 82 also stores information necessary for executing the link recovery method, such as, but not limited to, first packet information, second packet information, etc.
[0036] As described above, the present invention provides a network switch and method for implementing dual homing, and detects whether a connected network device has fully resumed operation by observing the source MAC address of a data packet, so that the link can be switched after the connected network device is ready, thereby maximally reducing the packet loss rate.
[0037] The above is a preferred embodiment of the present invention, and all equivalent changes and modifications made within the scope of the claims of the present invention belong to the scope of the present invention. [Explanation of symbols]
[0038] 1 Network System 10. Network Switches 20_1, 20_2, 20_3 Network device P1 Primary port P2 Backup Port P3~P5 ports L1 Primary Link L2 Backup Link R1~R6 route DP1 First Plurality of Data Packets DP2 Second multiple data packets F Forwarding state B Blocking state L Learning status 40 Process 400~416 steps 8 equipment 80 Processing Units 82 Storage Unit 820 Program Code
Claims
1. A dual-homing link recovery method for a network switch, comprising: the network switch is coupled to a first network device via a primary link by a primary port and to a second network device via a backup link by a backup port; The link recovery method includes: receiving a first plurality of data packets by the backup port when the backup port is in a forwarding state, and acquiring first packet information; in response to detecting an electrical signal of the primary link, converting the primary port into a learning state and receiving a second plurality of data packets by the primary port to obtain second packet information; comparing the first packet information and the second packet information to obtain a comparison result; and switching the link based on the comparison result.
2. 2. The link recovery method of claim 1, wherein the second network device backs up the first network device.
3. 2. The link recovery method of claim 1, wherein the first network device and the second network device are the same device, and the primary link and the backup link are coupled to different network interface controllers (NICs).
4. 2. The link recovery method of claim 1, wherein the first packet information includes a source Media Access Control (MAC) address of the first plurality of data packets, and the second packet information includes a source Media Access Control (MAC) address of the second plurality of data packets.
5. 2. The link recovery method of claim 1, wherein the step of switching the link based on the comparison result includes switching the link when the comparison result indicates that the source media access control address in the second packet information and the source media access control address in the first packet information are the same.
6. 2. The link recovery method according to claim 1, wherein the step of switching the link based on the comparison result includes converting the state of the primary port to a forwarding state and converting the state of the backup port to a blocking state.
7. 1. A network switch, comprising: a primary port coupled to a first network device by a primary link; a backup port coupled to a second network device by a backup link; a processing unit for executing program code; a storage unit coupled to the processing unit and configured to store the program code and instruct the processing unit to perform a dual-homing link recovery method; The link recovery method includes: receiving a first plurality of data packets by the backup port when the backup port is in a forwarding state, and acquiring first packet information; in response to detecting an electrical signal of the primary link, converting the primary port into a learning state and receiving a second plurality of data packets by the primary port to obtain second packet information; comparing the first packet information and the second packet information to obtain a comparison result; and switching the link based on the comparison result.
8. The network switch of claim 7 , wherein the second network device backs up the first network device.
9. 8. The network switch of claim 7, wherein the first network device and the second network device are the same device, and the primary link and the backup link are coupled to different network interface controllers (NICs).
10. 8. The network switch of claim 7, wherein in the link recovery method, the first packet information includes a source Media Access Control (MAC) address of the first plurality of data packets, and the second packet information includes a source Media Access Control (MAC) address of the second plurality of data packets.
11. 11. The network switch of claim 10, wherein in the link recovery method, the step of switching the link based on the comparison result includes switching the link when the comparison result indicates that a source media access control address in the second packet information and a source media access control address in the first packet information are the same.
12. 8. The network switch of claim 7, wherein in the link recovery method, the step of switching the link based on the comparison result converts the state of the primary port to a forwarding state and converts the state of the backup port to a blocking state.
Citation Information
Patent Citations
Network convergence method, network bridges and system
CN101534211A
Cross connector
JP1998257580A
Bypass line switch-back control circuit, bypass line switch-back control method and recording medium recording its control program
JP2000078157A
Link layer loop detection method and apparatus
US20080267081A1
Spanning tree in fabric switches
US20140247754A1