Communication method and apparatus
By using feature information to determine the forwarding interface and forwarding packets through peer-link links in cross-device link aggregation groups (MLAG), the problems of bandwidth waste and flow interruption in existing technologies are solved, and global load balancing and efficient operation of network devices are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEW H3C TECH CO LTD
- Filing Date
- 2024-07-08
- Publication Date
- 2026-07-07
AI Technical Summary
In existing technologies, the bandwidth waste and disconnection problems caused by configuring the minimum number of selected member ports or the member port linkage function in the aggregation group cannot be effectively solved in cross-device link aggregation groups (MLAG).
By receiving service packets from the network side, determining the forwarding interface based on feature information, and obtaining the associated interface identifier when the interface is not within the local device, the packets are forwarded to the peer network device using the peer-link link, thereby removing the Layer 2 unicast traffic isolation between the local peer-link port and the member ports within the MLAG and achieving global load balancing.
It solves the problems of bandwidth waste and flow interruption, realizes global load balancing of Layer 2 unicast traffic, and improves the reliability and efficiency of network devices.
Smart Images

Figure CN118890310B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology
[0002] Multichassis Link Aggregation Group (MLAG) is a mechanism for implementing cross-device link aggregation. It aggregates the links of one network device with two other network devices, thereby improving link reliability from the board level to the device level.
[0003] For Layer 2 forwarding, MLAG can be understood as a horizontal virtualization technology that logically virtualizes the two network devices constituting the MLAG into a single network device, forming a unified Layer 2 logical node. For example... Figure 1 As shown, Figure 1 This is a schematic diagram of an existing MLAG network. Figure 1 In this scenario, network device A and network device B form an MLAG (Multi-Level Asynchronous Group) and share the load, jointly forwarding traffic. When one network device fails, traffic can be quickly switched to the other network device, ensuring the normal operation of services.
[0004] If the MLAG interface in the aggregation group of a network device fails, traffic from the network side will be forwarded to another network device via the peer link, and subsequent traffic will be forwarded by the other network device. The specific process is as follows:
[0005] The downlink interface (also known as the MLAG interface) between network device A and network device C is within an aggregation group. If this downlink interface fails, the network side is unaware and continues to send traffic to both network device A and network device B. The downlink interface between network device B and network device C is also within an aggregation group and is functioning normally. After receiving traffic from the network side accessing network device C, network device A forwards the traffic to network device B via peer-link. Network device B then forwards traffic to network device C through its downlink interface. Once the downlink interface of network device A recovers, it continues to forward network-side traffic.
[0006] In practical applications, if the aforementioned downlink interface includes multiple member ports, and one of the local member ports fails while the others are functioning normally, packet loss will occur under the existing local priority forwarding principle. For example... Figure 2 As shown, Figure 2 This is a network topology diagram showing an existing network device with an MLAG interface including multiple member ports. Figure 2In the diagram, the downlink interface between network device A and network device C includes multiple member ports, such as member port 1 and member port 2. Traffic from network device E to network device C passes through network device A. Assuming the traffic is 15G, and member port 1 of the downlink interface in network device A fails, according to the local priority forwarding principle, network device A continues to forward traffic to network device C through member port 2. At this time, the traffic between network device A and network device C will decrease from 20G to 10G, resulting in a traffic loss of 5G.
[0007] To address the packet loss issue caused by member port failure, the following approach can be adopted: configure the minimum number of selected member ports within the aggregation group or implement member port linkage function. This will ensure that all member ports included in the MLAG interface are unselected, allowing traffic to be redirected via peer-link to another network device.
[0008] However, using the minimum number of selected member ports in the configuration aggregation group or the member port linkage function to trigger traffic bypass also exposes the following defects: 1) Linking all normal member ports to an unselected state will lead to wasted bandwidth; 2) If there are member port failures in both network devices' MLAG interfaces, it will lead to traffic interruption. Summary of the Invention
[0009] In view of this, this application provides a communication method and apparatus to solve the problems of bandwidth waste and interruption caused by the existing method of using the minimum number of selected member ports in the configuration aggregation group or the member port linkage function to trigger traffic bypass.
[0010] In a first aspect, this application provides a communication method applied to a first network device, the first network device being located within an MLAG, the MLAG further including a second network device, and a peer-link being established between the first network device and the second network device, the method comprising:
[0011] Receive a first service message sent by the network side, the first service message including first feature information;
[0012] Based on the first feature information, a first interface for forwarding the first service message is determined;
[0013] If the first interface is not within the first network device, then obtain the interface identifier of the second interface associated with the first interface;
[0014] The first service message is sent to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local MLAG member port, and then forward the first service message to the third network device accessing the MLAG.
[0015] The first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0016] Secondly, this application provides a communication device applied to a first network device located within an MLAG (Multi-Level Link Aggregator), the MLAG further comprising a second network device, wherein a peer-link has been established between the first network device and the second network device, the device comprising:
[0017] A receiving unit is configured to receive a first service message sent by the network side, wherein the first service message includes first feature information.
[0018] The determining unit is configured to determine, based on the first feature information, a first interface for forwarding the first service message;
[0019] The first acquisition unit is configured to acquire the interface identifier of the second interface associated with the first interface if the first interface is not within the first network device.
[0020] The sending unit is configured to send the first service message to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local member port of the MLAG, and then forward the first service message to the third network device accessing the MLAG.
[0021] The first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0022] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.
[0023] Therefore, by applying the communication method and apparatus provided in this application, a first network device receives a first service message sent by the network side, the first service message including first characteristic information; based on the first characteristic information, the first network device determines a first interface for forwarding the first service message; if the first interface is not within the first network device, the first network device obtains the interface identifier of a second interface associated with the first interface; through the second interface indicated by the interface identifier and the peer-link, the first network device sends the first service message to the second network device, so that the second network device can release the Layer 2 unicast traffic isolation between its local peerlink port and the member port within its local MLAG, and then forward the first service message to a third network device accessing the MLAG; wherein, the first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0024] Thus, when determining the interface for forwarding the first service packet, the first interface not located within the first network device can be used as the interface for forwarding the first service packet. The first service packet is then forwarded to the network device where the first interface resides via a peer-link, allowing the network device to continue forwarding the first service packet and achieving global load balancing of Layer 2 unicast traffic. This solves the problems of bandwidth waste and traffic interruption caused by existing methods that use the minimum number of selected member ports within an aggregation group or member port linkage functions to trigger traffic redirection. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of an existing MLAG network.
[0026] Figure 2 This is a network topology diagram of an existing network device where the MLAG interface includes multiple member ports;
[0027] Figure 3 A flowchart illustrating the communication method provided in the embodiments of this application;
[0028] Figure 4 A schematic diagram of an MLAG network provided in this application embodiment;
[0029] Figure 5 This is another MLAG networking diagram provided in an embodiment of this application;
[0030] Figure 6 A structural diagram of a communication device provided in an embodiment of this application;
[0031] Figure 7 The network device hardware structure provided in the embodiments of this application. Detailed Implementation
[0032] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0033] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.
[0034] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0035] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 3 , Figure 3 A flowchart illustrating a communication method provided in an embodiment of this application. This method is applied to a first network device. The communication method provided in an embodiment of this application may include the following steps.
[0036] Step 310: Receive a first service message sent by the network side, wherein the first service message includes first feature information;
[0037] Specifically, the first and second network devices form an MLAG (Multi-Level Aggregator) and share the load, jointly forwarding traffic. The first network device includes a first peerlink port, and the second network device includes a second peerlink port. The two network devices establish peer-link links through their respective peerlink ports. The third network device connects to the MLAG and is connected to downlink port 1 of the first network device and downlink port 2 of the second network device.
[0038] In this embodiment, downlink port 1 and downlink port 2 belong to the same MLAG and are member ports within the MLAG. Downlink port 1 and downlink port 2 can also be referred to as aggregated ports. It is understood that the interface through which the third network device accesses the MLAG also belongs to the same MLAG as downlink port 1 and downlink port 2, and the interface through which the third network device accesses the MLAG can also be referred to as an aggregated port.
[0039] The network side wishes to communicate with a third network device. The network side sends a first service message to the third network device, which includes first characteristic information. The first characteristic information may specifically be a 5-tuple, which includes a first destination MAC address.
[0040] Optionally, after receiving the first service packet, the first network device first obtains the first destination MAC address. Based on the first destination MAC address, the first network device retrieves a first MAC entry matching the first destination MAC address from its local MAC forwarding table. This first MAC entry includes a first outgoing interface for forwarding the first service packet, and this first outgoing interface indicates an MLAG. Specifically, the first outgoing interface may be the aggregation group identifier of the MLAG.
[0041] Step 320: Determine the first interface for forwarding the first service message based on the first feature information;
[0042] Specifically, according to the description of step 310, after the first network device obtains the first feature information, it also determines the first interface used to forward the first service message through the first feature information.
[0043] It is understandable that the MLAG includes multiple member ports. In step 310, after the first network device determines that it will forward the first service packet to the third network device through the MLAG, it needs to continue to determine the member port used to forward the first service packet from within the MLAG. This first interface is the member port within the MLAG.
[0044] The first network device identifies whether the first interface is within the first network device. If the first interface is not within the first network device, the first network device executes step 330.
[0045] Optionally, the specific process by which the first network device determines the first interface for forwarding the first service packet based on the first feature information in this step is as follows: the first network device performs a hash calculation on the first feature information to obtain a first hash value of the first feature information; based on the first hash value, the first network device obtains a first aggregation table entry that matches the first hash value in the aggregation table entry; the first aggregation table entry includes the interface identifier of the first interface; the first network device uses the first interface indicated by the first interface identifier as the interface for forwarding the first service packet; wherein, the first interface is a member port within the MLAG.
[0046] Optionally, prior to the aforementioned steps, a process may also be included whereby the first network device generates aggregated entries.
[0047] Furthermore, the user inputs a first configuration command into the first network device via command line. This first configuration command includes a hash value, the aggregation group identifier of the MLAG, and the member port identifier of the member port within the MLAG. Upon receiving the first configuration command, the first network device retrieves the hash value, aggregation group identifier, and member port identifier from it. The first network device generates an aggregation table entry locally and stores the aggregation table entry, which includes the hash value, aggregation group identifier, and member port identifier.
[0048] The member port identifier includes the identifiers of all member ports belonging to the same MLAG within the network devices constituting the MLAG. For example, the identifier of downlink port 1 included in the first network device, and the identifier of downlink port 2 included in the second network device. That is, the aggregated entry generated by the first network device includes not only the identifiers of member ports belonging to the MLAG within the first network device, but also the identifiers of member ports belonging to the same MLAG in other network devices constituting the MLAG.
[0049] Optionally, after generating the aggregation table entry locally, the first network device further identifies whether the member port indicated by each member port identifier is within the first network device. If the member port indicated by the member port identifier is not within the first network device, the first network device establishes a redirection relationship between the member port not within the first network device and the second interface; the first network device stores the redirection relationship in the aggregation table entry. Here, the second interface is the first network device's local peerlink port, i.e., the first peerlink port.
[0050] Step 330: If the first interface is not within the first network device, then obtain the interface identifier of the second interface associated with the first interface;
[0051] Specifically, according to the description of step 320, the first network device identifies whether the first interface is within the first network device.
[0052] If the first interface is not within the first network device, the first network device continues to obtain the interface identifier of the second interface associated with the first interface from the aggregation table entry.
[0053] Understandably, when the first network device establishes the aggregation table entry, it has already established a redirection relationship between member ports not within its own network device and the second interface (i.e., the first peerlink port). Therefore, after determining that the first interface is not within the first network device, the first network device can directly obtain the interface identifier of the second interface from the aggregation table entry. That is, the first network device obtains the interface identifier of the first peerlink port.
[0054] Optionally, if the first interface is located within the first network device, the first network device sends the first service message to the third network device through the first interface.
[0055] Step 340: Send the first service message to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local MLAG member port, and then forward the first service message to the third network device accessing the MLAG.
[0056] Specifically, according to the description of step 330, after the first network device obtains the interface identifier of the second interface, the first network device sends a first service message to the second network device through the second interface indicated by the interface identifier and the peer-link.
[0057] After receiving the first service packet, the second network device can obtain the first destination MAC address from the first service packet. The second network device can then look up the local MAC address table based on the first destination MAC address.
[0058] If a MAC entry matching the first destination MAC address exists in the local MAC address table and the Layer 2 unicast traffic isolation between the local peerlink port (second peerlink port) of the second network device and the member port (downlink port 2) within the local MLAG of the second network device has been removed, the second network device forwards the first service packet to the third network device.
[0059] Therefore, by applying the communication method provided in this application, the first network device receives a first service message sent by the network side, the first service message including first feature information; based on the first feature information, the first network device determines a first interface for forwarding the first service message; if the first interface is not within the first network device, the first network device obtains the interface identifier of the second interface associated with the first interface; through the second interface indicated by the interface identifier and the peer-link, the first network device sends the first service message to the second network device, so that the second network device can release the Layer 2 unicast traffic isolation between the local peerlink port of the second network device and the member port within the local MLAG, and then forward the first service message to the third network device accessing the MLAG; wherein, the first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0060] Thus, when determining the interface for forwarding the first service packet, the first interface not located within the first network device can be used as the interface for forwarding the first service packet. The first service packet is then forwarded to the network device where the first interface resides via a peer-link, allowing the network device to continue forwarding the first service packet and achieving global load balancing of Layer 2 unicast traffic. This solves the problems of bandwidth waste and traffic interruption caused by existing methods that use the minimum number of selected member ports within an aggregation group or member port linkage functions to trigger traffic redirection.
[0061] Optionally, in this embodiment of the application, the first network device will also start a global hash mode before performing step 310.
[0062] Specifically, in one implementation, the user inputs a second configuration command to the first network device via command line. Upon receiving the second configuration command, the first network device initiates a global hash mode. This global hash mode is used by the first network device to determine the interface for forwarding service packets, selecting any one of the member interfaces within the MLAG as the interface for forwarding service packets.
[0063] In another implementation, the first network device determines whether the bandwidth and values of multiple member ports used between it and the third network device are the same as a bandwidth threshold (which can be the bandwidth value between the first network device and the network side); if they are different, a global hash mode is initiated. This global hash mode is used by the first network device to determine the interface for forwarding service packets, using any one of all member ports in the MLAG as the interface for forwarding service packets.
[0064] Optionally, in this embodiment of the application, the first network device may also receive the second service message sent by the second network device through a peer-link and forward the second service message.
[0065] Specifically, after receiving the second service message, the second network device can send the second service message to the first network device through the second peerlink port and peer-link, as described in steps 310-340 above. It is understood that the process of the second network device executing steps 310-340 is the same as that of the first network device, and will not be repeated here.
[0066] Through peer-link, the first network device receives the second service packet sent by the second network device and obtains the second characteristic information from it. The second characteristic information may specifically be a 5-tuple, which includes the second destination MAC address.
[0067] Based on the second destination MAC address, the first network device retrieves a second MAC entry from its local MAC forwarding table that matches the second destination MAC address. This second MAC entry includes a second outgoing interface for forwarding the second service packet, and this second outgoing interface indicates the MLAG.
[0068] The first network device performs a hash calculation on the second feature information to obtain a second hash value. Based on the second hash value, the first network device retrieves a second aggregation table entry that matches the second hash value. This second aggregation table entry includes the interface identifier of the third interface. The third interface is a member port within the MLAG.
[0069] The first network device forwards the second service message to the third network device through the third interface indicated by the interface identifier of the third interface.
[0070] Optionally, in this embodiment of the application, before the first network device can forward the service packets sent by the second network device through the peer-link, the first network device needs to remove the Layer 2 unicast traffic isolation between the local peerlink port, i.e., the first peerlink port, and the member ports within the local MLAG.
[0071] Specifically, the user inputs a third configuration command into the first network device via command line. Based on the third configuration command, the first network device removes the Layer 2 unicast traffic isolation between its local peerlink port and the member ports within its local MLAG.
[0072] It should be noted that in existing technologies, to avoid loops during message forwarding, when the third network device accessing the MLAG is a dual-active access device, the downlink ports of the first and second network devices are each set to unidirectional isolation to isolate traffic sent from the peer-link to the downlink port. Unidirectional isolation applies to Layer 2 unicast traffic, Layer 2 broadcast traffic, Layer 2 multicast traffic, and Layer 3 multicast traffic, but does not involve Layer 3 unicast traffic.
[0073] Optionally, in the embodiments of this application, after either the first network device or the second network device synchronizes the MAC entries of the third network device to the peer, the peer will maintain unidirectional isolation when learning the MAC entries of the third network device, so as to avoid the defect of the third network device receiving multiple identical service packets.
[0074] Specifically, after the third network device accesses the MLAG, it sends a gratuitous ARP packet to the MLAG. For example, after the second network device receives the gratuitous ARP packet, it learns and generates a third MAC entry for the third network device.
[0075] The second network device generates a first notification message, which includes a third MAC address entry. The second network device then sends this first notification message to the first network device via a peer-link.
[0076] After receiving the first notification message, the first network device retrieves the third MAC entry from it. Based on the third MAC entry, the first network device generates the fourth MAC entry locally. At the same time, the first network device maintains isolation of unknown unicast traffic between its local peerlink port (i.e., the first peerlink port) and the member port within its local MLAG (downlink port 1 connected to the third network device).
[0077] When the first network device receives a third service message sent by the second network device and destined for the third network device via peer-link, it will no longer forward the third service message to the third network device through its local MLAG member port. The first network device will discard the third service message.
[0078] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 4 , Figure 4 This is a schematic diagram of an MLAG network provided in an embodiment of this application.
[0079] exist Figure 4 In this example, network device A and network device B constitute an MLAG. Each network device includes multiple downlink ports, and these downlink ports are connected to the multiple uplink ports of network device C. In other words, network device C is a dual-active device connected to the MLAG, with its multiple uplink ports connected to the multiple downlink ports of network devices A and B, respectively.
[0080] Network devices A, B, and C all have multiple downlink ports that belong to the same MLAG1 member port. For example, if network device A includes port 1 and port 2, network device B includes port 3 and port 4, and network device C includes port 5, port 6, port 7, and port 8, then port 1, port 2, port 3, port 4, port 5, port 6, port 7, and port 8 are member ports within the same MLAG1.
[0081] Network devices A and B also include multiple uplink ports, and each network device's uplink port is connected to network device D. Each network device's uplink port belongs to a member port within MLAG2.
[0082] Network device A and network device B each include a peerlink port. For example, network device A includes peerlink port 1, and network device B includes peerlink port 2. Peerlink port 1 and peerlink port 2 establish a peer-link. It is understandable that the peerlink port can also be an aggregation port, such as... Figure 4 As shown, multiple interfaces in network device A are aggregated into peerlink port 1, and multiple interfaces in network device B are aggregated into peerlink port 2.
[0083] In this embodiment, network device C is a user-side access device, and network device D is a network-side access device.
[0084] The following explanation uses network device B as an example.
[0085] The user inputs configuration command 1 into network device B via command line. According to configuration command 1, network device B removes the Layer 2 unicast traffic isolation between its peerlink port 2 and ports 3 and 4.
[0086] The user inputs configuration command 2 into network device A via command line. Configuration command 2 includes hash values (1, 2, 3, 4), the aggregation group identifier (MLAG1) of MLAG1, and the member port identifiers (port1, port2, port3, port4) of the member ports within MLAG1. Upon receiving configuration command 2, network device A retrieves the hash value, aggregation group identifier, and member port identifier from it. Network device A generates an aggregation table locally, containing multiple aggregation table entries. Each aggregation table entry includes a hash value, aggregation group identifier, and member port identifier. The first aggregation table is shown in Table 1 below.
[0087] Table 1 First Aggregation Table
[0088] Hash value Aggregation group identifier Member sign 1 MLAG1 port1 2 MLAG1 port2 3 MLAG1 port3 4 MLAG1 port4
[0089] Furthermore, after generating the aggregation table locally, network device A also identifies whether the member port indicated by each member port identifier is within network device A. If network device A identifies that port1 and port2 are within network device A, then network device A will not redirect ports1 and port2. If network device A identifies that port3 and port4 are not within network device A but are within network device B in the MLAG, then network device A will redirect ports3 and port4. Network device A will establish redirection relationships between ports3 and port4 and the local peerlink port, i.e., with peerlink port 1.
[0090] Network device A stores the redirection relationships in the corresponding aggregation table entries. The second aggregation table is shown in Table 2 below.
[0091] Table 2 Second Aggregation Table
[0092] Hash value Aggregation group identifier Member sign Redirection relationship 1 MLAG1 port1 2 MLAG1 port2 3 MLAG1 port3 peerlink port 1 4 MLAG1 port4 peerlink port 1
[0093] In this embodiment, the network side intends to communicate with the user side. Network device E sends service message 1 to network device C. Service message 1 includes characteristic information 1. Characteristic information 1 may specifically be 5-tuple information, which includes the destination MAC address 1.
[0094] Network device E sends service message 1 to MLAG. According to the load balancing principle, service message 1 will be sent to either network device A or network device B. The following explanation will take the case where network device A receives service message 1 as an example.
[0095] After receiving service packet 1, network device A first obtains the destination MAC address 1. Based on the destination MAC address 1, network device A retrieves the MAC entry 1 that matches the destination MAC address 1 from its local MAC forwarding table. This MAC entry 1 includes an outgoing interface 1 used for forwarding service packet 1, and this outgoing interface 1 indicates MLAG1.
[0096] Simultaneously, network device A also obtains characteristic information 1 from service message 1, such as 5-tuple information. After obtaining characteristic information 1, network device A determines the member port used for forwarding service message 1 from MLAG1 based on characteristic information 1.
[0097] Network device 1 performs a hash calculation on feature information 1 to obtain hash value 1 (e.g., hash value 1 is 3). Based on hash value 1, network device A retrieves the aggregation table entry that matches hash value 1 (e.g., aggregation table entry 3). This aggregation table entry includes a member port identifier of port3. Network device A uses port3, indicated by the member port identifier, as the interface for forwarding service packet 1.
[0098] Network device A checks whether port3 is within network device A. If port3 is not within network device A, network device A continues to retrieve the peerlink port 1 that has a redirection relationship with port3 from aggregate table entry 3.
[0099] Network device A sends service message 1 to network device B through peerlink port 1 and peer-link.
[0100] After receiving service packet 1, network device B can obtain the destination MAC address 1 from service packet 1. Network device B can then look up the local MAC address table based on the destination MAC address 1.
[0101] If a MAC entry matching the destination MAC1 address exists in the local MAC address table and the Layer 2 unicast traffic isolation between peerlink port 2 and ports 3 and 4 has been removed in network device B, network device B can forward service packet 1 to network device C through port 3 or port 4.
[0102] It should be noted that, in the aforementioned process, network device B can only forward service packet 1 received through peer-link after it has learned the MAC entry of network device C locally.
[0103] In practical applications, if network device B fails to learn the MAC entry of network device C after removing the Layer 2 unicast traffic isolation between its peerlink port 2 and ports 3 and 4, network device C will receive multiple service packets 1.
[0104] like Figure 5 As shown, Figure 5 This is another MLAG networking diagram provided for an embodiment of this application. Figure 5 In this scenario, if network device A learns the MAC address of network device C, it generates a MAC entry for network device C and immediately synchronizes this entry to network device B. During this synchronization, network device B receives service packet 1 from network device D. Since network device B has not yet synchronized its MAC entry for network device C, it treats service packet 1 as an unknown unicast. Network device B sends one copy of service packet 1 to network device A via peer-link, and simultaneously sends another copy of service packet 1 to network device C via port 3 or port 4. When service packet 1 arrives at network device A, since network device A has already learned the MAC entry for network device C and has removed the Layer 2 unicast traffic isolation between its peer-link port 1 and ports 1 and 2, it will send another copy of service packet 1 to network device C. Therefore, network device C will receive two copies of service packet 1, resulting in multiple packet reception.
[0105] To avoid network device C receiving multiple packets, in this embodiment, before generating the aggregation table locally, network device A determines whether the bandwidth and values of multiple member ports between it and network device C are the same as a bandwidth threshold (which can be the bandwidth value between network device A and network device D, 20G). If they are different, network device A initiates a global hash mode. This global hash mode is used by network device A to determine the interface for forwarding service packets, using any one of all member ports within the network devices constituting the MLAG as the interface for forwarding service packets. This reduces peer-link detours and the probability of receiving multiple packets.
[0106] In the embodiments of this application, after either network device A or network device B synchronizes the MAC entry of network device C to the peer, the peer will maintain unidirectional isolation while learning the MAC entry of network device C, so as to avoid network device C receiving multiple packets.
[0107] For example, after network device C accesses the MLAG, it sends a gratuitous ARP packet to the MLAG. For example, after network device A receives the gratuitous ARP packet, it learns and generates MAC entry 1 for network device C.
[0108] Network device A generates notification message 1, which includes MAC address entry 1. Network device A then sends notification message 1 to network device B via peer-link.
[0109] After receiving notification message 1, network device B retrieves MAC entry 1 from it. Based on MAC entry 1, network device B generates MAC entry 2 for network device C locally. At the same time, during the process of learning the MAC entry of network device C, network device B maintains isolation of unknown unicast traffic between its peerlink port 2 and ports 3 and 4.
[0110] When network device B receives service packet 1 from network device A, which is destined for network device C, via peer-link, network device B will no longer forward service packet 1 to network device C via port 3 or port 4. Network device B will discard service packet 1.
[0111] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 6 , Figure 6 The communication apparatus provided in this application embodiment is applied to a first network device, the first network device being located within an MLAG, the MLAG further including a second network device, and a peer-link being established between the first network device and the second network device. The apparatus includes:
[0112] The receiving unit 610 is configured to receive a first service message sent by the network side, wherein the first service message includes first feature information;
[0113] The determining unit 620 is configured to determine, based on the first feature information, a first interface for forwarding the first service message;
[0114] The first acquisition unit 630 is used to acquire the interface identifier of the second interface associated with the first interface if the first interface is not in the first network device.
[0115] The sending unit 640 is used to send the first service message to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local MLAG member port, and then forward the first service message to the third network device accessing the MLAG.
[0116] The first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0117] Optionally, the receiving unit 610 is further configured to receive a first configuration instruction input by a user, the first configuration instruction including a hash value, an aggregation group identifier of the MLAG, and a member port identifier of a member port within the MLAG;
[0118] The apparatus further includes a generation unit (not shown in the figure), used to generate an aggregation table entry locally and store the aggregation table entry in an aggregation table, wherein the aggregation table entry includes the hash value, the aggregation group identifier, and the member port identifier.
[0119] Optionally, the first service message includes a first destination MAC address;
[0120] The apparatus further includes: a second acquisition unit (not shown in the figure), configured to acquire a first MAC entry matching the first destination MAC address from a local MAC forwarding table based on the first destination MAC address, wherein the first MAC entry includes a first outgoing interface for forwarding the first service packet, and the first outgoing interface indicates the MLAG;
[0121] The determining unit 620 is specifically used to perform a hash calculation on the first feature information to obtain a first hash value of the first feature information;
[0122] Based on the first hash value, obtain the first aggregate table entry that matches the first hash value from the aggregate table entry. The first aggregate table entry includes the interface identifier of the first interface.
[0123] The first interface indicated by the first interface identifier shall be used as the interface for forwarding the first service message;
[0124] The first interface is the member port within the MLAG.
[0125] Optionally, the device further includes:
[0126] An establishment unit (not shown in the figure) is used to establish a redirection relationship between the member port not in the first network device and the second interface if the member port indicated by the member port identifier is not in the first network device.
[0127] A storage unit (not shown in the figure) is used to store the redirection relationship in the aggregate table entry.
[0128] Optionally, the receiving unit 610 is further configured to receive a second configuration instruction input by the user;
[0129] The device further includes: a first startup unit (not shown in the figure), configured to start a global hash mode according to the second configuration instruction, wherein the global hash mode is used by the first network device to use any one of the member ports in the MLAG as the interface for forwarding the service packet when determining the interface for forwarding the service packet.
[0130] Optionally, the device further includes:
[0131] The judgment unit (not shown in the figure) is used to determine whether the bandwidth and value of multiple member ports between the third network device and the third network device are the same as the bandwidth threshold.
[0132] The second startup unit (not shown in the figure) is used to start the global hash mode if they are different. The global hash mode is used by the first network device to use any one of the member ports in the MLAG as the interface for forwarding the service packet when determining the interface for forwarding the service packet.
[0133] Optionally, the receiving unit 610 is further configured to receive a second service packet sent by the second network device through the peer-link, the second service packet including a second destination MAC address;
[0134] The second acquisition unit (not shown in the figure) is further configured to, based on the second destination MAC address, acquire a second MAC entry from the local MAC forwarding table that matches the second destination MAC address, the second MAC entry including a second outgoing interface for forwarding the second service packet, the second outgoing interface indicating the MLAG;
[0135] The first acquisition unit 630 is further configured to perform a hash calculation on the second feature information included in the second service message to obtain a second hash value of the second feature information;
[0136] The first acquisition unit 630 is further configured to, based on the second hash value, acquire a second aggregate table entry that matches the second hash value in the aggregate table entry, wherein the second aggregate table entry includes the interface identifier of the third interface;
[0137] The sending unit 640 is further configured to forward the second service message to the third network device through the third interface indicated by the interface identifier of the third interface;
[0138] The third interface is the member port within the MLAG.
[0139] Optionally, the receiving unit 610 is further configured to receive a third configuration instruction input by the user;
[0140] The device further includes a release unit (not shown in the figure), used to release the Layer 2 unicast traffic isolation between the local peerlink port of the first network device and the local MLAG member port according to the third configuration instruction.
[0141] Optionally, the receiving unit 610 is further configured to receive a first notification message sent by the second network device through the peer-link, wherein the first notification message includes a third MAC entry of the third network device;
[0142] The apparatus further includes: a holding unit (not shown in the figure), used to maintain the isolation of unknown unicast traffic between the local peerlink port of the first network device and the local member port of the MLAG when the generating unit generates the fourth MAC entry of the third network device locally according to the third MAC entry;
[0143] The sending unit 640 is further configured to, when the receiving unit 610 receives a third service message sent by the second network device and destined for the third network device through the peer-link, no longer forward the third service message to the third network device through the local MLAG member port;
[0144] The device further includes a discarding unit (not shown in the figure) for discarding the third service message.
[0145] Therefore, by applying the communication device provided in this application, the first network device receives a first service message sent by the network side, the first service message including first characteristic information; based on the first characteristic information, the first network device determines a first interface for forwarding the first service message; if the first interface is not within the first network device, the first network device obtains the interface identifier of the second interface associated with the first interface; through the second interface indicated by the interface identifier and the peer-link, the first network device sends the first service message to the second network device, so that the second network device can release the Layer 2 unicast traffic isolation between the local peerlink port of the second network device and the member port within the local MLAG, and then forward the first service message to the third network device accessing the MLAG; wherein, the first service message is a Layer 2 unicast message, and the second interface is the local peerlink port of the first network device.
[0146] Thus, when determining the interface for forwarding the first service packet, the first interface not located within the first network device can be used as the interface for forwarding the first service packet. The first service packet is then forwarded to the network device where the first interface resides via a peer-link, allowing the network device to continue forwarding the first service packet and achieving global load balancing of Layer 2 unicast traffic. This solves the problems of bandwidth waste and traffic interruption caused by existing methods that use the minimum number of selected member ports within an aggregation group or member port linkage functions to trigger traffic redirection.
[0147] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 7 As shown, the system includes a processor 710, a transceiver 720, and a machine-readable storage medium 730. The machine-readable storage medium 730 stores machine-executable instructions that can be executed by the processor 710. The processor 710 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 6 The communication device shown can be used as follows: Figure 7 The hardware structure of the network device shown is implemented.
[0148] The aforementioned computer-readable storage medium 730 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 730 may also be at least one storage device located remotely from the aforementioned processor 710.
[0149] The processor 710 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0150] In this embodiment of the application, the processor 710 reads the machine-executable instructions stored in the machine-readable storage medium 730, and is prompted by the machine-executable instructions to enable the processor 710 itself and the transceiver 720 to execute the communication method described in the foregoing embodiment of the application.
[0151] In addition, this application provides a machine-readable storage medium 730 that stores machine-executable instructions. When called and executed by the processor 710, the machine-executable instructions cause the processor 710 itself and the transceiver 720 to execute the communication method described in the aforementioned application.
[0152] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0153] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0154] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.
[0155] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A communication method, characterized in that, The method is applied to a first network device, which is located within an MLAG (Multi-Level Link Aggregator). The MLAG also includes a second network device, and a peer-link has been established between the first network device and the second network device. The method includes: Receive a first service message sent by the network side, the first service message including first feature information; Based on the first feature information, a first interface for forwarding the first service message is determined; If the first interface is not within the first network device, then obtain the interface identifier of the second interface associated with the first interface from the aggregation table entry; The first service message is sent to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local MLAG member port, and then forward the first service message to the third network device accessing the MLAG. Wherein, the first service message is a Layer 2 unicast message, the second interface is the local peerlink port of the first network device; the aggregation table entry stores the redirection relationship between the MLAG member port that is not in the first network device and the second interface.
2. The method according to claim 1, characterized in that, Before receiving the first service message sent by the network side, the method further includes: Receive a first configuration instruction input by the user, the first configuration instruction including a hash value, the aggregation group identifier of the MLAG, and the member port identifier of the member port within the MLAG; Generate an aggregate table entry locally and store the aggregate table entry in the aggregate table. The aggregate table entry includes the hash value, the aggregate group identifier, and the member port identifier.
3. The method according to claim 2, characterized in that, The first service message includes the first destination MAC address; After receiving the first service message sent by the network side, the method further includes: Based on the first destination MAC address, a first MAC entry matching the first destination MAC address is obtained from the local MAC forwarding table. The first MAC entry includes a first outgoing interface for forwarding the first service packet, and the first outgoing interface indicates the MLAG. The step of determining the first interface for forwarding the first service message based on the first feature information specifically includes: Perform a hash calculation on the first feature information to obtain the first hash value of the first feature information; Based on the first hash value, obtain the first aggregate table entry that matches the first hash value from the aggregate table entry. The first aggregate table entry includes the interface identifier of the first interface. The first interface indicated by the first interface identifier shall be used as the interface for forwarding the first service message; The first interface is the member port within the MLAG.
4. The method according to claim 2, characterized in that, After generating the aggregate table entry locally, the method further includes: If the member port indicated by the member port identifier is not in the first network device, then a redirection relationship is established between the member port not in the first network device and the second interface; The redirection relationship is stored in the aggregate table entry.
5. The method according to claim 1, characterized in that, Before receiving the first service message sent by the network side, the method further includes: Receive the second configuration command input by the user; According to the second configuration instruction, the global hash mode is started. The global hash mode is used by the first network device to select any one of the member ports in the MLAG as the interface for forwarding the service packet when determining the interface for forwarding the service packet.
6. The method according to claim 1, characterized in that, Before receiving the first service message sent by the network side, the method further includes: Determine whether the bandwidth and values of multiple member ports used between the third network device and the third network device are the same as the bandwidth threshold. If they are different, then the global hash mode is activated. The global hash mode is used by the first network device to determine the interface for forwarding service packets, and to use any one of the member interfaces in the MLAG as the interface for forwarding the service packets.
7. The method according to claim 2, characterized in that, The method further includes: The peer-link is used to receive a second service message sent by the second network device, the second service message including a second destination MAC address; Based on the second destination MAC address, a second MAC entry matching the second destination MAC address is obtained from the local MAC forwarding table. The second MAC entry includes a second outgoing interface for forwarding the second service packet, and the second outgoing interface indicates the MLAG. The second feature information included in the second service message is hashed to obtain the second hash value of the second feature information; Based on the second hash value, a second aggregated entry matching the second hash value is obtained from the aggregated entry, the second aggregated entry including the interface identifier of the third interface; The second service message is forwarded to the third network device through the third interface indicated by the interface identifier of the third interface; The third interface is the member port within the MLAG.
8. The method according to claim 7, characterized in that, Before receiving the second service message sent by the second network device via the peer-link, the method further includes: Receive third configuration commands input by the user; According to the third configuration instruction, the Layer 2 unicast traffic isolation between the local peerlink port of the first network device and the local MLAG member port is released.
9. The method according to claim 8, characterized in that, The method further includes: The third network device receives a first notification message sent by the second network device via the peer-link. The first notification message includes a third MAC entry of the third network device. When the fourth MAC entry of the third network device is generated locally based on the third MAC entry, the unknown unicast traffic between the local peerlink port of the first network device and the local MLAG member port is kept isolated. When a third service message sent by the second network device and destined for the third network device is received through the peer-link, the third service message will no longer be forwarded to the third network device through the local MLAG member port; Discard the third service message.
10. A communication device, characterized in that, The device is applied to a first network device, which is located within an MLAG (Multi-Level Link Aggregator). The MLAG also includes a second network device, and a peer-link has been established between the first network device and the second network device. The device comprises: A receiving unit is configured to receive a first service message sent by the network side, wherein the first service message includes first feature information. The determining unit is configured to determine, based on the first feature information, a first interface for forwarding the first service message; The first acquisition unit is configured to acquire the interface identifier of the second interface associated with the first interface from the aggregation table if the first interface is not within the first network device. The sending unit is configured to send the first service message to the second network device through the second interface indicated by the interface identifier and the peer-link, so that the second network device can release the Layer 2 unicast traffic isolation between the local peer-link port of the second network device and the local member port of the MLAG, and then forward the first service message to the third network device accessing the MLAG. Wherein, the first service message is a Layer 2 unicast message, the second interface is the local peerlink port of the first network device; the aggregation table entry stores the redirection relationship between the MLAG member port that is not in the first network device and the second interface.