MAC address learning delayed validation method, device, network element equipment and medium
By detecting and broadcasting messages with unknown MAC addresses, combined with table management, the problem of network element devices in ring network topology being unable to effectively learn adjacent MAC addresses is solved, efficient and automated MAC address learning is achieved, and the difficulty of operation and maintenance is reduced.
Patent Information
- Application Number
- CN202411851590.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-12-16
AI Technical Summary
In a ring network topology, network elements (NEs) cannot effectively learn the MAC addresses of adjacent NEs, resulting in message forwarding errors. Existing solutions are inefficient or rely on highly skilled manual troubleshooting.
By checking whether the destination MAC address of the message received by the UNI interface exists in the forwarding table, if not, the message is broadcast and the corresponding relationship is added to the MAC address table. Combined with aging table entry management, this ensures that the adjacent network element learns the MAC address.
It realizes an efficient and automated MAC address learning process, reduces the skill requirements for operation and maintenance personnel, and improves the MAC address learning efficiency of network devices.
Smart Images

Figure CN119697088B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a method, apparatus, network element device, and storage medium for delaying the effectiveness of MAC address learning. Background Art
[0002] In some communication network configurations, such as Figure 1 As shown in the ring network topology diagram, the data network analyzer sends message 1 to network element 1 through UNI (User Network Interface) _1. Since network element 1 has not learned the MAC address of message 1, it forwards message 1 through NNI (Network to Network Interface) Message 1 is forwarded to NE 3 through UNI_1-1, and then forwarded to NE 2 through NNI_1-2. NE 2 receives a message with a source MAC address of MAC1 (NE 1's MAC address) through NNI_2-2, and can learn that MAC1 corresponds to NNI_2-2. Subsequently, if the data network analyzer sends message 2 with a destination MAC address of MAC1 to NE 2 through UNI_2, NE 2 has already learned that MAC1 corresponds to NNI_2-2, so it forwards message 2 through NNI_2-2. This will cause NE 3 to not receive the message from NE 2 and, therefore, NE 3 will not be able to learn NE 2's MAC address. Subsequently, if the data network analyzer sends message 3 with a destination MAC address of MAC2 (NE 2's MAC address) to NE 3 through UNI_3, NE 3 can only forward message 3 in broadcast mode.
[0003] There are generally two existing solutions to the problems in the above business scenarios:
[0004] Solution 1: Wait for the MAC table entry corresponding to NNI_2-2, learned by NE 2, to age. Then, if the data network analyzer sends a packet with the destination MAC address of MAC1 to NE 2 through UNI_2, NE 2 will forward the packet in broadcast mode, allowing NE 3 to learn NE 2's MAC address. However, waiting for the MAC table entry to age takes a long time, making this solution inefficient.
[0005] Solution 2: First, manually troubleshoot and determine that NE 3's broadcast behavior is due to the failure to learn MAC2. Then, control NE 2's broadcast messages so that NE 3 learns NE 2's MAC address. However, this method requires high professional skills from operation and maintenance personnel and is difficult to implement. Summary of the Invention
[0006] In order to solve the above technical problems, the present application provides a MAC address learning delayed validation method, apparatus, network element equipment and computer-readable storage medium.
[0007] In a first aspect, an embodiment of the present application provides a method for delaying the effectiveness of MAC address learning, the method comprising:
[0008] Detect whether a first forwarding table entry corresponding to the destination MAC address of a first message received by the UNI of the local network element exists in the first MAC address table;
[0009] If the first forwarding entry does not exist in the first MAC address table, broadcast the first message to the neighboring network elements through all NNIs of the local network element, and the first MAC address table is initially empty;
[0010] After the first message is broadcasted, if the first forwarding entry exists in the second MAC address table, the first forwarding entry is added to the first MAC address table. Any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
[0011] In conjunction with the first aspect, in one embodiment, the process of adding a new forwarding entry in the second MAC address table specifically includes:
[0012] When any NNI of the network element receives the second message, the second message is parsed to obtain the source MAC address of the second message;
[0013] Detecting whether there is a second forwarding entry in the second MAC address table that represents a correspondence between any one of the NNIs and the source MAC address;
[0014] If the second forwarding entry does not exist in the second MAC address table, then the second forwarding entry is added to the second MAC address table.
[0015] In combination with the first aspect, in one embodiment, when any NNI of the local network element receives the second message, after parsing the second message to obtain the source MAC address of the second message, the method further includes:
[0016] If a third forwarding entry for indicating a correspondence between another NNI and the source MAC address exists in the second MAC address table, the third forwarding entry is deleted, and the other NNI is different from any NNI.
[0017] In combination with the first aspect, in one embodiment, after detecting whether the first forwarding entry corresponding to the destination MAC address of the first message received by the UNI of the current network element exists in the first MAC address table, the method further includes:
[0018] If the first forwarding entry exists in the first MAC address table, detecting whether the NNI corresponding to the first forwarding entry is an NNI that can be used for the service;
[0019] If the NNI corresponding to the first forwarding entry is not an NNI available for the service, the first message is broadcast to neighboring network elements through all NNIs of the local network element, and the first forwarding entry is deleted.
[0020] In conjunction with the first aspect, in one embodiment, after detecting whether the NNI corresponding to the first forwarding entry is an NNI that can be used for the service, the method further includes:
[0021] If the NNI corresponding to the first forwarding entry is an NNI available for the service, the first message is unicast based on the first forwarding entry.
[0022] In combination with the first aspect, in one embodiment, the method for delaying validation of MAC address learning further includes:
[0023] When there is an aged forwarding entry in the second MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0024] In combination with the first aspect, in one embodiment, the method for delaying validation of MAC address learning further includes:
[0025] When there is an aged forwarding entry in the second MAC address table, detecting whether there is the aged forwarding entry in the first MAC address table;
[0026] If the aged forwarding entry exists in the first MAC address table, retain the aged forwarding entry in the first MAC address table and the second MAC address table;
[0027] If the aged forwarding entry does not exist in the first MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0028] In a second aspect, an embodiment of the present application provides a MAC address learning delay validation device, the MAC address learning delay validation device comprising:
[0029] A detection module, configured to detect whether a first forwarding table entry corresponding to a destination MAC address of a first message received by a UNI of the current network element exists in a first MAC address table;
[0030] a broadcast module configured to broadcast the first message to adjacent network elements through all NNIs of the local network element if the first forwarding entry does not exist in the first MAC address table, where the first MAC address table is initially empty;
[0031] The MAC address learning module is configured to, after broadcasting the first message, add the first forwarding entry to the first MAC address table if the first forwarding entry exists in the second MAC address table, wherein any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
[0032] In a third aspect, an embodiment of the present application provides a network element device, which includes a processor, a memory, and a MAC address learning delay effectiveness program stored on the memory and executable by the processor, wherein when the MAC address learning delay effectiveness program is executed by the processor, the steps of the MAC address learning delay effectiveness method described in the first aspect are implemented.
[0033] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a MAC address learning delayed effectiveness program is stored. When the MAC address learning delayed effectiveness program is executed by a processor, the steps of the MAC address learning delayed effectiveness method described in the first aspect are implemented.
[0034] The beneficial effects of the technical solutions provided in the embodiments of the present application include:
[0035] In an embodiment of the present application, it is detected whether the first forwarding table entry corresponding to the destination MAC address of the first message received by the UNI of this network element exists in the first MAC address table; if the first forwarding table entry does not exist in the first MAC address table, the first message is broadcast to the adjacent network elements through all NNIs of this network element, and the first MAC address table is initially empty; after the broadcast of the first message is completed, if the first forwarding table entry exists in the second MAC address table, the first forwarding table entry is added to the first MAC address table, and any forwarding table entry in the second MAC address table is used to characterize the correspondence between NNI and MAC address. Through the embodiment of the present application, for a network element, it receives a message with a destination MAC address of MAC_x through UNI. If the message with a destination MAC address of MAC_x has not been broadcast before, then the forwarding table entry corresponding to MAC_x must not exist in the first MAC address table, and the received message needs to be broadcast, which ensures that its adjacent network elements can learn the MAC address of the network element. That is, for a network element, even if it has learned MAC_x, it must broadcast and forward the message with the destination MAC address of MAC_x at least once, which is equivalent to delaying the effectiveness of the learned MAC address, thereby ensuring that its adjacent network elements can learn the MAC address of the network element. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 This is a schematic diagram of the ring network topology;
[0037] Figure 2 This is a flowchart of an embodiment of the method for delaying the effectiveness of MAC address learning in this application;
[0038] Figure 3 This is a flowchart of another embodiment of the method for delaying the effectiveness of MAC address learning in this application;
[0039] Figure 4 This is a flow chart of adding a new forwarding entry to the second MAC address table in accordance with an embodiment of the method for delaying the effectiveness of MAC address learning in this application;
[0040] Figure 5 This is a functional module diagram of an embodiment of a MAC address learning delay validation device of the present application;
[0041] Figure 6 This is a hardware structure diagram of the MAC address learning delayed effectiveness device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the present invention, 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 without creative work are within the scope of protection of this application.
[0043] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0044] In a first aspect, an embodiment of the present application provides a method for delaying the effectiveness of MAC address learning.
[0045] In one embodiment, referring to Figure 2 , Figure 2 This is a flow chart of an embodiment of the MAC address learning delay validation method of this application. Figure 2 As shown in the figure, the MAC address learning delay method includes:
[0046] Step S110, detecting whether a first forwarding table entry corresponding to the destination MAC address of the first message received by the UNI of the current network element exists in the first MAC address table;
[0047] In this embodiment, the MAC address table is divided into a first MAC address table and a second MAC address table. The first MAC address table is used for table lookup forwarding, and the forwarding entries in the first MAC address table are updated and adjusted based on the forwarding entries in the second MAC address table. For details, please refer to the subsequent description of step S30.
[0048] Combine Figure 1 The ring network topology shown in the figure is based on Figure 1 Taking NE 2 in the example, the following description is given:
[0049] The data network analyzer sends message 1 to network element 1 via UNI_1. Since network element 1 has not learned the MAC address of message 1, it forwards message 1 to network element 3 via NNI_1-1 and then to network element 2 via NNI_1-2. Network element 2 receives a message with a source MAC address of MAC1 (network element 1's MAC address) via NNI_2-2. It then learns that MAC1 corresponds to NNI_2-2 and records it in the second MAC address table. Based on this premise, when the data network analyzer sends message 2 (the first message) with a destination MAC address of MAC1 to network element 2 via UNI_2, it checks whether the first forwarding table entry corresponding to MAC1 exists in the first MAC address table. In other words, it checks whether the first MAC address table contains a corresponding relationship between MAC1 and NNI.
[0050] Step S120: If the first forwarding entry does not exist in the first MAC address table, broadcast the first message to neighboring network elements through all NNIs of the local network element. The first MAC address table is initially empty.
[0051] Step S130: After the broadcast of the first message is completed, if the first forwarding entry exists in the second MAC address table, the first forwarding entry is added to the first MAC address table. Any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
[0052] In this embodiment, referring to the above description, if a message with a destination MAC address of MAC1 has not been broadcast before, and the first forwarding entry does not exist in the first MAC address table, the first message is forwarded to NE 1 via NNI_2-2 and to NE 3 via NNI_2-1. In this way, NE 1 learns the correspondence between MAC2 (NE 2's MAC address) and NNI_1-2, and NE 3 learns the correspondence between MAC2 (NE 2's MAC address) and NNI_3-2.
[0053] After the first message is broadcasted, if it is detected that the first forwarding entry exists in the second MAC address table (for example, MAC1 corresponds to NNI_2-2), the first forwarding entry is newly added to the first MAC address table.
[0054] Subsequently, if the UNI of network element 2 receives a message with a destination MAC address of MAC1 again, the currently received message is directly forwarded through NNI_2-2 because the forwarding entry corresponding to MAC1 exists in the first MAC address table.
[0055] In an embodiment of the present application, it is detected whether the first forwarding table entry corresponding to the destination MAC address of the first message received by the UNI of this network element exists in the first MAC address table; if the first forwarding table entry does not exist in the first MAC address table, the first message is broadcast to the adjacent network elements through all NNIs of this network element, and the first MAC address table is initially empty; after the broadcast of the first message is completed, if the first forwarding table entry exists in the second MAC address table, the first forwarding table entry is added to the first MAC address table, and any forwarding table entry in the second MAC address table is used to characterize the correspondence between NNI and MAC address. Through the embodiment of the present application, for a network element, it receives a message with a destination MAC address of MAC_x through UNI. If the message with a destination MAC address of MAC_x has not been broadcast before, then the forwarding table entry corresponding to MAC_x must not exist in the first MAC address table, and the received message needs to be broadcast, which ensures that its adjacent network elements can learn the MAC address of the network element. That is, for a network element, even if it has learned MAC_x, it must broadcast and forward the message with the destination MAC address of MAC_x at least once, which is equivalent to delaying the effectiveness of the learned MAC address, thereby ensuring that its adjacent network elements can learn the MAC address of the network element.
[0056] Furthermore, in one embodiment, referring to Figure 3 , Figure 3 This is a flow chart of another embodiment of the MAC address learning delay validation method of this application. Figure 3 As shown, after step S110, the following steps are further included:
[0057] Step S140: If the first forwarding entry exists in the first MAC address table, detecting whether the NNI corresponding to the first forwarding entry is an NNI available for the service;
[0058] In this embodiment, if the first forwarding entry exists in the first MAC address table, for example, the first forwarding entry is MAC1 corresponding to NNI_2-3, it is necessary to further detect whether NNI_2-3 is an NNI that can be used for the service.
[0059] Step S150: If the NNI corresponding to the first forwarding entry is not an NNI available for the service, the first message is broadcast to neighboring network elements through all NNIs of the local network element, and the first forwarding entry is deleted.
[0060] In this embodiment, the NNI that can be used for the service is determined by the service logic. For example, the NNI that can be used for the service is NNI_2-1 and NNI_2-2. At this time, it can be determined that the NNI corresponding to the first forwarding table entry is not the NNI that can be used for the service. Then, the message cannot be forwarded based on the current first forwarding table entry. The first message is broadcast to the adjacent network elements through all NNIs of this network element, and the forwarding table entry corresponding to NNI_2-3 of MAC1 in the first MAC address table is deleted.
[0061] It should be noted that after step S150, if the first forwarding entry exists in the second MAC address table, the first forwarding entry is added to the first MAC address table.
[0062] Furthermore, in one embodiment, after step S140, the method further includes:
[0063] If the NNI corresponding to the first forwarding entry is an NNI available for the service, the first message is unicast based on the first forwarding entry.
[0064] In this embodiment, the destination MAC address of the first message takes MAC1 as an example. If the NNI corresponding to the first forwarding table entry is an NNI that can be used for the service, it means that the message with the destination MAC address of MAC1 has been broadcast before, and the first forwarding table entry is valid. In this case, the first message is forwarded in unicast mode based on the first forwarding table entry.
[0065] Furthermore, in one embodiment, referring to Figure 4 , Figure 4 This is a flow chart of adding a new forwarding entry in the second MAC address table in one embodiment of the MAC address learning delay validation method of this application. Figure 4 As shown in FIG, the process of adding a forwarding entry to the second MAC address table specifically includes:
[0066] Step S210: When any NNI of the network element receives a second message, the second message is parsed to obtain a source MAC address of the second message;
[0067] Step S220: Detect whether there is a second forwarding entry in the second MAC address table that represents the correspondence between any NNI and the source MAC address;
[0068] Step S230: If the second forwarding entry does not exist in the second MAC address table, then the second forwarding entry is added to the second MAC address table.
[0069] In this embodiment, taking NNI_2-2 of network element 2 receiving the second message sent by network element 1 as an example, the second message can be parsed to obtain the source MAC address of the second message as MAC1 (ie, the MAC address of network element 1).
[0070] If network element 2 currently receives the message sent by network element 1 for the first time, and the second forwarding entry indicating that MAC1 corresponds to NNI_2-2 does not exist in the second MAC address table, a new second forwarding entry is added to the second MAC address table.
[0071] Furthermore, in one embodiment, after step S210, the method further includes:
[0072] If a third forwarding entry for indicating a correspondence between another NNI and the source MAC address exists in the second MAC address table, the third forwarding entry is deleted, and the other NNI is different from any NNI.
[0073] In this embodiment, combined with the description in the previous embodiment, if there is a third forwarding table entry in the second MAC address table that is used to represent the correspondence between other NNIs and source MAC addresses, for example, the third forwarding table entry is NNI_2-3 corresponding to MAC1, it means that the forwarding interface corresponding to MAC1 has changed, and the original forwarding table entry needs to be deleted, that is, the third forwarding table entry needs to be deleted.
[0074] Similarly, if the third forwarding entry exists in the first MAC address table, it is deleted from the first MAC address table.
[0075] Furthermore, in one embodiment, the method for delaying the effectiveness of MAC address learning further includes:
[0076] When there is an aged forwarding entry in the second MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0077] In this embodiment, when the duration for which a forwarding entry exists in the second MAC address table reaches the aging duration, it is an aged forwarding entry and is directly deleted from the second MAC address table.
[0078] In addition, it is also detected whether the aged forwarding entry exists in the first MAC address table, and if so, it is deleted.
[0079] Furthermore, in one embodiment, the method for delaying the effectiveness of MAC address learning further includes:
[0080] When there is an aged forwarding entry in the second MAC address table, detecting whether there is the aged forwarding entry in the first MAC address table;
[0081] If the aged forwarding entry exists in the first MAC address table, retain the aged forwarding entry in the first MAC address table and the second MAC address table;
[0082] If the aged forwarding entry does not exist in the first MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0083] In this embodiment, when the length of time a forwarding entry exists in the second MAC address table reaches the aging length, it is an aged forwarding entry. For example, the aged forwarding entry is MAC1 corresponding to NNI_2-2. It is detected whether there is a forwarding entry MAC1 corresponding to NNI_2-2 in the first MAC address table. If so, it means that the forwarding entry MAC1 corresponding to NNI_2-2 has been hit, and it is retained; if not, it means that the forwarding entry MAC1 corresponding to NNI_2-2 has not been hit, and it is deleted from the second MAC address table.
[0084] In a second aspect, an embodiment of the present application also provides a MAC address learning delayed effectiveness device.
[0085] In one embodiment, referring to Figure 5 , Figure 5 This is a functional module diagram of an embodiment of the MAC address learning delay validation device of the present application. Figure 5 As shown, the MAC address learning delay effectiveness device includes:
[0086] A detection module 10 is configured to detect whether a first forwarding table entry corresponding to a destination MAC address of a first message received by a UNI of the current network element exists in a first MAC address table;
[0087] a broadcast module 20 configured to broadcast the first message to adjacent network elements through all NNIs of the local network element if the first forwarding entry does not exist in the first MAC address table, where the first MAC address table is initially empty;
[0088] The MAC address learning module 30 is configured to add the first forwarding entry to the first MAC address table if the first forwarding entry exists in the second MAC address table after broadcasting the first message. Any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
[0089] Furthermore, in one embodiment, the MAC address learning module 30 is further configured to:
[0090] When any NNI of the network element receives the second message, the second message is parsed to obtain the source MAC address of the second message;
[0091] Detecting whether there is a second forwarding entry in the second MAC address table that represents a correspondence between any one of the NNIs and the source MAC address;
[0092] If the second forwarding entry does not exist in the second MAC address table, then the second forwarding entry is added to the second MAC address table.
[0093] Furthermore, in one embodiment, the MAC address learning delay validation apparatus further includes a deletion module configured to:
[0094] If a third forwarding entry for indicating a correspondence between another NNI and the source MAC address exists in the second MAC address table, the third forwarding entry is deleted, and the other NNI is different from any NNI.
[0095] Furthermore, in one embodiment, the detection module 10 is further configured to:
[0096] If the first forwarding entry exists in the first MAC address table, detecting whether the NNI corresponding to the first forwarding entry is an NNI that can be used for the service;
[0097] The broadcast module 20 is further configured to broadcast the first message to adjacent network elements through all NNIs of the local network element and delete the first forwarding entry if the NNI corresponding to the first forwarding entry is not an NNI available for the service.
[0098] Furthermore, in one embodiment, the MAC address learning delay validation apparatus further includes a unicast module configured to:
[0099] If the NNI corresponding to the first forwarding entry is an NNI available for the service, the first message is unicast based on the first forwarding entry.
[0100] Furthermore, in one embodiment, the MAC address learning delay validation apparatus further includes a first aging processing module configured to:
[0101] When there is an aged forwarding entry in the second MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0102] Furthermore, in one embodiment, the MAC address learning delay validation apparatus further includes a second aging processing module, configured to:
[0103] When there is an aged forwarding entry in the second MAC address table, detecting whether there is the aged forwarding entry in the first MAC address table;
[0104] If the aged forwarding entry exists in the first MAC address table, retain the aged forwarding entry in the first MAC address table and the second MAC address table;
[0105] If the aged forwarding entry does not exist in the first MAC address table, the aged forwarding entry is deleted from the second MAC address table.
[0106] Among them, the functional implementation of each module in the above-mentioned MAC address learning delayed effectiveness device corresponds to the various steps in the above-mentioned MAC address learning delayed effectiveness method embodiment, and its functions and implementation processes are no longer repeated here.
[0107] In a third aspect, an embodiment of the present application provides a network element device.
[0108] Reference Figure 6 , Figure 6 Schematic diagram of the hardware structure of the MAC address learning delay validation device involved in the embodiment of the present application. In the embodiment of the present application, the MAC address learning delay validation device may include a processor, a memory, a communication interface and a communication bus.
[0109] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.
[0110] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces, which interconnect components within the MAC address learning delay validation device and connect the MAC address learning delay validation device to other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet, fiber, or ATM interfaces; user devices can be display screens or keyboards.
[0111] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0112] The processor may be a general-purpose processor, which may call the MAC address learning delay validation program stored in the memory and execute the MAC address learning delay validation method provided in the embodiments of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the MAC address learning delay validation program is called may refer to the various embodiments of the MAC address learning delay validation method of the present application and will not be repeated here.
[0113] Those skilled in the art will understand that Figure 6 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0114] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0115] The computer-readable storage medium of the present application stores a MAC address learning delayed validation program, wherein when the MAC address learning delayed validation program is executed by a processor, the steps of the MAC address learning delayed validation method as described above are implemented.
[0116] Among them, the method implemented when the MAC address learning delayed effectiveness program is executed can refer to the various embodiments of the MAC address learning delayed effectiveness method of this application, and will not be repeated here.
[0117] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0118] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit the "first", "second" and "third" to different types.
[0119] In the description of the embodiments of this application, the words "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0120] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0121] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.
[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of the present application.
[0123] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for delaying the effectiveness of MAC address learning, characterized in that: The MAC address learning delay validation method includes: Detect whether a first forwarding table entry corresponding to the destination MAC address of the first message received by the UNI of the local network element exists in the first MAC address table, wherein the first MAC address table is used for table lookup forwarding, and the forwarding table entry in the first MAC address table is updated and adjusted based on the forwarding table entry in the second MAC address table; If the first forwarding entry does not exist in the first MAC address table, broadcast the first message to the neighboring network elements through all NNIs of the local network element, and the first MAC address table is initially empty; After the first message is broadcasted, if the first forwarding entry exists in the second MAC address table, the first forwarding entry is added to the first MAC address table. Any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
2. The method for delaying the effectiveness of MAC address learning according to claim 1, wherein: The process of adding a forwarding entry to the second MAC address table specifically includes: When any NNI of the network element receives the second message, the second message is parsed to obtain the source MAC address of the second message; Detecting whether there is a second forwarding entry in the second MAC address table that represents a correspondence between any one of the NNIs and the source MAC address; If the second forwarding entry does not exist in the second MAC address table, then the second forwarding entry is added to the second MAC address table.
3. The method for delaying the effectiveness of MAC address learning according to claim 2, wherein: When any NNI of the local network element receives the second message, after parsing the second message to obtain the source MAC address of the second message, the method further includes: If a third forwarding entry for indicating a correspondence between another NNI and the source MAC address exists in the second MAC address table, the third forwarding entry is deleted, and the other NNI is different from any NNI.
4. The method for delaying the effectiveness of MAC address learning according to claim 1, wherein: After detecting whether the first forwarding entry corresponding to the destination MAC address of the first message received by the UNI of the current network element exists in the first MAC address table, the method further includes: If the first forwarding entry exists in the first MAC address table, detecting whether the NNI corresponding to the first forwarding entry is an NNI that can be used for the service; If the NNI corresponding to the first forwarding entry is not an NNI available for the service, the first message is broadcast to neighboring network elements through all NNIs of the local network element, and the first forwarding entry is deleted.
5. The method for delaying the effectiveness of MAC address learning according to claim 4, wherein: After detecting whether the NNI corresponding to the first forwarding entry is an NNI that can be used for the service, the method further includes: If the NNI corresponding to the first forwarding entry is an NNI available for the service, the first message is unicast based on the first forwarding entry.
6. The method for delaying the effectiveness of MAC address learning according to any one of claims 1 to 5, wherein: The MAC address learning delay validation method further includes: When there is an aged forwarding entry in the second MAC address table, the aged forwarding entry is deleted from the second MAC address table.
7. The method for delaying the effectiveness of MAC address learning according to any one of claims 1 to 5, wherein: The MAC address learning delay validation method further includes: When there is an aged forwarding entry in the second MAC address table, detecting whether there is the aged forwarding entry in the first MAC address table; If the aged forwarding entry exists in the first MAC address table, retain the aged forwarding entry in the first MAC address table and the second MAC address table; If the aged forwarding entry does not exist in the first MAC address table, the aged forwarding entry is deleted from the second MAC address table.
8. A MAC address learning delay validation device, characterized in that: The MAC address learning delay validation device includes: a detection module, configured to detect whether a first forwarding table entry corresponding to a destination MAC address of a first message received by a UNI of the network element exists in a first MAC address table, wherein the first MAC address table is used for table lookup forwarding, and the forwarding table entry in the first MAC address table is updated and adjusted based on the forwarding table entry in the second MAC address table; a broadcast module configured to broadcast the first message to adjacent network elements through all NNIs of the local network element if the first forwarding entry does not exist in the first MAC address table, where the first MAC address table is initially empty; The MAC address learning module is configured to, after broadcasting the first message, add the first forwarding entry to the first MAC address table if the first forwarding entry exists in the second MAC address table, wherein any forwarding entry in the second MAC address table is used to represent the correspondence between the NNI and the MAC address.
9. A network element device, characterized in that: The network element device includes a processor, a memory, and a MAC address learning delay validation program stored on the memory and executable by the processor, wherein when the MAC address learning delay validation program is executed by the processor, the steps of the MAC address learning delay validation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a MAC address learning delay validation program, wherein when the MAC address learning delay validation program is executed by the processor, the steps of the MAC address learning delay validation method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Anti-attack MAC address learning method and device, and network equipment
CN107547535A
MAC address learning method and device and distributed equipment
CN110049149A