Message state checking method and device, switch equipment and storage medium
By pre-creating ACL rules and configuration registers on the switch, checking and processing packets, the problem of packets on the Marvell switch chip bypassing spanning tree status checks is solved, forwarding efficiency and stability are improved, and the intelligent processing of packets is realized Work in concert with security policies.
Patent Information
- Application Number
- CN202411407128.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art cannot realize packet forwarding bypassing spanning tree status checks on the Marvell switching chip, and the CPU software processing efficiency is low, packet loss is easy, and forwarding delay is large.
By pre-creating packet matching conditions and configuration registers in the ACL rule on the switch, check whether the packet matches the ACL rule, and performing corresponding action strategies based on the matching results, using the Marvell switching chip to assign identification codes to the packets to ensure that the packets are reported. The text can bypass spanning tree state checking and realize the coordinated work between the specified protocol and the spanning tree protocol.
While ensuring the normal operation of the spanning tree protocol, it realizes the function of packet bypass status checking, improves the switch's ability to deal with faults and abnormalities, and improves stability and reliability.
Smart Images

Figure CN119299407A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a message status checking method, device, switch equipment and storage medium. Background Art
[0002] Spanning Tree Protocol (STP) is a network protocol used to manage the topology of a local area network (LAN). Its main purpose is to prevent loops in the network and ensure that data packets can be transmitted from the source node to the destination node along a unique path. Bypassing the spanning tree status check usually means that in the network, certain specific traffic is not processed by the spanning tree protocol (STP) and is transmitted directly from the source to the destination.
[0003] However, due to the high complexity of the field of network communication technology, currently, there are generally two methods for bypassing the spanning tree status check for packets: First, the switching chip can redirect the packet to the destination port by configuring the ACL rule that the packet matches and setting the action of the ACL rule to redirect. However, the priority of each action in the Marvell switching chip is: packet sent to the CPU> discard> redirect to the port> forward. When the port spanning tree state is blocking, the action of the packet after being processed by the spanning tree module is discard, and the action after the ACL module is processed is redirected to the port. Since the priority of the action discard is higher than the action redirection, the packet will be discarded. This method cannot achieve forwarding of packets bypassing the spanning tree status check on the Marvell switching chip. Second, set the action of the ACL rule to forward to the CPU. Since the action priority of the Marvell switching chip forwarding the packet to the CPU is higher than discard, the packet will be forwarded to the CPU, and then the CPU will forward the packet to the specified destination port. This method requires the CPU to perform software processing on the packet, which is inefficient. When there are too many packets, it is easy to lose packets, and the forwarding delay is greater than the hardware forwarding delay.
[0004] Therefore, how to forward packets bypassing the spanning tree status check and improve the ability to cope with fault anomalies has become an important issue that needs to be solved urgently. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a message status check method, device, switch device and storage medium, which can effectively solve the problems that the prior art cannot realize message forwarding bypassing the spanning tree status check on the Marvell switching chip, and there are problems such as low CPU software processing efficiency, easy packet loss, and large forwarding delay.
[0006] In a first aspect, an embodiment of the present application provides a message status checking method, which is applied to a switch configured with an ACL rule, comprising:
[0007] When the message arrives at the physical port of the switch and is successfully received, check whether the message matches the ACL rule;
[0008] According to the matching result, an action strategy corresponding to the matching result is executed to process the message.
[0009] In some embodiments, the switch is configured with a Marvell switch chip; when the message arrives at the physical port of the switch and is successfully received, checking whether the message matches the ACL rule includes:
[0010] Pre-creating the message matching conditions and configuration registers in the ACL rule on the switch;
[0011] The ACL rule is used to configure the message action matching the ACL rule, and the Marvell switching chip is used to assign an identification code to the message; and the register is used to specify the destination port of the message having the identification code.
[0012] In some embodiments, executing the action strategy corresponding to the matching result to process the message according to the matching result includes:
[0013] When the message matches the ACL rule, the message is sent to the CPU, and the identification code is added to the message by using the Marvell switch chip, so that after the CPU receives the identification code, it obtains the destination port corresponding to the identification code from the register, and after processing the message, it forwards the message to the destination port;
[0014] The identification code is used to uniquely identify the reason why the message is sent to the CPU for processing.
[0015] In some embodiments, executing an action strategy corresponding to the matching result according to the matching result includes:
[0016] When the message does not match the ACL rule, the state of the message is obtained to execute a corresponding action strategy according to the state of the message.
[0017] In some embodiments, when the message does not match the ACL rule, obtaining the state of the message to execute a corresponding action strategy according to the state of the message includes:
[0018] When the message does not match the ACL rule, obtaining the source port status and the destination port status of the message;
[0019] According to the source port status and the destination port status of the message, the action strategy corresponding to the source port and the destination port is executed.
[0020] In some embodiments, executing the action strategy corresponding to the source port and the destination port according to the source port status and the destination port status of the message includes:
[0021] When the source port state or the destination port state of the message is in a first state, a first action strategy is executed; the first action strategy is to discard the message.
[0022] In some embodiments, executing the action strategy corresponding to the source port and the destination port according to the source port state and the destination port state includes:
[0023] When the source port state and the destination port state of the message are both in the second state, a second action strategy is executed; the second action strategy forwards the message to the destination port.
[0024] In a second aspect, an embodiment of the present application provides a message status checking device, including:
[0025] A rule matching module, used for checking whether the message matches the ACL rule when the message arrives at the physical port of the switch and is successfully received;
[0026] The message processing module is used to execute the action strategy corresponding to the matching result to process the message according to the matching result.
[0027] In a third aspect, an embodiment of the present application provides a switch device, the switch device comprising a processor and a memory, the memory storing a computer program, and the processor being used to execute the computer program to implement the message status checking method of the first aspect.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and when the computer program is executed on a processor, the message status checking method of the first aspect described above is implemented.
[0029] The embodiments of the present application have the following beneficial effects:
[0030] The present application discloses a message status checking method, device, switch device and storage medium. When a message arrives at the physical port of the switch and is successfully received, the method checks whether the message matches the message matching condition and configuration register in the ACL rule, and then executes the action strategy corresponding to the matching result to process the message according to the matching result. The message status checking method of the present application realizes the function of bypassing the status check of a specific message while ensuring the normal operation of the spanning tree protocol, so that the specified protocol and the spanning tree protocol work together, so that the switch can process the message data more intelligently according to the preset security and management strategy, and effectively improves the ability to cope with fault anomalies. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 An application scenario diagram of a message status checking method according to an embodiment of the present application is shown;
[0033] Figure 2 A flow chart of a message status checking method according to an embodiment of the present application is shown;
[0034] Figure 3 Another flow chart of a message status checking method according to an embodiment of the present application is shown;
[0035] Figure 4 A structural diagram of a message status checking method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0037] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0038] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0039] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0040] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0041] Considering that the prior art cannot realize forwarding of messages bypassing the spanning tree status check on the switching chip, and there are problems such as low CPU software processing efficiency, easy packet loss, and large forwarding delay, a message status checking method is proposed. By pre-creating the message matching conditions and configuration registers in the ACL rules on the switch, when the message arrives at the physical port of the switch and is successfully received, it is checked whether the message matches the message matching conditions and configuration registers in the ACL rules, and then according to the matching result, the action strategy corresponding to the matching result is executed to process the message. The message status checking method of the present application realizes the function of bypassing the status check of specific messages while ensuring the normal operation of the spanning tree protocol, allowing the specified protocol to work with the spanning tree protocol, so that the switch can process data more intelligently according to the preset security and management policies, and effectively improves the stability and reliability.
[0042] The present invention provides a method for checking the status of a message, which can be applied to Figure 1 In the application environment, specifically, the message status checking method of the present application is applied in a switch network, the network including: Figure 1The switch and network devices shown. The switch is the connection point of the network devices and is responsible for capturing, analyzing and processing the messages flowing through its ports. The switch manages network traffic and ensures the correct transmission of data by executing various protocols (including but not limited to spanning tree protocol, VLAN division, ACLs, etc.). Network devices, such as computers, printers, cameras, smart terminals, etc., are connected to the switch network through Ethernet cables or other types of connection media (such as Wi-Fi). These network devices communicate through the switch to send and receive data. In this process, the switch performs a message status check to verify the legitimacy, integrity or compliance of the message with specific security policies.
[0043] Figure 2 A flow chart of a message status checking method according to an embodiment of the present application is shown. The message status checking method comprises the following steps:
[0044] Step S100: When a message arrives at the physical port of the switch and is successfully received, it is checked whether the message matches the ACL rule.
[0045] Exemplarily, in network communication, a switch, as a core device for connecting network devices, has multiple physical ports for connecting other network devices, such as computers, servers, other switches, etc. When these devices send data packets, the packets are transmitted to the corresponding physical ports of the switch through network media, such as twisted pair cables, optical fibers, etc.; when the packets arrive at the physical ports of the switch, the switch performs a series of reception processing on the packets, including but not limited to signal integrity check, frame check sequence (FCS) verification, etc., to ensure that the received packets are intact and not damaged during transmission. Only when these checks pass, that is, the packets are successfully received, will the switch further process these packets.
[0046] Furthermore, after the message is successfully received, the switch will decide how to handle these messages according to predefined policies. One of the important strategies is to determine whether the access control list (ACL) is matched. ACL is a set of rules that define which types of messages are allowed to pass through the switch, which are rejected or specially processed. Specifically, the switch will match the rules defined in the ACL rules based on the specific attributes of the message (for example, source IP address, destination IP address, source port number, destination port number, protocol type, etc.). If the message meets the conditions of the ACL rule, the action defined by the rule (for example, allow, deny, redirect, etc.) will be executed.
[0047] Step S200: According to the matching result, the action strategy corresponding to the matching result is executed to process the message.
[0048] Exemplarily, when a network device such as a switch or a router receives a message and completes the process of matching the message with the ACL rule, it further processes the message according to the action policy defined by the matched rule.
[0049] For example, action policies include but are not limited to: Permit: If a message matches a certain allow rule in the ACL, the message will be allowed to continue to be transmitted in the network, which usually means that the message will be forwarded to its destination address or port; Deny: If a message matches a certain deny rule in the ACL, the message will be discarded and will not continue to be transmitted in the network; Set QoS (Quality of Service) parameters: In some cases, ACL rules can also be associated with QoS policies to adjust QoS parameters such as message priority and bandwidth allocation based on the matching results, thereby optimizing network performance and resource utilization. Logging: For messages that match specific rules, ACL can also be configured to generate log records, etc.
[0050] The message status checking method of the embodiment of the present application, when the message arrives at the physical port of the switch and is successfully received, checks whether the message matches the message matching condition and the configuration register in the ACL rule, and then executes the action strategy corresponding to the matching result to process the message according to the matching result. The message status checking method of the present application realizes the function of bypassing the status check of specific messages while ensuring the normal operation of the spanning tree protocol, allowing the specified protocol to work with the spanning tree protocol, so that the switch can process the message data more intelligently according to the preset security and management strategies, and effectively improves the ability to deal with fault anomalies.
[0051] In an optional embodiment, the switch is configured with a Marvell switch chip; when a message arrives at a physical port of the switch and is successfully received, checking whether the message matches an ACL rule includes:
[0052] Pre-create the packet matching conditions and configuration registers in the ACL rules on the switch.
[0053] Demonstratively, the switch uses Marvell switching chips as the hardware foundation to efficiently process messages in the network. The message matching conditions in the ACL rules are pre-defined on the switch to identify which messages will trigger the ACL rules. When the switch receives a message and the message matches a certain ACL rule, the action associated with the rule will be executed.
[0054] It is worth noting that when a message matches an ACL rule and needs to perform a specific action, the Marvell switch chip will use the configurability of the CPU physical port provided by the chip itself to assign a unique identification code to the message, that is, add a CPU_Code from 0 to 255. The CPU code identification code is used to identify the reason why the message is sent to the CPU.
[0055] The ACL rule is used to configure the message action matching the ACL rule, and the Marvell switching chip is used to assign an identification code to the message; the register is used to specify the destination port of the message with the identification code.
[0056] Exemplarily, the switch is also configured with a register, and the destination port of each identification code is configured through the register to facilitate flexible connection of the CPU. That is, the identification code and the destination port information corresponding to the identification code are stored to form a mapping relationship, which is convenient for flexible connection of the CPU. In this way, the switch can quickly determine which destination port the message should be sent to based on this mapping relationship. In other words, when the message is processed by the switch, the switch will quickly find the destination port corresponding to the identification code based on the previously stored mapping relationship, and send the message to the destination port corresponding to the identification code. Thereby, flexible control and processing of the message is achieved, and the performance and security of the network are improved.
[0057] Finally, apply the configured ACL rules to the switch to ensure that the rules take effect.
[0058] The message status checking method of the embodiment of the present application utilizes the configurability of the CPU physical port provided by the Marvell switching chip itself to assign a unique identification code to the message for identifying the reason why the message is sent to the CPU, and configures the destination port of each identification code through the configuration register to facilitate flexible connection of the CPU, that is, by pre-creating the message matching conditions and configuration registers in the ACL rules on the switch, when the message arrives at the physical port of the switch and is successfully received, it is checked whether the message matches the message matching conditions and configuration registers in the ACL rules, and then according to the matching result, the action strategy corresponding to the matching result is executed to process the message.
[0059] In an optional embodiment, for step S200, executing the action strategy corresponding to the matching result to process the message according to the matching result includes:
[0060] When a message matches an ACL rule, it is sent to the CPU, and the Marvell switch chip is used to add an identification code to the message, so that after the CPU receives the identification code, it obtains the destination port of the message corresponding to the identification code specified by the register according to the identification code, and forwards the message to the destination port after processing the message. The identification code is used to uniquely identify the reason why the message is sent to the CPU for processing.
[0061] Exemplarily, when a message matches an ACL rule, the message will be sent to the CPU for processing, CPU (trap_to_cpu). At the same time, using the configurability of the CPU physical port provided by the Marvell switch chip itself, an identification code cpu code is added to the message as n (n is greater than 0 and less than 255). When the CPU receives the identification code, it obtains the destination port of the message corresponding to the identification code specified in the register according to the identification code. After processing the message, the CPU sends the message from the destination port.
[0062] In detail, when a message enters a network device, it is checked according to the preset ACL rules. If the message meets the ACL rules, it is sent to the CPU for further processing. In this process, the Marvell switching chip uses the configurability of the CPU physical port provided by itself to add a special identification code to the message. This identification code is unique and is used to indicate the specific reason why the message is sent to the CPU for processing, for example, acl_action = trap_to_cpu; cpu_code = n; when the CPU receives a message with an identification code, it will look up the pre-associated information from the register based on this identification code to find out the target port of the message, for example, cpu_code_to_physical_port.n = dport; after completing the relevant processing of the message, the CPU will forward the message to the corresponding target port, ensuring that the message can be correctly identified, processed and forwarded to the correct destination port, ensuring that the message can be correctly routed and sent to the destination.
[0063] The message status checking method of the embodiment of the present application sends the message to the CPU when the message matches the ACL rule, and uses the Marvell switching chip to add an identification code to the message. At the same time, it is emphasized that the priority of the trap_to_cpu action is the highest level. Therefore, regardless of whether the spanning tree state of the source port is in a blocking state, the trap_to_cpu action is executed, that is, the message is sent to the CPU, and the discarding action of the spanning tree module is not executed, thereby bypassing the spanning tree status check of the source port and the destination port, and realizing the common use of the specified protocol and the spanning tree protocol.
[0064] In an optional embodiment, for step S200, executing the action strategy corresponding to the matching result according to the matching result further includes:
[0065] When the message does not match the ACL rule, the message status is obtained to execute the corresponding action policy according to the message status.
[0066] Exemplarily, when a message does not match a preset access control list (ACL) rule, for example, when pkt_action=forword, the spanning tree state of the message is checked. Then, according to the spanning tree state of the message, the corresponding action strategy is executed. For example, the action strategy may include discarding the message, allowing the message to pass, performing special processing on the message, etc.
[0067] The spanning tree status refers to the management of the status of each port by network devices when the spanning tree protocol (STP) is used in the network to prevent loops and ensure the stability of the network. The spanning tree status usually includes the following:
[0068] Blocking state: The port does not forward data frames but only receives data frames to prevent loops.
[0069] Listening state: The port is ready to receive data frames but does not forward them, waiting for the network topology to stabilize.
[0070] Learning state: The port starts to learn MAC addresses but still does not forward data frames.
[0071] Forwarding state: The port can receive and forward data frames and participate in network communications normally.
[0072] Fault state (Disabled): The port is disabled and does not participate in any data forwarding.
[0073] The message status checking method of the embodiment of the present application obtains the spanning tree status of the message when the message does not match the ACL rule, so as to execute the corresponding action strategy according to the spanning tree status, so as to ensure the normal operation of the spanning tree protocol in the subsequent steps, realize the function of bypassing the status check of specific messages, and allow the specified protocol to work with the spanning tree protocol, so that the switch can process data more intelligently according to the preset security and management policies, and effectively improve the stability and reliability.
[0074] In an optional embodiment, if Figure 3 As shown, when the message does not match the ACL rule, the message status is obtained to execute the corresponding action strategy according to the message status, including:
[0075] Step S201: when the message does not match the ACL rule, the source port status and the destination port status of the message are obtained.
[0076] For example, the source port is the port from which the message enters the device; the destination port is the port to which the message is to be sent; the status of the source port and the destination port, for example: forwarding state: the port is working normally and can forward data; blocking state: the port is blocked and does not forward data; fault state: the port is disabled and cannot be used.
[0077] Step S202: Execute the action strategy corresponding to the source port and the destination port according to the source port status and the destination port status of the message.
[0078] Exemplarily, whether a specific action strategy needs to be executed is determined based on the source and destination of the message, for example, allowing the message to pass, rejecting the message, performing security checks on the message, redirecting the message packet, recording log information, etc., so as to ensure that the message is forwarded along the correct path in the network and ensure the normal operation of the network.
[0079] The message status checking method of the embodiment of the present application obtains the source port status and the destination port status of the message when the message does not match the ACL rule, and then executes the action strategy corresponding to the source port and the destination port according to the port status.
[0080] In an optional embodiment, executing the action strategy corresponding to the source port and the destination port according to the source port state and the destination port state of the message includes:
[0081] When the source port state or the destination port state of the message is in the first state, a first action strategy is executed; the first action strategy is to discard the message.
[0082] Exemplarily, the "first state" is "blocking", which means that this state indicates that the port is blocked and does not allow data to pass through to avoid network congestion or message loops. The "first action strategy" is to discard the message.
[0083] When the source port or destination port is in a blocked state, the message is dropped. This means that any communication attempts through these ports will be ignored by the firewall or filter and will not enter the network. In other words, stp_action = drop.
[0084] In the message status checking method of the embodiment of the present application, when the source port and the destination port are both in the first state, the switch device executes a strategy of discarding the message, so that the switch can process data more intelligently according to preset security and management policies, effectively improving stability and reliability.
[0085] In an optional embodiment, executing the action strategy corresponding to the source port and the destination port according to the source port state and the destination port state includes:
[0086] When the source port state and the destination port state of the message are both in the second state, the second action strategy is executed; the second action strategy forwards the message to the destination port.
[0087] Exemplarily, when the source port state and the destination port state of the message are both in the second state, it means that they are not in a blocking state. In this case, the switch executes the second action strategy, i.e., forwards the message to the destination port.
[0088] The second state can be considered as a state that allows data transmission. In this state, the port is open and can receive and send data. When both the source port and the destination port are in this state, stp_action = forward, and the switch will forward the message from the source port to the destination port to achieve data transmission.
[0089] It is worth noting that the above parameters, for example, the values of "first" and "second" in the first action strategy, the second action strategy, the first state, and the second state are all examples and can be adaptively adjusted according to specific circumstances.
[0090] The message status checking method of the embodiment of the present application sets the port to the forwarding state when the source port status and the destination port status are both in the second state, and the switch device executes the message forwarding strategy, so that the switch can process data more intelligently according to the preset security and management strategies, effectively improving stability and reliability.
[0091] This application also proposes a message status checking method, such as Figure 4 As shown, the message status checking method device includes:
[0092] A rule matching module 41, configured to check whether the message matches the ACL rule when the message arrives at the physical port of the switch and is successfully received;
[0093] The message processing module 42 is used to execute the action strategy corresponding to the matching result to perform message processing according to the matching result.
[0094] It can be understood that the device of this embodiment corresponds to a message status checking method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.
[0095] The present application also provides a switch device. Exemplarily, the switch device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned message status checking method or the above-mentioned message status checking device.
[0096] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0097] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0098] The present application also provides a computer-readable storage medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0099] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0101] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
[0102] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A message status checking method, characterized in that: Applied to a switch configured with ACL rules, the method comprises: When the message arrives at the physical port of the switch and is successfully received, check whether the message matches the ACL rule; According to the matching result, an action strategy corresponding to the matching result is executed to process the message.
2. The message status checking method according to claim 1, characterized in that: The switch is configured with a Marvell switch chip; when the message arrives at the physical port of the switch and is successfully received, checking whether the message matches the ACL rule includes: Pre-creating the message matching conditions and configuration registers in the ACL rule on the switch; The ACL rule is used to configure the message action matching the ACL rule, and the Marvell switching chip is used to assign an identification code to the message; and the register is used to specify the destination port of the message having the identification code.
3. The message status checking method according to claim 1, characterized in that: The executing, according to the matching result, an action strategy corresponding to the matching result to perform message processing comprises: When the message matches the ACL rule, the message is sent to the CPU, and the identification code is added to the message by using the Marvell switch chip, so that after the CPU receives the identification code, it obtains the destination port corresponding to the identification code from the register, and after processing the message, it forwards the message to the destination port; The identification code is used to uniquely identify the reason why the message is sent to the CPU for processing.
4. The message status checking method according to claim 1, characterized in that: The step of executing an action strategy corresponding to the matching result according to the matching result includes: When the message does not match the ACL rule, the state of the message is obtained to execute a corresponding action strategy according to the state of the message.
5. The message status checking method according to claim 1, characterized in that: When the message does not match the ACL rule, obtaining the state of the message to execute a corresponding action strategy according to the state of the message includes: When the message does not match the ACL rule, obtaining the source port status and the destination port status of the message; According to the source port status and the destination port status of the message, the action strategy corresponding to the source port and the destination port is executed.
6. The message status checking method according to claim 5, characterized in that: The executing the action strategy corresponding to the source port and the destination port according to the source port state and the destination port state of the message comprises: When the source port state or the destination port state of the message is in a first state, a first action strategy is executed; the first action strategy is to discard the message.
7. The message status checking method according to claim 5, characterized in that: The executing the action strategy corresponding to the source port and the destination port according to the state of the source port and the state of the destination port comprises: When the source port state and the destination port state of the message are both in the second state, a second action strategy is executed; the second action strategy forwards the message to the destination port.
8. A message status inspection device, characterized in that: The device comprises: A rule matching module, used for checking whether the message matches the ACL rule when the message arrives at the physical port of the switch and is successfully received; The message processing module is used to execute the action strategy corresponding to the matching result to process the message according to the matching result.
9. A switch device, characterized in that: The switch device comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the message status checking method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed on a processor, the message status checking method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Spanning tree construction method and device for spanning tree protocol
CN121309261A