Method and device for switching when MLAG link fails

The network device's innovative use of three transfer databases addresses the inefficiencies in existing MLAG link failure switching methods, enhancing switching efficiency and reducing downtime by minimizing CPU-intensive updates and relearning processes.

JP7675809B2Active Publication Date: 2025-05-13HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023521837
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-10-12
Filing Date
2021-07-12
Publication Date
2025-05-13
Estimated Expiration
2041-07-12

AI Technical Summary

Technical Problem

Existing MLAG link failure switching methods are inefficient due to the need for CPU-intensive database updates and relearning processes, which result in prolonged traffic interruptions and link switching times.

Method used

The proposed solution involves a network device with a chip that generates and manages three separate transfer databases to reduce the number of entries to be corrected during link failures, thereby minimizing time overhead and improving switching efficiency. This includes using the first database to store active/wait flags, the second to map physical ports to MLAG member interfaces, and the third to store MAC address to MLAG member interface mappings.

Benefits of technology

This approach significantly reduces the time required for MLAG link switching and improves efficiency by minimizing CPU usage and avoiding the need for extensive relearning processes, ensuring faster recovery and reduced traffic disruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007675809000002
    Figure 0007675809000002
  • Figure 0007675809000003
    Figure 0007675809000003
  • Figure 0007675809000004
    Figure 0007675809000004
Patent Text Reader

Abstract

This application discloses an apparatus and method for switching MLAG links when they fail. The apparatus includes a chip configured to generate a forwarding database and forward packets based on the forwarding database, the forwarding database including a first forwarding database, a second forwarding database, and a third forwarding database. The apparatus switches a failed MLAG link by modifying the value of an active / standby switch flag corresponding to the failed link in the first forwarding database, thereby reducing link switching time and improving link switching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to communications technology, and more particularly, to a method and apparatus for MLAG link failure switching. [Background technology]

[0002] This application claims priority to Chinese Patent Application No. 202011086369.0, filed on October 12, 2020, and entitled “MLAG LINK FAILURE SWITCHING METHOD AND APPARATUS,” which is incorporated by reference in its entirety.

[0003] Multi-chassis link aggregation group (MLAG) refers to the aggregation of two or more switches across a device link into an active / active system to improve link reliability.

[0004] Please refer to FIG. 1. Switch 1 is connected to port 3 of switch 2 via port 1 (the link between port 1 and port 3 is called peer link) to form an MLAG system. A server is connected to this MLAG system. That is, the server is connected to both switch 1 and switch 2 via two independent physical ports. The server can send packets to the two switches simultaneously based on an active / active configuration, or can send packets to only one switch based on an active / standby configuration (if the switch is faulty, the server will send packets to the other switch). In the normal case, switch 1 receives a packet from the network side, searches a local forwarding database (FDB), such as a MAC address table, according to the destination address of the packet, to find the corresponding physical egress port connected to the server, such as port 2, and forwards the packet to the server via port 2.

[0005] When the link (port 2) between the server and switch 1 fails, in one method, switch 1 updates the forwarding database and updates the egress port value of all entries corresponding to port 2 to port 1 (peer link). In another method, switch 1 deletes all entries corresponding to port 2 or deletes all entries in the forwarding database, learns the record of the mapping from the MAC address corresponding to the server to port 1 by re-learning the MAC address, and completes the MLAG link switching.

[0006] Both of these two methods have their own drawbacks. In the former method, the port values ​​in the forwarding database need to be refreshed using the CPU of switch 1. During the processing by the CPU, the forwarding database needs to be frozen. As a result, the forwarding database cannot be used to forward packets, and the traffic of switch 1 is interrupted for a period of time. In the latter method, in the re-learning process, switch 1 broadcasts packets within a certain period of time. Moreover, it also takes a certain period of time to complete the re-learning. In either of the two methods, it takes a relatively long time to complete the MLAG link switching of switch 1. Summary of the Invention

[0007] The present application provides an MLAG link failure switching method and apparatus to reduce the time overhead required for link switching and improve the efficiency of link failure switching.

[0008] According to a first aspect, the present application provides a network device for MLAG link failure switching. The network device includes a chip. The chip is configured to generate a forwarding database and forward a received packet based on the forwarding database. The forwarding database includes a first forwarding database, a second forwarding database, and a third forwarding database. Since the forwarding database is divided into three parts, the number of entries modified in the forwarding database when a link fails can be reduced, time overhead can be reduced, and link switching efficiency can be improved.

[0009] In an optional implementation, the first forwarding database is used to store a mapping from at least one multi-chassis link aggregation group MLAG member interface to at least one active / standby switch flag, the second forwarding database is used to store a mapping from at least one first physical port to at least one MLAG member interface, and the third forwarding database is used to store a mapping from a media access control MAC address to a first MLAG member interface, the first MLAG member interface being in the at least one MLAG member interface. Because the network device uses the MLAG member interface to decouple the association between the MAC address and the physical port, when a network link changes (e.g., the link fails), the network device can implement a switch of the failed link without modifying information about the MAC address and the physical port, thereby improving switch efficiency.

[0010] In an optional implementation, the chip is further configured to store a mapping from the source MAC address of the packet to a second MLAG member interface in a third forwarding database, the second MLAG member interface being an MLAG member interface that corresponds to the first physical port based on the second forwarding database, and the first physical port being the physical port that receives the packet.

[0011] In an optional implementation, when an MLAG link is failed, the chip updates a value of an active / standby switch flag corresponding to a third MLAG member interface in the first forwarding database to a backup flag, and the backup flag is used to instruct the chip to send packets pointed to the third MLAG member interface over the peer link, the third MLAG member interface is an MLAG member interface corresponding to a second physical port based on the second forwarding database, and the second physical port is a physical port of the MLAG link. The network device completes the switch of the failed link by simply modifying the value of the active / standby switch flag, thereby improving link switching efficiency.

[0012] In an optional implementation, when the MLAG link is restored, the chip updates a value of the active / standby switch flag corresponding to the third MLAG member interface to a primary flag, and the primary flag is used to instruct the chip to forward packets based on the second forwarding database. The network device completes the recovery of the failed link by simply modifying the value of the active / standby switch flag, thereby improving link recovery efficiency.

[0013] In an optional implementation, the chip is configured to determine, based on the third forwarding database, that an MLAG member interface corresponding to a destination MAC address of the packet is the first MLAG member interface, and when a value of an active / standby switch flag corresponding to the first MLAG member interface in the first forwarding database is a primary flag, to forward the packet through a third physical port, the third physical port being the physical port corresponding to the first MLAG member interface in the second forwarding database.

[0014] In an optional implementation, when the value of the active / standby switch flag corresponding to the first MLAG member interface is a backup flag, the chip forwards the packet via the peer link.

[0015] In an optional implementation, the network device and another network device form an MLAG system, and the network device is configured to synchronize the third forwarding database with the other network device. Since the third forwarding database is synchronized in the MLAG system, when a new external device is connected to the MLAG system after a link failure, the network device can obtain information about the new access device.

[0016] According to a second aspect, the present application discloses an MLAG link switching method, the method includes: updating a value of an active / standby switch flag corresponding to a first MLAG member interface in a first forwarding database to a backup flag when an MLAG link of a network device is down, the backup flag is used to instruct the network device to transmit packets pointed to the first MLAG member interface over a peer link, the first MLAG member interface is an MLAG member interface corresponding to a first physical port according to a second forwarding database, and the first physical port is a physical port of the MLAG link, and the network device includes a first forwarding database and a second forwarding database, the first forwarding database is used to store a mapping from at least one multi-chassis link aggregation group MLAG member interface to at least one active / standby switch flag, and the second forwarding database is used to store a mapping from at least one physical port to at least one MLAG member interface.

[0017] In an optional implementation, when the MLAG link is restored, the value of the active / standby switch flag corresponding to the first MLAG member interface is updated to a primary flag, and the primary flag is used to instruct the network device to transmit packets based on the second forwarding database.

[0018] In an optional implementation, the network device further includes a third forwarding database, and the method further includes storing in the third forwarding database a mapping from the source MAC address of the packet to a second MLAG member interface, the second MLAG member interface being an MLAG member interface that corresponds to the second physical port based on the second forwarding database, and the second physical port being the physical port that receives the packet.

[0019] In an optional implementation, the method further includes determining, based on a third forwarding database, that an MLAG member interface corresponding to a destination MAC address of the packet is the first MLAG member interface, the third forwarding database further including a mapping from the destination MAC address to the first MLAG member interface, and forwarding the packet using the first physical port when a value of an active / standby switch flag corresponding to the first MLAG member interface in the first forwarding database is a primary flag.

[0020] In an optional implementation, when the value of the active / standby switch flag corresponding to the first MLAG member interface is a backup flag, the packet is forwarded over the peer link.

[0021] In an optional implementation, the third forwarding database is synchronized to another network device, which together with the network device form an MLAG system.

[0022] For advantageous effects of the second aspect of the present application, please refer to the first aspect and the implementation of the first aspect. [Brief description of the drawings]

[0023] [Figure 1] FIG. 1 is a schematic diagram of an MLAG. [Diagram 2] FIG. 1 is a schematic diagram of an MLAG networking mode. [Diagram 3] 1 is a schematic diagram of another MLAG networking mode. [Figure 4] 1 is a schematic diagram of another MLAG networking mode. [Diagram 5] 1 is a schematic diagram of an MLAG link failure switching device according to an embodiment of the present application; [Figure 6] FIG. 13 is a schematic diagram of a third forwarding database L2FDB according to an embodiment of the present application; [Figure 7] FIG. 2 is a schematic diagram illustrating a third forwarding database L3FDB according to an embodiment of the present application; [Figure 8] FIG. 2 is a schematic diagram of a first forwarding database according to an embodiment of the present application; [Figure 9] FIG. 2 is a schematic diagram of a second forwarding database according to an embodiment of the present application; [Figure 10] FIG. 11 is a schematic diagram of the generation of entries in a third forwarding database according to an embodiment of the present application; [Figure 11] FIG. 2 is a schematic diagram of MLAG link switching according to an embodiment of the present application. [Figure 12] FIG. 2 is a schematic diagram of a newly added access device according to an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions of the embodiments of the present application are hereinafter clearly described with reference to the accompanying drawings of the embodiments of the present application.

[0025] Multiple switches use the MLAG mechanism to implement link aggregation between multiple devices. These devices form an active-active system, also known as an MLAG system. Servers or customer edges (CEs) are connected to networks such as general Ethernet networks, transparent interconnection of lots of links (TRILL) networks, Virtual Extensible Local Area Networks (VXLANs), or the Internet through the MLAG system. Load balancing and backup protection can be implemented by connecting to the MLAG system.

[0026] The MLAG system has multiple networking modes, such as server connection, switch connection, and multi-layer MLAG mode. The server connection is shown in FIG. 2. The server is connected to the network through switch 1 and switch 2 (switch 1 and switch 2 form an MLAG system). The switch connection is shown in FIG. 3. The customer edge (switch 3) is connected to switch 1 and switch 2 (switch 1 and switch 2 form an MLAG system), and the server is connected to the network using switch 3. As shown in FIG. 4, switch 1 and switch 2 form an MLAG system (assuming this MLAG system is mlag1), switch 3 and switch 4 form an MLAG system (assuming this MLAG system is mlag2), and switch 3 and switch 4 are connected to the mlag1 system. The MLAG system may have more networking modes, which is not limited in this application. The MLAG link switching device disclosed in this application can be any switch in the MLAG system shown above, such as switch 1 or switch 2 shown in Figure 2 or Figure 3, and switch 1, switch 2, switch 3, or switch 4 shown in Figure 4. For ease of explanation, this application uses switch 1 of the server connection scenario shown in Figure 2 as an example to explain the MLAG link switching device.

[0027] The MLAG link switching device is shown as a switch 500 in FIG. 5. The switch 500 includes a chip, a memory 507, and a port. The chip includes a chip 502. The port 506 is used to forward packets. Furthermore, the port 506 may be connected to an external device to form an MLAG link or a peer link. As shown in FIG. 1, in the switch 1, each of the ports 1 and 2 is a port 506. The chip 502 may be an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a network processor (NP), or the like. The memory 507 may be a volatile memory such as a random access memory (RAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), or a content addressable memory (CAM), or may be a non-volatile memory such as a read-only memory (ROM) or a solid state disk (SSD), or may be a combination of multiple types of memory. In actual deployment, the memory 507 may include multiple memories of different types or the same type, and the multiple memories may be located in different modules of the switch 500. For example, the memory 507 may be located within the chip 502 as shown in FIG. 5, but may also be located outside the chip 502. The memory 507 may store instructions 508 or may store entries of the first forwarding database 503, the second forwarding database 504, and the third forwarding database 505.The instructions 508 and the entries of the first forwarding database 503, the second forwarding database 504, and the third forwarding database 505 may be stored in one memory or may be stored separately in different memories, which is not a limitation of the present application.

[0028] The chip 502 may further include a central processing unit (CPU) 501. The CPU 501 may be configured to control forwarding and maintain some software entries, such as a software routing table and a software ARP (Address Resolution Protocol) table. Furthermore, the chip 502 may use the CPU 501 to update the software routing table or the software ARP By searching the tables, the switch 500 can support routing and forwarding. The switch 500 generates a first forwarding database 503, a second forwarding database 504, and a third forwarding database 505 by invoking instructions 508 using a CPU 501 or a chip 502.

[0029] As shown in FIG. 8, the first forwarding database 503 includes a mapping from MLAG member interfaces (interfaces) to active / standby switch flags (switch-flags). The MLAG member interfaces are indicated by logical identifiers of physical ports (also called MLAG ports) that connect switch 1 to external devices, and are used to indicate individual external devices connected to switch 1. A link (including physical ports at both ends of the link) that is connected to an external device (this external device can be a server or a switch, such as server 1 in FIG. 2 or switch 3 in FIG. 3) using an MLAG port is called an MLAG link. The MLAG link is also a primary link for communication between an external device and switch 1. As shown in FIG. 2, for switch 1, "m-interface1" indicates that switch 1 is connected to server 1 via port 1, and "m-interface2" indicates that switch 1 is connected to server 2 via port 2. The primary link for communication between server 1 and switch 1 is the MLAG link connected using port 1, and the backup link is a peer link connected by switch 1 to switch 2 via port 5. The primary link for communication between Server 2 and Switch 2 is the MLAG link connected via port 2, and the backup link is the peer link connected to Switch 2 via port 5. For Switch 2, "m-interface1" indicates that Switch 2 is connected to Server 1 via port 3, and "m-interface2" indicates that Switch 2 is connected to Server 2 via port 4. The primary link for communication between Server 1 and Switch 2 is the MLAG link connected via port 3, and the backup link is the peer link connected by Switch 2 to Switch 1 via port 6. The primary link for communication between Server 2 and Switch 2 is the MLAG link connected via port 4, and the backup link is the peer link connected by Switch 2 to Switch 1 via port 6.The active / standby switch flag is used to indicate the current status of the MLAG link. As shown in FIG. 8, entry 801 indicates that the MLAG link (port 1) between switch 1 and server 1 in FIG. 2 is normal, and switch 1 forwards packets to server 1 through port 1. When the MLAG link (port 1) is faulty, the value of the active / standby switch flag in entry 801 is switched from "primary" to "backup", indicating that switch 1 needs to switch the egress port originally used to send packets to server 1 from port 1 to port 5. In this application, a character string such as "m-interface1\2" is used to identify the MLAG member interface. In actual deployment, the MLAG member interface may be identified using an identifier containing any characters. For example, the active / standby switch flag may also be identified by "active / standby" in addition to "primary / backup". This is not limited in this application.

[0030] The second forwarding database 504 includes a mapping from MLAG member interfaces to physical ports connected to external devices. As shown in Figure 9, Figure 9 shows a mapping between the MLAG member interfaces of switch 1 of Figure 2 and the physical ports used by switch 1 to connect to server 1 and server 2. Entry 901 indicates that switch 1 is connected to server 1 via port 1, and entry 902 indicates that switch 1 is connected to server 2 via port 2.

[0031] The third forwarding database 505 includes a layer 2 forwarding database (L2FDB). The L2FDB is mainly used for packet forwarding at the data link layer (layer 2). When the switch 500 has a layer 3 switching function, the third forwarding database 505 further includes a layer 3 forwarding database (L3FDB). The L3FDB is used for packet forwarding at the network layer (layer 3). The L2FDB includes information such as MAC address and port mapping, and the port information can be a physical port or an MLAG member interface. In addition to the MAC address and port information, the L2FDB can further include a virtual local area network (VLAN) identifier (VID). The L2FDB is shown in FIG. 6. As shown in FIG. 7, the L3FDB includes IP addresses, VIDs, MAC addresses, and port information. In the implementation, the L3FDB does not include port information. In the packet forwarding process, the switch 500 needs to search the L2FDB for port information according to the VID and MAC address.

[0032] The contents of the first forwarding database 503 and the second forwarding database 504 may be generated when the switch 500 receives a packet for forwarding, but are usually generated when a network administrator configures MLAG. As shown in FIG. 2, when the switch 1 and the switch 2 are configured to form an MLAG system, and the server 1 is connected to the MLAG system, the switch 1 may automatically (by link discovery, etc.) or manually generate information about related entries of the first forwarding database 503 shown in FIG. 8 and the second forwarding database 504 shown in FIG. 9. The entries of the third forwarding database 505 may be generated by manual configuration or dynamic learning (MAC learning). In this application, the dynamic learning is used as an example, and the process of creating the entries of the first forwarding database 503 is described by extending and applying FIG. 2. Specifically, as shown in FIG. 10, the configurations of the switch 1, the switch 2, the server 1, the server 2, and the server 3 are as follows:

[0033] [Table 1]

[0034] Since Switch 1 and Switch 2 form an MLAG system, Switch 1 and Switch 2 are configured to have the same IP address and the same MAC address (in implementation, MAC addresses in MLAG systems may be different). Since both Switch 1 and Switch 2 are connected to VLAN 100 and VLAN 200, the interface IP address (also known as Layer 3 interface IP address) of VLAN 100 is set to 1.1.1.1, and the interface IP address of VLAN 200 is set to 2.1.1.1. The MAC address (MAC-S) of Switch 1 may be the physical address or may be a virtual address of Switch 1, and the MAC address is used for Layer 3 packet switching. Server 1 and Server 3 belong to the same VLAN (VLAN 100), and the default gateway is 1.1.1.1. Switch 2 belongs to another VLAN (VLAN 200), and the default gateway is 2.1.1.1.

[0035] When Server 1 (physical host or virtual machine) communicates with Server 2, assuming that a packet is sent from Server 1 to Server 2, the process is as follows (assuming that the third forwarding database of Switch 1, L2FDB, contains the VLAN ID and L3FDB contains the port information): 1. Server 1 determines that destination IP address 2.1.1.1 (Server 2) is not in the same VLAN as Server 1. Therefore, Server 1 sends an ARP request asking for the MAC address corresponding to gateway 1.1.1.1. 2. After receiving the ARP request from Server 1, the chip of Switch 1 determines that the requested IP address is the Layer 3 interface IP address of Switch 1, and therefore Switch 1 sends an ARP response including the MAC address (MAC-S) of Switch 1. Furthermore, since Switch 1 receives the ARP request packet through Port 1, Switch 1 searches the second forwarding database, for example, using the identifier of Port 1 (port1), to find the entry shown in FIG. 9017, the switch 1 finds the corresponding MLAG member interface identifier "m-interface1" using the ARP request packet, and stores the source MAC address, source IP address, and VLAN identifier to which the port 1 belongs in the ARP request packet, and the correspondence between the MLAG member interfaces (1.1.1.2<=>MAC1<=>100<=>m-interface1) in the third forwarding database L3FDB, as shown as entry 701 in FIG. 7. In addition, the switch 1 further stores the source MAC address and VLAN identifier in the ARP request packet, and the correspondence between the MLAG member interfaces (MAC1<=>100<=>m-interface1) in the L2FDB, as shown as entry 603 in FIG. 6. In this example, the source MAC address and source IP address of the ARP request are those of the server 1. When the MLAG networking mode is the switch connection shown in FIG. 3, the source MAC address can also be the MAC address of the switch 3. 3. From switch 1 ARP After receiving the response, Server 1 assembles a packet (Packet A) and sends this packet to Switch 1. In this packet, the destination MAC address is MAC-S, the source MAC address is MAC1, the source IP address is 1.1.1.2, and the destination IP address is 2.1.1.2. 4. After receiving packet A, the chip of switch 1 searches the L2FDB according to the destination MAC address and VID of packet A, finds an entry that matches the MAC address of the layer 3 interface of switch 1 (for example, entry 601 shown in FIG. 6. Entry 601 is automatically added when switch 1 configures VLAN 100. Since the layer 3 forwarding flag is not obvious in FIG. 6, the layer 3 forwarding flag of entry 601 is set, and the set information is used to indicate that layer 3 forwarding needs to be performed when the destination address of the packet matches the entry), and then continues to search the third forwarding database, L3FDB. 5. The switch 1 chip searches the L3FDB according to the packet's destination address (2.1.1.2). Since no entry has been created, the switch 1 chip fails to search the L3FDB and sends the packet to the switch 1 CPU for software processing. 6. The CPU of switch 1 searches the software routing table of switch 1 according to the destination IP address (2.1.1.2) of the packet, and finds that the interface IP address of VLAN 200 matches. Therefore, the CPU continues to search the software routing table of switch 1. ARP It looks up its table, but the lookup still fails. Switch 1 then sends an ARP request to all ports in VLAN 200 requesting the MAC address that corresponds to 2.1.1.2. 7. After receiving the ARP packet from Switch 1, Server 2 determines that the requested IP address is its own IP address. Therefore, Server 2 sends an ARP response containing the MAC address of Server 2 (MAC2). Furthermore, Server 2 records the correspondence between the IP address and MAC address of Switch 1 (2.1.1.2<=>MAC-S) in the ARP table of Server 2. 8. After receiving the ARP response of Server 2, Switch 1 searches the second forwarding database based on the port (Port 2) used by Switch 1 to receive the packet, and finds the corresponding MLAG member interface identifier "m-interface2" according to entry 903 in FIG. 9. Switch 1 records the source MAC address, source IP address, and VLAN identifier in the ARP response packet, and the correspondence between the MLAG member interfaces (2.1.1.2<=>MAC1<=>200<=>m-interface2) in the third forwarding database L3FDB, as shown as entry 702 in FIG. 7. In addition, Switch 1 stores the source MAC address and VLAN identifier in the ARP response packet, and the correspondence between the MLAG member interfaces (MAC2<=>200<=>m-interface2) in the L2FDB, for example, as entry 604 shown in FIG. 6. After confirming the destination MAC address (MAC2) corresponding to the destination IP address 2.1.1.2, Switch 1 sends the packet B to Server 2. The difference between packet B and packet A is that the destination MAC address of packet A is MAC2 and the source MAC address of packet A is MAC-S. 9. After receiving packet B, server 2 sends a response packet to server 1. The forwarding process of the response packet is similar to the above steps. The only difference is that the response packet does not need to be processed by the CPU of switch 1 again, because the L3FDB of switch 1 already contains information about the related entry of server 1. Instead, the chip of switch 1 determines that the MLAG link is in a "primary" (normal) state according to the MLAG member interface identifier "m-interface1" in the L3FDB (entry 701 in FIG. 7) and the entry 801 in the first forwarding database shown in FIG. 8, and switch 1 does not need to forward the packet through the MLAG link. Therefore, the chip of switch 1 searches the second forwarding database and sends the packet to server 1 through port 1 according to the entry 901 shown in FIG. 9.

[0036] Through the above steps, the switch 1 completes learning the entries of the third forwarding database. After that, the packets between the server 1 and the server 2 can be directly forwarded in hardware by the chip of the switch 1 by searching the first forwarding database, the second forwarding database, and the third forwarding database, without needing to use the CPU of the switch to perform routing and forwarding, thereby improving packet forwarding efficiency.

[0037] When switch 1 is a layer 2 switch and performs only layer 2 forwarding, the learning process of the entries in the third forwarding database is shown in FIG. 1. Server 1 and Server 3 belong to the same VLAN (VLAN 100). The ARP table of Server 1 does not initially contain the MAC address information of Server 3, so Server 1 broadcasts an ARP request requesting the MAC address of Server 3, where the destination IP address of the ARP request is 1.1.1.3. 2. After receiving the ARP request of Server 1, the chip of Switch 1 finds the corresponding MLAG member interface identifier “m-interface1” in the second forwarding database according to the ingress port (port 1) of the ARP request, and Switch 1 forwards the ARP request to Server 1, as shown as entry 603 in FIG. packet Switch 1 records in the L2FDB the correspondence between the source MAC address in the packet, the VLAN identifier to which port 1 belongs (VLAN100), and the MLAG member interface identifier (100<=>MAC1<=>m-interface1). Switch 1 identifies the destination MAC address of the packet as a broadcast address and broadcasts the packet within VLAN100. 3. After receiving the broadcast packet, Server 3 updates the information of Server 1 (source MAC address and source IP address) into the ARP table of Server 3. Because the destination IP address of the broadcast packet is the IP address of Server 3, Server 3 sends an ARP response containing the MAC address of Server 3 (MAC2) to Server 1. 4. After receiving the ARP response, the chip of switch 1 searches the second forwarding database for a corresponding MLAG member interface identifier according to the ingress port (port 7) of the ARP response packet of switch 1. Since server 3 is connected only to switch 1 and not to switch 2, the MLAG member interface identifier corresponding to port 7 cannot be found in the second forwarding database. Therefore, the chip of switch 1 adds the correspondence (MAC3<=>VLAN100<=>port7) between the source MAC address in the ARP response packet (here, the MAC address MAC3 of server 3) and the VLAN identifier (VLAN100) corresponding to port 7 and the physical port (port 7) in the L2FDB of switch 1, as shown as entry 602 in FIG. 6. Furthermore, the chip of switch 1 searches the L2FDB according to the destination MAC address (MAC1) and VID (VLAN100) of the ARP request packet, and finds the corresponding MLAG member interface identifier "m-interface1" using the entry 603 shown in Fig. 6, searches the first forwarding database (entry 801 shown in Fig. 8) and the second forwarding database (entry 901 shown in Fig. 9), and determines that the physical port corresponding to "m-interface1" is "port 1", and the current status of the MLAG link is "primary". Finally, switch 1 sends an ARP response to server 1 via port 2. 5. After receiving the ARP response, Server 1 adds the MAC address of Server 3 to the ARP table of Server 1. Then, Server 1 can send a packet C to Server 3 with a destination MAC address of MAC3. 6. After receiving packet C, the chip of switch 1 finds a port identifier "port7" corresponding to an entry in the L2FDB (entry 602 shown in FIG. 6) according to the destination MAC address and VID in packet C. Because "port7" indicates a physical port, switch 3 does not need to keep searching the first forwarding database and the second forwarding database, and directly sends packet C to server 3 via port 7. 7. After receiving packet C, server 3 sends a response packet for packet C. 8. After receiving the response packet of packet C, the process is similar to step 4, that is, switch 1 searches the third forwarding database (L2FDB), the first forwarding database, and the second forwarding database, finally finds the physical egress port 1, and sends the packet to server 1 through port 1.

[0038] Through the above steps, switch 1 completes learning the entries of the third forwarding database. After that, in packet forwarding between server 1 and server 3, switch 1 only needs to use the chip to search the first forwarding database, the second forwarding database, and the third forwarding database, and then perform forwarding by hardware.

[0039] As shown in FIG. 11, server 1 is connected to an MLAG system including switch 1 and switch 2. When the chip or CPU of switch 1 detects that the MLAG link (port 1) is broken, the chip of switch 1 determines that the MLAG member interface corresponding to the broken MLAG link is "m-interface1" by searching the second forwarding database, e.g., entry 901 shown in FIG. 9. The chip searches the first forwarding database according to "m-interface1" for a corresponding active / standby switch flag, e.g., entry 1101, and changes the active / standby switch flag from "primary" to "backup" (entry 1102) to instruct switch 1 to communicate with server 1 via peer link (port 5). When the MLAG link (port 1) is restored, the chip changes the active / standby switch flag corresponding to the MLAG link from "backup" to "primary" based on the second forwarding database and the first forwarding database to instruct switch 1 to communicate with server 1 using the MLAG link (port 1). When an MLAG link fails or recovers, to implement link switching, switch 1 only needs to modify the corresponding active / standby switching flag in the first forwarding database according to the event. When link failure switching is performed using the above method, compared with the method of updating multiple entries in the MAC address table (one failed port corresponds to multiple MAC addresses) or deleting the mapping record of the failed port and then re-learning (learning the MAC address requires processes such as packet broadcast and packet response), the link failure switching method disclosed in the present application takes less time and can greatly improve the efficiency of link switching.

[0040] As shown in FIG. 12, switch 3 is connected to the MLAG system formed by switch 1 and switch 2, and server 1 communicates with server 2 connected to switch 1 using switch 3. In the normal case, server 1 communicates with server 2 via switch 3, link 1201, switch 1, and link 1204. When link 1201 is broken, switch 1 switches the MLAG link (link 1201) to a peer link (link 1203). Because the third forwarding database of switch 1 stores information about server 1 and server 2, server 1 and server 2 can continue to communicate with each other. In this case, a new server 4 is connected to switch 3. As for switch 2, the MLAG link (link 1202) corresponding to switch 3 is normal, and the MAC information of server 4 can be normally learned and entered into the third forwarding database of switch 2. However, for switch 1, since the packet transmitted from server 4 is received via the peer link (link 1203) and the packet does not carry information about switch 3, it cannot be determined that the MLAG link corresponding to server 4 is link 1201, and the MAC information of server 4 (the MLAG member interface identifier cannot be determined) cannot be entered into the third forwarding database of switch 1. In the implementation, before switch 1 receives the packet transmitted from server 4, switch 2 synchronizes the information about the third forwarding database stored in switch 2 (including the information about server 4) to switch 1 via the peer link. Switch 1 synchronizes the information about server 4 to the third forwarding database of switch 1 according to the information about the third forwarding database of switch 2.In an implementation, for example, an entry with a MAC address of MAC10 exists in both Switch 1 and Switch 2. The last update time of that entry in Switch 1 is t1, and the last update time of that entry in Switch 2 is t2 (indicating that t1 < t2, i.e., the last update time of that entry in Switch 2 is later than that in Switch 1). When there is a conflict in the entries of the third transfer database between Switch 1 and Switch 2, when the data in Switch 2 is synchronized with Switch 1, the entry in Switch 1 can be overwritten as it is according to t1 < t2. Since the MLAG member interface identifiers of Switch 1 and Switch 2 corresponding to Switch 3 are the same (assuming the MLAG member interface identifier is "m-interface4"), for Server 4, after Link 1201 fails, Server 4 can communicate with Server 2 via the peer link in the same way as Server 1. After Link 1201 is restored, the chip of Switch 1 modifies the active / standby switch flag corresponding to "m-interface4" in the first transfer database, and Server 4 can communicate with Server 2 using Link 1201.

[0041] It should be noted that the embodiments provided in this application are merely examples. For the sake of convenience of explanation and brevity of the description, in the above embodiments, the embodiments emphasize the differences, and for parts not described in detail in one embodiment, the relevant descriptions of other embodiments can be referred to, which can be clearly understood by those skilled in the art. The features disclosed in the embodiments of this application, the claims, and the accompanying drawings can exist independently or in combination. This is not limited in this specification.

[0042] The above description is merely a specific implementation of the present invention and is not intended to limit the protection scope of the present invention. Any deformation or substitution that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention shall be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall follow the protection scope of the claims.

Claims

1. A network device comprising a chip, the chip is configured to generate a forwarding database and forward received packets based on the forwarding database; the forwarding database comprises a first forwarding database, a second forwarding database, and a third forwarding database; the first forwarding database is used to store a mapping from at least one multi-chassis link aggregation group (MLAG) member interface to at least one active / standby switch flag; the second forwarding database is used to store a mapping from at least one physical port to the at least one MLAG member interface; and the third forwarding database is used to store a mapping from a media access control MAC address to a first MLAG member interface, the first MLAG member interface being among the at least one MLAG member interface; the chip is configured to update a value of an active / standby switch flag corresponding to the third MLAG member interface in the first forwarding database to a backup flag when an MLAG link is down, and to update the value of the active / standby switch flag corresponding to the third MLAG member interface to a primary flag based on the first forwarding database and the second forwarding database when the MLAG link is restored; Network devices.

2. The chip comprises:

2. The network device of claim 1, further configured to store a mapping from a source MAC address of the packet to a second MLAG member interface in the third forwarding database, the second MLAG member interface being an MLAG member interface that corresponds to a first physical port based on the second forwarding database, and the first physical port being a physical port that receives the packet.

3. A network device as described in claim 1 or 2, wherein the backup flag is used to instruct the chip to send packets pointing to the third MLAG member interface over a peer link, the third MLAG member interface being an MLAG member interface that corresponds to a second physical port based on the second forwarding database, and the second physical port being a physical port of the MLAG link.

4. The network device of claim 3, wherein the primary flag is used to instruct the chip to forward the packet based on the second forwarding database.

5. The chip comprises: determining, based on the third forwarding database, that an MLAG member interface corresponding to a destination MAC address of the packet is the first MLAG member interface; and 3. The network device of claim 1, further comprising: a third physical port configured to forward the packet when a value of an active / standby switch flag corresponding to the first MLAG member interface in the first forwarding database is a primary flag, the third physical port being a physical port corresponding to the first MLAG member interface in the second forwarding database.

6. The chip comprises: The network device of claim 5 , further configured to forward the packet over a peer link when the value of the active / standby switch flag corresponding to the first MLAG member interface is a backup flag.

7. The network device and another network device form a MLAG system; and The network device of claim 1 or 2, wherein the network device is configured to synchronize the third forwarding database with the other network device.

8. A method for switching a MLAG link, comprising: updating a value of an active / standby switch flag corresponding to a first MLAG member interface in a first forwarding database to a backup flag when an MLAG link of a network device is down, the backup flag being used to instruct the network device to transmit packets pointed to the first MLAG member interface over a peer link, the first MLAG member interface being an MLAG member interface corresponding to a first physical port according to a second forwarding database, and the first physical port being a physical port of the MLAG link; and the network device comprising the first forwarding database and the second forwarding database, the first forwarding database being used to store a mapping from at least one multi-chassis link aggregation group (MLAG) member interface to at least one active / standby switch flag, and the second forwarding database being used to store a mapping from at least one physical port to the at least one MLAG member interface; The method comprises: and updating the value of the active / standby switch flag corresponding to the first MLAG member interface to a primary flag based on the first forwarding database and the second forwarding database when the MLAG link is restored. MLAG link switching method.

9. The method of claim 8, wherein the primary flag is used to instruct the network device to forward the packet based on the second forwarding database.

10. The network device further comprises a third forwarding database, and the method further comprises:

10. The method of claim 8 or 9, further comprising the step of storing a mapping from the source MAC address of the packet to a second MLAG member interface in the third forwarding database, the second MLAG member interface being an MLAG member interface that corresponds to a second physical port based on the second forwarding database, and the second physical port being a physical port that receives the packet.

11. determining, based on the third forwarding database, that an MLAG member interface corresponding to a destination MAC address of the packet is the first MLAG member interface, the third forwarding database further comprising a mapping from the destination MAC address to the first MLAG member interface; forwarding the packet using the first physical port when the value of the active / standby switch flag corresponding to the first MLAG member interface in the first forwarding database is a primary flag; The method of claim 10 further comprising:

12. 12. The method of claim 11, further comprising forwarding the packet over the peer link when the value of the active / standby switch flag corresponding to the first MLAG member interface is the backup flag.

13. 11. The method of claim 10, further comprising synchronizing the third forwarding database with another network device, the other network device and the network device forming a MLAG system.

Citation Information

Patent Citations

  • Communication system and network relay device

    JP2014155186A

  • Relay system and switch device

    JP2015201751A

  • Relay system and relay device

    JP2017183873A

  • System and method for rapid link failure handling

    US20140241147A1