Switch and its forwarding table update method, storage medium and computing device

By monitoring link connection status changes in gateway switches and updating forwarding table entries, the problem of low network switching performance is solved, and the update of forwarding table entries at centisecond level is realized, which improves the real-time performance of the industrial Internet.

CN117955895BActive Publication Date: 2024-11-01KYLAND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311864879.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-11-01
Estimated Expiration
2043-12-29

AI Technical Summary

Technical Problem

In the industrial Internet, when networks that support different communication protocols are interconnected, the gateway switch cannot recognize the other party's broadcast clear message, resulting in the aging of the MAC address and the switching performance reaching the minute level, which seriously affects the real-time performance.

Method used

When the gateway switch of the first network monitors the change in the link connection status, it updates its own forwarding table entry and sends an entry update message based on the communication protocol of the first network to realize the update of forwarding table entry at a centisecond level, and solves the problem of The issue of the problem that the update time is too long by forwarding the table entry aging method.

Benefits of technology

It realizes that the switch updates forwarding items within 50ms, improves network switching performance, and meets the real-time requirements of the industrial Internet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117955895B_ABST
    Figure CN117955895B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method for updating a switch and its forwarding table items, a storage medium and a computing device. The method is used to update the forwarding table items of each switch of a first network, wherein the first port of each first gateway switch of the first network is connected to the corresponding second gateway switch of the second network, the second gateway switch manages the connection with the first gateway switch based on a second communication protocol, and each switch of the first network does not recognize the message of the second communication protocol, including: when the first port of each first gateway switch detects that the connection state of the link between the first port and the corresponding second gateway switch has changed, the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, updates its own forwarding table items, and sends a table item update message based on the first communication protocol to other switches of the first network, so as to achieve a centisecond level update of the forwarding table items of the first network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital communications, and in particular to a switch and a method for updating forwarding table items thereof, a storage medium and a computing device. Background Art

[0002] In the field of industrial Internet, there are more and more heterogeneous networks consisting of networks supporting different communication protocols. Based on the real-time requirements of the industrial Internet, when switching interconnection links between networks supporting different communication protocols, a switching performance of about 50ms is required.

[0003] However, when the interconnection link reaches the edge, the gateway switches of the networks supporting different communication protocols often cannot recognize the clearing messages broadcast by the other party, resulting in the need for MAC aging before it can be passed. The MAC address aging time generally defaults to 5 minutes, and the switching performance reaches the minute level, which seriously affects the real-time performance of the Industrial Internet. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a method for updating a switch and its forwarding table items, a storage medium and a computing device. The technical solution of the embodiment of the present invention is used for updating the forwarding table items of a switch in a first network that is heterogeneously interconnected with a second network. When a port of a gateway switch of the first network detects that the connection state of the link between it and the gateway switch of the second network has changed and the gateway switch of the first network determines that the change has caused the forwarding state of the port to also change, the gateway switch of the first network updates its own forwarding table items and sends a table item update message based on the communication protocol of the first network to each switch of the first network, thereby using the table item update message to implement the forwarding table item update of the switch of the first network at the centisecond level, solving the problem that it takes too long to update the forwarding table items by the method of forwarding table item aging.

[0005] In a first aspect, an embodiment of the present invention provides a method for updating forwarding table entries, which is used to update forwarding table entries of each switch of a first network, wherein the first port of each first gateway switch of the first network is connected to the corresponding second gateway switch of the second network, the second gateway switch manages the connection with the first gateway switch based on a second communication protocol, and each switch of the first network does not recognize the message of the second communication protocol. The method is applied to the first gateway switch, comprising: when the first port of each first gateway switch detects that the connection state of the link between the first port and the corresponding second gateway switch has changed, receiving the connection state change information of the link sent by the first port; when the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, it updates its own forwarding table entries, and sends a table entry update message based on the first communication protocol to other switches of the first network, so that each of the other switches updates their respective forwarding table entries according to the table entry update message.

[0006] As described above, when a port of the gateway switch of the first network detects that the connection state of the link between it and the gateway switch of the second network has changed, and the gateway switch of the first network determines that the change has caused the forwarding state of the port to also change, the gateway switch of the first network updates its own forwarding table items and sends a table item update message based on the communication protocol of the first network to each switch of the first network, so that the switches of the first network use the table item update message to implement centisecond-level forwarding table item updates, thereby solving the problem of too long time to update the forwarding table items by the method of forwarding table item aging.

[0007] In a possible implementation manner of the first aspect, the receiving the connection state change information of the link sent by the first port specifically includes: receiving the connection state change information sent by the first port through an interrupt.

[0008] As described above, in a heterogeneous network, when the port of each gateway switch interconnected with the other party detects a change in the link connection status between the switch and the other party's gateway switch, the gateway switch is made aware of the change through an interruption, thereby processing it in real time.

[0009] In a possible implementation manner of the first aspect, the connection state is a connection state of a link layer.

[0010] From the above, the connection status of the link can be detected at the link layer, which can not only detect its physical connection and disconnection, but also detect the connection and disconnection caused by the control command of its maintenance.

[0011] In a possible implementation manner of the first aspect, the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, including: when determining that the connection state of the first port has changed, the first gateway switch also obtains the forwarding state of the first port before the connection state changes; when determining that the forwarding state of the first port before the connection state changes is a forwarding state, the first gateway switch determines that the state change of the first port is from a forwarding state to a non-forwarding state.

[0012] As described above, based on the connection state change information of the first port of the first gateway switch and the forwarding state of the first port before the connection state changes, it is possible to accurately determine whether the state change of the first port of the first gateway switch is from the forwarding state to the non-forwarding state or from the non-forwarding state to the forwarding state, thereby meeting the needs of various scenarios.

[0013] In a possible implementation of the first aspect, when it is determined that the state change of the first port is from a forwarding state to a non-forwarding state, the first gateway switch updates its own forwarding table entry and sends a table entry update message based on a first communication protocol to other switches of the first network, including: the first gateway switch deletes the forwarding table entry related to the first port in its own forwarding table, and sends a first table clearing message based on the first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the first port in their respective forwarding table entries. The first table clearing message is also a table entry update message.

[0014] As described above, the first gateway switch sends a first table clearing message based on the first communication protocol to other switches in the first network, so that other switches delete the forwarding table entries related to the first port of the first gateway switch in their respective forwarding table entries within 50 ms.

[0015] In a possible implementation manner of the first aspect, the first gateway switch determines that the forwarding state of its first port has changed according to the connection state change information, including: when the connection state changes from disconnected to connected, the first gateway switch also obtains its master / slave parameters, and the master / slave parameters at least include: whether it is the master first gateway switch and whether to preempt the forwarding state of the corresponding port of the non-master first gateway switch; when the first gateway switch is configured as the master first gateway switch and preempts the forwarding state of the corresponding port of the non-master first gateway switch, the first gateway switch determines that the state change of the first port is port preemption.

[0016] From the above, according to the first port of the first gateway switch, it is detected that the corresponding link changes from disconnection to connection and the master-slave parameters of the first gateway switch, so as to accurately determine whether the forwarding state of the first port of the first gateway switch needs to change and whether to preempt the forwarding state, thereby meeting the needs of various scenarios.

[0017] In a possible implementation of the first aspect, when it is determined that the state change of the first port is port preemption, the first gateway switch updates its own forwarding table entry, and sends a table entry update message based on the first communication protocol to other switches of the first network, including: the first gateway switch deletes the forwarding table entry related to the preempted target port in its own forwarding table, and sends a second table clearing message based on the first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the preempted target port from their own forwarding table according to the second table clearing message, and the preempted target port is the corresponding port of the non-active first gateway switch whose forwarding state is preempted by the first port. The second table clearing message is also a table entry update message.

[0018] As described above, the first gateway switch sends the second table clearing message based on the first communication protocol to other switches in the first network, so that other switches delete the forwarding table entries related to the snatched target port in their respective forwarding table entries within 50 ms.

[0019] In a second aspect, an embodiment of the present invention provides a switch, which is a first gateway switch for a first network, wherein the first port of each first gateway switch of the first network is connected to the second gateway switch of the second network, the second gateway switch manages the connection with the first gateway switch based on a second communication protocol, and each switch of the first network does not recognize the message of the second communication protocol, including: a connection status receiving module, which is used for receiving the connection status change information of the link sent by the first port when the first port of each first gateway switch detects that the connection status of the link between the first port and the corresponding second gateway switch has changed; and a table clearing message sending module, which is used for the first gateway switch to update its own forwarding table entry when it determines that the forwarding state of the first port has changed according to the connection status change information, and send a table entry update message based on the first communication protocol to other switches of the first network, so that each other switch updates its respective forwarding table entry according to the table entry update message.

[0020] As described above, when a port of the gateway switch of the first network detects that the connection state of the link between it and the gateway switch of the second network has changed, and the gateway switch of the first network determines that the change has caused the forwarding state of the port to also change, the gateway switch of the first network updates its own forwarding table items and sends a table item update message based on the communication protocol of the first network to each switch of the first network, so that the switches of the first network use the table item update message to implement centisecond-level forwarding table item updates, thereby solving the problem of too long time to update the forwarding table items by the method of forwarding table item aging.

[0021] In a possible implementation manner of the second aspect, the connection status receiving module is specifically configured to receive the connection status change information sent by the first port through an interrupt.

[0022] As described above, in a heterogeneous network, when the port of each gateway switch interconnected with the other party detects a change in the link connection state between the switch and the other party's gateway switch, the gateway switch is made aware of the change through an interruption, thereby processing it in real time.

[0023] In a possible implementation of the second aspect, the connection state is a connection state of a link layer.

[0024] From the above, the connection status of the link can be detected at the link layer, which can not only detect its physical connection and disconnection, but also detect the connection and disconnection caused by the control command of its maintenance.

[0025] In a possible implementation of the second aspect, when the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, the clearing table sending module is specifically used to, when it is determined that the connection state of the first port has changed, the first gateway switch also obtains the forwarding state of the first port before the connection state changes; when it is determined that the forwarding state of the first port before the connection state changes is a forwarding state, the first gateway switch determines that the state change of the first port is from a forwarding state to a non-forwarding state.

[0026] As described above, the first port of the first gateway switch detects the forwarding state of the corresponding link from connected to disconnected and before the connection state of the first port changes, thereby accurately determining whether the forwarding state of the first port of the first gateway switch needs to change. This meets the needs of various scenarios.

[0027] In a possible implementation of the second aspect, when it is determined that the state change of the first port is from a forwarding state to a non-forwarding state, the table clearing message sending module updates its own forwarding table entry in the first gateway switch, and sends a table entry update message based on the first communication protocol to other switches of the first network, specifically for the first gateway switch to delete the forwarding table entry related to the first port in its own forwarding table, and send a first table clearing message based on the first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the first port in their respective forwarding table entries. The first table clearing message is also a table entry update message.

[0028] As described above, the first gateway switch sends a first table clearing message based on the first communication protocol to other switches in the first network, so that other switches delete the forwarding table entries related to the first port of the first gateway switch in their respective forwarding table entries within 50 ms.

[0029] In a possible implementation manner of the second aspect, when the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, the clearing table sending module is specifically used to, when the connection state changes from disconnected to connected, the first gateway switch also obtains its master-slave parameters, and the master-slave parameters at least include: whether it is the master first gateway switch and whether to preempt the forwarding state of the corresponding port of the non-master first gateway switch; and is also specifically used to, when the first gateway switch is configured as the master first gateway switch and preempts the forwarding state of the corresponding port of the non-master first gateway switch, the first gateway switch determines that the state change of the first port is port preemption.

[0030] From the above, according to the first port of the first gateway switch, it is detected that the corresponding link changes from disconnection to connection and the master-slave parameters of the first gateway switch, so as to accurately determine whether the forwarding state of the first port of the first gateway switch needs to change and whether to preempt the forwarding state, thereby meeting the needs of various scenarios.

[0031] In a possible implementation of the second aspect, when it is determined that the state change of the first port is port preemption, the table clearing message sending module updates its own forwarding table entry in the first gateway switch, and sends a table entry update message based on the first communication protocol to other switches of the first network, specifically for the first gateway switch to delete the forwarding table entry related to the preempted target port in its own forwarding table, and send a second table clearing message based on the first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the preempted target port from their own forwarding table according to the second table clearing message, and the preempted target port is the corresponding port of the non-active first gateway switch whose forwarding state is preempted by the first port. The second table clearing message is also a table entry update message.

[0032] As described above, the first gateway switch sends the second table clearing message based on the first communication protocol to other switches in the first network, so that other switches delete the forwarding table entries related to the snatched target port in their respective forwarding table entries within 50 ms.

[0033] In a third aspect, an embodiment of the present invention provides a computing device, including:

[0034] bus;

[0035] A communication interface connected to the bus;

[0036] at least one processor connected to the bus; and

[0037] At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any implementation of the first aspect of the present invention.

[0038] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having program instructions stored thereon, wherein when the program instructions are executed by a computer, the computer executes any implementation method described in the first aspect of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1A It is a structural diagram of a typical scenario 1 of a heterogeneous network embodiment 1 of the present invention;

[0040] Figure 1B This is a schematic diagram of a typical scenario 2 of a heterogeneous network embodiment 1 of the present invention;

[0041] Figure 1C This is a schematic diagram of a typical scenario 3 of a heterogeneous network embodiment 1 of the present invention;

[0042] Figure 2A schematic diagram of a flow chart of a first embodiment of a method for updating a forwarding table entry of the present invention;

[0043] Figure 3 This is a schematic diagram of the structure of a switch embodiment 1 of the present invention;

[0044] Figure 4 This is a schematic diagram of a typical scenario of a heterogeneous network embodiment 2 of the present invention;

[0045] Figure 5A A schematic flow chart of a method for switching between active and standby functions according to Embodiment 2 of a method for updating a forwarding table entry of the present invention;

[0046] Figure 5B A schematic flow chart of a forwarding state preemption method of a second embodiment of a method for updating a forwarding table entry of the present invention;

[0047] Figure 6 This is a schematic diagram of the structure of a switch embodiment 2 of the present invention;

[0048] Figure 7 1 is a structural diagram of a computing device according to various embodiments of the present invention. DETAILED DESCRIPTION

[0049] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0050] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present invention described here can be implemented in an order other than that illustrated or described here.

[0051] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the previous and next steps can be interchanged, or they can be executed simultaneously.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0053] An embodiment of the present invention provides a method for updating a switch and its forwarding table items, a storage medium and a computing device. The method is used to update the forwarding table items of each switch of a first network. The first port of each first gateway switch of the first network is connected to the corresponding second gateway switch of the second network. The second gateway switch manages the connection with the first gateway switch based on a second communication protocol. The switches of the first network do not recognize the messages of the second communication protocol. The method is applied to the first gateway switch, including: when the first port of each first gateway switch detects that the connection state of the link between the first port and the corresponding second gateway switch has changed, receiving the connection state change information of the link sent by the first port; when the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, the first gateway switch updates its own forwarding table items, and sends the table item update message based on the first communication protocol to other switches of the first network, so that the other switches update their respective forwarding table items according to the table item update message.

[0054] The technical solution of the embodiment of the present invention is used for updating the forwarding table entries of switches in a first network that is heterogeneously interconnected with a second network. When a port of a gateway switch of the first network detects that the connection state of the link between it and the gateway switch of the second network has changed and the gateway switch of the first network determines that the change causes the forwarding state of the port to also change, the gateway switch of the first network updates its own forwarding table entries and sends a table entry update message based on the communication protocol of the first network to each switch of the first network, so that the switch of the first network uses the table entry update message to implement centisecond-level forwarding table entry updates, thereby solving the problem of too long time to update forwarding table entries by the method of forwarding table entry aging.

[0055] The following describes various embodiments of the present invention in conjunction with the accompanying drawings. First, a first embodiment of a method for updating a forwarding table entry and a switch embodiment are described.

[0056] Combine the following Figures 1A to 1C A method for updating a forwarding table entry is introduced in a first embodiment, and a heterogeneous network is applied in the first embodiment.

[0057] In a heterogeneous network embodiment 1, it includes: a first network and a second network, the first port of each first gateway switch of the first network is connected to a second gateway switch of the second network, the switches of the first network are connected based on a first communication protocol; the second gateway switch manages the connection with the first gateway switch based on a second communication protocol, and the messages of the second communication protocol are not recognized by the switches of the first network. A monitoring function is set at the first port of each first gateway switch to monitor its connection status with the second network.

[0058] Among them, the networks in the heterogeneous network are generally interconnected through at least two different paths to achieve redundant interconnection, at least one of which is a backup link.

[0059] Figure 1A , Figure 1B and Figure 1C The following are several typical scenarios of heterogeneous network interconnection. In each figure, the switches of the first network include switches SW1-1, SW1-2, SW1-3 and SW1-4, switches SW1-1 and SW1-2 are the first gateway switches, and the switches of the second network include switches SW2-1, SW2-2, SW2-3 and SW2-4, switches SW2-1 and SW2-2 are the second gateway switches. Several typical scenarios of heterogeneous network interconnection can be considered as a combination of these. It should be emphasized that in actual scenarios, the number of switches, gateway switches, and connection ports of gateway switches to another network in each network can change according to time conditions, but the working principles are basically the same.

[0060] exist Figure 1A In the example, switches SW1-1 and SW1-2 are respectively provided with first ports, switch SW1-1 is connected to the second port of switch SW2-1 through its first port link, switch SW1-2 is connected to the second port of gateway switch SW2-2 through its first port link, and the first network and the second network are stacked. Figure 1B In the embodiment, the switch SW1-1 is provided with two first ports, which are respectively connected to the switches SW2-1 and SW2-2, and the switch SW1-2 is also provided with two first ports, which are respectively connected to the switches SW2-1 and SW2-2. Figure 1C In the embodiment, switches SW1-1 and SW1-2 are respectively provided with first ports, which are respectively connected to switch SW2-1.

[0061] Figure 1A , Figure 1B and Figure 1C The switches SW1-1 and SW1-2 in the embodiment perform a method for updating a forwarding table entry as described in Embodiment 1.

[0062] In order to clearly and concisely describe a method for updating a forwarding table entry, Figure 1A As an example, the switch SW1-1 in the example can also be used for Figure 1A The switch SW1-2 can also be used for Figure 1B SW1-1 and SW1-2 and Figure 1C The switches SW1-1 and SW1-2.

[0063] Figure 2 The flowchart of a first embodiment of a method for updating a forwarding table entry is shown, including steps S110 to S130.

[0064] Taking the link between the first port of switch SW1-1 and switch SW2-1 as the active link between the first network and the second network as an example, when it is disconnected, the active link between the first network and the second network is switched to the link between the first port of switch SW1-2 and switch SW2-2.

[0065] S110: The first port of the switch SW1-1 detects the connection status of the link with the second port of the switch SW2-1 at the link layer.

[0066] The first port of the switch SW1 - 1 independently detects the connection status with the switch SW2 - 1 , and the switch SW1 - 1 does not recognize the flush message (flush message) of the switch SW2 - 1 based on the second communication protocol.

[0067] Among them, in some embodiments, the connection status of the link between the first port of switch SW1-1 and the second port of switch SW2-1 is detected at the link layer, which can not only detect its physical connection and disconnection, but also detect the connection and disconnection caused by the control command maintained by it.

[0068] In some embodiments, the second communication protocol is a smartlink protocol.

[0069] S120: When the first port of the switch SW1-1 detects that the connection state of the link between it and the second port of the switch SW2-1 changes, the switch SW1-1 receives the connection state change information of the link sent by the first port.

[0070] The connection status change includes: a change from connected to disconnected, namely link down, and a change from disconnected to connected, namely link up.

[0071] In some embodiments, the first port of the switch SW1 - 1 notifies the switch SW1 - 1 of the state change through an interrupt, so that the switch SW1 - 1 senses the state change in real time.

[0072] In some embodiments, when the connection between the switch SW1 - 1 and the switch SW2 - 1 is disconnected, the switch SW2 - 1 also detects the disconnection state based on the second communication protocol. For example, the disconnection state is detected based on the smartlink protocol.

[0073] S130: When the switch SW1-1 determines that the forwarding state of its first port has changed according to the connection state change information, the switch SW1-1 updates its own forwarding table entry and sends a table entry update message based on the first communication protocol to other switches in the first network.

[0074] The forwarding table entries include MAC forwarding table entries and ARP forwarding table entries.

[0075] The switches SW1-2, SW1-3 and SW1-4 of the first network update their respective forwarding entries according to the received entry update message. Updating the forwarding entries according to the received entry update message can be completed within 50ms without relying on MAC table aging to update the forwarding entries.

[0076] Among them, in each embodiment of the present invention, the forwarding state of the port includes a forwarding state and a non-forwarding state. The forwarding state means that the port can forward message data outward, and the non-forwarding state means that the port cannot forward message data outward.

[0077] Among them, when switch SW2-1 also detects the connection state change based on the second communication protocol and determines that the connection state change causes the forwarding state of its second port to change, it updates its own forwarding table entry and sends a table entry update message based on the second communication protocol to other switches in the second network.

[0078] Among them, when the second port of the switch SW2-1 or the switch SW2-2 of the second network changes from a non-forwarding state to a forwarding state and starts to forward data to the first network, each switch in the first network performs forwarding table entry learning based on the received or sent data packets, updates its own forwarding table entries, and adds forwarding table entries related to the second port of the switch SW2-1 or the switch SW2-2 of the second network that changes from a non-forwarding state to a forwarding state.

[0079] In some embodiments, the first communication protocol is the DRP protocol, and the first network is a network based on a DRP ring. The table entry update message sent by the switch SW1-1 is based on the DRP protocol, and the table entry update message is a network topology change message.

[0080] In some embodiments, when the first port of the switch SW1-1 detects that the link between it and the second port of the switch SW2-1 changes from connected to disconnected, i.e., link down occurs, and the first port of the switch SW1-1 was previously in the forwarding state, the switch SW1-1 determines that the forwarding state of the first port will change from the forwarding state to the non-forwarding state, and the switch SW1-1 deletes the forwarding table entry related to its first port from its own forwarding table, and sends a first clearing message based on the first communication protocol to the switches SW1-2, SW1-3, and SW1-4 of the first network, and the switches SW1-2, SW1-3, and SW1-4 of the first network delete the forwarding table entry related to the first port of the switch SW1-1 from their respective forwarding tables according to the received first clearing message. The first clearing message is a table entry update message.

[0081] It should be emphasized that: in the embodiment of the present invention, the forwarding table entry related to the first port of the switch SW1-1 is the forwarding table entry related to the link between the first port of the switch SW1-1 and the second port of the switch SW2-1 of the second network, and the forwarding table entry related to the first port of the switch SW1-2 is the forwarding table entry related to the link between the first port of the switch SW1-2 and the second port of the switch SW2-2 of the second network.

[0082] In some embodiments, through the master-slave parameters of the switches, the switch SW1-1 is configured as the master first gateway switch, the switch SW1-2 is configured as the non-master first gateway switch, i.e., the backup first gateway switch, and the first port of the switch SW1-1 is configured to seize the forwarding state of the first port of the switch SW1-2. When the switch SW1-1 detects that the link between it and the second port of the switch SW2-1 changes from disconnection to connection, i.e., link up, the switch SW1-1 determines that its first port will seize the forwarding state of the first port of the switch SW2-1, so that the forwarding state will change from the non-forwarding state to the forwarding state. The switch SW1-1 deletes the forwarding table entry related to the first port of the switch SW2-1 from its own forwarding table, and sends the second clearing table message based on the first communication protocol to the switches SW1-2, SW1-3, and SW1-4 of the first network. The switches SW1-2, SW1-3, and SW1-4 of the first network delete the forwarding table entry related to the first port of the switch SW1-2 from their respective forwarding tables according to the second clearing table message received. The second clearing table message page is a table entry update message.

[0083] A method for updating a forwarding table entry Embodiment 1 can also be applied to Figure 1B and Figure 1C On the switch SW1-1 or SW2-1 on the heterogeneous network, Figure 1B and Figure 1C The forwarding table entries of each switch in the first network are updated within 50ms.

[0084] In summary, a first embodiment of a method for updating a forwarding table entry is used for updating a forwarding table entry of a switch in a first network that is heterogeneously interconnected with a second network. When a port of a gateway switch of the first network detects that the connection state of a link between the gateway switch of the first network and the gateway switch of the second network has changed and the gateway switch of the first network determines that the change has caused the forwarding state of the port to also change, the gateway switch of the first network updates its own forwarding table entry and sends a table entry update message based on the communication protocol of the first network to each switch of the first network, so that the switches of the first network can update the forwarding table entry at the centisecond level, thereby solving the problem of taking too long to update the forwarding table entry by the method of aging the forwarding table entry.

[0085] Figure 1A , Figure 1B and Figure 1C The switches SW1-1 and SW1-2 are switches described in the first embodiment of the switch, and execute the method described in the first embodiment of the method for updating a forwarding table entry, which has all the advantages of the first embodiment of the method for updating a forwarding table entry.

[0086] Figure 3 The structure of a switch embodiment 1 is shown, which includes: a connection status detection module 310, a connection status receiving module 320, and a table clearing message sending module 330.

[0087] In order to clearly and concisely describe the method of the first embodiment of a method for updating a forwarding table entry, Figure 1A Take the switch SW1-1 in as an example.

[0088] The connection status detection module 310 is used for the first port of the switch SW1-1 to detect the connection status of the link with the second port of the switch SW2-1 at the link layer. For its working principle and advantages, please refer to step S110 of the first embodiment of a method for updating a forwarding table entry.

[0089] The connection state receiving module 320 is used for the switch SW1-1 to receive the connection state change information of the link sent by the first port when the first port of the switch SW1-1 detects that the connection state of the link between the first port of the switch SW2-1 changes. For its working principle and advantages, please refer to step S120 of the first embodiment of a method for updating a forwarding table entry.

[0090] The clearing table message sending module 330 is used for, when the switch SW1-1 determines that the forwarding state of its first port has changed according to the connection state change information, the switch SW1-1 updates its own forwarding table entry, and sends a table entry update message based on the first communication protocol to other switches of the first network, so that the other switches update the forwarding table entry according to the table entry update message. For its working principle and advantages, please refer to step S130 of the first embodiment of a method for updating forwarding table entries.

[0091] The following is a second embodiment of a method for updating a forwarding table entry and a second embodiment of a switch.

[0092] Embodiment 2 of a method for updating a forwarding table entry is a detailed implementation of Embodiment 1 of a method for updating a forwarding table entry, and has all the advantages thereof.

[0093] Combine first Figure 4 A second heterogeneous network embodiment of a second embodiment of a method for updating a forwarding table entry is introduced.

[0094] In order to clearly and concisely describe a second embodiment of a heterogeneous network, Figure 1A The detailed implementation method corresponds to Figure 4 For example.

[0095] Figure 4 The structure of a second heterogeneous network embodiment is shown. The first network includes switches SW3-1, SW3-2, SW3-3 and SW3-4, which form a DRP ring based on the RDP communication protocol. The switches SW3-1 and SW3-2 are gateway switches for interconnecting the first network and the second network, namely, the first gateway switches.

[0096] The master-slave parameter configuration of switch SW3-1 is as follows: switch SW3-1 is the master first gateway switch, switch SW3-2 is the backup first gateway switch, switch SW3-1 is configured in preemptive mode, and the first port of switch SW3-1 preempts the forwarding state of the first port of switch SW3-2 when connected.

[0097] The second network includes switches SW4-1, SW4-2, SW4-3 and SW4-4, and the second network only includes switches SW4-1 and SW4-2; switches SW4-1 and SW4-2 are gateway switches for interconnecting the second network with the first network, namely, second gateway switches.

[0098] Switches SW4-1 and SW4-2 are connected by stacking, so that switches SW4-1 and SW4-2 can manage the connection status between the second network and the first network based on the smartlink protocol, wherein the second port of switch SW4-1 is the master port of the smartlink protocol, and the second port of switch SW4-2 is the slave port of the smartlink protocol. The second port of switch SW4-1 is set to preemptive mode. In the smartlink protocol, whether the second port of switch SW4-1 is set to preemptive mode is consistent with the first port setting of switch SW3-1 of the first network, that is, whether the connection port of the connected gateway switch of the two networks is set to preemptive mode should be consistent.

[0099] The first port of switch SW3-1 is provided with a monitoring function to detect the connection status of the link between the first port of switch SW3-1 and the second port of switch SW4-1; the first port of switch SW3-2 is also provided with a monitoring function to detect the connection status between the first port of switch SW3-2 and the second port of switch SW4-2.

[0100] Figure 4 The switch SW3-1 and the switch SW3-2 in the embodiment perform a method for updating a forwarding table entry as described in Embodiment 2.

[0101] In a second embodiment of a method for updating a forwarding table entry, because the switch SW3-1 and the switch SW3-2 adopt the master-slave mode and the switch SW3-1 is configured with the preemptive mode, the switch SW3-1 and the switch SW3-2 have the following four scenarios.

[0102] Scenario 1: The link between the first port of switch SW3-1 and the second port of switch SW4-1 is in a connected state, and the first port of switch SW3-1 is in a forwarding state, the link between the first port of switch SW3-2 and the second port of switch SW4-2 is in a connected state, but the first port of SW3-2 is in a non-forwarding state.

[0103] Scenario 2: The link between the first port of switch SW3-1 and the second port of switch SW4-1 is in a connected state, and the first port of switch SW3-1 is in a forwarding state, and the link between the first port of switch SW3-2 and the second port of switch SW4-2 is in a disconnected state.

[0104] Scenario 3: The link between the first port of switch SW3-1 and the second port of switch SW4-1 is disconnected, the link between the first port of switch SW3-2 and the second port of switch SW4-2 is connected, and the first port of switch SW3-2 is in forwarding state.

[0105] Scenario 4: The link between the first port of the switch SW3 - 1 and the second port of the switch SW4 - 1 is disconnected, and the link between the first port of the switch SW3 - 2 and the second port of the switch SW4 - 2 is disconnected.

[0106] In scenario 1, when the link between the first port of switch SW3-1 and the second port of switch SW4-1 becomes link down, the link changes from connected to disconnected, and the link between the first port of switch SW3-1 and the second port of switch SW4-1 is switched to the link between the first port of switch SW3-2 and the second port of switch SW4-2, thereby realizing the process of switching the master and standby functions of the switches.

[0107] It should be noted that: in scenario 1, if the switch SW3-1 is configured in non-preemptive mode, the switch SW3-1 also executes the same process to implement the process of switching the active and standby functions of the switch.

[0108] Figure 5A The flowchart of the active / standby function switching method of the second embodiment of the method for updating the forwarding table entry is shown, including steps S5110 to S5140.

[0109] S5110: The first port of the switch SW3-1 detects the connection status of the link with the second port of the switch SW4-1 at the link layer.

[0110] Among them, the connection status of the link is detected at the link layer, which can not only detect its physical connection and disconnection, but also detect the connection and disconnection caused by the control command of its maintenance.

[0111] S5120: When the first port of the switch SW3-1 detects that the connection with the switch SW4-1 is link down, the switch SW3-1 receives the disconnection status information sent by its first port through an interrupt.

[0112] The interruption enables the switch SW3 - 1 to quickly sense the change in the connection status of the link.

[0113] S5130: The switch SW3-1 determines that the forwarding state of the first port of the switch SW3-1 changes from the forwarding state to the non-forwarding state based on the connection state change information and the fact that the first port of the switch SW3-1 was in the forwarding state before the link down.

[0114] S5140: Switch SW3-1 deletes the forwarding table entry corresponding to the first port of switch SW3-1 from its own forwarding table, and sends a first topology change notification message based on the DRP protocol to switches SW3-2, SW3-3 and SW3-4, so that switches SW3-2, SW3-3 and SW3-4 delete the forwarding table entry corresponding to the first port of switch SW3-1 from their own forwarding table entries.

[0115] Among them, the topology change notification message is essentially a table clearing message based on the DRP protocol, which is a message that can be recognized by switches SW3-2, SW3-3 and SW3-4. Switches SW3-2, SW3-3 and SW3-4 quickly delete the forwarding table entry corresponding to the first port of switch SW3-1 from their own forwarding table entries based on the received topology change notification message.

[0116] It should be emphasized that: in the embodiment of the present invention, the forwarding table entry related to the first port of the switch SW3-1 is the forwarding table entry related to the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 of the second network, and the forwarding table entry related to the first port of the switch SW3-2 is the forwarding table entry related to the link between the first port of the switch SW3-2 and the second port of the switch SW4-2 of the second network.

[0117] Among them, at this time, switch SW3-2 adds the forwarding table entry related to the first port of switch SW3-2 through forwarding table entry learning according to the message of received or sent data, that is, the forwarding table entry corresponding to the link between the first port of switch SW3-2 and the second port of switch SW4-2; switches SW3-1, SW3-3 and SW3-4 quickly add the table entry related to the first port of switch SW3-2 through forwarding table entry learning according to the message of received or sent data.

[0118] Among them, at this point, the first port of switch SW3-2 can forward data to the second network, realizing rapid switching of the link between the first port of switch SW3-1 and the second port of switch SW4-1 to the link between the first port of switch SW3-2 and the second port of switch SW4-2.

[0119] Among them, at this time in the second network, switch SW4-1 detects that the link between its second port and the first port of switch SW3-1 is link down, and the second port of switch SW4-1 becomes a blocked slave port based on the smartlink protocol, and the second port of switch SW4-2 becomes a master port based on the smartlink protocol, and the corresponding forwarding table entry is updated. At this time, each switch in the second network also adds the table entry corresponding to the second port of switch SW4-2 through forwarding table entry learning, and the second port of switch SW4-2 can forward data to the first network, realizing the link between the first port of switch SW3-1 and the second port of switch SW4-1 to the link between the first port of switch SW3-2 and the second port of switch SW4-2. Rapid switching.

[0120] In scenario 2, when the link between the first port of switch SW3-1 and the second port of switch SW4-1 goes down, the connection changes to disconnection, and the connection between the first network and the second network is completely disconnected. Switch SW3-1 executes Figure 5A Steps S5110 to S5140 perform related forwarding table entry updates, which will not be described in detail here.

[0121] It should be noted that: in scenario 2, if the switch SW3-1 is configured in non-preemptive mode, when the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 is down, the connection changes from connected to disconnected, and the connection between the first network and the second network is also disconnected. The switch SW3-1 also executes Figure 5A Steps S5110 to S5140 perform related forwarding table entry updates, but do not perform forwarding table entry learning, which will not be described in detail here.

[0122] It should also be pointed out that: in scenario 2, when the link between the first port of switch SW3-2 and the second port of switch SW4-2 becomes link up, that is, it changes from disconnected to connected, regardless of whether switch SW3-1 is configured in non-preemptive mode, the forwarding state of each first port in the first network switch remains unchanged.

[0123] In scenario 3, when the link between the first port of switch SW3-1 and the second port of switch SW4-1 becomes link up, that is, it changes from disconnected to connected, because switch SW3-1 is the primary first gateway switch and is configured in preemptive mode, the first port of switch SW3-1 preempts the forwarding state of the first port of switch SW3-2.

[0124] It should be pointed out that: in scenario 3, if the switch SW3-1 is configured in non-preemptive mode, when the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 becomes link up, that is, changes from disconnected to connected, the forwarding status of the first port of the switch SW3-2 and the second port of the switch SW4-2 remains unchanged.

[0125] Figure 5B The flowchart of the forwarding state preemption method of the second embodiment of a method for updating a forwarding table entry is shown, including steps S5210 to S5240.

[0126] S5210: The first port of the switch SW3-1 detects the connection status of the link with the second port of the switch SW4-1 at the link layer.

[0127] Among them, the connection status of the link is detected at the link layer, which can not only detect its physical connection and disconnection, but also detect the connection and disconnection caused by the control command of its maintenance.

[0128] S5220: When the first port of the switch SW3-1 detects that the connection with the switch SW4-1 is link up, the switch SW3-1 receives the connection status information sent by its first port through an interrupt.

[0129] The interruption enables the switch SW3 - 1 to quickly sense the change in the connection status of the link.

[0130] S5230: Based on the connectivity status information and the master / slave parameter configuration of the switch SW3-1, the switch SW3-1 determines that the forwarding state of the first port of the switch SW3-1 will change from the non-forwarding state to the forwarding state.

[0131] Among them, at the same time, the first port of switch SW3-2 is the target port to be seized, and its forwarding state will also change from forwarding state to non-forwarding state. When there are multiple ports that can be the target ports to be seized, a comprehensive selection is made based on the load of each port in the multiple ports and the priority level of the data message.

[0132] S5240: Switch SW3-1 deletes the forwarding table entry corresponding to the first port of switch SW3-2 from its own forwarding table, and sends a second topology change notification message based on the DRP protocol to switches SW3-2, SW3-3 and SW3-4, so that switches SW3-2, SW3-3 and SW3-4 delete the forwarding table entry corresponding to the first port of switch SW3-2 from their own forwarding table entries.

[0133] Among them, the topology change notification message is essentially a table clearing message based on the DRP protocol, which is a message that can be recognized by switches SW3-2, SW3-3 and SW3-4. Switches SW3-2, SW3-3 and SW3-4 quickly delete the forwarding table entry corresponding to the first port of switch SW3-2 from their own forwarding table entries based on the received topology change notification message.

[0134] Among them, at this time, switch SW3-1 adds the table items related to the first port of switch SW3-1 through forwarding table item learning according to the message of received or sent data, that is, the table items corresponding to the link between the first port of switch SW3-1 and the second port of switch SW4-1; switches SW3-2, SW3-3 and SW3-4 quickly add the table items related to the first port of switch SW3-1 through forwarding table item learning according to the message of received or sent data.

[0135] Herein, the first port of the switch SW3 - 1 can now forward data to the second network, thereby enabling the first port of the switch SW3 - 1 to quickly seize the forwarding state of the first port of the switch SW3 - 2 .

[0136] Among them, at this time in the second network, the switch SW4-1 detects that the link between its second port and the first port of the switch SW3-1 is link up, and the second port of the switch SW4-2 becomes a blocked slave port based on the smartlink protocol, and the second port of the switch SW4-1 becomes the master port based on the smartlink protocol, and the corresponding forwarding table entries are updated; each switch in the second network also adds the table entry corresponding to the second port of the switch SW4-1 through forwarding table entry learning, and the second port of the switch SW4-1 can forward data to the first network, thereby realizing the rapid preemption of the master port function of the second port of the switch SW4-2 by the second port of the switch SW4-1.

[0137] In scenario 4, when the link between the first port of switch SW3-1 and the second port of switch SW4-1 becomes link up, that is, changes from disconnected to connected, the first port of switch SW3-1 changes to the forwarding state, and forwarding table entries are learned according to the received or sent data packets to realize data forwarding of the second network.

[0138] It should be pointed out that: in scenario 4, if the switch SW3-1 is configured in non-preemptive mode, when the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 becomes link up, that is, changes from disconnected to connected, the first port of the switch SW3-1 changes to the forwarding state, and the forwarding table entry learning is performed according to the received or sent data packet, and the table entry corresponding to the first port of the switch SW3-1 is added to realize data forwarding for the second network.

[0139] It should also be pointed out that: in scenario 4, when the link between the first port of switch SW3-2 and the second port of switch SW4-2 becomes link up, that is, it changes from disconnected to connected, regardless of whether switch SW3-1 is configured in non-preemptive mode, the first port of switch SW3-2 changes to forwarding state, and the forwarding table entry corresponding to the first port of switch SW3-2 is added according to the forwarding table entry learning of the received or sent data packet, thereby realizing data forwarding for the second network.

[0140] Although the above four scenarios are distinguished based on the switch SW3-1 being configured in preemptive mode, these scenarios also exist when the switch SW3-1 is configured in non-preemptive mode, and each scenario also points out the processing method in this non-preemptive mode.

[0141] In addition, if the switch SW3-1 is configured with the preemptive mode, scenario 5 will be added. In scenario 5, the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 is in a connected state, but the first port of the switch SW3-1 is in a non-forwarding state, the link between the first port of the switch SW3-2 and the second port of the switch SW4-2 is in a connected state, and the first port of SW3-2 is in a forwarding state. At this time, the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 becomes disconnected, and each switch does not have any operation. The link between the first port of the switch SW3-2 and the second port of the switch SW4-2 becomes disconnected, and the process of the master-slave function switching method of the second embodiment of a forwarding table update method will be executed to switch the forwarding state of the first port of the switch SW3-2 to the switch SW3-1, and the execution subject is replaced by the switch SW3-2.

[0142] The following also Figure 4 The switch SW3-1 in the embodiment 2 of the switch is taken as an example to end the embodiment 2 of the switch.

[0143] A switch embodiment 2 executes the method of embodiment 2 of a method for updating a forwarding table entry, and has all the advantages of embodiment 2 of a method for updating a forwarding table entry.

[0144] Figure 6 The structure of a switch embodiment 2 is shown, which includes: a connection status detection module 610, a connection status receiving module 620, a forwarding status judgment module 630 and a table clearing message sending module 640.

[0145] In order to clearly and concisely describe the method of the second embodiment of a switch, Figure 4 Take the switch SW3-1 in the example.

[0146] The connection state detection module 610 is used for detecting the connection state of the link between the first port of the switch SW3-1 and the second port of the switch SW4-1 at the link layer. For its working principle and advantages, please refer to step S5110 of the active-standby switching method and step S5210 of the forwarding state preemption method in the second embodiment of the method for updating the forwarding table entry.

[0147] The connection status receiving module 620 is used for the switch SW3-1 to detect that the connection with the switch SW4-1 is link down, and the switch SW3-1 receives the disconnection status information sent by its first port through an interruption; and is also used for the switch SW3-1 to detect that the connection with the switch SW4-1 is link up, and the switch SW3-1 receives the connection status information sent by its first port through an interruption. For its working principle and advantages, please refer to step S5120 of the active-standby switching method and step S5220 of the forwarding state preemption method in the second embodiment of a method for updating a forwarding table entry.

[0148] The forwarding state judgment module 630 is used for the switch SW3-1 to judge that the forwarding state of the first port of the switch SW3-1 will change from the forwarding state to the non-forwarding state based on the state change information and the fact that the first port of the switch SW3-1 was in the forwarding state before the link down; and is also used for the switch SW3-1 to judge that the forwarding state of the first port of the switch SW3-1 will change from the non-forwarding state to the forwarding state based on the state change information and the master / slave parameter configuration of the switch SW3-1. For its working principle and advantages, please refer to step S5130 of the master / slave switching method and step S5230 of the forwarding state preemption method in Embodiment 2 of a method for updating a forwarding table entry.

[0149] The clearing message sending module 640 is used for the switch SW3-1 to delete the forwarding table entry corresponding to the first port of the switch SW3-1 from its own forwarding table, and send the first topology change notification message based on the DRP protocol to the switches SW3-2, SW3-3 and SW3-4, so that the switches SW3-2, SW3-3 and SW3-4 delete the forwarding table entry corresponding to the first port of the switch SW3-1 from their own forwarding table entries; it is also used for the switch SW3-1 to delete the forwarding table entry corresponding to the first port of the switch SW3-2 from its own forwarding table, and send the second topology change notification message based on the DRP protocol to the switches SW3-2, SW3-3 and SW3-4, so that the switches SW3-2, SW3-3 and SW3-4 delete the forwarding table entry corresponding to the first port of the switch SW3-2 from their own forwarding table entries. For its working principle and advantages, please refer to step S5140 of the master-slave switching method and step S5240 of the forwarding state preemption method in the second embodiment of a method for updating forwarding table entries.

[0150] The embodiment of the present invention further provides a computing device, Figure 7 Detailed introduction.

[0151] The computing device 700 includes a processor 710 , a memory 720 , a communication interface 730 , and a bus 740 .

[0152] It should be understood that the communication interface 730 in the computing device 700 shown in this figure can be used to communicate with other devices.

[0153] The processor 710 may be connected to a memory 720. The memory 720 may be used to store the program code and data. Therefore, the memory 720 may be a storage unit inside the processor 710, or an external storage unit independent of the processor 710, or a component including a storage unit inside the processor 710 and an external storage unit independent of the processor 710.

[0154] Optionally, the computing device 700 may further include a bus 740. The memory 720 and the communication interface 730 may be connected to the processor 710 via the bus 740. The bus 740 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 740 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure is represented by only one line, but it does not mean that there is only one bus or one type of bus.

[0155] It should be understood that in the embodiment of the present invention, the processor 710 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 710 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present invention.

[0156] The memory 720 may include a read-only memory and a random access memory, and provides instructions and data to the processor 710. A portion of the processor 710 may also include a nonvolatile random access memory. For example, the processor 710 may also store information on the device type.

[0157] When the computing device 700 is running, the processor 710 executes the computer-executable instructions in the memory 720 to perform the operation steps of each method embodiment.

[0158] It should be understood that the computing device 700 according to an embodiment of the present invention can correspond to the corresponding subjects executing the methods according to the various embodiments of the present invention, and the above-mentioned and other operations and / or functions of each module in the computing device 700 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.

[0159] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0161] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0162] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0164] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0165] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to execute the operating steps of each method embodiment.

[0166] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0167] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0168] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0169] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0170] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present invention, all of which belong to the scope of protection of the present invention.

Claims

1. A method for updating a forwarding table entry, It is characterized in that The method is used to update the forwarding table entries of each switch of the first network, wherein the first port of each first gateway switch of the first network is connected to the corresponding second gateway switch of the second network, the second gateway switch manages the connection with the first gateway switch based on the second communication protocol, and each switch of the first network does not recognize the message of the second communication protocol, and the method is applied to the first gateway switch, including: When the first port of each first gateway switch detects that the connection state of the link between the first port and the corresponding second gateway switch changes, receiving the connection state change information of the link sent by the first port; When the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, the first gateway switch updates its own forwarding table entry, and sends a table entry update message based on the first communication protocol to other switches of the first network, so that the other switches update their respective forwarding table entries according to the table entry update message; Wherein, when the forwarding state of the first port before the connection state changes is a forwarding state, the first gateway switch determines that the first port changes from a forwarding state to a non-forwarding state, the first gateway switch deletes a forwarding table entry related to the first port in its own forwarding table, and sends a first table clearing message based on a first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the first port in their respective forwarding table entries; Among them, when the connection state changes from disconnected to connected, when the first gateway switch is configured as the active first gateway switch and preempts the forwarding state of the corresponding port of the non-active first gateway switch, the first gateway switch determines that port preemption occurs at the first port, and the first gateway switch deletes the forwarding table entry related to the preempted target port in its own forwarding table, and sends a second clearing message based on the first communication protocol to other switches in the first network, so that each other switch deletes the forwarding table entry related to the preempted target port from its own forwarding table according to the second clearing message, and the preempted target port is the corresponding port of the non-active first gateway switch whose forwarding state is preempted by the first port.

2. The method according to claim 1, It is characterized in that The receiving the connection status change information of the link sent by the first port specifically includes: The connection state change information sent by the first port through an interrupt is received.

3. The method according to claim 1, It is characterized in that The connection state is a link layer connection state.

4. A switch, It is characterized in that A first gateway switch for a first network, a first port of each first gateway switch of the first network connected to a second gateway switch of a second network, the second gateway switch managing the connection with the first gateway switch based on a second communication protocol, and each switch of the first network not recognizing a message of the second communication protocol, including: A connection status receiving module, configured to receive connection status change information of a link sent by a first port when a first port of each first gateway switch detects that a connection status of a link between the first port and a corresponding second gateway switch has changed; a table clearing message sending module, configured to update its own forwarding table entry when the first gateway switch determines that the forwarding state of the first port has changed according to the connection state change information, and send a table entry update message based on the first communication protocol to other switches of the first network, so that the other switches update their respective forwarding table entries according to the table entry update message; Wherein, when the forwarding state of the first port before the connection state changes is a forwarding state, the first gateway switch determines that the first port changes from a forwarding state to a non-forwarding state, and the table clearing message sending module matrix is ​​used by the first gateway switch to delete the forwarding table entry related to the first port in its own forwarding table, and send a first table clearing message based on the first communication protocol to other switches of the first network, so that the other switches delete the forwarding table entry related to the first port in their respective forwarding table entries; Among them, when the connection state changes from disconnected to connected, the clearing table message sending module matrix is ​​used to, when the first gateway switch is configured as the active first gateway switch and preempts the forwarding state of the corresponding port of the non-active first gateway switch, the first gateway switch determines that port preemption occurs on the first port, the first gateway switch deletes the forwarding table entry related to the preempted target port in its own forwarding table, and sends a second clearing table message based on the first communication protocol to other switches of the first network, so that each other switch deletes the forwarding table entry related to the preempted target port from its own forwarding table according to the second clearing table message, and the preempted target port is the corresponding port of the non-active first gateway switch whose forwarding state is preempted by the first port.

5. A computing device, It is characterized in that include, bus; A communication interface connected to the bus; at least one processor connected to the bus; as well as At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, It is characterized in that Program instructions are stored thereon, and when the program instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 3.