Mlag link failover method and apparatus
Patent Information
- Application Number
- CN202011086369.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-12
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2040-10-12
AI Technical Summary
在CPU处理过程中,需要将该转发数据库进行冻结(freezing),导致转发数据库无法用于报文转发,会导致交换机1在一段时间内断流
[0021] The beneficial effects of the second aspect of this application can be referenced in the first aspect and its implementation.
Smart Images

Figure CN114338512B_ABST
Abstract
Description
Technical Field
[0001] This application relates to a communication technology, and more particularly to a method and apparatus for switching MLAG link failures. Background Technology
[0002] A multi-chassis link aggregation group (MLAG) refers to the aggregation of links between two or more switches across devices into an active-active system to improve link reliability.
[0003] See Figure 1 Switch 1 connects to Switch 2 via port 1 and port 3 (the link between port 1 and port 3 is called a peer-link), forming an MLAG system. The server accesses this MLAG system by connecting to both Switch 1 and Switch 2 simultaneously via two independent physical ports. The server can be configured in active-active mode to send packets to both switches simultaneously, or configured in active-standby mode to send packets to only one switch (in case of failure, it sends packets to the other switch). Normally, when Switch 1 receives packets from the network side, it looks up the destination address in its local forwarding database (FDB), such as a MAC address table, to find the corresponding physical outgoing port connected to the server, such as port 2, and then forwards the traffic to the server via port 2.
[0004] When the link (port 2) between the server and switch 1 fails, one approach is for switch 1 to update its forwarding database, changing the outgoing port value of all entries corresponding to port 2 to port 1 (peer-link). Another approach is for switch 1 to delete all entries corresponding to port 2 or delete all entries in the forwarding database. Through MAC address relearning, it learns the mapping record between the server's MAC address and port 1, thus completing the MLAG link switchover.
[0005] Both methods have certain drawbacks. The first method requires CPU processing to refresh the port values in the forwarding database. During this process, the forwarding database needs to be frozen, rendering it unusable for packet forwarding and causing a temporary outage on switch 1. The second method causes switch 1 to broadcast for a period during the relearning process, which also takes time. Both methods result in relatively long MLAG link switching times for switch 1. Summary of the Invention
[0006] This application provides a method and apparatus for MLAG link failure switching, which reduces the time overhead of link switching and improves the efficiency of link failure switching.
[0007] Firstly, this application provides a network device for MLAG link failover. The network device includes a chip for generating a forwarding database and forwarding received packets according to the forwarding database. The forwarding database includes a first forwarding database, a second forwarding database, and a third forwarding database. By dividing the forwarding database into three parts, the number of entries requiring modification to the forwarding database during link failure can be reduced, thus lowering time overhead and improving the efficiency of link failover.
[0008] In one optional implementation, the first forwarding database stores mappings from at least one Multi-Frame Link Aggregation Group (MLAG) member interface to at least one primary / backup switchover flag; the second forwarding database stores mappings from at least one first physical port to the at least one MLAG member interface; and the third forwarding database stores mappings from Media Access Control (MAC) addresses to the first MLAG member interface, wherein the first MLAG member interface is located within the at least one MLAG member interface. By decoupling the association between MAC addresses and physical ports through MLAG member interfaces, network devices can switch over faulty links without modifying the MAC address and physical port information when network links change (e.g., due to link failure), thus improving switching efficiency.
[0009] In one alternative implementation, the chip is further configured to store the mapping of the source MAC address of the packet to the second MLAG member interface in the third forwarding database, wherein the second MLAG member interface is the MLAG member interface corresponding to the first physical port according to the second forwarding database, and the first physical port is the physical port for receiving the packet.
[0010] In one optional implementation, when an MLAG link fails, the chip updates the value of the primary / backup switchover flag corresponding to the third MLAG member interface in the first forwarding database to a backup flag. This backup flag instructs the chip to send a packet to the third MLAG member interface via a peer-to-peer link. The third MLAG member interface is the MLAG member interface corresponding to the second physical port in the second forwarding database, and the second physical port is the physical port of the MLAG link. By simply modifying the value of the primary / backup switchover flag, the network device completes the switchover of the failed link, improving the efficiency of link switching.
[0011] In one alternative implementation, when the MLAG link is restored, the chip updates the value of the primary / backup switchover flag corresponding to the third MLAG member interface to the primary flag. This primary flag instructs the chip to forward the packet according to the second forwarding database. By simply modifying the value of the primary / backup switchover flag, the network device completes the restoration of the failed link, improving the efficiency of link restoration.
[0012] In one optional implementation, the chip is used to: determine, according to the third forwarding database, the MLAG member interface corresponding to the destination MAC address of the packet as the first MLAG member interface; when the value of the primary / backup switching flag corresponding to the first MLAG member interface in the first forwarding data is the primary flag, the chip forwards the packet through the third physical port, wherein the third physical port is the physical port corresponding to the first MLAG member interface in the second forwarding database.
[0013] In one alternative implementation, when the value of the primary / backup switching flag corresponding to the first MLAG member interface is a backup flag, the chip forwards the message through a peer-to-peer link.
[0014] In one alternative implementation, the network device forms an MLAG system with another network device, and the network device is used to synchronize the third forwarding data to the other network device. Through the synchronization of the third forwarding database between MLAG systems, it is ensured that if a link fails, when a new external device connects to the MLAG system, the network device can obtain information about the newly connected device.
[0015] Secondly, this application discloses an MLAG link switching method, which includes: when the MLAG link of a network device fails, updating the value of the primary / backup switching flag corresponding to the first MLAG member interface in the first forwarding database to a backup flag, wherein the backup flag is used to instruct the network device to send a message to the first MLAG member interface through a peer-to-peer link, wherein the first MLAG member interface is an MLAG member interface corresponding to a first physical port according to the second forwarding database, and the first physical port is the physical port of the MLAG link, wherein the network device includes the first forwarding database and the second forwarding database, wherein the first forwarding database is used to store the mapping of at least one multi-frame link aggregation group MLAG member interface to at least one primary / backup switching flag, and the second forwarding database is used to store the mapping of at least one physical port to the at least one MLAG member interface.
[0016] In one alternative implementation, when the MLAG link is restored, the value of the primary / backup switch flag corresponding to the first MLAG member interface is updated to the primary flag, which is used to instruct the network device to send the packet according to the second forwarding database.
[0017] In one alternative implementation, the network device further includes a third forwarding database, and the method further includes: storing the mapping of the source MAC address of the packet to a second MLAG member interface in the third forwarding database, wherein the second MLAG member interface is an MLAG member interface corresponding to a second physical port according to the second forwarding database, and the second physical port is a physical port for receiving the packet.
[0018] In an optional implementation, the method further includes: determining, according to the third forwarding database, the MLAG member interface corresponding to the destination MAC address of the packet as the first MLAG member interface, wherein the third forwarding database also includes a mapping from the destination MAC address to the first MLAG member interface; when the value of the primary / backup switching flag corresponding to the first MLAG member interface in the first forwarding database is the primary flag, the packet is forwarded through the first physical port.
[0019] In one alternative implementation, when the value of the primary / backup switch flag corresponding to the first MLAG member interface is a backup flag, the message is forwarded through the peer-to-peer link.
[0020] In one alternative implementation, the third forwarding database is synchronized to another network device, wherein the other network device and the network device together form an MLAG system.
[0021] The beneficial effects of the second aspect of this application can be referenced in the first aspect and its implementation. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of an MLAG.
[0023] Figure 2 This is a schematic diagram of an MLAG networking method;
[0024] Figure 3 This is a schematic diagram of another MLAG networking method;
[0025] Figure 4 This is a schematic diagram of another MLAG networking method;
[0026] Figure 5 A schematic diagram of an MLAG link failure switching device provided for an embodiment of this application;
[0027] Figure 6 A schematic diagram of the L2FDB of the third forwarding database provided in the embodiments of this application;
[0028] Figure 7 A schematic diagram of the L3FDB, the third forwarding database provided in this application embodiment;
[0029] Figure 8 A schematic diagram of the first forwarding database provided in an embodiment of this application;
[0030] Figure 9 A schematic diagram of the second forwarding data provided in the embodiments of this application;
[0031] Figure 10 A schematic diagram illustrating the generation of a third forwarding database entry provided in an embodiment of this application;
[0032] Figure 11 A schematic diagram illustrating MLAG link failure switching as provided in an embodiment of this application;
[0033] Figure 12 A schematic diagram of the newly added access device provided in the embodiments of this application. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings.
[0035] Multiple switches use the MLAG mechanism to aggregate links between devices. These devices form an active-active system, also known as an MLAG system. Servers or customer edge devices (CEs) access ordinary Ethernet networks, transparent interconnection of lots of links (TRILL), Virtual Extensible Local Area Network (VXLAN), or the Internet through this MLAG system. Accessing through the MLAG system serves two purposes: load balancing and backup protection.
[0036] There are several networking methods for MLAG systems, such as server access, switch access, and multi-level MLAG. Server access includes... Figure 2 As shown, the server connects to the network via switches 1 and 2 (switch 1 and switch 2 form an MLAG system). The switch connections are as follows... Figure 3 As shown, the user edge device (switch 3) connects to the network via switches 1 and 2 (switch 1 and switch 2 form an MLAG system), and the server connects to the network via switch 3. Multi-level MLAGs are as follows: Figure 4As shown, switch 1 and switch 2 form an MLAG system (let's call it mlag1), and switch 3 and switch 4 form an MLAG system (let's call it mlag2). Switch 3 and switch 4 are also connected to system mlag1. There are many other networking methods for MLAG systems, and this application does not limit them. The MLAG link switching device disclosed in this application can be any of the switches in the MLAG system shown above, such as... Figure 2 , Figure 3 The switch 1 or switch 2 shown is shown. Figure 4 The switch shown is 1, 2, 3, or 4, etc. For ease of description, this application refers to it as... Figure 2 The MLAG link switching device is described using switch 1 in the server access scenario shown as an example.
[0037] MLAG link switching device such as Figure 5 As shown in the diagram, switch 500 consists of a chip, a memory 507, and ports. The chip includes chip 502. Port 506 is used for forwarding packets. Additionally, port 506 can be connected to external devices to form an MLAG link or peer-link link, such as... Figure 1 As shown, for switch 1, both port 1 and port 2 belong to port 506. Chip 502 can be an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a network processor (NP), etc. Memory 507 can be volatile memory such as random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), or content addressable memory (CAM), or non-volatile memory such as read-only memory (ROM) or solid-state drive (SSD), or a combination of multiple types of memory. In actual deployment, memory 507 can consist of multiple memories of different or the same type, and these memories can be deployed in different modules of switch 500. For example, as... Figure 5As shown, memory 507 can be located within chip 502, but it can also be located outside of chip 502. Memory 507 can store instruction 508 or entries of the first forwarding database 503, the second forwarding database 504, and the third forwarding data 505. The entries of instruction 508, the first forwarding database 503, the second forwarding database 504, and the third forwarding data 505 can be stored in one memory or separately in different memories; this application does not impose any limitations on this.
[0038] Chip 502 may also include a central processing unit (CPU) 501, which can be used for forwarding control and maintain some software entries (such as software routing tables, software ARP (address resolution protocol) tables, etc.). In addition, chip 502 can support routing forwarding by looking up software routing tables or software ARP tables through CPU 501. Switch 500 generates a first forwarding database 503, a second forwarding database 504, and a third forwarding database 505 by calling instruction 508 through CPU 501 or chip 502.
[0039] First forwarding database 503, such as Figure 8 As shown, this includes the mapping from the MLAG member interface to the switch-flag. The MLAG member interface is the logical identifier of the physical port (also known as the MLAG port) connecting switch 1 to external devices. It is used to indicate the specific external device connected to switch 1. The MLAG port connects to the external device (which can be a server or a switch, such as...). Figure 2 Server 1 in Figure 3 The link (including the physical ports at both ends of the link) connecting switch 1 (e.g., switch 3) is called an MLAG link. The MLAG link is also the main link for external devices to communicate with switch 1. Figure 2As shown, for switch 1, "m-interface1" indicates that switch 1 is connected to server 1 through port 1, and "m-interface2" indicates that switch 1 is connected to server 2 through port 2. The primary link for communication between server 1 and switch 1 is the MLAG link connected through port 1, and the backup link is the peer-link link connecting switch 1 and switch 2 through port 5. The primary link for communication between server 2 and switch 2 is the MLAG link connected through port 2, and the backup link is the peer-link link connecting switch 2 and switch 2 through port 5. For switch 2, "m-interface1" indicates that switch 2 is connected to server 1 through port 3, and "m-interface2" indicates that switch 2 is connected to server 2 through port 4. The primary link for communication between server 1 and switch 2 is the MLAG link connected through port 3, and the backup link is the peer-link link connecting switch 2 and switch 1 through port 6. The primary link for communication between server 2 and switch 2 is the MLAG link connected through port 4, and the backup link is the peer-link link connecting switch 2 and switch 1 through port 6. The primary / backup switching flag is used to indicate the current status of the MLAG link, such as... Figure 8 As shown, table entry 801 indicates Figure 2 The MLAG link (port 1) between switch 1 and server 1 is functioning normally, and switch 1 forwards packets to server 1 through port 1. When this MLAG link (port 1) fails, the value of the primary / standby switchover flag in entry 801 will change from "primary" to "backup," indicating that switch 1 needs to switch the outgoing port originally used to send packets to server 1 from port 1 to port 5. In this application, strings such as "m-interface1\2" are used to identify MLAG member interfaces. In actual deployment, MLAG member interfaces can be marked with identifiers composed of any characters. For example, in addition to using "primary / backup," the primary / standby switchover flag can also be marked with identifiers such as "active / standby," and this application does not impose any limitations.
[0040] The second forwarding database 504 includes a mapping from MLAG member interfaces to physical ports connecting to external devices, such as... Figure 9 As shown, Figure 2 The table shows the mapping between the MLAG member interface of switch 1 and the physical ports of switch 1 that connect to server 1 and server 2. Entry 901 indicates that switch 1 is connected to server 1 through port 1, and entry 902 indicates that switch 1 is connected to server 2 through port 2.
[0041] The third forwarding database 505 includes a layer 2 forwarding database (L2FDB), which is primarily used for data link layer (Layer 2) packet forwarding. When the switch 500 has Layer 3 switching capabilities, the third forwarding database 505 also includes a layer 3 forwarding database (L3FDB), which is used for network layer (Layer 3) packet forwarding. The L2FDB includes information such as MAC addresses and port mappings; the port information can be physical ports or MLAG member interfaces. In addition to MAC addresses and port information, the L2FDB can also include Virtual Local Area Network (VLAN) identifiers (VIDs). For example, the L2FDB... Figure 6 As shown. L3FDB as Figure 7 As shown, it includes IP address, VID, MAC address, and port information. In one implementation, the L3FDB does not include port information; during packet forwarding, the switch 500 needs to look up the L2FDB based on the VLAN and MAC address to obtain the port information.
[0042] The contents of the first forwarding database 503 and the second forwarding database 504 can be generated when the switch 500 receives and forwards packets, but they are usually generated when the network administrator configures MLAG. Figure 2 As shown, when switch 1 and switch 2 are configured to form an MLAG system, and server 1 connects to this MLAG system, switch 1 can automatically generate (through link discovery, etc.) or manually configure it to generate a MLAG system like this. Figure 8 The first forwarding database 503 shown Figure 9 The information shown is related to the entries in the second forwarding database 504. The entries in the third forwarding database 505 can be generated manually or through dynamic learning (MAC learning). This application uses dynamic learning as an example, and further details are provided through extended appendices. Figure 2 This describes the creation process of the table entry for the first forwarded data 503. Specifically, as follows... Figure 10 As shown in the table below, the configurations of switch 1, switch 2, server 1, server 2, and server 3 are as follows:
[0043] Switch 1 IP-S MAC-S Switch 2 IP-S MAC-S Server 1 1.1.1.2 MAC1 1.1.1.1 VLAN 100 Server 2 2.1.1.2 MAC2 2.1.1.1 VLAN 200 Server 3 1.1.1.3 MAC3 1.1.1.1 VLAN 100
[0044] Since switches 1 and 2 form an MLAG system, they are assigned the same IP address and MAC address (in one implementation, the MAC addresses of the MLAG system may be different). Because both switches 1 and 2 are connected to VLAN 100 and VLAN 200, the interface IP address (also known as the Layer 3 interface IP) for VLAN 100 is set to 1.1.1.1, and the interface IP address for VLAN 200 is set to 2.1.1.1. The MAC address (MAC-S) of switch 1 can be its physical address or a virtual address; this MAC address is used for Layer 3 packet switching. Servers 1 and 3 belong to the same VLAN (VLAN 100), with a default gateway of 1.1.1.1. Switch 2 belongs to another VLAN (VLAN 200), with a default gateway of 2.1.1.1.
[0045] When communication occurs between server 1 (physical host or virtual machine) and server 2, assuming a message is sent from server 1 to server 2, the process is as follows (assuming that the L2FDB of switch 1's third forwarding database contains VLAN IDs and the L3FDB contains port information):
[0046] 1. Server 1 determines that the destination IP address 2.1.1.1 (Server 2) does not belong to the same VLAN as itself, so it sends an ARP request for the MAC address corresponding to gateway 1.1.1.1.
[0047] 2. After receiving the ARP request from server 1, the chip in switch 1 discovers that the requested IP address is its own Layer 3 interface IP address. Therefore, it sends an ARP reply, including its own MAC address (MAC-S). Furthermore, since switch 1 receives this ARP request packet through port 1, switch 1 can use the port 1 identifier (port1) to look up the second forwarding database, such as through... Figure 9 For entry 801 shown, find the corresponding MLAG member interface identifier "m-interface1". Switch 1 saves the mapping relationship between the source MAC address, source IP address, VLAN identifier of port 1, and MLAG member interface (1.1.1.2 <=> MAC1 <=> 100 <=> m-interface1) in the ARP request packet to the L3FDB of the third forwarding database, as follows. Figure 7 The table entry 701 is shown. In addition, switch 1 also saves the mapping between the source MAC address, VLAN identifier, and MLAG member interface (MAC1 <=> 100 <=> m-interface1) in the ARP request packet to the L2FDB, such as... Figure 6The table entry shown is 603. In this example, the source MAC address and source IP address of the ARP request are the addresses of server 1. When the MLAG networking method is as follows... Figure 3 When the switch shown is connected, the source MAC address can also be the MAC address of switch 3.
[0048] 3. After receiving the APR response from switch 1, server 1 assembles a message (message A) and sends it to switch 1. The destination MAC address of the message 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.
[0049] 4. After receiving packet A, the chip in switch 1 will look up the L2FDB based on the destination MAC address + VID of packet A and find an entry that matches the MAC address of its own Layer 3 interface (e.g., ...). Figure 6 The table entry 601 shown is automatically added when VLAN 100 is configured on switch 1, and the Layer 3 forwarding flag of entry 601 is set. Figure 6 If the value is not marked in the table, this bit setting is used to indicate that when the destination address of the packet matches the entry in the table, a three-layer forwarding is required. Therefore, the search continues in the L3FDB of the third forwarding database.
[0050] 5. The chip of switch 1 searches in L3FDB according to the destination address (2.1.1.2) of the message. Since no table entry has been created before, the search fails. Therefore, the message is sent to the CPU of switch 1 for software processing.
[0051] 6. Switch 1's CPU looks up the destination IP (2.1.1.2) in its software routing table and finds a match for the interface IP address of VLAN 200. It then continues to look up the software ARP table, but the lookup still fails. Switch 1 then sends an ARP request to all ports of VLAN 200 requesting the MAC address corresponding to address 2.1.1.2.
[0052] 7. After receiving the ARP request from switch 1, server 2 finds that the requested IP address is its own IP address. Therefore, it sends an ARP reply, including its own MAC address (MAC2). At the same time, it records the IP-MAC mapping of switch 1 (2.1.1.1 <==> MAC-S) in its own ARP table.
[0053] 8. After receiving the ARP reply from server 2, switch 1 searches the second forwarding database based on the receiving port (port 2) of the message, and then... Figure 9For entry 903, the corresponding MLAG member interface identifier "m-interface2" is found. Switch 1 records the mapping relationship between the source MAC address, source IP address, VLAN identifier, and MLAG member interface (2.1.1.2 <=> MAC1 <=> 200 <=> m-interface2) in the ARP reply packet into the L3FDB of the third forwarding database, such as... Figure 7 The table entry 702 is shown. Simultaneously, the mapping between the source MAC address, VLAN identifier, and MLAG member interface (MAC2 <=> 200 <=> m-interface2) in the ARP reply message is saved to L2FDB, as shown. Figure 6 The table entry shown is 604. After confirming the destination MAC address (MAC2) corresponding to the destination IP address 2.1.1.2, switch 1 sends packet B to server 2. The difference between packet B and packet A is that packet A's destination MAC address is MAC2 and its source MAC address is MAC-S.
[0054] 9. After receiving message B, server 2 sends a response message to server 1. The forwarding process of this response message is similar to the previous steps, except that since switch 1's L3FDB already contains the relevant table entries for server 1, this response message does not need to be processed again by switch 1's CPU. Instead, switch 1's chip processes the response message based on the L3FDB information (…). Figure 7 Entry 701 in the table, based on the MLAG member interface identifier "m-interface1", in the first forwarding database, according to Figure 8 As shown in table entry 801, the current MLAG link is confirmed to be in "primary" (normal) state, and switch 1 needs to forward packets through the MLAG link. Therefore, the chip of switch 1 searches the second forwarding database, according to... Figure 9 The table entry 901 shown sends the message to server 1 through port 1.
[0055] Through the above steps, switch 1 has completed the learning of the entries in the third forwarding database. Subsequently, packets between server 1 and server 2 can be directly forwarded by the chip of switch 1 by looking up the first, second, and third forwarding databases, without needing to be routed by the switch's CPU, thus improving the efficiency of packet forwarding.
[0056] When switch 1 is a Layer 2 switch and only performs Layer 2 forwarding, the learning process of the entries in the third forwarding database is as follows: Figure 10 Shown:
[0057] 1. Server 1 and Server 3 belong to the same VLAN (VLAN 100). Since Server 1's ARP table does not contain the MAC address information of Server 3, Server 1 broadcasts an ARP request to obtain the MAC address of Server 3. The target IP address of the ARP request is 1.1.1.3.
[0058] 2. After receiving an ARP request from server 1, the chip in switch 1 searches for the corresponding MLAG member interface identifier "m-interface1" in the second forwarding database based on the ingress port (port 1) of the ARP request. Switch 1 records the mapping relationship (100 <=> MAC1 <=> m-interface1) between the source MAC address of the ARP request, the VLAN identifier (VLAN 100) to which port 1 belongs, and the MLAG member interface identifier in the L2FDB. Figure 6 As shown in entry 603 of the table. Switch 1 identifies the destination MAC address of the packet as the broadcast address, and then broadcasts the packet within VLAN 100.
[0059] 3. After receiving the broadcast message, server 3 updates the information of server 1 (source MAC address, source IP address) into its own ARP table. Since the destination IP address of the broadcast message is server 3's own IP address, it sends an ARP reply to server 1, including its own MAC address (MAC2).
[0060] 4. After receiving the ARP reply, the chip in switch 1 searches for the corresponding MLAG member interface identifier in the second forwarding database based on the ingress port (port 7) of the ARP reply packet. Since server 3 is only connected to switch 1 and not to switch 2, it cannot find the MLAG member interface identifier corresponding to port 7 in the second forwarding database. Therefore, the chip in switch 1 adds the source MAC address of the ARP reply packet (here, the MAC address of server 3, MAC3), the VLAN identifier (VLAN 100) corresponding to port 7, and the mapping relationship of the physical port (port 7) (MAC3 <=> VLAN 100 <=> port7) to its L2FDB, as follows: Figure 6 The table entry 602 is shown. Based on the destination MAC address (MAC1) and VID (VLAN100) of the ARP request packet, through... Figure 6 The table entry 603 shown is found in the L2FDB with the corresponding MLAG member interface identifier "m-interface1". This is then retrieved by searching the first forwarding database. Figure 8 The table entry 801 shown), the second forwarding database ( Figure 9As shown in table 901), the physical port corresponding to “m-interface1” is confirmed to be “port 1”, the current MLAG link status is “primary”, and finally the ARP reply is sent to server 1 through port 2.
[0061] 5. After receiving the ARP reply, server 1 adds server 3's MAC address to its own ARP table. Then, server 1 can send a packet C to server 3 with a destination MAC address of MAC3.
[0062] 6. After receiving packet C, the chip in switch 1 locates the entry in the L2FDB based on the destination MAC address and VID in packet C (e.g., ...). Figure 6 The port identifier "port7" corresponding to the table entry 602 shown is a physical port. Therefore, switch 3 does not need to continue searching the first and second forwarding databases and can directly send packet C to server 3 through port 7.
[0063] 7. After receiving message C, server 3 sends a response message to message C;
[0064] 8. After receiving the response message of message C, switch 1 follows a similar process to step 4. It searches the third forwarding database (L2FDB), the first forwarding database, and the second forwarding database to find the physical output port 1 and sends the message to server 1 through port 1.
[0065] Through the above steps, switch 1 has completed learning the entries in the third forwarding database. For subsequent packet forwarding between server 1 and server 3, switch 1 only needs to look up the first, second, and third forwarding databases via its chip to perform hardware forwarding.
[0066] like Figure 11 As shown, server 1 is connected to an MLAG system consisting of switch 1 and switch 2. When the chip or CPU of switch 1 detects a fault in the MLAG link (port 1), the chip of switch 1 searches the second forwarding database, such as... Figure 9As shown in table 901, the MLAG member interface corresponding to the faulty MLAG link is determined to be "m-interface1". The chip will search for the corresponding primary / backup switchover flag in the first forwarding database based on "m-interface1", such as table 1101, and change the primary / backup switchover flag from "primary" to "backup" (table 1102) to instruct switch 1 to communicate with server 1 through the peer-link (port 5). When the MLAG link (port 1) returns to normal, the chip searches the second and first forwarding databases and changes the primary / backup switchover flag corresponding to the MLAG link from "backup" to "primary" to instruct switch 1 to communicate with server 1 through the MLAG link (port 1). For MLAG link failures or recovery, switch 1 only needs to modify the corresponding primary / backup switchover flag in the first forwarding database according to the event to achieve link switching. Compared to updating multiple entries in the MAC address table (a faulty port may correspond to multiple MAC addresses) or deleting the mapping record of the faulty port and then relearning (learning MAC addresses requires processes such as message broadcasting and message response), the faulty link switching method disclosed in this application is faster and can greatly improve the efficiency of link switching.
[0067] like Figure 12As shown in the figure, switch 3 accesses the MLAG system formed by switch 1 and switch 2, and server 1 communicates with server 2 connected to switch 1 through switch 3. Under normal conditions, server 1 communicates with server 2 via switch 3, link 1201, switch 1 and link 1204. After link 1201 fails, switch 1 switches the MLAG link (link 1201) to the peer-link (link 1203). Since the third forwarding database of switch 1 already stores the information of server 1 and server 2, server 1 and server 2 can continue to communicate with each other. At this time, a new server 4 is connected to switch 3. For switch 2, the corresponding MLAG link (link 1202) of switch 3 is in normal condition, so it can normally learn the MAC information of server 4 and fill it into the third forwarding database of switch 2. However, for switch 1, since the packet sent by server 4 is received via the peer-link (link 1203) and does not carry the information of switch 3, switch 1 cannot determine that the MLAG link corresponding to server 4 is link 1201, and thus cannot fill the MAC information of server 4 (since the MLAG member interface identifier cannot be determined) into the third forwarding database of switch 1. In one implementation, before switch 1 receives the packet sent by server 4, switch 2 synchronizes the information of its locally stored third forwarding database (including the information of server 4) to switch 1 via the peer-link. Switch 1 synchronizes the information of server 4 to its own third forwarding database according to the third forwarding database information from switch 2. In one implementation, when there is an entry conflict between the third forwarding databases of switch 1 and switch 2, for example, both switch 1 and switch 2 have an entry with a MAC address of MAC10, the last update time of the entry on switch 1 is t1, and the last update time of the entry on switch 2 is t2 (t1 < t2, indicating that the entry on switch 2 was updated later than the corresponding entry on switch 1), when the data on switch 2 is synchronized to switch 1, the entry on switch 1 can be directly overwritten based on the condition t1 < t2. Since the MLAG member interface identifiers corresponding to switch 3 on switch 1 and switch 2 are the same (assuming the MLAG member interface identifier is "m-interface4"), for server 4, after link 1201 fails, it can also communicate with server 2 via the peer-link just like server 1. After link 1201 returns to normal, the active / standby switching flag corresponding to "m-interface4" in the first forwarding database is modified by the chip of switch 1, and server 4 can communicate with server 2 via link 1201.
[0068] It should be noted that the embodiments provided in this application are merely illustrative. Those skilled in the art will understand that, for the sake of convenience and brevity, the descriptions of each embodiment have different focuses, and parts not described in detail in a particular embodiment can be referred to in the relevant descriptions of other embodiments. The features disclosed in the embodiments, claims, and drawings of this application can exist independently or in combination, and are not limited herein.
Claims
1. A network device, characterized in that, Including chips, The chip is used to generate a forwarding database and forward received packets according to the forwarding database; The forwarding database includes a first forwarding database, a second forwarding database, and a third forwarding database; The first forwarding database is used to store the mapping from at least one multi-frame link aggregation group (MLAG) member interface to at least one primary / backup switch flag; The second forwarding database is used to store the mapping from at least one physical port to the at least one MLAG member interface; The third forwarding database is used to store the mapping of Media Access Control MAC addresses to the first MLAG member interface, wherein the first MLAG member interface is in the at least one MLAG member interface; When the MLAG link fails, the chip updates the value of the primary / backup switch flag corresponding to the third MLAG member interface in the first forwarding database to the backup flag. The backup flag is used to instruct the chip to send a message to the third MLAG member interface through the peer-to-peer link. The third MLAG member interface is the MLAG member interface corresponding to the second physical port according to the second forwarding database. The second physical port is the physical port of the MLAG link.
2. The network device according to claim 1, characterized in that, The chip is also used for: The mapping of the source MAC address of the packet to the second MLAG member interface is stored in the third forwarding database, wherein the second MLAG member interface is the MLAG member interface corresponding to the first physical port according to the second forwarding database, and the first physical port is the physical port that receives the packet.
3. The network device according to claim 1 or 2, characterized in that, When the MLAG link is restored, the chip updates the value of the primary / backup switch flag corresponding to the third MLAG member interface to the primary flag. The primary flag is used to instruct the chip to send the message according to the second forwarding database.
4. The network device according to any one of claims 1-3, characterized in that, The chip is used for: Based on the third forwarding database, the MLAG member interface corresponding to the destination MAC address of the packet is determined to be the first MLAG member interface; When the value of the primary / backup switch flag corresponding to the first MLAG member interface in the first forwarding database is the primary flag, the message is forwarded through the third physical port, wherein the third physical port is the physical port corresponding to the first MLAG member interface in the second forwarding database.
5. The network device according to claim 4, characterized in that, The chip is also used for, When the value of the primary / backup switch flag corresponding to the first MLAG member interface is the backup flag, the message is forwarded through the peer-to-peer link.
6. The network device according to any one of claims 1-5, characterized in that, The network device and another network device form an MLAG system. The network device is used to synchronize the third forwarding database to the other network device.
7. A method for switching MLAG links, characterized in that, include: When the MLAG link of a network device fails, the value of the primary / backup switch flag corresponding to the first MLAG member interface in the first forwarding database is updated to the backup flag. The backup flag is used to instruct the network device to send a message to the first MLAG member interface through the peer-to-peer link. The first MLAG member interface is the MLAG member interface corresponding to the first physical port according to the second forwarding database. The first physical port is the physical port of the MLAG link. The network device includes the first forwarding database and the second forwarding database. The first forwarding database is used to store the mapping from at least one multi-frame link aggregation group MLAG member interface to at least one primary / backup switch flag. The second forwarding database is used to store the mapping from at least one physical port to the at least one MLAG member interface.
8. The method according to claim 7, characterized in that, include: When the MLAG link is restored, the value of the primary / backup switch flag corresponding to the first MLAG member interface is updated to the primary flag. The primary flag is used to instruct the network device to send the packet according to the second forwarding database.
9. The method according to claim 7 or 8, characterized in that, The network device further includes a third forwarding database, and the method further includes: The mapping of the source MAC address of the packet to the second MLAG member interface is stored in the third forwarding database, wherein the second MLAG member interface is the MLAG member interface corresponding to the second physical port according to the second forwarding database, and the second physical port is the physical port for receiving the packet.
10. The method according to claim 9, characterized in that, Also includes: According to the third forwarding database, the MLAG member interface corresponding to the destination MAC address of the packet is determined as the first MLAG member interface, wherein the third forwarding database also includes a mapping from the destination MAC address to the first MLAG member interface; When the value of the primary / backup switch flag corresponding to the first MLAG member interface in the first forwarding database is the primary flag, the message is forwarded through the first physical port.
11. The method according to claim 10, characterized in that, Also includes: When the value of the primary / backup switch flag corresponding to the first MLAG member interface is the backup flag, the message is forwarded through the peer-to-peer link.
12. The method according to any one of claims 9-11, characterized in that, Also includes: The third forwarding database is synchronized to another network device, wherein the other network device and the network device together form an MLAG system.
Citation Information
Patent Citations
Optimizing traffic flows via mac synchronization when using server virtualization with dynamic routing
US20140204760A1