Message debugging method and device for exchange unit
By adding forwarding information to the debug message header inside the switching unit, the problem of limited storage in the fixed registers of the switching chip is solved, enabling simultaneous debugging of multiple messages and improving debugging efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 北京东土军悦科技有限公司
- Filing Date
- 2022-12-07
- Publication Date
- 2026-05-19
AI Technical Summary
In existing debugging methods for switching chips, the fixed registers have limited storage, which means that only one type of message can be debugged at a time, and cannot effectively support the debugging needs of multiple messages.
Instead of saving the forwarding information of the debug message inside the switching unit to the debug message header, multiple debug message headers are generated, enabling simultaneous debugging of multiple messages.
It enables simultaneous debugging of multiple messages, avoiding storage limitations and information conflicts, and improving debugging efficiency.
Smart Images

Figure CN115865749B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technology, and in particular to a message debugging method and apparatus for a switching unit, a computing device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] The more advanced the network switching chip, the more switching functions it provides. When debugging packets, it is necessary to consider the forwarding process of the packets in the chip. This requires a high level of understanding of the chip's processes and registers. Debugging requires step-by-step inspection and modification of registers, which is not conducive to chip-level problem localization and maintenance.
[0003] One existing method for debugging switching chips enables online debugging signals by matching traffic characteristic keys. It saves the chip flow information of the matched data stream in a fixed debugging register. The CPU then reads and parses the information in the fixed register to obtain the forwarding flow of the debugging message within the switching chip. However, this method has limited debugging register storage. To prevent subsequent data packets entering the chip from overwriting and erasing the processing information of those packets, the debugging storage register needs to be locked for each debugging session, allowing only one type of message to be debugged at a time. Summary of the Invention
[0004] In view of the above-mentioned problems of the prior art, this application provides a message debugging method and apparatus for a switching unit, a computing device, a computer-readable storage medium and a computer program product, which can perform multiple message debugging simultaneously.
[0005] To achieve the above objectives, the first aspect of this application provides a method for debugging messages in a switching unit, comprising:
[0006] Receive a message as a debugging message;
[0007] When the debugging message is forwarded within the switching unit, the forwarding information of the debugging message is obtained and added to the debugging message header;
[0008] Obtain the debug message carrying the debug message header;
[0009] The forwarding process of the debug message within the switching unit is determined based on the forwarding information in the debug message header of the obtained debug message.
[0010] This application does not use a fixed register with limited storage to store the forwarding information of debug messages within the switching unit. Instead, it adds the forwarding information to the debug message header. When multiple debug messages arrive at the same time, multiple debug message headers can be generated. Multiple debug message headers can be parsed simultaneously to obtain the forwarding process of the corresponding debug messages within the switching unit, thus achieving the purpose of debugging multiple messages simultaneously.
[0011] To achieve the above objectives, a second aspect of this application provides a message debugging apparatus for a switching unit, comprising:
[0012] The receiving module is used to receive a message as a debugging message.
[0013] The header processing module is used to obtain the forwarding information of the debugging message and add it to the debugging message header when the debugging message is forwarded within the switching unit. The debugging message header is a header added to the debugging message.
[0014] An acquisition module is used to acquire the debug message carrying the debug message header;
[0015] The forwarding process determination module is used to determine the forwarding process of the debug message within the switching unit based on the forwarding information in the debug message header of the obtained debug message.
[0016] This application does not use a fixed register with limited storage to store the forwarding information of debug messages within the switching unit. Instead, it adds the forwarding information to the debug message header. When multiple debug messages arrive at the same time, multiple debug message headers can be generated. Multiple debug message headers can be parsed simultaneously to obtain the forwarding process of the corresponding debug messages within the switching unit, thus achieving the purpose of debugging multiple messages simultaneously.
[0017] A third aspect of this application provides a switching device, including: a switching unit and a processor;
[0018] The switching unit is used to: receive a message as a debugging message; when forwarding the debugging message within the switching unit, obtain the forwarding information of the debugging message and add it to the debugging message header, wherein the debugging message header is a message header added to the debugging message;
[0019] The processor is configured to: acquire the debug message carrying the debug message header, and determine the forwarding process of the debug message within the switching unit based on the forwarding information in the debug message header of the acquired debug message.
[0020] A fourth aspect of this application provides a computing device, including: a communication interface and at least one processor; wherein the at least one processor is configured to execute program instructions, which, when executed by the at least one processor, cause the computing device to perform any of the methods described in the first aspect above.
[0021] The fifth aspect of this application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a computer, cause the computer to perform any of the methods described in the first aspect above.
[0022] A sixth aspect of this application provides a computer program product comprising program instructions that, when executed by a computer, cause the computer to perform any of the methods described in the first aspect above. Attached Figure Description
[0023] Figure 1 This is a flowchart of the first embodiment of the message debugging method for the switching unit of this application;
[0024] Figure 2 This is a schematic diagram of the debugging message header of this application;
[0025] Figure 3 This is a flowchart of the second embodiment of the message debugging method for the switching unit of this application;
[0026] Figure 4 This is a structural schematic diagram of the message debugging device for the switching unit of this application;
[0027] Figure 5 This is a structural schematic diagram of the switching equipment in this application;
[0028] Figure 6 This is a schematic structural diagram of a computing device provided in an embodiment of this application.
[0029] It should be understood that the dimensions and shapes of the block diagrams in the above structural diagrams are for reference only and should not constitute an exclusive interpretation of the embodiments of this application. The relative positions and inclusion relationships between the block diagrams presented in the structural diagrams are only schematic representations of the structural relationships between the block diagrams, and are not intended to limit the physical connection methods of the embodiments of this application. Detailed Implementation
[0030] The technical solutions provided in this application will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the system architecture and business scenarios provided in the embodiments of this application are mainly for illustrating possible implementations of the technical solutions of this application and should not be construed as the sole limitation on the technical solutions of this application. Those skilled in the art will recognize that the technical solutions provided in this application are equally applicable to similar technical problems as system architectures evolve and new business scenarios emerge.
[0031] It should be understood that the message debugging solutions provided in this application include message debugging methods and apparatus. Since these technical solutions solve problems based on the same or similar principles, some repetitive details may not be repeated in the following descriptions of specific embodiments. However, it should be considered that these specific embodiments have mutual references and can be combined with each other.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. In case of any inconsistency, the meaning set forth in this specification or derived from the content described herein shall prevail. Furthermore, the terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit the scope of this application.
[0033] The message debugging method enables online debugging signals by matching traffic feature keys. It saves the switching chip process information of the matched data stream in a fixed debugging register. The CPU reads and parses the information in the fixed register to obtain the forwarding process of the debugging message within the switching chip. This method has limited debugging register storage. To prevent subsequent data packets entering the chip from overwriting and erasing the processing information of the current data packet, the debugging storage register needs to be locked for each debugging session, and only one type of message can be debugged at a time.
[0034] To address the aforementioned issues, this application provides a message debugging method for a switching unit. Instead of storing the forwarding information of the debugging message within the switching unit in the debugging message header, this method avoids the problem of limited storage and prevents subsequent forwarding information from overwriting the forwarding information of the previous debugging message. Instead, a corresponding debugging message header is generated for each incoming debugging message, allowing for simultaneous debugging of multiple messages. The forwarding process of the debugging message within the switching unit is then determined by analyzing the debugging message carrying the debugging message header.
[0035] The message debugging method for the switching unit provided in this application embodiment can be applied to any device that includes a switching unit, such as a router, repeater, hub, bridge, switch, etc.
[0036] like Figure 1 As shown in the figure, this application provides a method for debugging messages in a switching unit. The following refers to... Figure 1 The flowchart shown illustrates the first embodiment of the message debugging method of this application. Wherein, as... Figure 1 As shown, in this first embodiment, the method includes:
[0037] S110: Receives a message as a debugging message.
[0038] In one embodiment, after receiving a message, it can be used directly as a debugging message, or it can be processed before being used as a debugging message. This processing can be a filtering process, where key information is selected from the message to be used as the debugging message.
[0039] In one embodiment, the filtering process may involve keyword matching of packets. When the information in a packet matches a specified keyword, the packet is treated as a debugging packet. When the information in a packet does not match the specified keyword, the packet is not treated as a debugging packet, but is forwarded normally by the switching unit. The keywords may include packet information such as destination MAC, source MAC, destination IP address, source IP address, destination port number, source port number, VLAN, and MPLS tag.
[0040] In one embodiment, matching can be performed using an Access Control List (ACL). An Access Control List (ACL) is a packet filtering-based access control technique that filters packets on an interface based on set conditions, allowing them to pass or dropping them.
[0041] ACL execution requires configuring enabled actions; therefore, ACL actions are extended by adding an enable debugging action for online packet debugging. This is achieved by adding a debug enable switch. When the debug enable switch is on, packet debugging actions are executed; when the debug enable switch is off, other configured operations are executed.
[0042] In this embodiment, when the information in the message matches the specified keyword, the method further includes: when the debug enable switch of the access control list (ACL) is in the open state, the message is treated as a debug message; when the debug enable switch is in the closed state, the message is forwarded normally by the switching unit.
[0043] S120: When forwarding the debug message within the switching unit, obtain the forwarding information of the debug message and add it to the debug message header.
[0044] In one embodiment, the switching unit may include a Layer 2 forwarding unit, a Layer 3 forwarding unit, or a Multi-Protocol Label Switching (MPLS) unit.
[0045] For Layer 2 forwarding units, the forwarding information involved is Layer 2 forwarding information, which may include, for example, whether the Direct Memory Access (DMAC) controller has a hit, whether the source MAC has a hit, and whether the source MAC has enabled learning, dequeueing, VLAN exit, and port exit information.
[0046] For a Layer 3 forwarding unit, the forwarding information involved is Layer 3 forwarding information, which may include information such as whether the Layer 3 routing table is HIT, outgoing queue, outgoing destination MAC, outgoing VLAN, outgoing port, etc.
[0047] For MPLS units, the forwarding information involved is MPLS forwarding information, which may include information such as whether the MPLS table is HIT, dequeue, whether the MPLS label is popped (POP), whether the MPLS label is swapped (SWAP), MPLS label ID, outgoing VLAN, outgoing port, etc.
[0048] Based on the above description of the switching unit, the forwarding mentioned here refers to the multiple forwardings of a message within the switching unit. The forwarding information is the forwarding information at each forwarding, and finally all the forwarding information is recorded and added to the debug message header.
[0049] In one embodiment, the debug header may include the source port, the resolved VLAN ID, whether the Route MAC is Hit, and the aforementioned forwarding information.
[0050] like Figure 2 As shown, different debug message header formats are given. The top layer is the debug message header corresponding to the Layer 2 forwarding unit. The middle layer is the debug message header corresponding to the MPLS unit. The bottom layer is the debug message header corresponding to the Layer 3 forwarding unit.
[0051] S130: Obtain the debug message carrying the debug message header;
[0052] S140: Determine the forwarding process of the debug message within the switching unit based on the forwarding information in the debug message header of the obtained debug message.
[0053] In one embodiment, since the debug message carries a debug message header, directly obtaining the debug message carrying the debug message header may affect the normal forwarding of the debug message. Therefore, the debug message carrying the debug message header can be obtained through mirroring, thus avoiding affecting the normal forwarding of the debug message. The processor (CPU) of the switching unit can obtain the debug message carrying the debug message header through mirroring and determine the forwarding process of the debug message within the switching unit.
[0054] In one embodiment, if the processor (CPU) of the switching unit obtains the debug message carrying the debug message header through mirroring and determines the forwarding flow of the debug message within the switching unit, this processing method may consume the processor (CPU) of the switching unit and affect the processor (CPU) from processing other information. Therefore, the debug message carrying the debug message header can also be obtained through mirroring of an external device coupled to the destination port, and the forwarding flow of the debug message within the switching unit can be determined. This does not consume the processor (CPU) of the switching unit and does not affect the forwarding of normal messages.
[0055] This application adds the forwarding information of the debugging message within the switching unit to the debugging message header instead of saving it to a fixed debugging register. This avoids the problem of limited storage and prevents subsequent forwarding information from overwriting the forwarding information of the previous debugging message. Instead, a corresponding debugging message header is generated for each incoming debugging message, allowing for simultaneous debugging of multiple messages. The debugging message carrying the debugging message header is then analyzed to determine the forwarding process of the debugging message within the switching unit.
[0056] The second embodiment of this application provides a specific embodiment of a packet debugging method. This method outlines the specific switching and forwarding process of packets within the switching chip of a switch, such as... Figure 3 As shown, the following are included:
[0057] S10: The switching chip receives a message and parses the message.
[0058] S20: Determine whether the parsing result of the packet matches the keyword selected by the ACL. If they do not match, the packet is forwarded in the switching chip by looking up the table, and then forwarded out through the exit of the switching chip.
[0059] The keywords in an ACL can include packet information such as destination MAC, source MAC, destination IP address, source IP address, destination port number, source port number, VLAN, and MPLS tag.
[0060] S30: If a match is found, determine the status of the enable debug switch in the ACL. If the switch is on, perform online debugging of the message, look up the debug message in the table and forward it in the switching chip, and then generate the debug message header according to the forwarding process.
[0061] Taking Layer 3 switching forwarding as an example, the debug message header includes the source port, the resolved VLAN ID, whether the Route MAC is Hit, and forwarding information. The forwarding information is Layer 3 forwarding, which includes whether the Layer 3 routing table is Hit, outgoing queue, outgoing destination MAC, outgoing VLAN, outgoing port, and other information.
[0062] S40: If the switch is closed, no online debugging of the message will be performed. The received message will be forwarded in the switching chip by looking up the table, and then forwarded out through the output of the switching chip.
[0063] S50: Then determine whether to enable debug image. If not, forward the debug message through the switch chip's output.
[0064] S60: Determine whether debug mirroring is enabled. If debug mirroring is enabled, the debug message carrying the debug header is mirrored to the mirroring destination port. The CPU port of the switch connected to the mirroring destination port or the external device coupled to the mirroring destination port analyzes and processes the message. This does not affect the forwarding of normal debug messages, allowing the original debug message to be forwarded normally from the egress point. Then, the CPU or external device analyzes the debug message header to determine the forwarding process of the debug message within the switching chip.
[0065] like Figure 4 As shown, this application provides a message debugging device for a switching unit. This message debugging device can be used to implement the message debugging method for the switching unit in the above embodiments, such as... Figure 4 As shown, the message debugging device 400 of the switching unit has a receiving module 410, a message header processing module 420, an acquisition module 430, and a forwarding process determination module 440.
[0066] The receiving module 410 is used to receive a message as a debugging message.
[0067] The header processing module 420 is used to obtain the forwarding information of the debugging message and add it to the debugging message header when the debugging message is forwarded within the switching unit. The debugging message header is a header added to the debugging message.
[0068] The acquisition module 430 is used to acquire the debug message carrying the debug message header;
[0069] The forwarding process determination module 440 is used to determine the forwarding process of the debugging message within the switching unit based on the forwarding information in the header of the obtained debugging message.
[0070] like Figure 5 As shown, this application embodiment provides a switching device 500, including: a switching unit 510 and a processor 520;
[0071] The switching unit 510 is configured to: receive a message as a debugging message; when forwarding the debugging message within the switching unit, obtain the forwarding information of the debugging message and add it to the debugging message header, wherein the debugging message header is a message header added to the debugging message;
[0072] The processor 520 is configured to: acquire the debug message carrying the debug message header, and determine the forwarding process of the debug message within the switching unit based on the forwarding information in the debug message header of the acquired debug message.
[0073] Figure 6This is a schematic structural diagram of a computing device 900 provided in an embodiment of this application. This computing device can function as an instruction sending device, executing various optional embodiments of the instruction sending method described above, or it can function as an instruction receiving device, executing various optional embodiments of the instruction receiving method described above. The computing device can be a terminal, or it can be a chip or chip system within a terminal. Figure 6 As shown, the computing device 900 includes: a processor 910, a memory 920, and a communication interface 930.
[0074] It should be understood that Figure 6 The communication interface 930 in the computing device 900 shown can be used to communicate with other devices, and may specifically include one or more transceiver circuits or interface circuits.
[0075] The processor 910 can be connected to the memory 920. The memory 920 can be used to store the program code and data. Therefore, the memory 920 can be a storage unit inside the processor 910, an external storage unit independent of the processor 910, or a component that includes both the storage unit inside the processor 910 and the external storage unit independent of the processor 910.
[0076] Optionally, the computing device 900 may also include a bus. The memory 920 and communication interface 930 can be connected to the processor 910 via the bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The symbol is represented by a line without an arrow, but this does not mean that there is only one bus or one type of bus.
[0077] It should be understood that in the embodiments of this application, the processor 910 may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Alternatively, the processor 910 may employ one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0078] The memory 920 may include read-only memory and random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include non-volatile random access memory. For example, the processor 910 may also store device type information.
[0079] When the computing device 900 is running, the processor 910 executes computer execution instructions stored in the memory 920 to perform any of the operational steps of the above method and any of the optional embodiments thereof.
[0080] It should be understood that the computing device 900 according to the embodiments of this application can correspond to the corresponding subject in executing the methods according to the various embodiments of this application, and the above and other operations and / or functions of each module in the computing device 900 are respectively for implementing the corresponding processes of the methods of this embodiment. For the sake of brevity, they will not be described in detail here.
[0081] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0082] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0083] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0084] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0085] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0086] If the aforementioned functions are implemented as software functional units 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0087] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is used to perform the above-described method, which includes at least one of the schemes described in the above embodiments.
[0088] The computer storage medium in this application embodiment can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0089] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0090] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0091] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0092] Furthermore, the terms "first, second, third, etc." or similar terms such as module A, module B, and module C used in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that, where permissible, a specific order or sequence may be interchanged so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0093] In the above description, the labels of the steps involved, such as S110, S120, etc., do not mean that the steps will necessarily be executed. The order of the steps can be interchanged or executed simultaneously if permitted.
[0094] The term "comprising" as used in the specification and claims should not be construed as limiting itself to what follows; it does not exclude other elements or steps. Therefore, it should be interpreted as specifying the presence of the mentioned feature, integral, step, or component, but does not exclude the presence or addition of one or more other features, integrals, steps, or components, or groups thereof. Thus, the statement "device comprising means A and B" should not be limited to a device consisting solely of components A and B.
[0095] The terms "an embodiment" or "an embodiment" as used in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in at least one embodiment of this application. Therefore, the terms "in one embodiment" or "in an embodiment" appearing throughout this specification do not necessarily refer to the same embodiment, but may refer to the same embodiment. Furthermore, in one or more embodiments, the particular features, structures, or characteristics can be combined in any suitable manner, as will be apparent to those skilled in the art from this disclosure.
[0096] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, all of which fall within the scope of protection of this application.
Claims
1. A method for debugging messages in a switching unit, characterized in that, include: Receive a message as a debugging message; The debugging message is forwarded within the switching unit, and the forwarding information of the debugging message is obtained and added to the debugging message header. Obtain the debug message carrying the debug message header, wherein, when debug mirroring is enabled, the debug message carrying the debug message header is mirrored to the mirroring destination port; The forwarding process of the debug message within the switching unit is determined based on the forwarding information in the header of the debug message. Specifically, when debug mirroring is enabled, the forwarding process is obtained by analyzing and processing the CPU port of the switch connected to the mirror destination port or the external device coupled to the mirror destination port. Receiving a message as a debug message includes: receiving a message, wherein if the information in the message matches a specified keyword, the message is used as a debug message; the matching is performed using an Access Control List (ACL). When the information in the message matches the specified keyword, the method further includes: when the debug enable switch of the access control list (ACL) is in the open state, the message is treated as a debug message; when the debug enable switch is in the closed state, the message is forwarded normally by the switching unit.
2. The method according to claim 1, characterized in that, Also includes: If the information in the message does not match the specified keyword, the message will be forwarded normally by the switching unit.
3. A message debugging device for a switching unit, characterized in that, include: The receiving module is used to receive a message as a debugging message. The header processing module is used to forward the debugging message within the switching unit, and at the same time obtain the forwarding information of the debugging message and add it to the debugging message header. The debugging message header is a header added to the debugging message. The acquisition module is used to acquire the debug message carrying the debug message header, wherein, when debug mirroring is enabled, the debug message carrying the debug message header is mirrored to the mirroring destination port; The forwarding process determination module is used to determine the forwarding process of the debug message within the switching unit based on the forwarding information in the debug message header of the obtained debug message. In this case, when debug mirroring is enabled, the forwarding process is obtained by the analysis and processing of the CPU port of the switch connected to the mirror destination port or the external device coupled to the mirror destination port. Receiving a message as a debug message includes: receiving a message, wherein if the information in the message matches a specified keyword, the message is used as a debug message; the matching is performed using an Access Control List (ACL). When the information in the message matches the specified keyword, the method further includes: when the debug enable switch of the access control list (ACL) is in the open state, the message is treated as a debug message; when the debug enable switch is in the closed state, the message is forwarded normally by the switching unit.
4. A switching device, characterized in that, include: Switching units and processors; The switching unit is used to: receive a message, forward the debugging message as a debugging message within the switching unit, and simultaneously obtain the forwarding information of the debugging message and add it to the debugging message header, wherein the debugging message header is a message header added to the debugging message. The processor is configured to: acquire the debug message carrying the debug message header, and determine the forwarding flow of the debug message within the switching unit based on the forwarding information in the debug message header of the acquired debug message. Specifically, when debug mirroring is enabled, acquiring the debug message carrying the debug message header includes: mirroring the debug message carrying the debug message header to the mirroring destination port; determining the forwarding flow of the debug message within the switching unit based on the forwarding information in the debug message header of the acquired debug message includes: analyzing and processing the forwarding flow through the CPU port of the switch connected to the mirroring destination port or the external device coupled to the mirroring destination port. Receiving a message as a debug message includes: receiving a message, wherein if the information in the message matches a specified keyword, the message is used as a debug message; the matching is performed using an Access Control List (ACL). When the information in the message matches the specified keyword, the method further includes: when the debug enable switch of the access control list (ACL) is in the open state, the message is treated as a debug message; when the debug enable switch is in the closed state, the message is forwarded normally by the switching unit.
5. A computing device, characterized in that, include: processor, and A memory having stored program instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 2.