A MAC table entry synchronization method and device
By using the distributed aggregation DR interface and internal control IPL link in the M-LAG network, the problem of MAC table entry synchronization depends on the CPU is solved, efficient and accurate synchronization of MAC address table entry is achieved, and network performance between devices is improved.
Patent Information
- Application Number
- CN202211740429.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The MAC table entry synchronization process in M-LAG network is overly dependent on the CPU, resulting in low timeliness and easy timing errors, affecting the normal forwarding of network traffic.
Receive data packets and add DR tags through the distributed aggregation DR interface, and send data packets carrying DR tags using the internal control IPL link, so that the peer device can learn MAC address table entries based on the source MAC address and DR tags, reducing CPU participation and encapsulation resolution delay.
It improves the timeliness of MAC table entry synchronization, can complete synchronization between devices within the nanosecond level, avoids timing errors, and reduces the CPU burden.
Smart Images

Figure CN116346719B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for synchronizing MAC table entries. Background Art
[0002] M-LAG (Multichassis Link Aggregation Group) is a cross-device link aggregation technology. By aligning two access switches and user-side devices or servers in the same state, M-LAG improves link reliability from the board level to the device level.
[0003] In M-LAG technology, a DR interface (Distributed Relay interface) is a Layer 2 aggregation interface connected to external devices. An IPP interface (Intra-Portal Port) is an interface connected to a DR neighbor device for internal control.
[0004] In an M-LAG network, multiple devices operate independently, with decoupled control planes. This provides network backup and traffic load balancing. To ensure normal traffic forwarding, multiple devices must synchronize MAC (Media Access Control) and ARP (Address Resolution Protocol) entries through protocols, which places certain demands on the real-time and reliability of this synchronization. However, in current M-LAG networks, MAC entry synchronization between multiple devices requires multiple CPUs to perform protocol encapsulation and parsing, placing a heavy reliance on the CPU. The latency introduced by CPU encapsulation and parsing is unavoidable, resulting in low MAC entry synchronization timeliness. Summary of the Invention
[0005] The present invention aims to provide a method and apparatus for synchronizing MAC table entries, thereby resolving the technical issues of excessive reliance on the CPU during MAC table entry synchronization, which places high demands on CPU performance, resulting in low timeliness of MAC table entry synchronization, and the susceptibility to timing errors that can lead to MCA table entry errors. The specific technical solution is as follows:
[0006] To achieve the above object, an embodiment of the present invention provides a method for synchronizing MAC table entries, the method comprising:
[0007] Receiving a first data packet through a distributed aggregation DR interface;
[0008] Adding a DR label to the data message according to the distributed aggregation group to which the DR interface belongs; wherein the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group;
[0009] The first data packet carrying the DR label is sent to the opposite device through the internal control IPL link, so that the opposite device learns the MAC address table entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0010] Optionally, the method includes:
[0011] receiving a second data message sent by the opposite device through the IPL link;
[0012] Determining that the second data packet carries a peer DR label of the distributed aggregation group;
[0013] Learning, based on the source MAC address of the second data packet and the peer DR label, a MAC address entry whose outgoing interface is the distributed aggregation group;
[0014] The second data packet with the DR label of the opposite end removed is sent according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet.
[0015] Optionally, the step of learning, based on the source MAC address of the second data packet and the peer DR label, a MAC address entry whose outgoing interface is the distributed aggregation group includes:
[0016] Determining a virtual DR logical interface based on the DR label carried by the second data packet;
[0017] Finding the virtual DR logical interface associated with the distributed aggregation group;
[0018] A MAC address table entry is learned based on the source MAC address of the second data packet and the distributed aggregation group.
[0019] Optionally, before the step of determining the virtual DR logical interface based on the DR label carried by the second data packet, the method further includes:
[0020] Associating the distributed aggregation group with a local virtual DR logical interface;
[0021] Allocating the DR label to the distributed aggregation group;
[0022] Notifying the DR label assigned to the distributed aggregation group to the peer device through the IPL link;
[0023] receiving, through the IPL link, the peer DR label allocated by the peer device to the distributed aggregation group;
[0024] The peer DR label is associated with the local virtual DR logical interface.
[0025] Optionally, the method further includes:
[0026] receiving, through the IPL link, a third data packet sent by the opposite device;
[0027] Determining that the third data packet does not carry the DR label;
[0028] Learning, based on the source MAC address of the third data packet, a MAC address entry whose outgoing interface is the IPP interface of the IPL link;
[0029] The third data packet is sent according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the third data packet.
[0030] To achieve the above-mentioned object, an embodiment of the present invention further provides a MAC table entry synchronization device, the device comprising:
[0031] A first receiving module, configured to receive a first data message through a distributed aggregation DR interface;
[0032] an adding module for adding a DR label to the data message according to the distributed aggregation group to which the DR interface belongs; wherein the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group;
[0033] The first sending module is used to send the first data packet carrying the DR label to the opposite device through the internal control IPL link, so that the opposite device learns the MAC address table entry whose output interface is the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0034] Optionally, the device further includes:
[0035] A second receiving module, configured to receive a second data message sent by the opposite device through the IPL link;
[0036] A first determining module is configured to determine that the second data packet carries a peer DR label of the distributed aggregation group;
[0037] A first learning module is configured to learn a MAC address entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the second data packet and the peer DR label;
[0038] The second sending module is configured to send the second data packet with the DR label of the opposite end stripped off according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet.
[0039] Optionally, the first learning module is specifically used to:
[0040] Determining a virtual DR logical interface based on the DR label carried by the second data packet;
[0041] Finding the virtual DR logical interface associated with the distributed aggregation group;
[0042] A MAC address table entry is learned based on the source MAC address of the second data packet and the distributed aggregation group.
[0043] Optionally, the device further includes:
[0044] An association module is used to associate the distributed aggregation group with a local virtual DR logical interface before receiving the first data packet through the distributed aggregation DR interface; assign the DR label to the distributed aggregation group; notify the opposite device of the DR label assigned to the distributed aggregation group through the IPL link; receive the opposite DR label assigned to the distributed aggregation group by the opposite device through the IPL link; and associate the opposite DR label with the local virtual DR logical interface.
[0045] Optionally, the device further includes:
[0046] The third sending module is used to receive the third data packet sent by the opposite device through the IPL link; determine that the third data packet does not carry the DR label; learn the MAC address table entry whose outgoing interface is the IPP interface of the IPL link based on the source MAC address of the third data packet; and send the third data packet according to the outgoing interface of the MAC address table entry matched with the destination MAC address of the third data packet.
[0047] Beneficial effects of the embodiments of the present invention:
[0048] The MAC table item synchronization method provided in an embodiment of the present invention is applied, a first data packet is received through a distributed aggregation DR interface, and a DR label is added to the data packet according to the distributed aggregation group to which the DR interface belongs; wherein, the DR interface connected to the same aggregation group on the external device belongs to the same distributed aggregation group; the first data packet carrying the DR label is sent to the opposite device through an internal control IPL link, so that the opposite device learns the MAC address table item of the outgoing interface as the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0049] It can be seen that a DR label is added to the first data packet received from the distributed aggregation DR interface. The DR label can represent the distributed aggregation group to which the DR interface belongs. The data packet is then sent to the opposite device. The opposite device determines the distributed aggregation group corresponding to the DR label based on the DR label carried by the data packet, and then can use the MAC self-learning function of the chip to learn the MAC address table entry to the corresponding distributed aggregation group based on the source MAC address of the first data packet and the DR label. The entire process does not require the participation of the CPU and does not have to rely on the performance of the CPU. In addition, it also avoids the delay caused by the CPU repeatedly encapsulating and parsing the message, greatly improving the timeliness of the MAC table synchronization, and can increase the speed of synchronizing MAC information between devices in the DRNI network to the ns (nanosecond) level. Since the speed of learning the MAC table entry is fast enough, there will be no timing errors that cause MCA table errors.
[0050] Of course, it is not necessary to achieve all of the advantages described above simultaneously in order to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0052] Figure 1 A schematic diagram of synchronizing MAC table entries using the existing M-LAG technology;
[0053] Figure 2 This is a schematic diagram of the DRNI network model structure;
[0054] Figure 3 A schematic diagram of a first flow chart of a MAC table entry synchronization method provided by an embodiment of the present invention;
[0055] Figure 4 A second flow chart of a MAC table entry synchronization method provided by an embodiment of the present invention;
[0056] Figure 5 A third flow chart of a MAC table entry synchronization method provided by an embodiment of the present invention;
[0057] Figure 6 A fourth flow chart of a MAC table entry synchronization method provided by an embodiment of the present invention;
[0058] Figure 7 A first structural diagram of a MAC table entry synchronization device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on the present invention are within the scope of protection of the present invention.
[0060] To facilitate understanding, the following briefly describes the MAC table synchronization process in the Distributed Resilient Network Interconnect (DRNI) scenario. DRNI can also be understood as a cross-device link aggregation technology.
[0061] like Figure 1 As shown in the figure, after a data packet arrives at Device A, it first learns the MAC address on the ASIC (Application-Specific Integrated Circuit) chip Switch A. Subsequently, the CPU senses that the device has completed MAC learning and packages the locally learned MAC table entry information through a software protocol and sends it to Device B. The CPU of Device B parses the protocol message and then sends the MAC table entry information to Switch B.
[0062] As can be seen, the MAC table synchronization process in the existing technology has the following disadvantages:
[0063] First, it requires heavy CPU participation. When the table size is large, the CPU performance requirements are high. Second, synchronizing MAC table entries from Device A to Device B requires protocol encapsulation and parsing by multiple CPUs, which reduces the timeliness of MAC synchronization. Third, it is prone to timing errors. If Device A and Device B learn MAC addresses simultaneously within a short period of time, the traffic may reach Switch A before Switch B. Due to the delay in protocol processing, the actual CPU processing result is that Switch B's learning message is received before Switch A's message, resulting in MAC table entry errors.
[0064] In order to solve the technical problems of excessive reliance on the CPU during MAC table entry synchronization, high CPU performance requirements, low timeliness of MAC table entry synchronization, and easy occurrence of timing errors leading to MCA table entry errors, the embodiments of the present invention provide a MAC table entry synchronization method and apparatus, which can be applied to DRNI networks. Figure 2 .
[0065] Figure 2 This is a diagram of the DRNI network model. Device A and Device B are peer devices in DRNI and can both connect to the IP network. The IPL (Intra-Portal Link) allows Device A and Device B to exchange protocol messages and transmit data. Device C and Device E are both external devices connected to Device A, while Device D is an external device connected to Device B.
[0066] like Figure 3 As shown, the MAC table entry synchronization method provided by the embodiment of the present invention may include the following steps:
[0067] S301: Receive a first data packet through a distributed aggregation DR interface.
[0068] In the embodiment of the present invention, the distributed aggregation DR interface refers to a Layer 2 aggregation interface connected to an external device.
[0069] The MAC table synchronization method provided in the embodiment of the present invention can be applied to any device in DRNI. Figure 2 For illustration, this method can be applied to both Device A and Device B.
[0070] For ease of understanding, the following examples use Device A as the executing entity of the method. In some examples, Device A is described as the local device.
[0071] Taking Device A as an example, Device A can include multiple common ports and multiple distributed aggregation DR interfaces. That is, Device A can receive packets from platform ports as well as DR interfaces.
[0072] As an example, Device A receives a first data packet sent by Device C through DR interface 1.
[0073] S302: Add a DR label to the data packet according to the distributed aggregation group to which the DR interface belongs; wherein, the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group.
[0074] In the embodiment of the present invention, DR interfaces connected to the same aggregation group on external devices belong to the same distributed aggregation group.
[0075] As an example, Figure 2 As shown in the figure, DR interface 1 of Device A and DR interface 3 of Device B are connected to the external device Device C. DR interface 1 and DR interface 3 belong to the same distributed aggregation group, which can be recorded as distributed aggregation group 1. External device Device C is connected to Device A and Device B respectively through two member links of its link aggregation group (LAG).
[0076] In addition, DR interface 2 on Device A and DR interface 4 on Device B are connected to an external device, Device D. DR interface 2 and DR interface 4 belong to the same distributed aggregation group, which can be recorded as distributed aggregation group 2. External device Device D is connected to Device A and Device B through its two LAG member links.
[0077] In the embodiment of the present invention, the generation rules of the DR labels may be preset, specifically: different DR labels are generated for different distributed aggregation groups according to the differences between the distributed aggregation groups.
[0078] As an example, combining Figure 2 To further illustrate, when Device A receives a data packet from Device C through DR interface 1, it adds the DR label corresponding to distributed aggregation group 1, to which DR interface 1 belongs, to the data packet.
[0079] When Device A receives a data packet from Device D through DR interface 2, it adds a DR label corresponding to distributed aggregation group 2, to which DR interface 2 belongs, to the data packet.
[0080] S303: Send a first data packet carrying a DR label to a peer device via an internal control IPL link, so that the peer device learns a MAC address table entry whose outgoing interface is a distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0081] In the embodiment of the present invention, an IPL link is a link used for exchanging protocol messages and transmitting data between DR devices in a DRNI architecture.
[0082] In this embodiment of the present invention, after receiving a first data packet through a DR interface, a DR label is added according to step S302, and then the first data packet carrying the DR label is sent to a peer device through an IPL link. After receiving the first data packet, the peer device parses the data packet, obtains the source MAC address and DR label of the first data packet, determines the distributed aggregation group corresponding to the DR label, and then, based on the source MAC address in the first data packet, uses the chip's MAC self-learning function to learn a MAC address table entry whose outgoing interface is the distributed aggregation group.
[0083] It's understood that the chip's MAC address table learning essentially establishes a correspondence between MAC addresses and interfaces. This step utilizes the chip's MAC self-learning function to establish a correspondence between the source MAC address in the first data packet and the distributed aggregation group. After MAC address table learning is complete, if the peer device receives a packet with the same destination MAC address as the source MAC address, it can directly send the packet out of the local DR interface of the distributed aggregation group.
[0084] The MAC table item synchronization method provided in an embodiment of the present invention is applied, a first data packet is received through a distributed aggregation DR interface, and a DR label is added to the data packet according to the distributed aggregation group to which the DR interface belongs; wherein, the DR interface connected to the same aggregation group on the external device belongs to the same distributed aggregation group; the first data packet carrying the DR label is sent to the opposite device through an internal control IPL link, so that the opposite device learns the MAC address table item of the outgoing interface as the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0085] It can be seen that a DR label is added to the first data packet received from the distributed aggregation DR interface. The DR label can represent the distributed aggregation group to which the DR interface belongs. The data packet is then sent to the opposite device. The opposite device determines the distributed aggregation group corresponding to the DR label based on the DR label carried by the data packet, and then can use the MAC self-learning function of the chip to learn the MAC address table entry to the corresponding distributed aggregation group based on the source MAC address of the first data packet and the DR label. The entire process does not require the participation of the CPU and does not have to rely on the performance of the CPU. In addition, it also avoids the delay caused by the CPU repeatedly encapsulating and parsing the message, greatly improving the timeliness of the MAC table synchronization, and can increase the speed of synchronizing MAC information between devices in the DRNI network to the ns (nanosecond) level. Since the speed of learning the MAC table entry is fast enough, there will be no timing errors that cause MCA table errors.
[0086] See also Figure 4 , Figure 4A second flow chart of a MAC table entry synchronization method provided in an embodiment of the present invention may include the following steps:
[0087] S401: Receive a second data packet sent by a peer device through an IPL link.
[0088] In the embodiment of the present invention, the second data message can be understood as a data message with a DR tag sent by the peer device to the local device based on the IPL link between the IPP interfaces, that is, a data message received by the peer device through the DR interface. Figure 2 For Device A, the data packet carrying the DR label sent by Device B to Device A based on the IPL between the IPP interfaces is the second data packet. This data packet is received by Device B through the DR interface connected to the external device.
[0089] S402: Determine whether the second data packet carries the peer DR label of the distributed aggregation group.
[0090] In the embodiment of the present invention, the peer DR label refers to the label added to the data packet when the peer device receives the data packet from the external device through the DR interface. The peer DR label is associated with the distributed aggregation group to which the DR interface of the peer device receives the packet belongs.
[0091] S403: Based on the source MAC address of the second data packet and the DR label of the opposite end, learn a MAC address entry whose outgoing interface is a distributed aggregation group.
[0092] As an example, the peer device (Device B) receives the second data packet at the local interface of distributed aggregation group 1, adds the peer DR label to the second data packet, and sends it to the local device (Device A). Subsequently, the local device learns the MAC address table entry based on the source MAC address of the second data packet and the peer DR label, that is, establishes a correspondence between the source MAC address and distributed aggregation group 1.
[0093] S404: Send the second data packet with the DR label of the opposite end removed according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet.
[0094] As an example, after the local device (Device A) completes the learning of the MAC address table entry, it needs to forward the second data packet. Since the peer DR label has played a role in the process of learning the MAC address table entry, before sending the packet, it is necessary to strip off the peer DR label, and then send the packet according to the destination MAC address of the second data packet. Specifically: determine the outbound interface corresponding to the destination MAC address based on the pre-learned MAC address table entry, and send the second data packet from the outbound interface.
[0095] In one embodiment of the present invention, the above step S403 may specifically include the following detailed steps:
[0096] Step 4031: Determine a virtual DR logical interface based on the DR label carried by the second data packet.
[0097] In an embodiment of the present invention, the virtual DR logical interface is predetermined and can be formed by logically splitting the IPP interface into multiple virtual DR logical interfaces, and there is a one-to-one binding relationship between the virtual DR logical interface and the DR label. In order to facilitate the query of the binding information of the DR label and the virtual DR logical interface, this binding relationship can be saved in a data table. The data table can also save the correspondence between multiple virtual DR logical interfaces and DR labels. Through the data table, the local device can quickly determine the virtual DR logical interface corresponding to the DR label of the other end.
[0098] Step 4032: Find the distributed aggregation group associated with the virtual DR logical interface.
[0099] In the embodiment of the present invention, the distributed aggregation group is pre-associated with the virtual DR logical interface on both the local device and the opposite device.
[0100] Therefore, after determining the virtual DR logical interface corresponding to the opposite-end DR label, the distributed aggregation group can be determined based on the above association.
[0101] Step 4033: Learn a MAC address table entry based on the source MAC address of the second data packet and the distributed aggregation group.
[0102] In the embodiment of the present invention, after the distributed aggregation group is determined, the MAC address table entry can be learned. For details, please refer to the above and will not be repeated here.
[0103] In one embodiment of the present invention, before the step of determining the virtual DR logical interface based on the DR label carried by the second data packet, the following steps may be further included:
[0104] Step 41: Associate the distributed aggregation group with a local virtual DR logical interface;
[0105] Step 42: Assign a DR label to the distributed aggregation group;
[0106] Step 43: Notify the peer device of the DR label assigned to the distributed aggregation group through the IPL link.
[0107] Step 44: Receive the peer DR label allocated by the peer device to the distributed aggregation group through the IPL link;
[0108] Step 45: Associate the peer DR label with the local virtual DR logical interface.
[0109] Specifically, steps 41 to 45 can be understood as pre-processing. Taking the local device as an example, the local device pre-associates the distributed aggregation group with a local virtual DR logical interface, assigns a DR label to the distributed aggregation group, and then notifies the opposite device of the DR label assigned to the distributed aggregation group.
[0110] Accordingly, the local device can receive the peer DR label allocated by the peer device to the distributed aggregation group through the IPL link, and then associate the peer DR label with the local virtual DR logical interface.
[0111] Correspondingly, the peer device can also associate the DR label allocated by the local device to the distributed aggregation group with the peer virtual DR logical interface.
[0112] That is, through the above-mentioned pre-processing, the local device can determine the locally associated virtual DR logical interface through the peer DR label, and then determine the distributed aggregation group corresponding to the peer DR label based on the association relationship between the distributed aggregation group and the local virtual DR logical interface.
[0113] For ease of understanding, the following Figure 2 For further explanation, Device A associates distributed aggregation group 1 with virtual DR logical interface a1 and assigns label tag1. Device B associates distributed aggregation group 1 with virtual DR logical interface b1 and assigns label tag2. Device A then notifies Device B via the IPL link that the label it assigned to distributed aggregation group 1 is tag1. Device B receives this notification via the IPL link and binds label tag1 to virtual DR logical interface b1.
[0114] Accordingly, Device B notifies Device A through the IPL link that the tag assigned by Device B to distributed aggregation group 1 is tag2. Device A receives the notification through the IPL link and binds tag2 to virtual DR logical interface a1.
[0115] Continuing with the previous example, when Device A receives a data packet through DR interface 1 belonging to distributed aggregation group 1, it adds tag 1 to the data packet and then sends the data packet to the peer device, Device B, over the IPL link. After receiving the data packet with tag 1, Device B determines the bound virtual DR logical interface b1 based on tag 1. Based on the association between distributed aggregation group 1 and virtual DR logical interface b1, Device B determines that virtual DR logical interface b1 is bound to distributed aggregation group 1. Then, Device B uses the chip's MAC self-learning function to learn the MAC address table for distributed aggregation group 1.
[0116] Correspondingly, when Device B receives a data packet through DR interface 3 belonging to distributed aggregation group 1, it adds tag 2 to the data packet and then sends the data packet to the peer device Device A through the IPL link. After receiving the data packet with tag 2, Device A determines the bound virtual DR logical interface a1 based on tag 2. Then, based on the association between distributed aggregation group 1 and virtual DR logical interface a1, it determines that virtual DR logical interface a1 is bound to distributed aggregation group 1. Then, Device A uses the MAC self-learning function of the chip to learn the MAC address table to distributed aggregation group 1.
[0117] It can be seen that in an embodiment of the present invention, for the two devices constituting the DRNI architecture, the distributed aggregation group is associated with the virtual DR logical interface, and a DR label is assigned to the distributed aggregation group. The DR label assigned to the distributed aggregation group is then notified to the peer device. Correspondingly, each device will also receive the peer DR label assigned by the peer device to the distributed aggregation group, and then associate the peer DR label with the local virtual DR logical interface.
[0118] Therefore, during the learning process of MAC address table entries, the local device can determine the virtual DR logical interface based on the peer DR label carried in the message sent by the peer device, and then determine the distributed aggregation group based on the association between the distributed aggregation group and the virtual DR logical interface, and learn the MAC address to the distributed aggregation group, thereby achieving high-timeliness and high-accuracy MAC address table entry learning.
[0119] See also Figure 5 , Figure 5 A third flow chart of a MAC table entry synchronization method provided in an embodiment of the present invention may include the following steps:
[0120] S501: Receive a third data packet sent by a peer device through an IPL link.
[0121] S502: Determine that the third data packet does not carry a DR label.
[0122] In the embodiment of the present invention, the third data message can be understood as a data message received by the peer device through a common interface. Figure 2 Device A receives a data packet sent by Device E through a common interface. When Device A sends the data packet to Device B through an IPL link, Device B understands the data packet as a third data packet.
[0123] In other words, by identifying that the third data packet does not carry a DR label, it can be determined that the third data packet does not flow in through the DR interface, but flows in through a common interface.
[0124] S503: Based on the source MAC address of the third data packet, learn a MAC address entry of an IPP interface whose outgoing interface is an IPL link.
[0125] In this embodiment of the present invention, for the third data packet that does not carry a DR tag, a normal MAC address learning method can be used. That is, the local device learns the MAC address table entry to the IPP interface based on the source MAC address in the third data packet using the MAC self-learning function of the chip.
[0126] S504: Send the third data packet according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the third data packet.
[0127] As an example, after completing the learning of the MAC address table entry, the local device (Device A) needs to forward the third data packet. Specifically, it determines the outgoing interface corresponding to the destination MAC address of the third data packet according to the pre-learned MAC address table entry, and sends the third data packet from the outgoing interface.
[0128] It can be seen that in an embodiment of the present invention, for the third data packet received from the IPL link and not carrying a DR label, the source MAC address of the third data packet will not be learned into the distributed aggregation group, but the source MAC address of the third data packet will be learned into the IPP interface of the IPL link, thereby ensuring the correctness of the learned MAC address table entry.
[0129] To facilitate understanding, the MAC table entry synchronization method provided by the embodiment of the present invention is further described below.
[0130] As an example, Figure 6As shown, when a data packet enters the chip of the local device, the local device determines whether the data packet enters through the DR interface. If so, a corresponding DR label is added to the data packet, and the data packet is sent to the opposite device through the IPP port. If the data packet is not a DR interface, the data packet is directly sent to the opposite device through the IPP port.
[0131] The opposite device receives and parses the data packet sent by the local device, and determines whether the data packet carries a DR label. If the data packet does not carry a DR label, the MAC table entry information in the data packet is self-learned to the IPP interface; if the data packet carries a DR label, the virtual DR logical interface corresponding to the DR label is determined based on the DR label in the data packet, and the distributed aggregation group is determined based on the virtual DR logical interface, and then the MAC table entry information is self-learned to the corresponding distributed aggregation group.
[0132] It can be seen that the embodiment of the present invention, by encapsulating DR labels between the IPP ports of the M-LAG devices, identifies data packets entering from different source ports of the local device in the input direction of the IPP port, adds different DR labels to the data packets entering from different source ports or does not add DR labels to distinguish them, and learns the MAC table entry information in the data packet to different distributed aggregation groups or IPP interfaces based on the DR labels. The entire synchronization process optimizes the CPU's multiple processing steps for data packets, and can achieve synchronization of MAC table entries between cross-device link aggregation networks within nanoseconds. At the same time, it can reduce the protocol burden of the CPU in the cross-device link aggregation network.
[0133] Corresponding to a MAC table entry synchronization method provided in an embodiment of the present invention, an embodiment of the present invention further provides a MAC table entry synchronization device, see Figure 7 , the device may include the following modules:
[0134] The first receiving module 701 is configured to receive a first data packet through a distributed aggregation DR interface;
[0135] Adding module 702, configured to add a DR label to the data message according to the distributed aggregation group to which the DR interface belongs; wherein the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group;
[0136] The first sending module 703 is used to send the first data packet carrying the DR label to the opposite device through the internal control IPL link, so that the opposite device learns the MAC address table entry with the outgoing interface as the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0137] A synchronization device for MAC table entries provided by an embodiment of the present invention is applied, a first data packet is received through a distributed aggregation DR interface, and a DR label is added to the data packet according to the distributed aggregation group to which the DR interface belongs; wherein, the DR interface connected to the same aggregation group on the external device belongs to the same distributed aggregation group; the first data packet carrying the DR label is sent to the opposite device through an internal control IPL link, so that the opposite device learns the MAC address table entry of the outgoing interface as the distributed aggregation group based on the source MAC address of the first data packet and the DR label.
[0138] It can be seen that a DR label is added to the first data packet received from the distributed aggregation DR interface. The DR label can represent the distributed aggregation group to which the DR interface belongs. The data packet is then sent to the opposite device. The opposite device determines the distributed aggregation group corresponding to the DR label based on the DR label carried by the data packet, and then can use the MAC self-learning function of the chip to learn the MAC address table entry to the corresponding distributed aggregation group based on the source MAC address of the first data packet and the DR label. The entire process does not require the participation of the CPU and does not have to rely on the performance of the CPU. In addition, it also avoids the delay caused by the CPU repeatedly encapsulating and parsing the message, greatly improving the timeliness of the MAC table synchronization, and can increase the speed of synchronizing MAC information between devices in the DRNI network to the ns (nanosecond) level. Since the speed of learning the MAC table entry is fast enough, there will be no timing errors that cause MCA table errors.
[0139] In one embodiment of the present invention, Figure 7 Based on the device shown, it can include:
[0140] A second receiving module, configured to receive a second data message sent by the opposite device through the IPL link;
[0141] A first determining module is configured to determine that the second data packet carries a peer DR label of the distributed aggregation group;
[0142] A first learning module is configured to learn a MAC address entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the second data packet and the peer DR label;
[0143] The second sending module is configured to send the second data packet with the DR label of the opposite end stripped off according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet.
[0144] In one embodiment of the present invention, the first learning module determines a virtual DR logical interface based on the DR label carried by the second data packet; searches for the virtual DR logical interface associated with the distributed aggregation group; and learns the MAC address table entry based on the source MAC address of the second data packet and the distributed aggregation group.
[0145] In one embodiment of the present invention, Figure 7 Based on the device shown, it can also include an associated module,
[0146] An association module is used to associate the distributed aggregation group with a local virtual DR logical interface before receiving the first data packet through the distributed aggregation DR interface; assign the DR label to the distributed aggregation group; notify the opposite device of the DR label assigned to the distributed aggregation group through the IPL link; receive the opposite DR label assigned to the distributed aggregation group by the opposite device through the IPL link; and associate the opposite DR label with the local virtual DR logical interface.
[0147] In one embodiment of the present invention, Figure 7 Based on the device shown in FIG. 1 , a third sending module may be further included.
[0148] The third sending module is used to receive the third data packet sent by the opposite device through the IPL link; determine that the third data packet does not carry the DR label; learn the MAC address table entry whose outgoing interface is the IPP interface of the IPL link based on the source MAC address of the third data packet; and send the third data packet according to the outgoing interface of the MAC address table entry matched with the destination MAC address of the third data packet.
[0149] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0150] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0151] Each embodiment in this specification is described in a related manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the MAC table entry synchronization apparatus embodiment is substantially similar to the MAC table entry synchronization method embodiment, so its description is relatively simple. For related portions, refer to the description of the method embodiment.
[0152] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A method for synchronizing MAC table entries, characterized in that: The method comprises: Receiving a first data packet through a distributed aggregation DR interface; Adding a DR label to the data message according to the distributed aggregation group to which the DR interface belongs; wherein the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group; Sending the first data packet carrying the DR label to the peer device through the internal control IPL link, so that the peer device learns a MAC address table entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the first data packet and the DR label; receiving a second data message sent by the opposite device through the IPL link; Determining that the second data packet carries a peer DR label of the distributed aggregation group; Determine a virtual DR logical interface based on the DR label carried by the second data packet, where the virtual DR logical interface is obtained by logically splitting the IPP interface; Searching for the distributed aggregation group associated with the virtual DR logical interface; Learning a MAC address table entry based on the source MAC address of the second data packet and the distributed aggregation group; The second data packet with the DR label of the opposite end removed is sent according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet.
2. The method according to claim 1, characterized in that Before the step of determining the virtual DR logical interface based on the DR label carried by the second data packet, the method further includes: Associating the distributed aggregation group with a local virtual DR logical interface; Allocating the DR label to the distributed aggregation group; Notifying the DR label assigned to the distributed aggregation group to the peer device through the IPL link; receiving, through the IPL link, the peer DR label allocated by the peer device to the distributed aggregation group; The peer DR label is associated with the local virtual DR logical interface.
3. The method according to claim 1, characterized in that The method further comprises: receiving, through the IPL link, a third data packet sent by the opposite device; Determining that the third data packet does not carry the DR label; Learning, based on the source MAC address of the third data packet, a MAC address entry whose outgoing interface is the IPP interface of the IPL link; The third data packet is sent according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the third data packet.
4. A MAC table entry synchronization device, characterized in that: The device comprises: A first receiving module, configured to receive a first data message through a distributed aggregation DR interface; an adding module for adding a DR label to the data message according to the distributed aggregation group to which the DR interface belongs; wherein the DR interfaces connected to the same aggregation group on the external device belong to the same distributed aggregation group; A first sending module, configured to send the first data message carrying the DR label to the peer device through an internal control IPL link, so that the peer device learns a MAC address table entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the first data message and the DR label; The device comprises: A second receiving module, configured to receive a second data message sent by the opposite device through the IPL link; A first determining module is configured to determine that the second data packet carries a peer DR label of the distributed aggregation group; A first learning module is configured to learn a MAC address entry whose outgoing interface is the distributed aggregation group based on the source MAC address of the second data packet and the peer DR label; A second sending module is configured to send the second data packet with the DR label of the opposite end stripped off according to the outgoing interface of the MAC address table entry that matches the destination MAC address of the second data packet; The first learning module is specifically used to: Determining a virtual DR logical interface based on the DR label carried by the second data packet; Finding the virtual DR logical interface associated with the distributed aggregation group; A MAC address table entry is learned based on the source MAC address of the second data packet and the distributed aggregation group.
5. The device according to claim 4, characterized in that The device further comprises: An association module is used to associate the distributed aggregation group with a local virtual DR logical interface before receiving the first data packet through the distributed aggregation DR interface; assign the DR label to the distributed aggregation group; notify the opposite device of the DR label assigned to the distributed aggregation group through the IPL link; receive the opposite DR label assigned to the distributed aggregation group by the opposite device through the IPL link; and associate the opposite DR label with the local virtual DR logical interface.
6. The device according to claim 4, characterized in that The device further comprises: The third sending module is used to receive the third data packet sent by the opposite device through the IPL link; determine that the third data packet does not carry the DR label; learn the MAC address table entry whose outgoing interface is the IPP interface of the IPL link based on the source MAC address of the third data packet; and send the third data packet according to the outgoing interface of the MAC address table entry matched with the destination MAC address of the third data packet.
Citation Information
Patent Citations
ARP entry learning method and DR device
CN108259635A