Updating method and device for forwarding database in ring network link
By sending terminal messages carrying switch node identifiers in the ring network link and detecting abnormal link connectivity, the forwarding database is dynamically updated, solving the problem of low forwarding database update efficiency in the Ethernet ring network protection switching protocol and improving communication performance and quality.
Patent Information
- Application Number
- CN202510932975.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-09-05
AI Technical Summary
In the existing Ethernet ring network protection switching protocol, the update efficiency of the forwarding database is low, resulting in a waste of communication bandwidth resources and a flood of broadcast messages, which affects the communication quality.
By sending terminal messages carrying switch node identifiers in the ring network link, the forwarding database of the switch nodes passing through is updated. When an abnormal link is detected, a blocking protection link is formed. The node connectivity is detected through the detection scheme, and the forwarding database is dynamically updated.
It improves the update efficiency of the forwarding database, reduces the update time of FDB entries, improves the ring network switching performance, avoids the flooding of broadcast messages, and ensures the communication quality.
Smart Images

Figure CN120602260A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Ethernet ring network link protection, and in particular to a method and device for updating a forwarding database in a ring network link. Background Art
[0002] Ethernet Ring Protection Switching (ERPS), also known as G.8032, is a ring protection protocol developed by the International Telecommunication Union (ITU). It is a link layer protocol specifically designed for Ethernet rings. When the Ethernet ring is intact, it eliminates loops by blocking the Ring Protection Link (RPL), effectively preventing broadcast storms. If a link in the Ethernet ring is disconnected, it quickly restores communication between nodes by opening the RPL and switching over to update the forwarding database (FDB) entries.
[0003] Traditional solutions, based on the method clearly defined in the G.8032 specification, relearn the FDB message forwarding path after a link switchover by clearing the Ethernet switch's FDB entries and then flooding the data packets. This wastes Ethernet communication bandwidth resources. Especially for Ethernet switches, the construction of FDB entries relies on active communication from connected devices. This results in uncontrollable time required to clear the FDB and then reconstruct the complete, identical FDB entries. This can lead to prolonged broadcast message flooding within the LAN, impacting communication quality.
[0004] Currently, no effective solution has been proposed for the problem of low FDB table entry update efficiency in the prior art. Summary of the Invention
[0005] Based on this, it is necessary to provide a method and device for updating a forwarding database in a ring network link to address the above technical problems.
[0006] In a first aspect, the present application provides a method for updating a forwarding database in a ring network link, including a first switch node, wherein the method includes:
[0007] Obtain a terminal message uploaded by the current terminal device, and add the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes the terminal address of the terminal device;
[0008] Sending the new terminal message to the target terminal device via the ring network link, so that each switch node along the ring network link passes the terminal message and updates the forwarding database corresponding to each switch node along the path, wherein the forwarding database includes the acquired terminal address and corresponding node information;
[0009] When an abnormal link is detected in the ring network link, the blocking protection port in the ring network link is opened through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link. The connectivity of each node in the blocking protection link is detected through a preset detection scheme, and the forwarding database is updated according to the connectivity results.
[0010] In one embodiment, obtaining a terminal message uploaded by a currently connected terminal device and adding the node identifier of the first switch node to the terminal message to obtain a new terminal message includes:
[0011] Matching the terminal message uploaded by the current terminal device through a preset filtering rule;
[0012] The node identifier of the first switch node is added to the local area network identifier field of the terminal message to obtain the new terminal message.
[0013] In one embodiment, sending the new terminal message to the target terminal device through the ring network link includes:
[0014] When it is detected that the new terminal message is sent to the target switch connected to the target terminal device, the node identifier of the first switch node is stripped off by the target switch.
[0015] In one embodiment, detecting connectivity of each node in the blocking protection link by a preset detection scheme and updating the forwarding database according to the connectivity result includes:
[0016] Based on the node address of each switch, traverse each switch node, and detect the connectivity between the first direction node port and the second direction node port of each switch node in turn through a preset detection instruction to obtain the connectivity of each switch node;
[0017] If it is detected that there is a node to be tested in the switch node whose first direction node port and the second direction node port are both in a disconnected state, the corresponding relationship between the node information of the switch node and the corresponding terminal address is deleted.
[0018] In one embodiment, based on the node address of each switch, each switch node is traversed, and connectivity of the node port of each switch node in the first direction and the second direction is detected by a preset detection instruction to obtain the connectivity of each switch node, including:
[0019] Based on the node address of each switch, traverse each switch node and detect the working status of the node port of each switch node in the first direction;
[0020] If it is detected that the node port in the first direction is in a normal working state, the network connectivity state of the node port in the first direction is detected. If it is detected that the node port in the first direction is in a connectable state, whether the node port in the first direction is consistent with the node port recorded in the local forwarding database of the first switch node is detected. If they are inconsistent, the forwarding database is updated based on the node port in the first direction.
[0021] If it is detected that the node port in the first direction is not in a normal working state, the node port in the second direction of each switch node is detected. If it is detected that the node port in the second direction is in a normal working state, the network connectivity status of the node port in the second direction is detected. If it is detected that the node port in the second direction is in a connectable state, it is detected whether the node port in the second direction is consistent with the node port recorded in the local forwarding database of the first switch node. If they are inconsistent, the forwarding database is updated based on the node port in the second direction.
[0022] In one embodiment, obtaining the node address of each switch includes:
[0023] Acquire a ring network protection protocol forwarded in a ring network link, and parse node address relationship information in the ring network protection protocol, wherein the node address relationship information includes a node address of a switch;
[0024] The node address relationship information is stored locally, and the locally stored address relationship table is updated;
[0025] The node address information, node identifier, and locally stored address relationship table of the first switch node are appended to the ring network protection protocol to obtain an updated ring network protection protocol, and the updated ring network protection protocol is forwarded to other switch nodes; wherein, each switch node in the ring network link is traversed through the ring network protection protocol, so that each switch node learns the node address relationship information of each switch node in the ring network link.
[0026] In one embodiment, the method further comprises:
[0027] When it is detected that the terminal address corresponding to the terminal device in the ring network link is in an aging state, a query is performed in the forwarding database based on the terminal address;
[0028] If it is detected that the terminal address exists in the forwarding database, the terminal address and the switch node information corresponding to the terminal address are deleted from the forwarding database.
[0029] In one embodiment, after updating the forwarding database according to the connectivity result, the method further includes:
[0030] The updated forwarding database is synchronized to the preset hardware database device, and the traffic of the terminal device is controlled to be forwarded based on the updated forwarding database.
[0031] In a second aspect, the present application further provides a method for updating a forwarding database in a ring network link, which is applied to a first switch node in the ring network link, and the method includes:
[0032] The first switch node obtains a terminal message uploaded by the current terminal device, and adds the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes a terminal address of the terminal device;
[0033] The first switch node sends the new terminal message to the target terminal device through the ring network link;
[0034] Each first switch node passed through on the ring network link updates a forwarding database corresponding to each passed switch node through the terminal message, wherein the forwarding database includes the acquired terminal address and corresponding node information;
[0035] When the first switch node detects that there is an abnormal link in the ring network link, it opens the blocking protection port in the ring network link through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link, detects the connectivity of each node in the blocking protection link through a preset detection scheme, and updates the forwarding database according to the connectivity result.
[0036] In one embodiment, each switch node on the ring network link updates the forwarding database corresponding to each switch node through the terminal message, including:
[0037] The switch node passed through obtains the terminal address corresponding to the terminal message and detects whether the terminal address is included in the local forwarding database;
[0038] When the switch node passing through detects that the terminal address is not included in the local forwarding database, the corresponding relationship between the terminal address carried in the terminal message and the node information of the corresponding first switch node is added to the forwarding database;
[0039] The switch node passing through, upon detecting that the terminal address is included in the local forwarding database, checks whether the correspondence between the terminal address and the node information in the forwarding database is the same as the correspondence between the node information and the terminal address carried in the terminal message;
[0040] If different, updating the forwarding database based on the correspondence between the node information carried in the terminal message and the terminal address;
[0041] If they are the same, then the updating of the forwarding database is ended.
[0042] In a third aspect, the present application further provides a device for updating a forwarding database in a ring network link. The device comprises:
[0043] an acquisition module, configured to acquire a terminal message uploaded by the currently connected terminal device, and add the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes a terminal address of the terminal device;
[0044] an updating module, configured to send the new terminal message to a target terminal device via the ring network link, so that each switch node along the ring network link passes the terminal message and updates a forwarding database corresponding to each switch node along the path, wherein the forwarding database includes the acquired terminal address and corresponding node information;
[0045] The generation module is used to, when an abnormal link is detected in the ring network link, open the blocking protection port in the ring network link through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link, detect the connectivity of each node in the blocking protection link through a preset detection scheme, and update the forwarding database according to the connectivity result.
[0046] The above-mentioned method and device for updating the forwarding database in a ring network link are applied to a first switch node, which is any switch node in the ring network link. First, the terminal message uploaded by the current terminal device is obtained, and the node identifier of the first switch node is added to the terminal message to obtain a new terminal message. Then, the new terminal message is sent to the target terminal device through the ring network link, so that each switch node passing through the ring network link passes the terminal message and updates the forwarding database corresponding to each switch node passed through. When an abnormality is detected in the ring network link, the blocking protection port in the ring network link is opened to form a blocking protection link. The connectivity of each node in the blocking protection link is detected through a preset detection scheme, and the forwarding database is updated according to the connectivity result. Through this application, the efficiency of updating the forwarding database FDB table entries can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 FIG2 is an application environment diagram of a method for updating a forwarding database in a ring network link according to an embodiment;
[0048] Figure 2 1 is a flow chart of a method for updating a forwarding database in a ring network link according to an embodiment;
[0049] Figure 3 1 is a flow chart of a method for updating a forwarding database in a ring network link in a preferred embodiment;
[0050] Figure 4 1 is a structural block diagram of a device for updating a forwarding database in a ring network link in an embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0052] Figure 1 This is an application scenario of the present application. The figure includes four switch nodes, each of which is connected to one or more terminal devices ( Figure 1 Take the following example to connect a terminal device). Figure 1 It includes the Ring Protection Link Owner (RPL Owner), which is adjacent to the RPL link. The RPL Owner node controls the state transition of the ring network by blocking and opening the RPL port, enabling the ring network to switch between normal and protection states to adapt to different network conditions. Figure 1It also includes Network Video Recorder (NVR), Figure 1 The NVR is the terminal device connected to the RPL Owner. Figure 1 A schematic diagram of a single-ring link is given in , and the method in this application is also applicable to multi-ring links.
[0053] A method for updating a forwarding database in a ring network link is provided. Figure 2 A schematic flow chart of an updating method in an embodiment, wherein the method is applied to Figure 1 Taking the first switch node in the example as an example, the following steps are included:
[0054] Step S210: Acquire a terminal message uploaded by the current terminal device, and add the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes the terminal address of the terminal device.
[0055] Specifically, the first switch node obtains a terminal message uploaded by a terminal device currently connected to the first switch node. In actual applications, the first switch node can match incoming messages using access control list (ACL) rules to filter terminal messages from the terminal device and exclude messages from non-terminal device ports. The terminal message includes the media access control address (MAC) of the terminal device, i.e., the terminal address, and information about the port through which the terminal device is connected to the first switch node. After obtaining the terminal message, the first switch node adds a node identifier of the first switch node to the terminal message to obtain a new terminal message. In actual applications, the node identifier of the first switch node can be added to the VLAN ID field corresponding to the 802.1Q tag in the inner layer of the terminal message to obtain the new terminal message. Specifically, the node identifier of the first switch node is the node ID of the switch node, and the first switch node refers to any switch node in the ring network link.
[0056] In step S220, the new terminal message is sent to the target terminal device via the ring network link, so that each switch node along the ring network link passes the terminal message and updates the forwarding database corresponding to each switch node along the path, wherein the forwarding database includes the acquired terminal address and the corresponding node information.
[0057] Specifically, the new terminal message is sent to the preset target terminal device through the ring network link. In the outgoing direction, the node identifier of the first switch node added above is stripped off through the switch node connected to the target terminal device to avoid affecting the subsequent processing of the target terminal device.
[0058] When the new terminal message is sent to the target terminal device along the ring network link through the first switch node, each switch node passed through on the ring network link parses the new terminal message and extracts the node information and terminal address of the first switch node carried in the new terminal message.
[0059] Each switch node has a corresponding forwarding database (FDB), which includes node information corresponding to multiple terminal addresses. For each switch node that a route passes through, based on the terminal address parsed from the new terminal message and the node information of the corresponding first switch node, the route updates the corresponding forwarding database for each terminal address with updated information. This node information includes, but is not limited to, the node identifier (i.e., node ID) of the switch node, the port connecting the switch node to the terminal device, and the broadcast domain in which the switch resides. The following table is a schematic diagram of the FDB storage format in one embodiment, for illustrative purposes only. This application does not impose any additional restrictions on the content contained in the FDB table:
[0060]
[0061] As can be seen from the above, the FDB table of each switch node includes but is not limited to the MAC address (i.e., the terminal address mentioned above), switch port, VLAN ID, and the node ID of the switch node connected to the terminal device. Among them, when the ring network link is a multi-ring link, data may be transmitted through multiple rings. The above VLAN ID can be used to distinguish different broadcast domains and achieve network isolation.
[0062] In step S230, when an abnormal link is detected in the ring network link, the blocking protection port in the ring network link is opened through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link. The connectivity of each node in the blocking protection link is detected through a preset detection scheme, and the forwarding database is updated according to the connectivity results.
[0063] Specifically, when an abnormality is detected in the ring network link, the blocking protection port is opened to form a blocking protection link. The abnormality in the ring network link includes but is not limited to the following situations: an interface in the ring network link cannot work normally, or some links cannot be connected.
[0064] The above-mentioned detection scheme includes, but is not limited to, detection through east-west port ping detection and ARP request / reply detection. Since the ring network link structure changes after the blocking protection port is enabled, each switch node in the ring network link uses the above-mentioned detection scheme to detect the newly generated blocking protection link, detecting the connectivity between the switch nodes in the blocking protection link. Then, based on the connectivity results obtained between the switch nodes, the forwarding database of each switch node is updated. An example of a forwarding database can be seen in the FDB table example above. For example, in the FDB table above, assume that the switch node connection port corresponding to the terminal "0000.0201.0103" has changed, and the previous port 1 is no longer functioning properly. In the blocking protection link, the switch node should complete the connection through port 2. In this case, port 1 in the FDB table should be changed to port 2, indicating that subsequent communication should be carried out through port 2, thereby updating the forwarding database based on the connectivity results. The above-mentioned update method also includes, if it is detected that all ports of the switch node corresponding to the terminal "0000.0201.0103" cannot be connected normally, then the terminal "0000.0201.0103" and its corresponding switch node related information are deleted, etc. The method for updating the forwarding database includes but is not limited to the above two update contents.
[0065] It should be noted that this step uses the first switch node as an example. In actual applications, the operation to open the blocked protection port in the ring network link must be performed by the master switch node and the switch nodes adjacent to the abnormal link. However, the subsequent steps of detecting the connectivity of each node in the blocked protection link through a detection solution and updating the forwarding database based on the connectivity results can also be completed by other switch nodes in the ring network link.
[0066] Through steps S210 to S230, by adding the node identifier of the first switch node to the terminal message, the other multiple switch nodes can construct and update their respective forwarding databases using the terminal message, effectively improving the efficiency of establishing and updating the forwarding database. Furthermore, when switching to a new blocking protection link, a preset detection method is used to dynamically detect the new path, and then the forwarding database corresponding to each switch node is updated based on the detection results, rather than directly rebuilding the forwarding database. The method of this application effectively reduces the FDB update time and improves the efficiency of FDB table update.
[0067] In one embodiment, obtaining a terminal message uploaded by a current terminal device and adding a node identifier of the first switch node to the terminal message to obtain a new terminal message includes:
[0068] Match the terminal message uploaded by the current terminal device through the preset filtering rules;
[0069] The node identifier of the first switch node is added to the local area network identifier field of the terminal message to obtain a new terminal message.
[0070] Specifically, the filtering rules include but are not limited to ACL hardware rules, and adding rules to carry node information through the soft conversion solution ebtables, etc. The filtering rules are used to filter the messages uploaded by the current terminal device and match the terminal messages.
[0071] The node identifier (i.e., node ID) of the first switch node is then added to the local area network identifier field (i.e., VLAN ID field) of the above-mentioned terminal message to obtain the above-mentioned new terminal message. It can be understood that the terminal device and the switch node are in a one-to-many relationship. The terminal message uploaded by the terminal device carries the node ID information of the unique switch node corresponding to the terminal device.
[0072] Through this embodiment, the node identifier is added to the VLAN ID field in the inner layer of the message in the inbound direction of the ring network node, and other switch nodes parse this information to construct and update the forwarding database FDB.
[0073] In one embodiment, sending a new terminal message to a target terminal device via a ring network link includes:
[0074] When it is detected that a new terminal message is sent to a target switch connected to a target terminal device, the target switch strips the node identifier of the first switch node.
[0075] Specifically, the new terminal message is sent to the preset target terminal device via the ring network link, so that all switch nodes along the transmission path learn the terminal address and node information contained in the new terminal message. Upon detecting that the new terminal message has been sent to the target switch connected to the target terminal device, it indicates that the switch nodes along the path have completed learning. In the outbound direction, the node identifier of the first switch node added above can be stripped off by the switch node connected to the target terminal device to avoid affecting subsequent processing by the target terminal device.
[0076] It can be understood that this embodiment describes that the first switch node in the ring network link adds its node identifier to the terminal message, and the node identifier of the first switch node in the terminal message is stripped by the target switch. However, in actual applications, all switch nodes on the ring network link can add their node identifiers to the terminal message sent by the terminal device connected to the switch node.
[0077] In one embodiment, the connectivity of each node in the blocking protection link is detected by a preset detection scheme, and a forwarding database is updated according to the connectivity result, including:
[0078] Based on the node address of each switch, traverse each switch node, and detect the connectivity between the first direction node port and the second direction node port of each switch node in turn through a preset detection instruction to obtain the connectivity of each switch node;
[0079] If it is detected that there is a node to be tested in the switch node whose first direction node port and second direction node port are both in a disconnected state, the node information of the switch node and the corresponding relationship between the terminal address are deleted.
[0080] Specifically, this embodiment provides a method for updating a forwarding database in a blocking protection link. First, the first switch node in the ring network link traverses the other switch nodes based on the node addresses of the other switches in the ring network link (that is, the IP addresses of the switch nodes), and detects the connectivity of the first direction node ports and the second direction node ports of the other switch nodes through preset detection instructions, thereby obtaining the connectivity of the other switch nodes. The connectivity of the switch node indicates whether the switch node can be connected to the ring network link through the first direction node port or the second direction node port. In actual applications, the first direction node port and the second direction node port are generally east-west ports.
[0081] If a switch node in the ring network is detected with both its first-direction node port and its second-direction node port in a disconnected state, this indicates that the node has been disconnected from the blocking protection link. The node information for the node under test, as well as the correspondence between the node under test and the terminal address corresponding to the node under test, is deleted. It should be noted that the solution described in this embodiment can be applied to all switch nodes in the ring network, not just the first switch node.
[0082] In one embodiment, based on the node address of each switch, each switch node is traversed, and connectivity of the node port of each switch node in the first direction and the second direction is detected by a preset detection instruction to obtain the connectivity of each switch node, including:
[0083] Based on the node address of each switch, traverse each switch node and detect the working status of the node port of the first direction of each switch node;
[0084] If it is detected that the node port in the first direction is in a normal working state, the network connectivity state of the node port in the first direction is detected. If it is detected that the node port in the first direction is in a connectable state, whether the node port in the first direction is consistent with the node port recorded in the local forwarding database of the first switch node is detected. If they are inconsistent, the forwarding database is updated based on the node port in the first direction.
[0085] If it is detected that the node port in the first direction is not in a normal working state, the node port in the second direction of each switch node is detected. If it is detected that the node port in the second direction is in a normal working state, the network connectivity status of the node port in the second direction is detected. If it is detected that the node port in the second direction is in a connectable state, it is detected whether the node port in the second direction is consistent with the node port recorded in the local forwarding database of the first switch node. If they are inconsistent, the forwarding database is updated based on the node port in the second direction.
[0086] Specifically, this embodiment provides a specific method for detecting the connectivity of switch nodes. First, the first switch node traverses each switch node in the ring network link based on the node address (IP address) of each switch, and detects the working status of the first direction node port of each switch node, where the first direction node port can be an eastbound port or a westbound port, and the working status of the node port includes normal operation and abnormal operation.
[0087] If it is detected that the node port in the first direction is in a normal working state, the network connectivity status of the node port in the first direction is detected, that is, ping detection (ping detection refers to verifying that two network nodes can successfully communicate in both directions by sending an Internet Control Message Protocol (ICMP) echo request message and receiving an ICMP echo reply message). If it is detected that the node port in the first direction is in a connectable state, the first direction node port of the switch node (that is, other nodes except the first switch node) is detected to see whether it is consistent with the node port of the switch node recorded in the forwarding database locally stored in the first switch node. If they are inconsistent, the forwarding database is updated based on the first direction node port, and the port recorded in the forwarding database is changed to the first direction node port. Similarly, if they are consistent, the forwarding database locally stored in the first switch node is not updated.
[0088] Similarly, if it is detected that the node port in the first direction of a switch node (i.e., a node other than the first switch node) is not in a normal working state, the node port in the second direction of the switch node is detected. The second direction node port is the westbound port or eastbound port opposite to the first direction node port. If the second direction node port is detected to be in a normal working state, the second direction node port is further tested for network connectivity. If the second direction node port is detected to be in a connectable state, the node port in the second direction of the switch node (i.e., a node other than the first switch node) is tested to see if it is consistent with the port recorded in the forwarding database locally stored by the first switch node. If they are inconsistent, the forwarding database is updated based on the second direction node port, and the port recorded in the forwarding database is changed to the second direction node port. Similarly, if they are consistent, the forwarding database locally stored by the first switch node is not updated. In summary, if there is a switch node in the ring network link whose east and west ports are both unable to work properly or cannot be pinged, the node information of the switch node and the terminal address of the terminal device corresponding to the switch node are deleted from the forwarding database.
[0089] It should be noted that this embodiment takes the first switch node as the starting point and explains how to update the locally stored forwarding database. In actual applications, all switch nodes in the ring network link can execute the solution described in this embodiment, that is, any switch node 1 in the ring network link can detect the connectivity of other switch nodes except switch node 1 through the solution in this embodiment, and update the forwarding database locally stored in switch node 1 based on the detection results.
[0090] Through this embodiment, the ping mechanism can be used to dynamically detect the path of the blocked protection link, and then the FDB table can be updated and directly refreshed into the hardware FDB without directly clearing the FDB table entry corresponding to the FDB path that needs to be updated, thereby reducing the FDB construction time and improving the ring network switching performance.
[0091] In one embodiment, obtaining the node address of each switch includes:
[0092] Acquire a ring network protection protocol forwarded in a ring network link, and parse node address relationship information in the ring network protection protocol, wherein the node address relationship information includes a node address of a switch;
[0093] The node address relationship information is stored locally, and the locally stored address relationship table is updated;
[0094] The node address information, node identifier, and locally stored address relationship table of the first switch node are appended to the ring network protection protocol to obtain an updated ring network protection protocol, and the updated ring network protection protocol is forwarded to other switch nodes; wherein, each switch node in the ring network link is traversed through the ring network protection protocol, so that each switch node learns the node address relationship information of each switch node in the ring network link.
[0095] Specifically, this embodiment provides a method for obtaining the node address of each switch node.
[0096] The first switch node obtains the Ethernet Ring Protection Switching (ERPS) protocol forwarded in the ring network link and parses the switch node ID and node IP address information carried in the TLV (Type-Length-Value) field in the ring network protection protocol. It can be understood that the switch node ID and the IP address have a one-to-one correspondence. The user sets a unique IP address for each node in the ring network link in the same network segment, namely the node address, and the node IP information is the node address.
[0097] The first switch node stores the resolved node IP and ID information of other switch nodes locally and updates the locally stored address relationship table, where the address relationship table records the corresponding relationship between the IP addresses and IDs of multiple switch nodes in the ring network link.
[0098] The first switch node then appends its own node address information (i.e., node IP information), its own node identifier (i.e., node ID), and the locally stored address relationship table of the first switch node to the ring network protection protocol to obtain an updated ring network protection protocol, wherein the locally stored address relationship table is the IP address and node ID information of other switch nodes that the first switch node has stored in the past. The updated ring network protection protocol is then forwarded to other switch nodes, so that the ring network protection protocol can eventually traverse each switch node in the ring network link, so that each switch node learns the node IP address and ID information of each switch node in the ring network link, and each switch node constructs an address relationship table for the entire ring network link. It can be understood that all switch nodes in the ring network link can update the local address relationship table and update and forward the ring network protection protocol through the method described in this embodiment. The following table is the storage format of the address relationship table in one embodiment:
[0099]
[0100] In one embodiment, the method further comprises:
[0101] When it is detected that the terminal address corresponding to the terminal device in the ring network link is in an aging state, a query is performed in the forwarding database based on the terminal address;
[0102] If it is detected that the terminal address exists in the forwarding database, the terminal address and the switch node information corresponding to the terminal address are deleted from the forwarding database.
[0103] Specifically, when the first switch node detects that the terminal address of a terminal device in the ring network link is in an aging state, it searches the forwarding database corresponding to the first switch node based on the terminal address, using the terminal address as an index. If the terminal address is detected to exist in the forwarding database, the terminal address and the switch node information corresponding to the terminal address are deleted, that is, the content corresponding to the terminal address in the FDB table is deleted. Similarly, if the terminal address is detected to not exist in the forwarding database, the aging module processing flow is terminated. The method for detecting whether the terminal address is in an aging state includes, but is not limited to, determining that the terminal address is in an aging state if it is detected that the terminal address has not sent a data frame for a long time (generally 300 seconds, which can be set by relevant technical personnel).
[0104] It can be understood that this embodiment takes the first switch node as an example to illustrate how to update the local forwarding database of the first switch node based on the aging terminal address. In actual applications, all switch nodes in the ring network link can update the forwarding database stored locally in each switch node based on the aging terminal address based on this embodiment.
[0105] In one embodiment, after updating the forwarding database according to the connectivity result, the method further includes:
[0106] The updated forwarding database is synchronized to the preset hardware database device, and the traffic of the terminal device is controlled to be forwarded based on the updated forwarding database.
[0107] Specifically, after each switch node completes updating of the local forwarding database, the updated forwarding database is synchronized to the hardware database device corresponding to the switch node, ie, the hardware FDB, so that the traffic of the terminal device is forwarded according to the updated forwarding database.
[0108] The present application also provides a preferred embodiment of a method for updating a forwarding database in a ring network link. Figure 3 This is a flowchart of a method for updating a forwarding database in a preferred embodiment. For ease of expression, the following content is written from the perspective of the first switch node. However, it should be noted that the first switch node is any switch node in the ring network link.
[0109] Step S310: Terminal message processing. Specifically, the user configures a unique node ID for a switch node located in a ring network link. The first switch node matches terminal messages from terminal devices connected to the first switch node using ACL rules, adds the node ID of the first switch node to the VLAN ID field corresponding to the 802.1Q tag in the inner layer of the message in the terminal message, and sends the terminal message from the first switch node to a preset target terminal device. This allows each switch node passing through the ring network link to parse the terminal message to obtain the terminal address and the corresponding node information of the first switch node. Each switch node then updates its own forwarding database based on the terminal address and the corresponding node information of the first switch node. When it is detected that the terminal message has been sent to the switch node corresponding to the target terminal device, the switch node removes the node ID from the terminal message. In actual applications, the original terminal message format is generally as follows:
[0110]
[0111] DA is the destination address, which can be used to identify the target terminal device mentioned above, SA is the source address, LEN / ETYPE is the type / length field, DATA is the data field, and FCS is the frame check sequence. Based on the original terminal message, the node ID of the first switch node is added. The new terminal message format is:
[0112]
[0113] The 802.1Q tag is the inner and outer VLAN tag.
[0114] In step S320, each switch node constructs a node ID address relationship table. Specifically, the user first sets a unique IP address for each node in the ring network link within the same network segment. Then, by using the ERPS protocol to carry the switch node's node ID (i.e., node identifier) and node IP (i.e., node address information) in the TLV field, each switch node can learn the address correspondence between node IDs and node IPs in the entire ring network link through the ERPS protocol.
[0115] Step S330: Each node updates its forwarding database. Specifically, while the new terminal message is being sent to the target terminal device, the switch nodes it passes through learn the terminal device address (i.e., MAC address) contained in the new message. Based on the newly learned MAC address, each switch node notifies its processor to parse the terminal message information. The software layer of each switch node then constructs a table of relationships between the FDB and node IDs (i.e., the forwarding database). If it is detected that the newly learned MAC address differs from the MAC address stored in the local forwarding database of the passed switch node, the local forwarding database of the passed switch node is updated based on the correspondence between the MAC address in the new terminal message and the node information.
[0116] Step S340 detects anomalies in the ring network link. Specifically, when the first switch node detects an anomaly in the ring network link (e.g., a link disconnection, abnormal port operation, etc.), the master switch node and nodes adjacent to the abnormal link open a blocking protection port in the ring network link to form a new blocking protection link (it should be noted that only the master switch node can open the blocking protection port). At this point, each switch node updates its forwarding database. The updating method specifically includes: determining the IP address of each switch node based on the address correspondence between the node ID and the node IP address in the ring network link, detecting connectivity with the corresponding node through ping detection of the east-west ports, and then updating the respective forwarding databases based on the connectivity relationship. If it is detected that a switch interface has both its east-west ports malfunctioning or cannot be pinged, the switch node ID and the forwarding database are deleted from the forwarding database.
[0117] Step S350: Synchronize the forwarding database. Specifically, the updated forwarding database of each switch node is sent to the corresponding hardware device, so that the terminal traffic is forwarded along the new path.
[0118] In summary, the above process also includes each switch node detecting whether the MAC address is aged in real time. If a MAC address is detected to be aged, the information corresponding to the MAC address in the forwarding database of the switch node is deleted.
[0119] In a second aspect, the present application further provides a solution for updating a forwarding database in a ring network link, the method comprising:
[0120] The first switch node obtains a terminal message uploaded by the current terminal device, and adds the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes a terminal address of the terminal device;
[0121] The first switch node sends the new terminal message to the target terminal device through the ring network link;
[0122] Each switch node on the ring network link updates the forwarding database corresponding to each switch node through the terminal message, wherein the forwarding database includes the acquired terminal address and corresponding node information;
[0123] When the first switch node detects an abnormality in the ring network link, it opens the blocking protection port in the ring network link to form a blocking protection link, detects the connectivity of each node in the blocking protection link through a preset detection scheme, and updates the forwarding database according to the connectivity results.
[0124] In one embodiment, each switch node on the ring network link further updates the forwarding database corresponding to each switch node through the terminal message, including:
[0125] Obtain the terminal address corresponding to the terminal message through the terminal message passed, and check whether the terminal address is included in the local forwarding database;
[0126] When it is detected that the local forwarding database does not include the terminal address, the correspondence between the terminal address carried in the terminal message and the node information of the corresponding switch node is added to the forwarding database;
[0127] When it is detected that the local forwarding database includes the terminal address, detecting whether the correspondence between the existing terminal address and node information in the forwarding database is the same as the correspondence between the node information and the terminal address carried in the terminal message;
[0128] If they are different, the forwarding database is updated based on the correspondence between the node information carried in the terminal message and the terminal address;
[0129] If they are the same, the update of the forwarding database is terminated.
[0130] Specifically, this embodiment is applied to all switch nodes in a ring network link. For example, taking the switch nodes that a route from the first switch node to the target switch node passes through as an example, when each switch node receives a terminal message, it parses the terminal address (i.e., MAC address) in the terminal message and checks whether the terminal address is included in its local forwarding database. If the terminal address does not exist, the correspondence between the terminal address carried in the terminal message and the node information of the corresponding switch node (in this case, the switch node connected to the terminal address) is added to the local forwarding database of the passed switch node. If the terminal address is already included in the local forwarding database of the passed switch node, the correspondence between the terminal address and node information in the forwarding database is checked to see if it matches the correspondence between the node information and the terminal address carried in the terminal message.
[0131] If they are different, based on the correspondence between the node information carried in the terminal message and the terminal address, the corresponding content in the local forwarding database of the switch node passed through is updated, that is, the locally stored FDB and node ID relationship table is updated; similarly, if they are the same, there is no need to update the forwarding database FDB.
[0132] Through this embodiment, when the terminal address or the switch node corresponding to the terminal address changes, the FDB database stored in other switch nodes in the loop can be updated in time. Compared with the method of directly deleting the FDB database and then re-learning by flooding data in the prior art, the method in this application can improve the update efficiency of the FDB database and prevent unknown unicast messages from flooding the local area network for a long time.
[0133] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0134] Based on the same inventive concept, embodiments of the present application also provide a device for updating a forwarding database in a ring network link, which is used to implement the aforementioned method for updating a forwarding database in a ring network link. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations in one or more embodiments of the device for updating a forwarding database in a ring network link provided below can be found in the aforementioned method for updating a forwarding database in a ring network link, and will not be further elaborated here.
[0135] In one embodiment, Figure 4 As shown, a device for updating a forwarding database in a ring network link is provided, comprising: an acquisition module 41, an update module 42 and a generation module 43, wherein:
[0136] An acquisition module 41 is configured to acquire a terminal message uploaded by a currently connected terminal device and add a node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes a terminal address of the terminal device;
[0137] An updating module 42 is configured to send a new terminal message to a target terminal device via the ring network link. During the process of sending the message to the target terminal device, other switches passing through the ring network link obtain the terminal address of the current terminal device and the node information of the first switch node corresponding to the terminal address through the terminal message. Each switch updates its local forwarding database based on the terminal address and node information. The forwarding database of each switch node includes the obtained terminal address and corresponding node information.
[0138] The generation module 43 is used to open the blocking protection port in the ring network link when an abnormality is detected in the ring network link to obtain the blocking protection link, detect the connectivity of each node in the blocking protection link through a preset detection scheme, and update the forwarding database according to the connectivity result.
[0139] Each module in the aforementioned apparatus for updating the forwarding database in a ring network link may be implemented in whole or in part via software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0141] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0142] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for updating a forwarding database in a ring network link, applied to a first switch node in the ring network link, characterized in that: The method comprises: Obtain a terminal message uploaded by the current terminal device, and add the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes the terminal address of the terminal device; Sending the new terminal message to the target terminal device via the ring network link, so that each switch node along the ring network link passes the terminal message and updates the forwarding database corresponding to each switch node along the path, wherein the forwarding database includes the acquired terminal address and corresponding node information; When an abnormal link is detected in the ring network link, the blocking protection port in the ring network link is opened through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link. The connectivity of each node in the blocking protection link is detected through a preset detection scheme, and the forwarding database is updated according to the connectivity results.
2. The method according to claim 1, characterized in that The acquiring of the terminal message uploaded by the current terminal device and adding the node identifier of the first switch node to the terminal message to obtain a new terminal message includes: Matching the terminal message uploaded by the current terminal device through a preset filtering rule; The node identifier of the first switch node is added to the local area network identifier field of the terminal message to obtain the new terminal message.
3. The method according to claim 1, characterized in that The sending of the new terminal message to the target terminal device through the ring network link includes: When it is detected that the new terminal message is sent to the target switch connected to the target terminal device, the node identifier of the first switch node is stripped off by the target switch.
4. The method according to claim 1, wherein The detecting the connectivity of each node in the blocking protection link by using a preset detection scheme and updating the forwarding database according to the connectivity result includes: Based on the node address of each switch, traverse each switch node, and detect the connectivity between the first direction node port and the second direction node port of each switch node in turn through a preset detection instruction to obtain the connectivity of each switch node; If it is detected that there is a node to be tested in the switch node whose first direction node port and the second direction node port are both in a disconnected state, the corresponding relationship between the node information of the switch node and the corresponding terminal address is deleted.
5. The method according to claim 4, characterized in that The method of traversing each switch node based on the node address of each switch, detecting the connectivity of the node port in the first direction and the node port in the second direction of each switch node through a preset detection instruction, and obtaining the connectivity of each switch node includes: Based on the node address of each switch, traverse each switch node and detect the working status of the node port of each switch node in the first direction; If it is detected that the node port in the first direction is in a normal working state, the network connectivity state of the node port in the first direction is detected; if it is detected that the node port in the first direction is in a connectable state, whether the node port in the first direction is consistent with the node port recorded in the local forwarding database of the first switch node is detected; if they are inconsistent, the forwarding database is updated based on the node port in the first direction; If it is detected that the node port in the first direction is not in a normal working state, the second direction node port of each switch node is detected. If it is detected that the node port in the second direction is in a normal working state, the network connectivity status of the node port in the second direction is detected. If it is detected that the node port in the second direction is in a connectable state, it is detected whether the node port in the second direction is consistent with the node port recorded in the local forwarding database of the first switch node. If they are inconsistent, the forwarding database is updated based on the second direction node port.
6. The method according to claim 4, characterized in that Obtaining the node address of each switch includes: Acquire a ring network protection protocol forwarded in the ring network link, and parse node address relationship information in the ring network protection protocol, wherein the node address relationship information includes the node address of the switch; Storing the node address relationship information locally and updating the locally stored address relationship table; The node address information, node identifier, and locally stored address relationship table of the first switch node are appended to the ring network protection protocol to obtain an updated ring network protection protocol, and the updated ring network protection protocol is forwarded to other switch nodes; wherein, each switch node in the ring network link is traversed through the ring network protection protocol, so that each switch node learns the node address relationship information of each switch node in the ring network link.
7. The method according to claim 1, characterized in that The method further comprises: When detecting that a terminal address corresponding to a terminal device in the ring network link is in an aging state, querying the forwarding database based on the terminal address; If it is detected that the terminal address exists in the forwarding database, the terminal address and the switch node information corresponding to the terminal address are deleted from the forwarding database.
8. The method according to claim 1, characterized in that After updating the forwarding database according to the connection result, the method further includes: The updated forwarding database is synchronized to a preset hardware database device, and the traffic of the terminal device is controlled to be forwarded based on the updated forwarding database.
9. A method for updating a forwarding database in a ring network link, characterized in that: The method comprises: The first switch node obtains a terminal message uploaded by the current terminal device, and adds the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes the terminal address of the terminal device; The first switch node sends the new terminal message to the target terminal device through the ring network link; Each switch node on the ring network link passes through, respectively updating the forwarding database corresponding to each switch node through the terminal message, wherein the forwarding database includes the acquired terminal address and corresponding node information; When the first switch node detects that there is an abnormal link in the ring network link, it opens the blocking protection port in the ring network link through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link, detects the connectivity of each node in the blocking protection link through a preset detection scheme, and updates the forwarding database according to the connectivity result.
10. The method according to claim 9, characterized in that Each switch node passed through on the ring network link updates the forwarding database corresponding to each switch node passed through by the terminal message, including: The switch node passed through obtains the terminal address corresponding to the terminal message and detects whether the terminal address is included in the local forwarding database; When the switch node passing through detects that the terminal address is not included in the local forwarding database, the corresponding relationship between the terminal address carried in the terminal message and the node information of the corresponding first switch node is added to the forwarding database; The switch node passing through, upon detecting that the terminal address is included in the local forwarding database, checks whether the correspondence between the terminal address and the node information in the forwarding database is the same as the correspondence between the node information and the terminal address carried in the terminal message; If different, updating the forwarding database based on the correspondence between the node information carried in the terminal message and the terminal address; If they are the same, then the updating of the forwarding database is ended.
11. A device for updating a forwarding database in a ring network link, characterized in that: The device comprises: an acquisition module, configured to acquire a terminal message uploaded by the currently connected terminal device, and add the node identifier of the first switch node to the terminal message to obtain a new terminal message, wherein the terminal message includes a terminal address of the terminal device; an updating module, configured to send the new terminal message to a target terminal device via the ring network link, so that each switch node along the ring network link passes the terminal message and updates a forwarding database corresponding to each switch node along the path, wherein the forwarding database includes the acquired terminal address and corresponding node information; The generation module is used to, when an abnormal link is detected in the ring network link, open the blocking protection port in the ring network link through the main switch node in the ring network link and the adjacent node of the abnormal link to form a blocking protection link, detect the connectivity of each node in the blocking protection link through a preset detection scheme, and update the forwarding database according to the connectivity result.