A mac entry rollback synchronization learning method and device

By adopting the MAC entry rollback synchronization learning method and employing timed retransmission and rollback synchronization mechanisms, the reliability problem of MAC entry synchronization in MLAG devices is solved, ensuring the stability of the MLAG protocol and avoiding peerlink link congestion.

CN118677827BActive Publication Date: 2025-11-21INSPUR NETWORK TECH (SHANDONG) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410942140.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2025-11-21
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

The existing MAC entry synchronization method for MLAG master/backup devices has poor reliability and is prone to causing peerlink link congestion, leading to MLAG protocol anomalies.

Method used

The MAC entry rollback synchronization learning method is adopted. Through a two-timed retransmission and rollback synchronization mechanism, a timer is used to retransmit and rollback synchronize when writing or transmission fails. Combined with the timed pending table synchronization mechanism, MAC synchronization is performed in batches to avoid congestion of the peerlink communication channel.

Benefits of technology

It achieves consistency of MAC entries between the MLAG master and backup devices, improves the reliability of synchronization, avoids congestion on the peerlink link, and ensures the stable operation of the MLAG protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677827B_ABST
    Figure CN118677827B_ABST
Patent Text Reader

Abstract

The application discloses a MAC table item rollback synchronization learning method and equipment, belongs to the network communication technical field, and is used for solving the technical problems that the reliability of the MAC table item synchronization method of the current MLAG master / standby equipment is poor, and the peerlink link is easily congested, and the MLAG protocol is abnormally caused. The method comprises the following steps: an MLAG equipment encapsulates a learned new MAC address and a first reason label into an MLAG synchronization message, and sends the MLAG synchronization message to a peer MLAG equipment; if the message sending fails, the MLAG equipment writes the new MAC address into a local first synchronization object table, and starts a first timer; after the first timer is timed out, the MLAG equipment sends all the to-be-synchronized objects in the first synchronization object table to the peer MLAG equipment, and deletes the to-be-synchronized objects in the first synchronization object table after the sending is successful.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a MAC entry rollback synchronization learning method and device. BACKGROUND

[0002] Multi-Chassis Link Aggregation (MLAG) technology is a cross-device link aggregation technology. The master device and the backup device of the MLAG synchronize MAC, IGMP, ARP and other protocol entries through a peerlink link, so as to keep the protocol entries of the two MLAG devices the same. The master device and the backup device of the MLAG perform cross-device link aggregation negotiation with the accessed device by using the same information and state. The accessed device can establish a link aggregation relationship by regarding the two MLAG devices as one device. The cross-device link aggregation mechanism can be regarded as a logical link aggregation group, and realizes link aggregation among multiple devices.

[0003] Since the master device and the backup device of the MLAG belong to the same device in the cross-device link aggregation environment, the MAC entries of the two devices must be consistent. The existing method is that when any one of the MLAG devices learns a new MAC address entry in the cross-device link aggregation group, the MLAG device immediately encapsulates the MAC entry into an MLAG synchronization message and sends the MLAG synchronization message to the opposite MLAG device through the peerlink link. The opposite MLAG device parses the MAC entry content in the synchronization message and writes the MAC entry into the local MAC address table. In order to increase the reliability of MAC synchronization, the master device and the backup device of the MLAG also have a timing synchronization mechanism. The master device and the backup device of the MLAG periodically synchronize all local MAC entries to the opposite MLAG device at a certain time interval, so as to further ensure the consistency of the MAC entries of the MLAG devices.

[0004] However, the above-mentioned existing solution has the following disadvantages:

[0005] 1. If the local device fails in the process of sending the MAC synchronization message, or the opposite device fails in the process of receiving the MAC synchronization message and writing the MAC address into the local MAC address table, the MAC entries of the two MLAG devices will be inconsistent.

[0006] 2. If the device has a large number of MAC entries to be periodically synchronized, the synchronization channel of the peerlink link will be congested, which may cause packet loss or even cause the peerlink connection to be disconnected, so that the MLAG protocol becomes abnormal.

[0007] Therefore, the MAC entry synchronization method of the current master / backup device of the MLAG has poor reliability, and is prone to cause congestion of the peerlink link, which leads to abnormality of the MLAG protocol. SUMMARY

[0008] The embodiment of the present application provides a MAC entry rollback synchronization learning method and device, and the technical problems of the following are solved: the reliability of the MAC entry synchronization method of the current MLAG master / standby device is poor, and the peerlink link is easily congested, so that the MLAG protocol is abnormal.

[0009] The embodiment of the present application adopts the following technical scheme:

[0010] In one aspect, the embodiment of the present application provides a MAC entry rollback synchronization learning method, and the method comprises the following steps:

[0011] The MLAG device encapsulates the learned new MAC address and a first reason label into an MLAG synchronization message, and sends the MLAG synchronization message to a peer MLAG device; wherein, when the MLAG device is a master device, the peer MLAG device is a standby device, and when the MLAG device is a standby device, the peer MLAG device is a master device.

[0012] If the message sending fails, the MLAG device writes the new MAC address into a first synchronization object table locally, and starts a first timer.

[0013] After the first timer expires, the MLAG device sends all the synchronization objects in the first synchronization object table to the peer MLAG device, and deletes the synchronization objects in the first synchronization object table after the sending succeeds.

[0014] In one possible implementation, the MLAG device encapsulates the learned new MAC address and a first reason label into an MLAG synchronization message, and sends the MLAG synchronization message to a peer MLAG device, and the method specifically comprises the following steps:

[0015] After the MLAG device receives a MAC service traffic message through a cross-device aggregation port, a MAC learning operation is triggered, and the learned new MAC address is written into a local MAC address table.

[0016] If the address writing succeeds, the new MAC address and the first reason label are encapsulated into an MLAG synchronization message, and the MLAG synchronization message is sent to the peer MLAG device through a peerlink link.

[0017] In one possible implementation, if the message sending fails, the MLAG device writes the new MAC address into a first synchronization object table locally, and starts a first timer, and the method specifically comprises the following steps:

[0018] If the MLAG device fails to send the MAC synchronization message, it re-sends until it has failed to send for a preset number of times, then writes the new MAC address into a first synchronization object table pending_sync of the MLAG device locally, temporarily stores it, and starts a first timer timer_sync for a preset time length.

[0019] In a feasible implementation, after the first timer expires, the MLAG device sends all the synchronization objects in the first synchronization object table to the peer MLAG device, and deletes the synchronization objects in the first synchronization object table after successful sending, specifically including:

[0020] After the first timer expires, the MLAG device traverses all the MAC address table entries in the local first synchronization object table pending_sync, and sends all the MAC address table entries and the first reason label as synchronization objects to the peer MLAG device through the peerlink link.

[0021] The successfully sent MAC address table entries are deleted from the first synchronization object table pending_sync of the MLAG device locally.

[0022] On the other hand, the embodiment of the application also provides a MAC table rollback synchronization learning method, which includes:

[0023] The MLAG device writes the new MAC address in the MLAG synchronization message into a local MAC address table according to the reason label in the received MLAG synchronization message; when the MLAG device is a master device, the peer MLAG device is a backup device, and when the MLAG device is a backup device, the peer MLAG device is a master device.

[0024] If the writing into the local device fails, the MLAG device generates a second reason label, encapsulates the new MAC address into a new MLAG synchronization message, and sends it back to the peer MLAG device.

[0025] If the sending back fails, the MLAG device writes the new MAC address into a second synchronization object table locally, and starts a second timer.

[0026] After the second timer expires, the MLAG device sends all the synchronization objects in the second synchronization object table to the peer MLAG device, and deletes the synchronization objects in the second synchronization object table after successful sending.

[0027] In an implementable embodiment, the MLAG device writes the new MAC address in the received MLAG synchronization message into the local MAC address table according to the reason tag in the MLAG synchronization message, specifically comprising:

[0028] The MLAG device parses the MAC address and the reason tag carried in the received synchronization message;

[0029] If the reason tag is the first reason tag, the MAC address is written into the local MAC address table as a new MAC address;

[0030] If the reason tag is the second reason tag, and the MAC address already exists in the local MAC address table of the MLAG device, the MAC address is stored in the local first synchronization object table pending_sync, and is re-sent to the peer MLAG device after the next timeout of the first timer.

[0031] In an implementable embodiment, if the writing into the local device fails, the MLAG device generates a second reason tag, and encapsulates the new MAC address into a new MLAG synchronization message with the second reason tag, and sends the new MLAG synchronization message back to the peer MLAG device, specifically comprising:

[0032] If the writing of the new MAC address into the local MAC address table fails, the MLAG device generates a second reason tag, and encapsulates the new MAC address and the second reason tag into a new MLAG synchronization message, and sends the new MLAG synchronization message back to the peer MLAG device through the peerlink link.

[0033] In an implementable embodiment, if the sending back message fails, the MLAG device writes the new MAC address into the local second synchronization object table, and starts a second timer, specifically comprising:

[0034] If the MLAG device fails to send the new MAC synchronization message, the MLAG device re-sends the new MAC synchronization message until a preset number of times, and if the sending still fails after the preset number of times, the MLAG device writes the new MAC address into the local second synchronization object table pending_unsync for temporary storage, and starts a second timer timer_unsync with a preset time length.

[0035] In an implementable embodiment, after the timeout of the second timer, the MLAG device sends all the synchronization objects in the second synchronization object table to the peer MLAG device, and deletes the synchronization objects in the second synchronization object table after the sending succeeds, specifically comprising:

[0036] After the second timer expires, the MLAG device traverses all MAC address entries in the local second synchronization object table pending_unsync, and sends all traversed MAC address entries and the second reason label as synchronization objects to the peer MLAG device through the peerlink link;

[0037] The successfully sent MAC address entries are deleted from the local second synchronization object table pending_sync of the MLAG device;

[0038] If any or more MAC address entries in the local MAC address table of the MLAG device are deleted, the corresponding MAC address entries in the local first synchronization object table and the second synchronization object table are synchronously deleted, and the peer MLAG device is informed to synchronously delete the corresponding MAC address entries in the local first synchronization object table and the second synchronization object table.

[0039] Finally, the embodiment of the application further provides a MAC address rollback synchronization learning device, which comprises at least one processor and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, so that the at least one processor can execute:

[0040] The learned new MAC address and the first reason label are encapsulated as an MLAG synchronization message, and sent to the peer MLAG device; wherein when the MLAG device is a master device, the peer MLAG device is a backup device, and when the MLAG device is a backup device, the peer MLAG device is a master device;

[0041] If the message fails to be sent, the new MAC address is written into the local first synchronization object table, and a first timer is started; after the first timer expires, all synchronization objects in the first synchronization object table are sent to the peer MLAG device, and the synchronization objects are deleted from the first synchronization object table after being successfully sent;

[0042] According to the received reason label in the MLAG synchronization message, the new MAC address in the MLAG synchronization message is written into the local MAC address table; if the writing into the local MAC address table fails, a second reason label is generated, and the new MAC address is encapsulated as a new MLAG synchronization message and returned to the peer MLAG device;

[0043] If the return message fails, write the new MAC address into a second synchronization object table locally, and start a second timer; after the second timer expires, send all the to-be-synchronized objects in the second synchronization object table to the peer MLAG device, and delete the to-be-synchronized objects in the second synchronization object table after the sending is successful.

[0044] Compared with the prior art, the MAC table item rollback synchronization learning method and device provided by the embodiment of the application has the following beneficial effects:

[0045] The application designs a high-efficiency and reliable MAC table item rollback synchronization learning method and device, which adopts secondary timed retransmission and rollback synchronization mechanism in the process of MAC learning real-time synchronization of master / standby devices, retransmits and performs rollback synchronization through the timer when writing fails or return fails, and guarantees the reliability of MAC synchronization.

[0046] In addition, to solve the problem that MAC timed full synchronization is easy to cause peerlink communication channel congestion, the application adopts a timed pending table synchronization mechanism to perform MAC synchronization in batches, effectively relieving the communication burden of the peerlink channel. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor. In the drawings:

[0048] Figure 1 A structure schematic diagram of a MLAG cross-device link aggregation system provided by the embodiment of the application;

[0049] Figure 2 A MAC table item rollback synchronization learning method flowchart provided by the embodiment of the application;

[0050] Figure 3 Another MAC table item rollback synchronization learning method flowchart provided by the embodiment of the application;

[0051] Figure 4 A structure schematic diagram of a MAC table item rollback synchronization learning device provided by the embodiment of the application. DETAILED DESCRIPTION

[0052] In order to make the person skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should fall within the scope of the present application.

[0053] Figure 1 A structural schematic diagram of an MLAG cross-device link aggregation system provided by an embodiment of the present application is shown in FIG. 1. In the MLAG environment shown in FIG. 1, the master device C and the backup device D perform LACP cross-device link aggregation negotiation with the accessed device G with exactly the same information and state, and the accessed device G can establish a link aggregation relationship with the two MLAG devices as one device. Figure 1

[0054] The agg1 port of the master device C learns the mac1 address table item through a traffic message and synchronizes it to the agg1 port of the backup device D. Similarly, the agg1 port of the backup device D learns the mac2 address table item through a traffic message and synchronizes it to the agg1 port of the master device C. The agg1 ports of the master device C and the backup device D both have the same MAC address table.

[0055] Further, when the MLAG device is a synchronization party, the MAC table item rollback synchronization learning method provided by the present application has the following specific process:

[0056] First, the MLAG device encapsulates the learned new MAC address and the first reason label into an MLAG synchronization message and sends it to the opposite MLAG device; wherein, when the MLAG device is a master device, the opposite MLAG device is a backup device, and when the MLAG device is a backup device, the opposite MLAG device is a master device.

[0057] Further, if the sending message fails, the MLAG device writes the new MAC address into the first synchronization object table locally and starts a first timer. After the first timer expires, the MLAG device sends all the synchronization objects in the first synchronization object table to the opposite MLAG device, and deletes the synchronization objects in the first synchronization object table after the sending is successful.

[0058] In one embodiment, the MAC table item rollback synchronization learning method process when the MLAG device is a synchronization party is shown in FIG. 2. Figure 2

[0059] ​​1. The cross-device aggregation port agg1 of the master device C receives the mac1 traffic message sent by the device E, triggers the MAC learning operation, and writes the learned mac1 address into the local MAC address table.

[0060] 2. If the writing is successful, the mac1 address and the first reason label sync are encapsulated into the MLAG synchronization message, and are sent to the peer MLAG device D (i.e., the backup device D) through the peerlink link.

[0061] 3. If a failure occurs in the process of sending the MAC synchronization message (such as peerlink link congestion or connection exception), which leads to the failure of the synchronization sending, the sending is retransmitted for 3 times, if the retransmission is still failed after 3 times, the mac1 address is written into the local first synchronization object table pending_sync of the master device C for temporary storage and a first timer timer_sync of 10 seconds is started.

[0062] 4. After the first timer expires, the MLAG device traverses all the MAC address table entries in the local first synchronization object table pending_sync, and sends all the MAC address table entries and the first reason label as the to-be-synchronized objects to the peer MLAG device through the peerlink link. Then, the successfully sent MAC address table entries are deleted from the first synchronization object table pending_sync of the MLAG device.

[0063] It should be noted that if the cross-device aggregation port agg1 of the backup device D receives the mac2 traffic message sent by the device F, the execution process is consistent with the above steps 1-4, and the only difference is that the peer MLAG device is the master device C at this time.

[0064] Further, when the MLAG device is the synchronized party, the MAC table rollback synchronization learning method provided by the application has the following process:

[0065] Firstly, the MLAG device writes the new MAC address in the MLAG synchronization message into the local MAC address table according to the reason label in the MLAG synchronization message; wherein, when the MLAG device is the master device, the peer MLAG device is the backup device, and when the MLAG device is the backup device, the peer MLAG device is the master device.

[0066] Further, if the writing into the local device fails, the MLAG device generates a second reason label, encapsulates the new MAC address into a new MLAG synchronization message, and sends the new MLAG synchronization message back to the peer MLAG device. If the back transmission message fails, the MLAG device writes the new MAC address into the second synchronization object table of the local device, and starts a second timer;

[0067] Further, after the second timer expires, the MLAG device sends all the objects to be synchronized in the second synchronization object table to the peer MLAG device, and deletes the objects to be synchronized in the second synchronization object table after the sending is successful.

[0068] In one embodiment, the MAC table entry rollback synchronization learning method flow of the MLAG device as a synchronized party is as shown in Figure 3

[0069] 1. If the agg2 port of the backup device D receives the MAC synchronization message sent by the primary device C, the MAC address and the reason tag in the synchronization message are parsed.

[0070] 2. If the reason tag carried in the MAC synchronization message received by the backup device D is sync, the MAC address in the message is written into the local MAC address table of the backup device D. If the MAC address fails to be written into the local backup device D due to some protocol condition restrictions or MAC resource restrictions, etc., the MAC address and the second reason tag unsync are encapsulated into a new MLAG synchronization message, and the new MLAG synchronization message is returned to the peer MLAG device C through the peerlink link.

[0071] 3. If the reason tag carried in the MAC synchronization message received by the backup device D is unsync, and the MAC address already exists in the local MAC address table of the backup device D, it is indicated that this is the MAC address synchronized by the backup device D to the primary device C first, but the primary device C fails to write and returns the new MAC synchronization message. At this time, the backup device D stores the MAC address in the local pending_sync table again, and waits for the next timer_sync timer to expire to synchronize and send to the primary device C again.

[0072] 4. If the return of the new MLAG synchronization message fails and the retransmission is sent 3 times and still fails, the MAC address is written into the local second synchronization object table pending_unsync table of the backup device D for temporary storage, and a second timer timer_unsync of 10 seconds is started.

[0073] 5. After the second timer expires, the backup device D traverses all the MAC address table entries in the local second synchronization object table pending_unsync, and sends all the MAC address table entries and the second reason tag as objects to be synchronized to the primary device C through the peerlink link. Then the successfully sent MAC address table entries are deleted in the second synchronization object table pending_sync of the backup device D.

[0074] ​It should be noted that if the agg2 port of the master device C receives the MAC synchronization message sent by the backup device D, the execution flow is consistent with the above steps 1-5, the only difference is that the peer MLAG device at this time is the backup device D.

[0075] As a feasible implementation, if any one or more MAC address table entries in the master device C are deleted, the corresponding MAC table entries in the pending_sync table and the pending_unsync table in the master device C also need to be deleted, and the backup device D is notified to perform the same action, i.e., deleting the MAC address and synchronously deleting the MAC table entry in the local pending_sync table and the pending_unsync table.

[0076] As a feasible implementation, if Figure 1 In the MLAG environment shown in the figure, if the peerlink link is disconnected, the local timer_sync timer and the timer_unsync timer of the two MLAG devices are closed, and all newly learned MAC addresses are written into the pending_sync table.

[0077] After the peerlink connection is successfully restored, all MAC address table entries in the pending_sync table of the two MLAG devices are synchronized immediately, and if the pending_sync table is not empty, the 10-second timer_sync timer is restarted, and if the pending_unsyc table is not empty, the 10-second timer_unsync timer is restarted.

[0078] In addition, the embodiment of the application also provides a MAC table rollback synchronization learning device, as shown in the figure. Figure 4 As shown in the figure, the MAC table rollback synchronization learning device specifically comprises:

[0079] at least one processor; and a memory connected in communication with the at least one processor; wherein

[0080] The memory stores instructions executable by the at least one processor, so that the at least one processor can execute:

[0081] encapsulating the learned new MAC address and the first reason label into an MLAG synchronization message and sending the MLAG synchronization message to a peer MLAG device; wherein when the MLAG device is a master device, the peer MLAG device is a backup device, and when the MLAG device is a backup device, the peer MLAG device is a master device;

[0082] If the sending of the message fails, the new MAC address is written into a first synchronization object table of the local device, and a first timer is started; after the first timer expires, all the to-be-synchronized objects in the first synchronization object table are sent to the peer MLAG device, and the to-be-synchronized objects are deleted from the first synchronization object table after the sending succeeds;

[0083] According to the received reason label in the MLAG synchronization message, the new MAC address in the MLAG synchronization message is written into a local MAC address table; if the writing into the local device fails, a second reason label is generated, and the new MAC address is encapsulated into a new MLAG synchronization message, which is returned to the peer MLAG device;

[0084] If the returned message fails, the new MAC address is written into a second synchronization object table of the local device, and a second timer is started; after the second timer expires, all the to-be-synchronized objects in the second synchronization object table are sent to the peer MLAG device, and the to-be-synchronized objects are deleted from the second synchronization object table after the sending succeeds.

[0085] Each of the embodiments in the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment mainly explains the difference from other embodiments. Especially, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the method embodiment.

[0086] The above describes the specific embodiments of the present application. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.

[0087] The above only describes the embodiments of the present application and is not used to limit the present application. The embodiments of the present application can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the present application.

Claims

1. A method for MAC entry rollback synchronization learning, characterized in that, The method comprises: The MLAG device encapsulates the learned new MAC address and a first reason label into an MLAG synchronization message and sends the MLAG synchronization message to a peer MLAG device; when the MLAG device is a master device, the peer MLAG device is a backup device, and when the MLAG device is a backup device, the peer MLAG device is a master device; If the message fails to be sent, the MLAG device writes the new MAC address into a first synchronization object table locally and starts a first timer; After the first timer expires, the MLAG device sends all the synchronization objects in the first synchronization object table to the peer MLAG device and deletes the synchronization objects in the first synchronization object table after the sending succeeds; If the peer MLAG device fails to write locally, the peer MLAG device generates a second reason label, encapsulates the second reason label and the new MAC address into a new MLAG synchronization message, and sends the new MLAG synchronization message back to the MLAG device; If the reason label in the MLAG synchronization message received by the MLAG device is the second reason label and the MAC address already exists in a local MAC address table of the MLAG device, the MLAG device stores the MAC address in a first synchronization object table pending_sync locally and waits for the first timer to expire again to resend the MAC address to the peer MLAG device. 2.The MAC entry rollback synchronization learning method of claim 1, wherein, The MLAG device encapsulates the learned new MAC address and a first reason label into an MLAG synchronization message and sends the MLAG synchronization message to a peer MLAG device, and the method comprises the following steps: After the MLAG device receives a MAC service traffic message through a cross-device aggregation port, the MLAG device triggers a MAC learning operation and writes the learned new MAC address into a local MAC address table; If the address is written successfully, the MLAG device encapsulates the new MAC address and the first reason label into an MLAG synchronization message and sends the MLAG synchronization message to the peer MLAG device through a peerlink link. 3.The MAC entry rollback synchronization learning method of claim 1, wherein, If the message fails to be sent, the MLAG device writes the new MAC address into a first synchronization object table locally and starts a first timer, and the method comprises the following steps: If the MLAG device fails to send the MAC synchronization message, the MLAG device resends the MAC synchronization message until a preset number of times, and if the MAC synchronization message still fails to be sent after the preset number of times, the MLAG device writes the new MAC address into a first synchronization object table pending_sync locally and starts a first timer timer_sync with a preset time length.

4. The MAC entry rollback synchronization learning method of claim 1, wherein, After the first timer expires, the MLAG device sends all the synchronization objects in the first synchronization object table to the peer MLAG device and deletes the synchronization objects in the first synchronization object table after the sending succeeds, and the method comprises the following steps: After the first timer expires, the MLAG device traverses all the MAC address table entries in the local first synchronization object table pending_sync, encapsulates the traversed MAC address table entries and the first reason label as synchronization objects, and sends the synchronization objects to the peer MLAG device through the peerlink link; Delete the successfully sent MAC address table item in the first synchronization object table pending_sync local to the MLAG device. 5.A method for MAC entry rollback synchronization learning, characterized in that, The method comprises: The MLAG device writes the new MAC address in the received MLAG synchronization message into the local MAC address table according to the reason label in the MLAG synchronization message; wherein the MLAG device is a master device, and the peer MLAG device is a backup device, or the MLAG device is a backup device, and the peer MLAG device is a master device; and the method specifically comprises: The MLAG device parses the MAC address and the reason label carried in the received synchronization message; If the reason label is a first reason label, the MAC address is written into the local MAC address table as a new MAC address; If the reason label is a second reason label, and the MAC address already exists in the local MAC address table of the MLAG device, the MAC address is stored in the first synchronization object table pending_sync local, and is re-sent to the peer MLAG device after the next timeout of the first timer; If the writing into the local device fails, the MLAG device generates a second reason label, and encapsulates the new MAC address into a new MLAG synchronization message, and returns to the peer MLAG device; If the return message fails, the MLAG device writes the new MAC address into the second synchronization object table local, and starts a second timer; After the timeout of the second timer, the MLAG device sends all the synchronization objects in the second synchronization object table to the peer MLAG device, and deletes the synchronization objects in the second synchronization object table after the sending succeeds.

6. The MAC entry rollback synchronization learning method of claim 5, wherein, If the writing into the local device fails, the MLAG device generates a second reason label, and encapsulates the new MAC address into a new MLAG synchronization message, and returns to the peer MLAG device, and the method specifically comprises: If the writing of the new MAC address into the local MAC address table fails, the MLAG device generates a second reason label, and encapsulates the new MAC address and the second reason label into a new MLAG synchronization message, and returns to the peer MLAG device through the peerlink link.

7. The method of claim 5, wherein, If the return message fails, the MLAG device writes the new MAC address into the second synchronization object table local, and starts a second timer, and the method specifically comprises: If the MLAG device fails when sending the new MAC synchronization message, the MLAG device re-sends until a preset number of times, and if the sending still fails after the preset number of times, the MLAG device writes the new MAC address into the second synchronization object table pending_unsync local to the MLAG device for temporary storage, and starts a second timer timer_unsync with a preset time length. 8.The MAC entry rollback synchronization learning method of claim 5, wherein, After the timeout of the second timer, the MLAG device sends all the synchronization objects in the second synchronization object table to the peer MLAG device, and deletes the synchronization objects in the second synchronization object table after the sending succeeds, and the method specifically comprises: After the second timer expires, the MLAG device traverses all MAC address entries in the local second synchronization object table pending_unsync, and sends all traversed MAC address entries and the second reason label as synchronization objects to the peer MLAG device through the peerlink link; The successfully sent MAC address entries are deleted from the local second synchronization object table pending_sync of the MLAG device; If any or more MAC address entries in the local MAC address table of the MLAG device are deleted, the corresponding MAC address entries in the local first and second synchronization object tables are also deleted, and the peer MLAG device is notified to delete the corresponding MAC address entries in the local first and second synchronization object tables.

9. A MAC table entry rollback synchronization learning device applying the MAC table entry rollback synchronization learning method according to any one of claims 1-8, characterized in that, The device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform: encapsulating the learned new MAC address and the first reason label into an MLAG synchronization message and sending the MLAG synchronization message to a peer MLAG device; wherein the MLAG device is a master device, and the peer MLAG device is a backup device, or the MLAG device is a backup device, and the peer MLAG device is a master device; if the message fails to be sent, writing the new MAC address into a local first synchronization object table, and starting a first timer; after the first timer expires, sending all synchronization objects in the first synchronization object table to the peer MLAG device, and deleting the synchronization objects from the first synchronization object table after the sending is successful; according to the reason label in the received MLAG synchronization message, writing the new MAC address in the MLAG synchronization message into a local MAC address table; if the writing into the local MAC address table fails, generating a second reason label, and encapsulating the second reason label and the new MAC address into a new MLAG synchronization message and sending the new MLAG synchronization message back to the peer MLAG device; if the message fails to be sent, writing the new MAC address into a local first synchronization object table, and starting a first timer; after the first timer expires, sending all synchronization objects in the first synchronization object table to the peer MLAG device, and deleting the synchronization objects from the first synchronization object table after the sending is successful; if the message fails to be sent, writing the new MAC address into a local first synchronization object table, and starting a first timer; after the first timer expires, sending all synchronization objects in the first synchronization object table to the peer MLAG device, and deleting the synchronization objects from the first synchronization object table after the sending is successful;

Citation Information

Patent Citations

  • Method and apparatus of quickly synchronizing medium access control address table

    CN105099961A

  • MAC address synchronization method, device and system, equipment and medium

    CN111107182A