Network forwarding method and device for avoiding MAC table item drift

By detecting the drift of the Mac table item and stopping the drift of drift in the network device, analyzes the information and updates the ARP table item, solves the problem of data loss and business interruption caused by the Mac table drift, and improves the stability and response speed of the network Essence

CN119383149APending Publication Date: 2025-01-28HANGZHOU DPTECH TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411486449.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In a layer three network environment, MAC table entry drift causes ARP table entry to be inconsistent with MAC table entry, resulting in packet loss and service interruption.

Method used

When the port drift is generated by the port, stop forwarding the drifting packet, analyzes the panel to generate analytical information, send the information to the CPU, the CPU builds ARP request packets and updates the ARP table for network forwarding.

Benefits of technology

Effectively avoid the failure and business interruption of data forwarding due to Mac table drift, improve the stability of the equipment, and ensure that the network can quickly return to normal work when MAC drift occurs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119383149A_ABST
    Figure CN119383149A_ABST
Patent Text Reader

Abstract

The invention relates to a network forwarding method and device for avoiding MAC table item drift. The method comprises the following steps: when MAC table item drift occurs at a port, stopping forwarding a drifting message; analyzing the message to generate analysis information; the analysis information is uploaded to the CPU; the CPU constructs an ARP request message based on the analysis information, wherein the ARP request message comprises an ARP updating table item; the ARP request is sent to a device connected with the port; and after an ARP response message of the equipment is obtained, the CPU updates the ARP table based on the ARP update table item so as to carry out network forwarding. According to the network forwarding method and device for avoiding MAC table item drifting, the problems of data forwarding failure and service interruption caused by MAC table item drifting can be solved, the stability of equipment is further improved, it is ensured that when MAC drifting happens to a network, normal work can be rapidly recovered, and it is ensured that services are not interrupted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer information processing, and in particular to a network forwarding method and device for preventing MAC table entry drift. Background Art

[0002] With the continuous development of Ethernet technology and the increase in network demand, network switching equipment has not only significantly improved in performance, but also has become increasingly diverse in types and functions. The network scale of modern enterprises and data centers has gradually expanded, and the network topology has become more complex and diverse. For example, traditional network equipment mainly communicates through static configuration and physical connections, but nowadays, the widespread application of virtualization technology has made the deployment and management of network equipment more flexible.

[0003] However, as the functions of network devices are enhanced, users have higher and higher requirements for network devices in terms of forwarding efficiency, data processing capabilities, fault response, etc. In a three-layer network environment, network devices distribute data traffic based on IP routing forwarding. A typical process is: when a device receives a data packet, it will look up the destination MAC address according to the ARP table entry, then look up the corresponding IP routing information in the routing table, and forward the data packet to the correct port.

[0004] In actual applications, as traffic changes and network topology structures are adjusted, MAC table entry drift may occur. That is, devices with the same MAC address continue to appear and be learned on different physical ports in the network, causing the content of the MAC address table to change. When MAC table entry drift occurs, the ARP table entries and MAC table entries originally stored in the switching device no longer match, causing the device to find the correct path during Layer 2 forwarding, which in turn causes data packet loss and service interruption. Since there is a certain time delay in the aging and deletion of ARP table entries, network devices can only re-learn new MAC addresses and resume normal data forwarding after the old ARP table entries are deleted. This delay may cause long-term interruption of network services, affecting user experience and service continuity.

[0005] Therefore, a new network forwarding method and device for avoiding MAC table entry drift is needed.

[0006] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0007] In view of this, the present application provides a network forwarding method and device to avoid MAC table entry drift, which can solve the problems of data forwarding failure and service interruption caused by MAC table entry drift, thereby improving the stability of the equipment and ensuring that the network can quickly resume normal operation and ensure uninterrupted service when MAC drift occurs.

[0008] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0009] According to one aspect of the present application, a network forwarding method for avoiding MAC table entry drift is proposed, the method comprising: when MAC table entry drift occurs at a port, stopping forwarding the drifted message; parsing the message to generate parsing information; sending the parsing information to a CPU; the CPU constructing an ARP request message based on the parsing information, the ARP request message including an ARP update table entry; sending the ARP request to a device connected to the port; after obtaining an ARP reply message from the device, the CPU updating the ARP table based on the ARP update table entry for network forwarding.

[0010] In an exemplary embodiment of the present application, the method further includes: enabling a MAC entry drift detection function of a port of a switching device; and configuring a drift action of the port.

[0011] In an exemplary embodiment of the present application, when a port generates MAC table entry drift, forwarding of drifted messages is stopped, including: the chip detects the port based on a MAC table entry drift detection function; when it is determined that the port generates MAC table entry drift, forwarding of drifted messages is stopped.

[0012] In an exemplary embodiment of the present application, when MAC table entry drift occurs on a port, forwarding of the drifted message is stopped, and the method further includes: parsing the message to obtain a MAC address and VLAN information; and deleting the MAC table entry corresponding to the drifted message according to the MAC address and the VLAN information.

[0013] In an exemplary embodiment of the present application, parsing the message and generating parsing information includes: driving the parsing of the message to obtain a source MAC address, a destination MAC address, a VLAN, a source IP address, and a destination IP address.

[0014] In an exemplary embodiment of the present application, sending the parsed information to the CPU includes: storing the parsed information in a channel structure; and sending the parsed information to the CPU based on the channel structure.

[0015] In an exemplary embodiment of the present application, sending the parsing information to the CPU based on the channel structure includes: sending the parsing information to the main control CPU based on the channel structure and the GE channel; or sending the parsing information to the main control of the standby frame based on the channel structure and the GE channel, and then sending the parsing information to the main control CPU based on the VSM channel.

[0016] In an exemplary embodiment of the present application, the CPU constructs an ARP request message based on the resolution information, including: the CPU deletes drifted ARP table entries based on the resolution information and constructs ARP update table entries; and constructs an ARP request message based on the ARP update table entries.

[0017] In an exemplary embodiment of the present application, sending the ARP request to the device connected to the port includes: sending the ARP request to the device connected to the port by broadcasting.

[0018] According to one aspect of the present application, a network forwarding device for avoiding MAC table entry drift is proposed, and the device includes: a detection module, which is used to stop forwarding drifted messages when MAC table entry drift occurs at a port; a parsing module, which is used to parse the message and generate parsing information; a sending module, which is used to send the parsing information to a CPU; a construction module, which is used for the CPU to construct an ARP request message based on the parsing information, wherein the ARP request message includes an ARP update table entry; a sending module, which is used to send the ARP request to a device connected to the port; and an updating module, which is used for the CPU to update the ARP table based on the ARP update table entry for network forwarding after obtaining the ARP reply message of the device.

[0019] According to one aspect of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0020] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0021] According to the network forwarding method and device for avoiding MAC table entry drift of the present application, when MAC table entry drift occurs on a port, forwarding of drifted messages is stopped; the message is parsed to generate parsing information; the parsing information is sent to the CPU; the CPU constructs an ARP request message based on the parsing information, the ARP request message includes an ARP update table entry; the ARP request is sent to the device connected to the port; after obtaining the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding, which can solve the problem of data forwarding failure and service interruption caused by MAC table entry drift, thereby improving the stability of the device, ensuring that the network can quickly resume normal operation when MAC drift occurs, and ensuring that the service is not interrupted.

[0022] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative effort.

[0024] Figure 1 The present invention is a flowchart of a network forwarding method for avoiding MAC table entry drift according to an exemplary embodiment.

[0025] Figure 2 The present invention is a flow chart showing a network forwarding method for avoiding MAC table entry drift according to another exemplary embodiment.

[0026] Figure 3 The present invention is a flow chart showing a network forwarding method for avoiding MAC table entry drift according to another exemplary embodiment.

[0027] Figure 4 The present invention is a flow chart showing a network forwarding method for avoiding MAC table entry drift according to another exemplary embodiment.

[0028] Figure 5 The invention is a block diagram showing a network forwarding device for preventing MAC table entry drift according to an exemplary embodiment.

[0029] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0030] Figure 7 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0032] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0034] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0035] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0036] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0037] The technical abbreviations involved in this application are explained as follows:

[0038] MAC: Media Access Control, also known as the media access control sub-protocol. This protocol is located in the lower half of the data link layer in the OSI seven-layer protocol, and is mainly responsible for controlling the physical medium that connects to the physical layer.

[0039] FIB: Forwarding information Base, also known as forwarding information table or forwarding table, this protocol is located in the data link layer of the OSI seven-layer protocol.

[0040] MAC entry drift: Station Move refers to the phenomenon that two different ports in the same VLAN on the switch chip learn the same MAC address, and the later learned MAC address entry overwrites the previous MAC address entry.

[0041] ARP: Address Resolution Protocol, which is the network layer of the OSI seven-layer protocol, mainly obtains the MAC physical address based on the IP address.

[0042] RIB: Routing Information Base, also known as routing domain information base or routing table. The routing table contains the topological information around the network. The main purpose of establishing the routing table is to implement routing protocols and static routing selection.

[0043] System channel: A method used for inter-board communication and inter-device communication on a frame-type device, referred to as a channel. It includes dual main control channels, main control to interface board channels, main control to service board channels, and VSM channels.

[0044] VSM: Virtual Switch Matrix. A new network device virtualization technology that virtualizes multiple network devices into one network device.

[0045] After investigation, the applicant of this case found that in traditional network equipment, the forwarding of data messages mainly depends on the cooperation between the IP routing table and the ARP table. When a network device receives a data message, it first queries its destination MAC address through the ARP table, then finds the next hop IP address and its corresponding port according to the routing table, and forwards the data message from the port.

[0046] In this solution, the contents of the ARP table and the MAC address table must be consistent to ensure correct data forwarding. The MAC address table records the physical port corresponding to each MAC address, while the ARP table associates the IP address with the MAC address. Under normal circumstances, the ARP table and the MAC address table correspond to each other, ensuring that data packets can be forwarded along the established path.

[0047] Although this traditional forwarding mechanism works effectively in most cases, network devices may encounter MAC entry drift problems when the traffic in the network changes or the network topology changes due to factors such as link failures or device changes. When the traffic inlet of a device (that is, the port it connects to the switch) changes, the switch will learn the new MAC address and port information of the device. At this time, the ARP table entry originally associated with the MAC address is still retained in the old MAC address table entry, resulting in inconsistency between the ARP table entry and the MAC table entry. In this case, the network device will not be able to forward data correctly, resulting in forwarding failure, which in turn leads to service interruption.

[0048] Normally, only after the original ARP entry ages and is deleted naturally, the device will relearn the correct MAC address and resume normal forwarding. However, this process may take a long time, causing service traffic interruption during the process, bringing great uncertainty to the stability of the network.

[0049] In addition, in the existing technical solutions, network devices lack a mechanism for automatic detection and rapid repair of MAC table entry drift, which means that when drift occurs, the problem cannot be quickly located and solved, thereby affecting the performance and stability of the entire network.

[0050] In order to solve the above problems, the present application proposes a method for automatically detecting and updating ARP entries when MAC entry drift occurs. Through this method, the network device can detect the change of MAC entry in real time, update ARP entry in time, ensure the correctness of data forwarding path, and thus avoid the occurrence of service interruption. This solution not only improves the stability of the equipment, but also enhances the fault tolerance and response speed of the network, so that the network can still operate efficiently in a complex and dynamic environment.

[0051] The content of this application is described in detail below with the help of specific embodiments.

[0052] Figure 1 The flowchart of a network forwarding method for avoiding MAC table entry drift according to an exemplary embodiment is shown. The network forwarding method 10 for avoiding MAC table entry drift at least includes steps S102 to S112.

[0053] like Figure 1 As shown, in S102, when the port generates MAC entry drift, the forwarding of drifted messages is stopped. The chip can, for example, detect the port based on the MAC entry drift detection function; when it is determined that the port generates MAC entry drift, the forwarding of drifted messages is stopped.

[0054] More specifically, when a port has MAC entry drift, the chip of the switching device will first detect the port where the drift occurs based on the MAC entry drift detection function. When the MAC entry drift is detected, the device will immediately stop forwarding messages on the port. This action ensures that incorrect data streams are no longer sent to the network, avoiding data transmission errors caused by incorrect MAC information, which in turn causes a wider range of network failures or service interruptions.

[0055] In one embodiment, the method further includes: enabling the MAC entry drift detection function of the port of the switching device; and configuring the drift action of the port. In some embodiments, it is necessary to enable the port MAC entry drift detection function of the switching device in advance and configure the action after the drift. For example, the user can start the port MAC entry detection through a specified command, and set to stop forwarding and report the drift message when the drift occurs.

[0056] In S104, the message is parsed to generate parsing information. While stopping forwarding, the chip will pass the drifted message to the driver layer for parsing. The driver will analyze these drifted messages and extract key information therein, including: source MAC address, destination MAC address, VLAN ID, source IP address, and destination IP address.

[0057] The above information can be used to accurately locate and identify the device where MAC entry drift occurs and its associated network information.

[0058] In S106, the parsing information is sent to the CPU. For example, the parsing information can be stored in a channel structure; based on the channel structure, the parsing information is sent to the CPU. After the parsing is completed, the parsing information can be stored in the channel structure. As a carrier of information transmission in the switching device, the channel structure ensures that the parsing information can be correctly transmitted to the CPU for further processing. In this step, the parsing information is sent from the driver layer to the main control CPU through the channel, providing a basis for the next step of ARP request construction.

[0059] In S108, the CPU constructs an ARP request message based on the resolution information, wherein the ARP request message includes an ARP update entry. The CPU may, for example, delete drifted ARP entries based on the resolution information and construct an ARP update entry; and construct the ARP request message based on the ARP update entry.

[0060] More specifically, after receiving the resolution information, the CPU will construct a new ARP request message based on this information. During this process, the CPU will first delete the original, incorrect ARP table entries (i.e., the table entries that do not match the drifted MAC address) and create ARP update table entries based on the new resolution information. Through these update table entries, the CPU can correctly identify the devices in the network and is ready to send ARP requests.

[0061] In S110, the ARP request is sent to the device connected to the port. For example, the ARP request can be sent to the device connected to the port by broadcasting. After the ARP request message is constructed, the device will send the message to the device connected to the port by broadcasting. The purpose of broadcasting the ARP request is to notify other devices in the network that are directly connected to the device, requiring them to respond and provide correct MAC address information. In this way, the switching device can quickly collect the correct ARP information that matches the drifted MAC address.

[0062] In S112, after obtaining the ARP reply message of the device, the CPU updates the ARP table based on the ARP update entry for network forwarding. Once the device receives the correct ARP reply message, the CPU updates the ARP table entry in the device based on the information in the message. This update action ensures that the switching device can store the latest MAC address and IP address correspondence in the ARP table, thereby restoring the correct Layer 2 and Layer 3 network forwarding operations.

[0063] After this series of steps, the device can not only quickly identify and handle MAC table entry drift, but also ensure uninterrupted network services by quickly updating ARP table entries, thereby greatly improving network stability and reliability.

[0064] According to the network forwarding method for avoiding MAC table entry drift of the present application, when MAC table entry drift occurs on a port, forwarding of drifted messages is stopped; the message is parsed to generate parsing information; the parsing information is sent to the CPU; the CPU constructs an ARP request message based on the parsing information, wherein the ARP request message includes an ARP update table entry; the ARP request is sent to a device connected to the port; after obtaining the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding, thereby solving the problem of data forwarding failure and service interruption caused by MAC table entry drift, thereby improving the stability of the device, ensuring that the network can quickly resume normal operation when MAC drift occurs, and ensuring that the service is not interrupted.

[0065] It should be clearly understood that the present application describes how to form and use specific examples, but the principles of the present application are not limited to any details of these examples. On the contrary, based on the teaching of the content disclosed in the present application, these principles can be applied to many other embodiments.

[0066] Figure 2 The present invention is a flowchart of a network forwarding method for avoiding MAC table entry drift according to an exemplary embodiment. Figure 2 The process 20 shown is for Figure 1 The detailed description of S102 "when MAC table entry drift occurs on the port, stop forwarding the drifted message" in the process shown.

[0067] like Figure 2 As shown, in S202, the chip detects the port based on the MAC entry drift detection function.

[0068] In a specific embodiment, the chip of the switching device can continuously monitor the port, for example, using a MAC entry drift detection function. MAC entry drift usually occurs when the network topology or device connection changes, such as when the traffic inlet or the physical connection of the device changes. Through the detection function, the chip can identify when the MAC address of a device is no longer consistent with the previous port, and determine whether a MAC entry drift has occurred.

[0069] This detection mechanism is usually based on continuous table entry learning and comparison. When the chip detects that the same MAC address appears on different ports, it will be considered as drift and trigger the subsequent processing mechanism.

[0070] In S204, when it is determined that the port has MAC entry drift, the forwarding of drifted messages is stopped. After determining that the port has MAC entry drift, the chip immediately takes measures to stop forwarding related messages. This operation is to avoid erroneously forwarding messages to a device that does not originally belong to the MAC address due to inconsistent entries. Incorrect message forwarding not only affects communication in the network, but may also cause security issues or cause service traffic interruption.

[0071] By stopping forwarding, the device temporarily freezes the error propagation of the data stream, creating conditions for subsequent correction and recovery operations.

[0072] In S206, the message is parsed to obtain the MAC address and VLAN information. The chip performs in-depth parsing of the message and extracts key information from the message, mainly including: Source MAC address: the physical address information of the sender of the message. Destination MAC address: the physical address of the recipient to whom the message is intended to be delivered. VLAN information: If the device is in a virtual local area network, this information is used to determine which virtual network the message belongs to, to avoid confusion between different VLANs.

[0073] This information is an important basis for determining MAC entry drift and is also the basis for subsequent ARP entry updates.

[0074] In S208, the MAC table entry corresponding to the drifted message is deleted according to the MAC address and the VLAN information. After obtaining the MAC address and VLAN information of the message, the device will search for the corresponding entry in its internal MAC table according to this information and perform a deletion operation. The purpose of this step is to clear the wrong MAC table entry to avoid continuing to use these invalid or wrong entries to guide the forwarding of data streams. By deleting the drifted MAC table entry, the device ensures that subsequent network forwarding can be based on the updated correct information.

[0075] In addition, deleting entries can also trigger the device to relearn new MAC address entries to ensure the accuracy of the entries.

[0076] Figure 3 The present invention is a flow chart showing a network forwarding method for avoiding MAC table entry drift according to another exemplary embodiment. Figure 3 The process 30 shown is for Figure 2 Detailed description of S106 "sending parsed information to CPU" in the process shown.

[0077] like Figure 3 As shown, in S302, the resolution information is stored in the channel structure. The resolution information is first stored in the channel structure. The resolution information usually includes key network parameters such as source MAC address, destination MAC address, VLAN, source IP address and destination IP address. This information is crucial in the following processing steps because it is used to update the ARP table entries of the device to ensure the normal operation of network communication.

[0078] The channel structure can be used as a temporary data storage, ensuring that the parsed information can be transmitted through different hardware modules. The use of the channel structure provides an efficient storage and reading mechanism to support subsequent forwarding operations.

[0079] In S304, the parsed information is sent to the main control CPU based on the channel structure and the GE channel. In the main switching device, the device sends the parsed information in the channel structure to the main control CPU through the GE channel (Gigabit Ethernet channel). The main control CPU is the core control unit of the entire device, responsible for processing and coordinating all operations of the device.

[0080] The GE channel provides a fast and stable data transmission path, so that the resolution information can be sent to the main control CPU as soon as possible, thereby triggering the subsequent ARP table update process. After receiving the resolution information, the main control CPU will delete the incorrect ARP table entry based on this information and construct a new ARP request to achieve self-repair of the network.

[0081] In S306, the parsed information is sent to the main control of the standby frame based on the channel structure and the GE channel. If the device is in a redundant configuration mode (i.e., a main-standby dual-frame system), the parsed information needs to be sent not only to the main control CPU, but also to the main control CPU of the standby frame. This operation is completed through the same GE channel to ensure that the standby frame can obtain the latest network status information.

[0082] The main control CPU of the standby frame is the backup control unit of the entire redundant system. When the main control CPU fails or is under maintenance, the standby frame can seamlessly take over the control and management tasks of the network. Therefore, the main control CPU of the standby frame must synchronously grasp the parsing information of the MAC table entry drift in the current network, so that the ARP table entry can be updated in time when necessary to ensure that network forwarding is not interrupted.

[0083] In S308, the parsing information is sent to the main control CPU of the main frame based on the VSM channel. When the system is in the virtual switching matrix (VSM) architecture, multiple switching devices are virtualized as a whole. At this time, the transmission of parsing information needs to be coordinated between devices through the VSM channel. In this step, the main control CPU of the standby frame transmits the parsing information to the main control CPU of the main frame through the VSM channel to ensure that the main control CPU can fully grasp the parsing information in the VSM architecture.

[0084] The VSM channel provides a virtualized channel for information transmission between multiple switching devices, ensuring that all main control units in the entire system can receive the latest parsing information. In a redundant configuration, this mechanism improves the reliability and fault tolerance of the system, ensuring that even if the main control device fails, the standby frame can continue to process and forward data.

[0085] The user uses the specified command to enable the function, and then traverses all physical panel ports to enable the port detection MAC drift function. At the same time, the configuration is added so that when the chip detects MAC drift on the port, it stops forwarding and sends the drift message to the CPU. The application layer code parses the drift message to obtain information and update the ARP table entry.

[0086] Figure 4 The present invention is a flow chart showing a network forwarding method for avoiding MAC table entry drift according to another exemplary embodiment. Figure 4 The process 40 shown is for Figure 2 Detailed description of the process shown.

[0087] like Figure 4 As shown, in S402, the MAC entry drift detection function is enabled. The port may be properly configured in advance.

[0088] Single network switching device: If the two ports before and after the drift belong to the same chip of the same network switching device, after the user uses the specified command to enable the function, the user should enable port MAC drift detection for all physical panel ports of the chip and configure the port to drop packets and send them to the CPU when drift occurs.

[0089] Multiple chips or virtual switching devices: If the two ports before and after the drift belong to different chips of the same network switching device, or belong to multiple network switching devices configured in a VSM virtual environment, in addition to configuring the port MAC drift as packet loss and sending it to the CPU on the chip, the same configuration needs to be performed on another chip to ensure that the drift event can be detected and processed in a timely manner.

[0090] In S404, the port is configured to send lost packets.

[0091] In S406, when the MAC address is drifting, the traffic is forwarded normally.

[0092] In S408, when MAC drifts, traffic packets are lost. When the chip detects that MAC drift occurs on the port, it stops forwarding the drift message and sends the information of the drift message to the CPU through an interrupt.

[0093] In S410, the message information is obtained and the old MAC table entry is deleted. For example, after receiving the drift message, the driver can parse the message, obtain the source MAC address, destination MAC address, VLAN, source IP address and destination IP address, and store the information in the channel structure.

[0094] If the current environment is a single network switching device, or multiple network switching devices are in the main chassis of the VSM virtual environment, the message information will be directly sent to the main control CPU through the GE channel.

[0095] If the current environment is a standby chassis with multiple network switching devices in a VSM virtual environment, the message information will first be sent to the standby chassis master controller through the GE channel, and then the message information will be transmitted from the standby chassis master controller to the master chassis master controller through the VSM channel.

[0096] In S412, the traffic is sent to the CPU and the old ARP entry is deleted. When the chip sends the drift message to the CPU, in order to prevent the continuous sending of the drift message from increasing the CPU burden, the chip will first parse the message information to obtain the source MAC address and VLAN information. Then, it will delete the old drift entry in the chip. Through this process, the chip will relearn the MAC entry, thereby restoring the normal forwarding of the data message and stopping the action of sending the drift message to the CPU. This can effectively reduce the CPU workload and improve the overall performance and stability of the system.

[0097] In S414, an ARP request message is constructed and broadcast to the sending device.

[0098] After receiving the message information and parsing the drift message, the CPU will delete the ARP table entry before the drift. Then, the CPU will construct an ARP request message and forward it to the device connected to the port after the drift by broadcasting.

[0099] When the connected device receives an ARP request message, it generates and replies an ARP reply message to the CPU.

[0100] If the current environment is a single network switching device, or a master chassis of multiple network switching devices in a VSM virtual environment, the ARP reply message will be directly sent to the CPU through the ACL function.

[0101] If the current environment is a standby chassis with multiple network switching devices in a VSM virtual environment, the ARP reply message is first sent to the standby chassis master CPU through the ACL function, and then sent to the master CPU of the master chassis through the VSM channel.

[0102] Finally, after receiving the ARP reply message, the main control CPU will update the ARP table entry to ensure normal network forwarding.

[0103] In S416, whether a response message is received.

[0104] In S418, a response message is received and the ARP table is updated.

[0105] In S420, the process ends.

[0106] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided in the present application are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0107] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0108] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0109] Figure 5 FIG. 1 is a block diagram of a network forwarding device for preventing MAC table entry drift according to an exemplary embodiment. Figure 5 As shown, the network forwarding device 50 for preventing MAC table entry drift includes: a detection module 502 , a parsing module 504 , a sending module 506 , a construction module 508 , a sending module 510 , and an updating module 512 .

[0110] The detection module 502 is used to stop forwarding drifted messages when MAC table entry drift occurs on the port; the detection module 502 is also used for the chip to detect the port based on the MAC table entry drift detection function; when it is determined that the port has MAC table entry drift, it stops forwarding the drifted messages.

[0111] The parsing module 504 is used to parse the message and generate parsing information; the parsing module 504 is also used to drive the parsing of the message to obtain the source MAC address, the destination MAC address, the VLAN, the source IP address and the destination IP address.

[0112] The sending module 506 is used to send the parsing information to the CPU; the sending module 506 is also used to store the parsing information in a channel structure; and send the parsing information to the CPU based on the channel structure.

[0113] The construction module 508 is used for the CPU to construct an ARP request message based on the resolution information, wherein the ARP request message includes an ARP update table entry; the construction module 508 is also used for the CPU to delete the drifted ARP table entry based on the resolution information and construct the ARP update table entry; and construct the ARP request message based on the ARP update table entry.

[0114] The sending module 510 is used to send the ARP request to the device connected to the port; the sending module 510 is also used to send the ARP request to the device connected to the port by broadcasting.

[0115] The updating module 512 is used for, after acquiring the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding.

[0116] According to the network forwarding device for avoiding MAC table entry drift of the present application, when MAC table entry drift occurs at a port, forwarding of drifted messages is stopped; the message is parsed to generate parsing information; the parsing information is sent to the CPU; the CPU constructs an ARP request message based on the parsing information, wherein the ARP request message includes an ARP update table entry; the ARP request is sent to a device connected to the port; after obtaining the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding. This method can solve the problem of data forwarding failure and service interruption caused by MAC table entry drift, thereby improving the stability of the device and ensuring that the network can quickly resume normal operation and ensure uninterrupted service when MAC drift occurs.

[0117] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0118] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present application is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0119] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0120] The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 610 can perform the following steps: Figures 1 to 4 Follow the steps shown in .

[0121] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0122] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0123] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0124] The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 600, and / or any device (e.g., routers, modems, etc.) that the electronic device 600 can communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface 650. In addition, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0125] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Figure 7 As shown, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation mode of the present application.

[0126] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0127] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0128] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0129] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the following functions: when a MAC table entry drift occurs at a port, stop forwarding the drifted message; parse the message and generate parsing information; send the parsing information to the CPU; the CPU constructs an ARP request message based on the parsing information, and the ARP request message includes an ARP update table entry; the ARP request is sent to the device connected to the port; after obtaining the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding.

[0130] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0131] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.

[0132] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A network forwarding method for avoiding MAC table entry drift, characterized in that: include: When MAC entry drift occurs on a port, the port stops forwarding drifting packets. Parsing the message to generate parsing information; Send the parsed information to the CPU; The CPU constructs an ARP request message based on the parsed information, wherein the ARP request message includes an ARP update table entry; Sending the ARP request to the device connected to the port; After acquiring the ARP reply message of the device, the CPU updates the ARP table based on the ARP update entry to perform network forwarding.

2. The method according to claim 1, characterized in that Also includes: Enable the MAC entry drift detection function on the switch port. Configure the port's flapping behavior.

3. The method according to claim 1, characterized in that When MAC entry flapping occurs on a port, the port stops forwarding the flapping packets, including: The chip detects ports based on the MAC entry drift detection function; When it is determined that MAC entry drift occurs on a port, forwarding of the drifted packets is stopped.

4. The method according to claim 3, characterized in that When MAC entry flapping occurs on a port, the port stops forwarding the flapping packets, which also includes: Parsing the message to obtain MAC address and VLAN information; The MAC table entry corresponding to the drifted message is deleted according to the MAC address and the VLAN information.

5. The method according to claim 1, characterized in that Parsing the message to generate parsing information includes: The driver parses the message to obtain the source MAC address, destination MAC address, VLAN, source IP address and destination IP address.

6. The method according to claim 1, characterized in that Send parsed information to the CPU, including: Storing the parsed information in a channel structure; The parsed information is sent to the CPU based on the channel structure.

7. The method according to claim 6, characterized in that Sending the parsed information to the CPU based on the channel structure includes: Sending the parsed information to the main control CPU based on the channel structure and the GE channel; or After the parsed information is sent to the main control of the standby frame based on the channel structure and the GE channel, the parsed information is sent to the main control CPU of the main frame based on the VSM channel.

8. The method according to claim 1, characterized in that The CPU constructs an ARP request message based on the parsed information, including: The CPU deletes the drifted ARP table entry based on the parsed information and constructs an ARP update table entry; An ARP request message is constructed based on the ARP update entry.

9. The method according to claim 1, characterized in that Sending the ARP request to the device connected to the port includes: The ARP request is sent to the device connected to the port by broadcasting.

10. A network forwarding device for preventing MAC table entry drift, characterized in that: include: A detection module, used for stopping forwarding drifted packets when MAC table entry drift occurs on a port; A parsing module, used for parsing the message and generating parsing information; The sending module is used to send the parsed information to the CPU; A construction module, configured for the CPU to construct an ARP request message based on the parsed information, wherein the ARP request message includes an ARP update table entry; A sending module, used for sending the ARP request to the device connected to the port; The updating module is used for, after acquiring the ARP reply message of the device, the CPU updates the ARP table based on the ARP update table entry to perform network forwarding.

Citation Information

Cited By

  • ARP attack defense method, data sending end and data receiving end

    CN119945807A

  • ARP Attack Defense Method, Data Sending End, and Data Receiving End

    CN119945807B