WO2017197982A1 - Packet processing method, device and system, and computer storage medium - Google Patents

Packet processing method, device and system, and computer storage medium Download PDF

Info

Publication number
WO2017197982A1
WO2017197982A1 PCT/CN2017/078382 CN2017078382W WO2017197982A1 WO 2017197982 A1 WO2017197982 A1 WO 2017197982A1 CN 2017078382 W CN2017078382 W CN 2017078382W WO 2017197982 A1 WO2017197982 A1 WO 2017197982A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
instruction
current state
state information
copy
Prior art date
Application number
PCT/CN2017/078382
Other languages
French (fr)
Chinese (zh)
Inventor
周佳
陈丹艳
钱勇
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017197982A1 publication Critical patent/WO2017197982A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults

Definitions

  • the present invention relates to network switching technologies, and in particular, to a message processing method, apparatus, system, and computer storage medium.
  • Method 1 An external tester is needed to perform packet extraction and analysis on the faulty service port of the device. However, in many cases, where the network device is running, the capture device such as the tester cannot be provided in time.
  • Method 2 According to the characteristic values of the packet, such as MAC (Media Access Control), IP (Internet Protocol, protocol inter-network interconnection), UDP_PORT (User Datagram Protocol PORT, user datagram protocol port), etc. Layer 3 information is extracted by setting forwarding entries or configuring ACL (Access Control List) rules.
  • ACL Access Control List
  • Method 3 By adding a breakpoint in the execution program, when a message is processed to a corresponding breakpoint location, all the programs are terminated and the message is extracted, but this method is limited to the test, and cannot be It is applied in the actual live network, otherwise it will cause serious consequences such as business interruption.
  • the embodiments of the present invention provide a packet processing method, device, system, and computer storage medium, and are expected to solve the problem of the external technology of the test device in the failure location of the packet processing, and the low efficiency.
  • the present invention provides a packet processing method, including:
  • the current state information of the message processing is saved according to the message descriptor corresponding to the message.
  • the embodiment of the invention further provides a message processing device, including:
  • a mark setting module configured to set a copy mark in a message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark
  • An instruction execution module configured to execute each instruction to process the message
  • the saving module is configured to save the current state information of the packet processing according to the message descriptor corresponding to the packet when the specified instruction is executed.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing message processing method.
  • the present invention provides a message processing method, apparatus, system and computer storage medium, which sets a copy mark in a message descriptor corresponding to a message, and then executes an instruction to process the message, when executing the specified instruction
  • the current state information of the message processing is saved according to the copy mark, which effectively reduces the dependence on other external test equipment and ensures the efficiency of message processing.
  • FIG. 1 is a flowchart of a packet processing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic block diagram of a message processing apparatus according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a packet processing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic block diagram of a message processing system according to an embodiment of the present invention.
  • a copy mark is set at a position of a specified instruction of a message, and when the instruction is executed, the current state information of the message processing is cached, and then the current state information of the cache is performed. Analysis and analysis results are obtained, which improves the efficiency of fault location, and also reduces the dependence on other fault location equipment and the impact on the normal execution of the message.
  • This embodiment provides a packet processing method. Referring to FIG. 1, the method includes:
  • the processing of the message is realized by executing the corresponding respective instructions; the processing of the message is the process of executing each instruction.
  • message parsing, forwarding entry lookup, message edit modification, and other instructions are all part of the message processing process.
  • Set in the message descriptor corresponding to the message Copying the mark means that the current state information of the processing of the message needs to be saved, and the timing of saving is to specify the position of an instruction in each executed instruction, and the current state of the processing can be performed when the instruction is executed.
  • the information is saved.
  • Specifying an instruction is arbitrary, can be specified by humans, or can be specified by the characteristics of the instruction. If there is an instruction to extract the message, it is more reasonable to set the copy mark at this instruction.
  • the copy mark and the specified instruction do not necessarily have to be related before setting the copy mark in the message descriptor. However, after the copy mark is set in the message descriptor, the corresponding instruction corresponding to the copy mark is also determined.
  • the relationship may be determined by setting, or may be determined according to the characteristics of the processed message.
  • the copy tag is set in the message descriptor.
  • the message descriptor is an overview of the content of the message, or a silhouette.
  • the size of the message descriptor is much smaller than the message size, but it can
  • the content of the message is roughly reflected, and information such as the processing logic of the message can be obtained from the message descriptor.
  • the message is processed in the network processor, and the message descriptor is carried when each message is processed in the network processor, and the copy mark in the message descriptor is used as a copy of the message. logo.
  • Each instruction in the message can be executed sequentially; the so-called sequential execution is to execute each instruction according to a preset execution logic, and the preset logic can be a system preset or an artificial setting.
  • the number of instructions of a message is often many, and the purpose of executing each instruction is not the same.
  • the copy mark is often set at the instruction as the message extraction.
  • the specified message fetching instruction is the instruction logic responsible for the normal processing of the message, and is not specifically used to extract the message. In the process of executing each instruction, the previously executed instruction often affects the executed instruction. On the other hand, there is generally no relationship between the unexecuted instruction and the status of the message.
  • the difference between the preceding and the last is not necessarily the relationship of the order execution that is initially set.
  • a jump may occur, that is, the execution in the preset order should be performed later.
  • the instruction may also be a previously executed instruction because of a jump, that is, the order of the previous execution and the subsequent execution depends on the actual execution.
  • the instruction specified by the copy mark is executed during the execution of the instruction.
  • the status of the message at this time is analyzed.
  • the current status information of the message processing needs to be saved. In fact, the status information of the message processing is only related to the executed instruction.
  • the unexecuted command does not affect the status of the message processing.
  • the current status information may include the processing information of the packet header according to the analysis requirements. At least one of the register information and the message buffer may be multiple, and may also have other unmentioned information to serve the state analysis of the message.
  • the processing information of the packet header reflects the change of the message content after the message processing, including the addition, deletion and replacement of the message;
  • the register information is the state information of the register for saving the message, such as the capacity, the access rate and the like.
  • the message cache is the cached content of the packet in the process of processing the packet, which is generally the cached content of the entire packet, and can detect whether the cached device is faulty, whether the cached packet content has a problem or the like.
  • the copy flag can also be set before executing the specified instruction.
  • the set operation corresponds to the reset operation, and the copy mark is considered to be active if set.
  • the copy mark can be activated, and if it is not activated, the current status information can be saved.
  • the save in this embodiment can be cached, and the cache refers to the buffer of data exchange.
  • the cache is characterized by fast running speed and much faster than memory, which is more efficient than direct storage.
  • the feature of the cache is that it is only used to cache the status information of the currently specified extraction, that is, the current status information is cached this time. If a new copy mark is specified again, the new status information will be overwritten. Status information cached in the cache.
  • the processing of the current state information is not required for the processing of each packet, further, the processing of the same packet does not necessarily have to save the current state information once. Therefore, the current state of the packet needs to be saved.
  • the copy request from the user is received, and then the copy mark is set; at this point, it is considered that the message needs to be performed. Save, and then save the current state information of the message processing when the specified instruction is executed.
  • the copy mark can be made to correspond to a plurality of specified instructions; the execution of each execution is performed sequentially, then, before executing to a specified instruction, if it is not required If the current state information is saved, then it is not necessary to set the copy flag. In other words, when the current state information needs to be saved, the copy flag is set.
  • This processing method is flexible and can be achieved very well. Effect.
  • the saved current state information can be obtained, and then the current state information is analyzed; the analysis process is based on the saved message header processing information, register information, message buffer, and the like.
  • the current state information is diagnosed; specifically, the current state information can be presented through the human-machine interaction interface, and the human-computer interaction interface can be obtained by logging in to the corresponding network device through the network management platform telnet (remote terminal protocol).
  • the content of the diagnosis may be whether the current extracted message is abnormal, whether the processing logic has a problem, whether the current state of the register and the storage space is correct, and the like.
  • each instruction can be compiled, and the serial number corresponding to each instruction is generated after compilation; among all the instructions of the message, the serial number and other instructions corresponding to each instruction are different, so that Directly and quickly locate the specified instruction without error.
  • the corresponding serial number can be determined accordingly.
  • the execution of the instruction may be determined according to the serial number, that is, determining whether to execute the specified instruction according to the serial number, thereby further determining whether to save the current status information.
  • the processing of the message that is, the execution of the instruction is still continuing, and the current state information of the saved message processing does not affect the execution of the remaining instructions, and the subsequent message.
  • the processing and the saving of the current state information may be performed synchronously, so that the efficiency of message processing can be ensured to the greatest extent, and the purpose of fault detection can be achieved at the same time.
  • the micro-engine in the network processor is a direct unit for processing the message.
  • the processing of each instruction of the message is usually performed in the micro-engine; the micro-engine is responsible for modifying and editing various messages, and forwarding the service entry. Access and processing operations, the processing of the message is completed through a series of instruction operations.
  • the fault location personnel can according to the cached message state information.
  • the analysis is performed to obtain the analysis result, so that the fault locating personnel can analyze the processing status of the message.
  • the fault location efficiency can be effectively improved without adding additional equipment, not knowing the packet feature value, and not affecting normal service forwarding.
  • This embodiment provides a packet processing apparatus. Referring to FIG. 2, the method includes:
  • the flag setting module 11 is configured to set a copy mark in the message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark;
  • the instruction execution module 12 is configured to execute each instruction to process the message
  • the saving module 13 is configured to save the current state information processed according to the message descriptor message corresponding to the message when the specified instruction is executed.
  • the processing of the message is realized by executing the corresponding respective instructions; the processing of the message is the process of executing each instruction.
  • message parsing, forwarding entry lookup, message edit modification, and other instructions are all part of the message processing process.
  • Setting the copy mark in the message descriptor corresponding to the message means that the current state information of the processing of the message needs to be saved, and the timing of saving is to specify the position of an instruction in each executed instruction, and execute When the instruction is reached, the current status information of the processing can be saved.
  • Specifying an instruction is arbitrary. It can be specified by human or by the characteristics of the instruction. If there is an instruction to extract the message, it is more reasonable to set the copy mark at this instruction.
  • the copy mark and the specified instruction do not necessarily have to be related before setting the copy mark in the message descriptor. However, after the copy mark is set in the message descriptor, the corresponding instruction corresponding to the copy mark is also determined.
  • the relationship may be determined by setting, or may be determined according to the characteristics of the processed message.
  • the copy tag is set in the message descriptor.
  • the message descriptor is an overview of the content of the message, or a silhouette.
  • the size of the message descriptor is much smaller than the message, but it can be roughly reflected.
  • the contents of the message, including the processing logic of the message, can be obtained from the message descriptor.
  • the message is processed in the network processor, and the message descriptor is carried when each message is processed in the network processor, and the copy mark in the message descriptor is used as a copy of the message. logo.
  • Each instruction in the message can be executed sequentially; the so-called sequential execution is to execute each instruction according to a preset execution logic, and the preset logic can be a system preset or an artificial setting.
  • the number of instructions of a message is often many, and the purpose of executing each instruction is not the same.
  • the copy mark is often set at the instruction as the message extraction.
  • the specified message fetching instruction is the instruction logic responsible for the normal processing of the message, and is not specifically used to extract the message. In the process of executing each instruction, the previously executed instruction often affects the executed instruction. On the other hand, there is generally no relationship between the unexecuted instruction and the status of the message.
  • the difference between the preceding and the last is not necessarily the relationship of the order execution that is initially set.
  • a jump may occur, that is, the execution in the preset order should be performed later.
  • the instruction may also be a previously executed instruction because of a jump, that is, the order of the previous execution and the subsequent execution depends on the actual execution.
  • the instruction specified by the copy mark is executed during the execution of the instruction.
  • the specified instruction When the specified instruction is executed, it indicates that the status of the message is to be analyzed at this time.
  • the saving module 13 needs to process the message.
  • the current status information is saved. In fact, the status information of the message processing is only related to the executed instruction.
  • the unexecuted command does not affect the status of the message processing.
  • the current status information may include the processing information of the packet header according to the analysis requirements. At least one of the register information and the message buffer may be multiple, and may also have other unmentioned information to serve the state analysis of the message.
  • the processing information of the packet header reflects the change of the message content after the message processing, including the addition, deletion and replacement of the message;
  • the register information is the state information of the register for saving the message, such as the capacity, the access rate and the like.
  • the message cache is the cached content of the packet in the process of processing the packet, which is generally the cached content of the entire packet, and can detect whether the cached device is faulty, whether the cached packet content has a problem or the like.
  • the setting module 15 is further configured to: set the copy flag before saving the current state information of the message processing.
  • the set operation corresponds to the reset operation, and the copy mark is considered to be active if set.
  • the copy mark can be activated, and if it is not activated, the current status information can be saved.
  • the save in this embodiment can be cached, and the cache refers to the buffer of data exchange.
  • the cache is characterized by fast running speed and much faster than memory, which is more efficient than direct storage.
  • the feature of the cache is that it is only used to cache the status information of the currently specified extraction, that is, the current status information is cached this time. If a new copy mark is specified again, the new status information will be overwritten. Status information cached in the cache.
  • the request receiving module 14 is further configured to receive the copy request from the user and then set the copy flag; at this time, it is considered that the message needs to be saved, and then the specified instruction is executed.
  • the current status information of the message processing is saved.
  • the copy mark can be made to correspond to a plurality of specified instructions; the execution of each execution is performed sequentially, then, If you do not need to save the current state information for this time before executing a specified instruction, you do not need to set the copy flag. In other words, when you need to save the current state information, you can copy the flag. With the set, the processing method is flexible and can achieve good results.
  • the saved current state information can be obtained, and then the current state information is analyzed to obtain an analysis result.
  • the analysis process is based on the current state information of the saved message header processing information, register information, message buffer, etc.; specifically, the current state information can be presented through the human-computer interaction interface, and the human-computer interaction interface can pass
  • the network management platform telnet is logged in to the corresponding network device.
  • the content of the diagnosis may be whether the current extracted message is abnormal, whether the processing logic has a problem, whether the current state of the register and the storage space is correct, and the like.
  • the compiling module 16 may be further configured to compile each instruction before executing each instruction, and generate a serial number corresponding to each instruction after compiling; among all the instructions of the message, the serial number corresponding to each instruction and Other instructions are different, so you can quickly and directly locate the specified instruction without error.
  • the sequence determining module 17 is further configured to: after compiling each instruction to generate a corresponding serial number, determine a serial number corresponding to the specified instruction, and determine whether to execute the specified instruction according to the serial number; After the serial number of the corresponding specified instruction, the execution of the instruction may be determined according to the serial number, that is, whether the specified instruction is executed according to the serial number, thereby further determining whether to save the current status information.
  • the processing of the message that is, the execution of the instruction is still continuing, that is, the instruction execution module 12 is further configured to continue while saving the current state information of the message processing.
  • Executing instructions to process the message; saving the current state information of the message processing does not affect the execution of the remaining instructions, and the subsequent processing of the message and the saving of the current state information may be performed synchronously, so that the maximum degree is The efficiency of packet processing is guaranteed, and the purpose of fault detection can be achieved at the same time.
  • the micro-engine in the network processor is a direct unit for processing the message.
  • the processing of each instruction of the message is usually performed in the micro-engine; the micro-engine is responsible for modifying and editing various messages, and forwarding the service entry. Access and processing operations, the processing of the message is completed through a series of instruction operations.
  • the fault location personnel can according to the cached message state information.
  • the analysis is performed to obtain the analysis result, so that the fault locating personnel can analyze the processing status of the message.
  • the fault location efficiency can be effectively improved without adding additional equipment, not knowing the packet feature value, and not affecting normal service forwarding.
  • This embodiment provides a packet processing method. Referring to FIG. 3, the method includes:
  • Step S201 The message enters the network processor for processing.
  • the processing of the message in the network processor is completed through a series of instruction operations, such as message parsing, forwarding entry search, message editing and modification, etc., and these instructions are in the micro-engine of the network processor.
  • the middle is executed sequentially, and the instructions are compiled by the compiler to generate an internal serial number, and the serial number of each instruction is unique.
  • Step S202 Setting a copy mark in the message descriptor may include: finding a position of the message extraction instruction at the compiled serial number according to the location of the message extraction instruction specified by the user, and reporting the message in the message descriptor The text copy flag is set.
  • each instruction is compiled by the compiler to generate a unique serial number.
  • the instruction is usually a message extraction instruction, and the corresponding serial number is determined by the instruction;
  • the message is executed to the instruction, it is executed to the corresponding
  • the copy flag in the message descriptor corresponding to the message is set. Set is understood to be active, ie the copy mark in the message descriptor is rendered active, corresponding to the reset.
  • Step S203 determining whether the copy flag in the message descriptor is set, if set, copying and saving the current state information of the message processing in a physical cache for subsequent analysis and processing, and the original message is still Continue processing normally in the microengine; if not set, only the original message is processed.
  • the copying and saving of the current state information of the message processing do not affect the forwarding of the original packet, that is, the original message will not be The business process has any influence.
  • the processing of the message that is, the execution of the instruction continues, and the two do not affect each other.
  • Step S204 Copying and saving current state information may include: when fault location and analysis are needed, obtaining current state information of the copy and save from the physical cache, and presenting the current state information through the human-machine interaction interface.
  • the physical cache is usually a small piece of special storage space allocated in memory on the micro engine, and is only used to cache current state information of the currently specified extraction. If a new message extraction location is specified again, the new current state information will be overwritten with the current state information stored in the previous cache.
  • the human-computer interaction interface can be obtained by remotely logging in to the corresponding network device through the network management platform telnet.
  • Step S205 Acquire saved current state information.
  • Step S206 analyzing the current state information, including: the fault locating personnel performs diagnosis according to the obtained packet processing information, determines whether the currently extracted packet is abnormal, whether the microengine processing logic has a problem, whether the current state of the register and the storage space is correct. Wait.
  • This embodiment provides a packet processing system. Referring to FIG. 4, the method includes:
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the message processing method provided by any one of the foregoing embodiments; 1. At least one of the methods shown in Figures 2 and 4.
  • the computer storage medium may be various types of storage media, specifically: an optical disk, a magnetic tape, a hard disk, a random storage medium, a read-only storage medium, or a flash memory; and the like may be a non-transitory storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)

Abstract

Embodiments of the present invention provide a packet processing method, device and system, the method comprising: setting a copy mark in a packet descriptor corresponding to a packet; then executing instructions to process the packet; storing current state information of packet processing according to the copy mark when a specified instruction is executed; and continuing executing the instructions while storing to process the packet. The embodiments of the present invention also provide a computer storage medium.

Description

报文处理方法、装置及系统和计算机存储介质Message processing method, device and system, and computer storage medium 技术领域Technical field
本发明涉及网络交换技术,特别涉及一种报文处理方法、装置、系统和计算机存储介质。The present invention relates to network switching technologies, and in particular, to a message processing method, apparatus, system, and computer storage medium.
背景技术Background technique
随着互联网的发展,网络设备承载的业务越来越繁杂,对网络故障的定位和业务恢复的速度要求也越来越高,如何对网络设备中遇到的各种问题做到快速分析和解决,显得尤为重要。网络设备目前大多支持报文提取来进行故障定位,主要有以下几种方法:With the development of the Internet, the services carried by network devices are more and more complicated, and the requirements for network fault location and service recovery speed are getting higher and higher. How to quickly analyze and solve various problems encountered in network devices It is especially important. Most network devices currently support packet extraction for fault location. The main methods are as follows:
方法一、需要外接测试仪,对设备的故障业务端口采取镜像的方式进行报文提取分析。然而在很多情况在网络设备运行的地方,不能及时提供测试仪等抓包设备。Method 1: An external tester is needed to perform packet extraction and analysis on the faulty service port of the device. However, in many cases, where the network device is running, the capture device such as the tester cannot be provided in time.
方法二、根据报文的特征值如MAC(Media Access Control,媒体访问控制)、IP(Internet Protocol,网络之间互连的协议)、UDP_PORT(User Datagram Protocol PORT,用户数据报协议端口)等二三层信息,通过设置转发条目或配置ACL(Access Control List,访问控制列表)规则来提取。但对于一些异常场景无法预估过来的报文的这些特征值,而且只能在报文做完所有流程处理后才能获取,不能得到报文在网络处理器中的实时处理情况,只能根据处理后的信息反推,影响故障定位效率。Method 2: According to the characteristic values of the packet, such as MAC (Media Access Control), IP (Internet Protocol, protocol inter-network interconnection), UDP_PORT (User Datagram Protocol PORT, user datagram protocol port), etc. Layer 3 information is extracted by setting forwarding entries or configuring ACL (Access Control List) rules. However, these eigenvalues of the packets that cannot be predicted by some abnormal scenarios can only be obtained after all the processes of the packets are processed. The real-time processing of the packets in the network processor cannot be obtained. After the information is reversed, it affects the efficiency of fault location.
方法三、通过执行程序中增加断点的方式,当有报文处理到对应的某个断点的位置,就将所有的程序运行终止并提取报文,但这种方式仅限于测试时,不能在实际现网中得到应用,否则会引起业务中断等严重后果。 Method 3: By adding a breakpoint in the execution program, when a message is processed to a corresponding breakpoint location, all the programs are terminated and the message is extracted, but this method is limited to the test, and cannot be It is applied in the actual live network, otherwise it will cause serious consequences such as business interruption.
发明内容Summary of the invention
本发明实施例提供了一种报文处理方法、装置、系统和计算机存储介质,期望解决了现有技术在对报文处理的故障定位中对外接测试设备的依赖,以及效率低的问题。The embodiments of the present invention provide a packet processing method, device, system, and computer storage medium, and are expected to solve the problem of the external technology of the test device in the failure location of the packet processing, and the low efficiency.
本发明提供了种报文处理方法,包括:The present invention provides a packet processing method, including:
在与报文对应的报文描述符中设置复制标记,并确定与所述复制标记对应的指定指令;Setting a copy mark in the message descriptor corresponding to the message, and determining a specified instruction corresponding to the copy mark;
执行各个指令,对所述报文进行处理;Execute each instruction to process the message;
当执行到所述指定指令时,根据所述报文对应的报文描述符对所述报文处理的当前状态信息进行保存。When the specified instruction is executed, the current state information of the message processing is saved according to the message descriptor corresponding to the message.
本发明实施例还提供了一种报文处理装置,包括:The embodiment of the invention further provides a message processing device, including:
标记设置模块,配置为在于报文对应的报文描述符中设置复制标记,并确定与所述复制标记对应的指定指令;a mark setting module configured to set a copy mark in a message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark;
指令执行模块,配置为执行各个指令,对所述报文进行处理;An instruction execution module configured to execute each instruction to process the message;
保存模块,配置为当执行到指定指令时,根据所述报文对应的报文描述符对所述报文处理的当前状态信息进行保存。The saving module is configured to save the current state information of the packet processing according to the message descriptor corresponding to the packet when the specified instruction is executed.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述报文处理方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing message processing method.
本发明提供了一种报文处理方法、装置、系统和计算机存储介质,在与报文对应的报文描述符中设置复制标记,然后执行指令,对报文进行处理,在执行到指定指令时,根据复制标记对报文处理的当前状态信息进行保存,有效的减少了对其他外接测试装备的依赖,且保证了报文处理的效率。 The present invention provides a message processing method, apparatus, system and computer storage medium, which sets a copy mark in a message descriptor corresponding to a message, and then executes an instruction to process the message, when executing the specified instruction The current state information of the message processing is saved according to the copy mark, which effectively reduces the dependence on other external test equipment and ensures the efficiency of message processing.
附图说明DRAWINGS
图1是本发明一实施例提供的报文处理方法的流程图;1 is a flowchart of a packet processing method according to an embodiment of the present invention;
图2是本发明一实施例提供的报文处理装置的模块示意图;2 is a schematic block diagram of a message processing apparatus according to an embodiment of the present invention;
图3是本发明一实施例提供的报文处理方法的流程图;FIG. 3 is a flowchart of a packet processing method according to an embodiment of the present invention;
图4是本发明一实施例提供的报文处理系统的模块示意图。FIG. 4 is a schematic block diagram of a message processing system according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供的技术方案中,在报文的指定指令的位置设置复制标记,当执行到该指令时,就将报文处理的当前状态信息进行缓存,然后在对缓存的当前状态信息进行分析,得出分析结果,从而提升了故障定位的效率,同时也减少了对其他故障定位设备的依赖和对报文的正常执行的影响。下面结合附图对本发明的各个实施方式作进一步说明,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。In the technical solution provided by the embodiment of the present invention, a copy mark is set at a position of a specified instruction of a message, and when the instruction is executed, the current state information of the message processing is cached, and then the current state information of the cache is performed. Analysis and analysis results are obtained, which improves the efficiency of fault location, and also reduces the dependence on other fault location equipment and the impact on the normal execution of the message. The embodiments of the present invention are further described in the following with reference to the accompanying drawings.
第一实施例First embodiment
本实施例提供了一种报文处理方法,请参考图1,包括:This embodiment provides a packet processing method. Referring to FIG. 1, the method includes:
S101、在与报文对应的报文描述符中设置复制标记,并确定与复制标记对应的指定指令;S101. Set a copy mark in a message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark;
S102、执行各个指令,对报文进行处理;S102. Execute each instruction to process the packet.
S103、当执行到指定指令时,根据报文对应的报文描述符对报文处理的当前状态信息进行保存。S103. When executing the specified instruction, save the current state information of the packet processing according to the message descriptor corresponding to the message.
报文的处理是通过执行对应的各个指令实现的;报文的处理过程,就是执行各个指令的过程。例如,报文解析、转发表项查找、报文编辑修改等指令都是报文处理过程的组成部分。在与报文对应的报文描述符中设置 复制标记,就是表明这个报文的处理的当前状态信息需要进行保存,而保存的时机就是在各个执行的指令中,指定一个指令的位置,在执行到该指令时,就可以对处理的当前状态信息进行保存。指定一个指令是任意的,可以由人为指定,也可以由指令的特性指定,如若存在提取报文的指令,那么在这个指令处设置复制标记就比较合理。复制标记和指定指令在设置报文描述符中的复制标记之前并不一定有关系,但在报文描述符中设置复制标记之后,相应的,复制标记对应的指定指令也就确定了,这个对应关系可以是认为设定,也可以是根据处理报文的特性而确定。The processing of the message is realized by executing the corresponding respective instructions; the processing of the message is the process of executing each instruction. For example, message parsing, forwarding entry lookup, message edit modification, and other instructions are all part of the message processing process. Set in the message descriptor corresponding to the message Copying the mark means that the current state information of the processing of the message needs to be saved, and the timing of saving is to specify the position of an instruction in each executed instruction, and the current state of the processing can be performed when the instruction is executed. The information is saved. Specifying an instruction is arbitrary, can be specified by humans, or can be specified by the characteristics of the instruction. If there is an instruction to extract the message, it is more reasonable to set the copy mark at this instruction. The copy mark and the specified instruction do not necessarily have to be related before setting the copy mark in the message descriptor. However, after the copy mark is set in the message descriptor, the corresponding instruction corresponding to the copy mark is also determined. The relationship may be determined by setting, or may be determined according to the characteristics of the processed message.
复制标记设置在报文描述符内,报文描述符是对报文的内容的一个概述,或者说是一个剪影,报文描述符的大小与报文相比数据量会小很多,但是其能够大致反映报文的内容,包括报文的处理逻辑等信息都可以从报文描述符中得到。报文是在网络处理器中进行处理的,而报文描述符是每一个报文在网络处理器中处理时都会携带的,报文描述符中的复制标记,作为是否对报文进行复制的标识。The copy tag is set in the message descriptor. The message descriptor is an overview of the content of the message, or a silhouette. The size of the message descriptor is much smaller than the message size, but it can The content of the message is roughly reflected, and information such as the processing logic of the message can be obtained from the message descriptor. The message is processed in the network processor, and the message descriptor is carried when each message is processed in the network processor, and the copy mark in the message descriptor is used as a copy of the message. Logo.
报文中的各个指令可以是顺序执行的;所谓顺序执行,就是按照一个预设的执行逻辑来执行各个指令,这个预设的逻辑可以是系统预设,也可以是人为设定。报文的指令数量往往很多,执行各个指令的目的也不尽相同,而在本实施例中,复制标记往往设置在作为报文提取的指令处。需要注意的是,指定的报文提取指令是负责报文正常处理的指令逻辑,并非专门用来提取报文的作用。而在执行各个指令的过程中,在先执行的指令往往会对在后执行的指令产生影响,另一方面,未执行的指令和报文的状态之间一般是没有关系的。在先和在后的区别,不一定是一开始设定的顺序执行的关系,在指令执行的过程中也可能出现跳转的情况,即按照预设的顺序执行的本来应该是在后执行的指令,也可能因为跳转而变为在先执行的指令,也就是说,在先和在后由实际执行的顺序而定。 Each instruction in the message can be executed sequentially; the so-called sequential execution is to execute each instruction according to a preset execution logic, and the preset logic can be a system preset or an artificial setting. The number of instructions of a message is often many, and the purpose of executing each instruction is not the same. In the present embodiment, the copy mark is often set at the instruction as the message extraction. It should be noted that the specified message fetching instruction is the instruction logic responsible for the normal processing of the message, and is not specifically used to extract the message. In the process of executing each instruction, the previously executed instruction often affects the executed instruction. On the other hand, there is generally no relationship between the unexecuted instruction and the status of the message. The difference between the preceding and the last is not necessarily the relationship of the order execution that is initially set. In the process of executing the instruction, a jump may occur, that is, the execution in the preset order should be performed later. The instruction may also be a previously executed instruction because of a jump, that is, the order of the previous execution and the subsequent execution depends on the actual execution.
在指定指令设置复制标记后,执行指令的过程中,会执行到复制标记所指定的那个指令。在执行到该指定指令时,说明要对此时的报文状态进行分析,为了对此时的报文状态进行分析,就需要对报文处理的当前状态信息进行保存。事实上报文处理的状态信息只与执行过的指令有关,还未执行的指令并不会影响报文处理的状态;当前状态信息根据分析的需求的不同,可以包括报文头的处理信息、寄存器信息、报文缓存中的至少一种,可以有多种,还可以有其他未提及的信息,服务于对报文的状态分析。报文头的处理信息,体现了报文处理后报文内容的变化,包括报文的增删与替换等;寄存器信息则是保存报文的寄存器的状态信息,如容量,存取速率等参数均可以包括;报文缓存则是在处理报文的过程中对报文的缓存内容,一般是整个报文的缓存内容,可以检测缓存的设备是否故障,缓存的报文内容是否有问题等。After the specified instruction sets the copy mark, the instruction specified by the copy mark is executed during the execution of the instruction. When the specified instruction is executed, the status of the message at this time is analyzed. In order to analyze the status of the message at this time, the current status information of the message processing needs to be saved. In fact, the status information of the message processing is only related to the executed instruction. The unexecuted command does not affect the status of the message processing. The current status information may include the processing information of the packet header according to the analysis requirements. At least one of the register information and the message buffer may be multiple, and may also have other unmentioned information to serve the state analysis of the message. The processing information of the packet header reflects the change of the message content after the message processing, including the addition, deletion and replacement of the message; the register information is the state information of the register for saving the message, such as the capacity, the access rate and the like. The message cache is the cached content of the packet in the process of processing the packet, which is generally the cached content of the entire packet, and can detect whether the cached device is faulty, whether the cached packet content has a problem or the like.
在执行到指定指令之前,还可以对复制标记进行置位。置位操作与复位操作对应,在置位的前提下,认为复制标记是激活的。在报文的指定指令的位置设置复制标记时,复制标记可以被激活,如果未被激活的话,就可以不对当前状态信息进行保存。本实施例中的保存可选的,可以为缓存,而缓存指的是数据交换的缓冲区,缓存的特点是运行速度快,比内存快得多,这比直接进行保存效率更高。而缓存的特点是,仅用来缓存当前指定提取的状态信息,也就是说,此次会将当前状态信息进行缓存,若再次指定一个新的复制标记,那么,新的状态信息就会覆盖之前缓存中所缓存的状态信息。The copy flag can also be set before executing the specified instruction. The set operation corresponds to the reset operation, and the copy mark is considered to be active if set. When the copy mark is set at the position of the specified instruction of the message, the copy mark can be activated, and if it is not activated, the current status information can be saved. The save in this embodiment can be cached, and the cache refers to the buffer of data exchange. The cache is characterized by fast running speed and much faster than memory, which is more efficient than direct storage. The feature of the cache is that it is only used to cache the status information of the currently specified extraction, that is, the current status information is cached this time. If a new copy mark is specified again, the new status information will be overwritten. Status information cached in the cache.
由于并不是每一个报文的处理都需要进行当前状态信息的保存,进一步的,同一个报文的处理过程中也不一定只有一次当前状态信息的保存,因此,在需要对报文的当前状态信息进行保存的时候,那么,就接收来自用户的复制请求,然后对复制标记进行置位;此时就认为需要对报文进行 保存,然后就在执行到指定指令时,对报文处理的当前状态信息进行保存。此外,在报文描述符中设置复制标记时,可以使该复制标记对应多个指定指令;各个执行的执行是顺序进行的,那么,在执行到一个指定指令之前,若不需要对此时的当前状态信息进行保存,那么,就不需要对复制标记进行置位,换言之,在需要对当前状态信息进行保存的时候,再对复制标记进行置位,这样的处理方法比较灵活,能够达到很好的效果。Since the processing of the current state information is not required for the processing of each packet, further, the processing of the same packet does not necessarily have to save the current state information once. Therefore, the current state of the packet needs to be saved. When the information is saved, then the copy request from the user is received, and then the copy mark is set; at this point, it is considered that the message needs to be performed. Save, and then save the current state information of the message processing when the specified instruction is executed. In addition, when the copy mark is set in the message descriptor, the copy mark can be made to correspond to a plurality of specified instructions; the execution of each execution is performed sequentially, then, before executing to a specified instruction, if it is not required If the current state information is saved, then it is not necessary to set the copy flag. In other words, when the current state information needs to be saved, the copy flag is set. This processing method is flexible and can be achieved very well. Effect.
在对当前状态信息进行保存后,就可以获取该保存的当前状态信息,然后对该当前状态信息进行分析;分析的过程就是根据保存的报文头的处理信息、寄存器信息、报文缓存等等当前状态信息进行诊断;具体的,可以通过人机交互界面呈现出当前状态信息,而人机交互界面可以通过网管平台telnet(远程终端协议)登录到对应的网络设备获得。诊断的内容,可以是判断当前提取的报文是否异常、处理逻辑是否存在问题、寄存器和存储空间当前状态是否正确等等。After saving the current state information, the saved current state information can be obtained, and then the current state information is analyzed; the analysis process is based on the saved message header processing information, register information, message buffer, and the like. The current state information is diagnosed; specifically, the current state information can be presented through the human-machine interaction interface, and the human-computer interaction interface can be obtained by logging in to the corresponding network device through the network management platform telnet (remote terminal protocol). The content of the diagnosis may be whether the current extracted message is abnormal, whether the processing logic has a problem, whether the current state of the register and the storage space is correct, and the like.
此外,在执行各个指令之前,还可以对各个指令进行编译,编译后生成与各个指令对应的序列号;报文的所有指令中,每一个指令所对应的序列号和其他指令均不同,这样可以直接快速的定位到指定的指令而不会出错。在对各个指令进行编译生成对应的序列号之后,由于复制标记和指定指令是对应的,那么就可以据此确定对应的序列号。In addition, before executing each instruction, each instruction can be compiled, and the serial number corresponding to each instruction is generated after compilation; among all the instructions of the message, the serial number and other instructions corresponding to each instruction are different, so that Directly and quickly locate the specified instruction without error. After compiling each instruction to generate a corresponding serial number, since the copy mark and the specified instruction are corresponding, the corresponding serial number can be determined accordingly.
在确定复制标记对应的指定指令的序列号之后,指令的执行就可以根据序列号来确定,即根据序列号确定是否执行到指定指令,从而进一步确定是否对当前状态信息进行保存。After determining the serial number of the specified instruction corresponding to the copy mark, the execution of the instruction may be determined according to the serial number, that is, determining whether to execute the specified instruction according to the serial number, thereby further determining whether to save the current status information.
在对报文处理的当前状态信息进行保存时,对报文的处理,即指令的执行仍然在继续进行,保存报文处理的当前状态信息并不影响剩下的指令的执行,之后的报文的处理和当前状态信息的保存可以是同步进行的,这样可以最大程度的保证报文处理的效率,且同时可以实现故障检测的目的。 When the current state information of the message processing is saved, the processing of the message, that is, the execution of the instruction is still continuing, and the current state information of the saved message processing does not affect the execution of the remaining instructions, and the subsequent message. The processing and the saving of the current state information may be performed synchronously, so that the efficiency of message processing can be ensured to the greatest extent, and the purpose of fault detection can be achieved at the same time.
网络处理器中的微引擎是对报文进行处理的直接单元,报文的各个指令的处理通常是在微引擎中进行的;微引擎负责各种报文的修改和编辑、业务转发表项的访问和处理等操作,对报文的处理时通过一系列的指令操作完成的。The micro-engine in the network processor is a direct unit for processing the message. The processing of each instruction of the message is usually performed in the micro-engine; the micro-engine is responsible for modifying and editing various messages, and forwarding the service entry. Access and processing operations, the processing of the message is completed through a series of instruction operations.
本实施例通过在当前处理的报文中的指定指令的位置设置复制标记,在执行到该指令时,对报文的当前状态信息进行缓存,故障定位人员就可以根据该缓存的报文状态信息进行分析,得出分析结果,从而便于故障定位人员对报文的处理状态进行分析。显然,本实施例可以在不增加额外设备、不了解报文特征值、不影响正常业务转发的前提下,有效提高故障定位效率。In this embodiment, by setting a copy mark in the position of the specified instruction in the currently processed message, when the instruction is executed, the current state information of the message is cached, and the fault location personnel can according to the cached message state information. The analysis is performed to obtain the analysis result, so that the fault locating personnel can analyze the processing status of the message. Obviously, in this embodiment, the fault location efficiency can be effectively improved without adding additional equipment, not knowing the packet feature value, and not affecting normal service forwarding.
第二实施例Second embodiment
本实施例提供了一种报文处理装置,请参考图2,包括:This embodiment provides a packet processing apparatus. Referring to FIG. 2, the method includes:
标记设置模块11,配置为在于报文对应的报文描述符中设置复制标记,并确定与复制标记对应的指定指令;The flag setting module 11 is configured to set a copy mark in the message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark;
指令执行模块12,配置为执行各个指令,对报文进行处理;The instruction execution module 12 is configured to execute each instruction to process the message;
保存模块13,配置为当执行到指定指令时,对根据报文对应的报文描述符报文处理的当前状态信息进行保存。The saving module 13 is configured to save the current state information processed according to the message descriptor message corresponding to the message when the specified instruction is executed.
报文的处理是通过执行对应的各个指令实现的;报文的处理过程,就是执行各个指令的过程。例如,报文解析、转发表项查找、报文编辑修改等指令都是报文处理过程的组成部分。在与报文对应的报文描述符中设置复制标记,就是表明这个报文的处理的当前状态信息需要进行保存,而保存的时机就是在各个执行的指令中,指定一个指令的位置,在执行到该指令时,就可以对处理的当前状态信息进行保存。指定一个指令是任意的, 可以由人为指定,也可以由指令的特性指定,如若存在提取报文的指令,那么在这个指令处设置复制标记就比较合理。复制标记和指定指令在设置报文描述符中的复制标记之前并不一定有关系,但在报文描述符中设置复制标记之后,相应的,复制标记对应的指定指令也就确定了,这个对应关系可以是认为设定,也可以是根据处理报文的特性而确定。The processing of the message is realized by executing the corresponding respective instructions; the processing of the message is the process of executing each instruction. For example, message parsing, forwarding entry lookup, message edit modification, and other instructions are all part of the message processing process. Setting the copy mark in the message descriptor corresponding to the message means that the current state information of the processing of the message needs to be saved, and the timing of saving is to specify the position of an instruction in each executed instruction, and execute When the instruction is reached, the current status information of the processing can be saved. Specifying an instruction is arbitrary. It can be specified by human or by the characteristics of the instruction. If there is an instruction to extract the message, it is more reasonable to set the copy mark at this instruction. The copy mark and the specified instruction do not necessarily have to be related before setting the copy mark in the message descriptor. However, after the copy mark is set in the message descriptor, the corresponding instruction corresponding to the copy mark is also determined. The relationship may be determined by setting, or may be determined according to the characteristics of the processed message.
复制标记设置在报文描述符内,报文描述符是对报文的内容的一个概述,或者说是一个剪影,报文描述符的大小与报文相比会小很多,但是其能够大致反映报文的内容,包括报文的处理逻辑等信息都可以从报文描述符中得到。报文是在网络处理器中进行处理的,而报文描述符是每一个报文在网络处理器中处理时都会携带的,报文描述符中的复制标记,作为是否对报文进行复制的标识。The copy tag is set in the message descriptor. The message descriptor is an overview of the content of the message, or a silhouette. The size of the message descriptor is much smaller than the message, but it can be roughly reflected. The contents of the message, including the processing logic of the message, can be obtained from the message descriptor. The message is processed in the network processor, and the message descriptor is carried when each message is processed in the network processor, and the copy mark in the message descriptor is used as a copy of the message. Logo.
报文中的各个指令可以是顺序执行的;所谓顺序执行,就是按照一个预设的执行逻辑来执行各个指令,这个预设的逻辑可以是系统预设,也可以是人为设定。报文的指令数量往往很多,执行各个指令的目的也不尽相同,而在本实施例中,复制标记往往设置在作为报文提取的指令处。需要注意的是,指定的报文提取指令是负责报文正常处理的指令逻辑,并非专门用来提取报文的作用。而在执行各个指令的过程中,在先执行的指令往往会对在后执行的指令产生影响,另一方面,未执行的指令和报文的状态之间一般是没有关系的。在先和在后的区别,不一定是一开始设定的顺序执行的关系,在指令执行的过程中也可能出现跳转的情况,即按照预设的顺序执行的本来应该是在后执行的指令,也可能因为跳转而变为在先执行的指令,也就是说,在先和在后由实际执行的顺序而定。Each instruction in the message can be executed sequentially; the so-called sequential execution is to execute each instruction according to a preset execution logic, and the preset logic can be a system preset or an artificial setting. The number of instructions of a message is often many, and the purpose of executing each instruction is not the same. In the present embodiment, the copy mark is often set at the instruction as the message extraction. It should be noted that the specified message fetching instruction is the instruction logic responsible for the normal processing of the message, and is not specifically used to extract the message. In the process of executing each instruction, the previously executed instruction often affects the executed instruction. On the other hand, there is generally no relationship between the unexecuted instruction and the status of the message. The difference between the preceding and the last is not necessarily the relationship of the order execution that is initially set. In the process of executing the instruction, a jump may occur, that is, the execution in the preset order should be performed later. The instruction may also be a previously executed instruction because of a jump, that is, the order of the previous execution and the subsequent execution depends on the actual execution.
在指定指令设置复制标记后,执行指令的过程中,会执行到复制标记所指定的那个指令。在执行到该指定指令时,说明要对此时的报文状态进行分析,为了对此时的报文状态进行分析,就需要保存模块13对报文处理 的当前状态信息进行保存。事实上报文处理的状态信息只与执行过的指令有关,还未执行的指令并不会影响报文处理的状态;当前状态信息根据分析的需求的不同,可以包括报文头的处理信息、寄存器信息、报文缓存中的至少一种,可以有多种,还可以有其他未提及的信息,服务于对报文的状态分析。报文头的处理信息,体现了报文处理后报文内容的变化,包括报文的增删与替换等;寄存器信息则是保存报文的寄存器的状态信息,如容量,存取速率等参数均可以包括;报文缓存则是在处理报文的过程中对报文的缓存内容,一般是整个报文的缓存内容,可以检测缓存的设备是否故障,缓存的报文内容是否有问题等。After the specified instruction sets the copy mark, the instruction specified by the copy mark is executed during the execution of the instruction. When the specified instruction is executed, it indicates that the status of the message is to be analyzed at this time. In order to analyze the status of the message at this time, the saving module 13 needs to process the message. The current status information is saved. In fact, the status information of the message processing is only related to the executed instruction. The unexecuted command does not affect the status of the message processing. The current status information may include the processing information of the packet header according to the analysis requirements. At least one of the register information and the message buffer may be multiple, and may also have other unmentioned information to serve the state analysis of the message. The processing information of the packet header reflects the change of the message content after the message processing, including the addition, deletion and replacement of the message; the register information is the state information of the register for saving the message, such as the capacity, the access rate and the like. The message cache is the cached content of the packet in the process of processing the packet, which is generally the cached content of the entire packet, and can detect whether the cached device is faulty, whether the cached packet content has a problem or the like.
可选的,还包括置位模块15,配置为在对报文处理的当前状态信息进行保存之前,对复制标记进行置位。置位操作与复位操作对应,在置位的前提下,认为复制标记是激活的。在报文的指定指令的位置设置复制标记时,复制标记可以被激活,如果未被激活的话,就可以不对当前状态信息进行保存。本实施例中的保存可选的,可以为缓存,而缓存指的是数据交换的缓冲区,缓存的特点是运行速度快,比内存快得多,这比直接进行保存效率更高。而缓存的特点是,仅用来缓存当前指定提取的状态信息,也就是说,此次会将当前状态信息进行缓存,若再次指定一个新的复制标记,那么,新的状态信息就会覆盖之前缓存中所缓存的状态信息。Optionally, the setting module 15 is further configured to: set the copy flag before saving the current state information of the message processing. The set operation corresponds to the reset operation, and the copy mark is considered to be active if set. When the copy mark is set at the position of the specified instruction of the message, the copy mark can be activated, and if it is not activated, the current status information can be saved. The save in this embodiment can be cached, and the cache refers to the buffer of data exchange. The cache is characterized by fast running speed and much faster than memory, which is more efficient than direct storage. The feature of the cache is that it is only used to cache the status information of the currently specified extraction, that is, the current status information is cached this time. If a new copy mark is specified again, the new status information will be overwritten. Status information cached in the cache.
由于并不是每一个报文的处理都需要进行当前状态信息的保存,进一步的,同一个报文的处理过程中也不一定只有一次当前状态信息的保存,因此,在需要对报文的当前状态信息进行保存的时候,那么,还包括请求接收模块14,配置为接收来自用户的复制请求,然后对复制标记进行置位;此时就认为需要对报文进行保存,然后就在执行到指定指令时,对报文处理的当前状态信息进行保存。此外,在报文描述符中设置复制标记时,可以使该复制标记对应多个指定指令;各个执行的执行是顺序进行的,那么, 在执行到一个指定指令之前,若不需要对此时的当前状态信息进行保存,那么,就不需要对复制标记进行置位,换言之,在需要对当前状态信息进行保存的时候,再对复制标记进行置位,这样的处理方法比较灵活,能够达到很好的效果。Since the processing of the current state information is not required for the processing of each packet, further, the processing of the same packet does not necessarily have to save the current state information once. Therefore, the current state of the packet needs to be saved. When the information is saved, then the request receiving module 14 is further configured to receive the copy request from the user and then set the copy flag; at this time, it is considered that the message needs to be saved, and then the specified instruction is executed. The current status information of the message processing is saved. In addition, when the copy mark is set in the message descriptor, the copy mark can be made to correspond to a plurality of specified instructions; the execution of each execution is performed sequentially, then, If you do not need to save the current state information for this time before executing a specified instruction, you do not need to set the copy flag. In other words, when you need to save the current state information, you can copy the flag. With the set, the processing method is flexible and can achieve good results.
在对当前状态信息进行保存后,就可以获取该保存的当前状态信息,然后对该当前状态信息进行分析,得出分析结果。分析的过程就是根据保存的报文头的处理信息、寄存器信息、报文缓存等等当前状态信息进行诊断;具体的,可以通过人机交互界面呈现出当前状态信息,而人机交互界面可以通过网管平台telnet登录到对应的网络设备获得。诊断的内容,可以是判断当前提取的报文是否异常、处理逻辑是否存在问题、寄存器和存储空间当前状态是否正确等等。After the current state information is saved, the saved current state information can be obtained, and then the current state information is analyzed to obtain an analysis result. The analysis process is based on the current state information of the saved message header processing information, register information, message buffer, etc.; specifically, the current state information can be presented through the human-computer interaction interface, and the human-computer interaction interface can pass The network management platform telnet is logged in to the corresponding network device. The content of the diagnosis may be whether the current extracted message is abnormal, whether the processing logic has a problem, whether the current state of the register and the storage space is correct, and the like.
此外,还可以包括编译模块16,配置为在执行各个指令之前,对各个指令进行编译,编译后生成与各个指令对应的序列号;报文的所有指令中,每一个指令所对应的序列号和其他指令均不同,这样可以直接快速的定位到指定的指令而不会出错。可选的,还包括序列确定模块17,用于在对各个指令进行编译生成对应的序列号之后,确定指定指令对应的序列号,以及,根据序列号确定是否执行到指定指令;在确定复制标记对应的指定指令的序列号之后,指令的执行就可以根据序列号来确定,即根据序列号确定是否执行到指定指令,从而进一步确定是否对当前状态信息进行保存。In addition, the compiling module 16 may be further configured to compile each instruction before executing each instruction, and generate a serial number corresponding to each instruction after compiling; among all the instructions of the message, the serial number corresponding to each instruction and Other instructions are different, so you can quickly and directly locate the specified instruction without error. Optionally, the sequence determining module 17 is further configured to: after compiling each instruction to generate a corresponding serial number, determine a serial number corresponding to the specified instruction, and determine whether to execute the specified instruction according to the serial number; After the serial number of the corresponding specified instruction, the execution of the instruction may be determined according to the serial number, that is, whether the specified instruction is executed according to the serial number, thereby further determining whether to save the current status information.
在对报文处理的当前状态信息进行保存时,对报文的处理,即指令的执行仍然在继续进行,即指令执行模块12还配置为在对报文处理的当前状态信息进行保存时,继续执行指令,对报文进行处理;保存报文处理的当前状态信息并不影响剩下的指令的执行,之后的报文的处理和当前状态信息的保存可以是同步进行的,这样可以最大程度的保证报文处理的效率,且同时可以实现故障检测的目的。 When the current state information of the message processing is saved, the processing of the message, that is, the execution of the instruction is still continuing, that is, the instruction execution module 12 is further configured to continue while saving the current state information of the message processing. Executing instructions to process the message; saving the current state information of the message processing does not affect the execution of the remaining instructions, and the subsequent processing of the message and the saving of the current state information may be performed synchronously, so that the maximum degree is The efficiency of packet processing is guaranteed, and the purpose of fault detection can be achieved at the same time.
网络处理器中的微引擎是对报文进行处理的直接单元,报文的各个指令的处理通常是在微引擎中进行的;微引擎负责各种报文的修改和编辑、业务转发表项的访问和处理等操作,对报文的处理时通过一系列的指令操作完成的。The micro-engine in the network processor is a direct unit for processing the message. The processing of each instruction of the message is usually performed in the micro-engine; the micro-engine is responsible for modifying and editing various messages, and forwarding the service entry. Access and processing operations, the processing of the message is completed through a series of instruction operations.
本实施例通过在当前处理的报文中的指定指令的位置设置复制标记,在执行到该指令时,对报文的当前状态信息进行缓存,故障定位人员就可以根据该缓存的报文状态信息进行分析,得出分析结果,从而便于故障定位人员对报文的处理状态进行分析。显然,本实施例可以在不增加额外设备、不了解报文特征值、不影响正常业务转发的前提下,有效提高故障定位效率。In this embodiment, by setting a copy mark in the position of the specified instruction in the currently processed message, when the instruction is executed, the current state information of the message is cached, and the fault location personnel can according to the cached message state information. The analysis is performed to obtain the analysis result, so that the fault locating personnel can analyze the processing status of the message. Obviously, in this embodiment, the fault location efficiency can be effectively improved without adding additional equipment, not knowing the packet feature value, and not affecting normal service forwarding.
第三实施例Third embodiment
本实施例提供了一种报文处理方法,请参考图3,包括:This embodiment provides a packet processing method. Referring to FIG. 3, the method includes:
步骤S201:报文进入网络处理器进行处理。Step S201: The message enters the network processor for processing.
需要说明的是,报文在网络处理器中的处理是通过一系列的指令操作完成的,如报文解析、转发表项查找、报文编辑修改等,且这些指令在网络处理器的微引擎中是被顺序执行的,指令经过编译器编译后会生成内部的序列号,每条指令的序列号都是唯一的。It should be noted that the processing of the message in the network processor is completed through a series of instruction operations, such as message parsing, forwarding entry search, message editing and modification, etc., and these instructions are in the micro-engine of the network processor. The middle is executed sequentially, and the instructions are compiled by the compiler to generate an internal serial number, and the serial number of each instruction is unique.
步骤S202:在报文描述符中设置复制标记,可包括:根据用户指定的报文提取指令的位置,找到该报文提取指令在编译后的序列号位置,并将报文描述符中的报文复制标记置位。Step S202: Setting a copy mark in the message descriptor may include: finding a position of the message extraction instruction at the compiled serial number according to the location of the message extraction instruction specified by the user, and reporting the message in the message descriptor The text copy flag is set.
具体而言,每一条指令经过编译器编译后都会生成一个唯一的序列号,当指定需要提取报文的处理指令时,这个指令通常是报文提取指令,通过该指令确定对应的序列号;当报文执行到条指令时,也即执行到该对应的 序列号时,将报文对应的报文描述符中的复制标记置位。置位可以理解为激活,即将报文描述符中的复制标记呈现为激活状态,与复位对应。Specifically, each instruction is compiled by the compiler to generate a unique serial number. When a processing instruction that needs to extract a message is specified, the instruction is usually a message extraction instruction, and the corresponding serial number is determined by the instruction; When the message is executed to the instruction, it is executed to the corresponding When the serial number is set, the copy flag in the message descriptor corresponding to the message is set. Set is understood to be active, ie the copy mark in the message descriptor is rendered active, corresponding to the reset.
步骤S203:判断报文描述符中的复制标记是否置位,若置位就会将报文处理的当前状态信息复制保存一份保存在物理缓存中,用于后续的分析处理,原始报文仍然继续在微引擎中正常处理;若未置位,则只对原始报文进行处理。Step S203: determining whether the copy flag in the message descriptor is set, if set, copying and saving the current state information of the message processing in a physical cache for subsequent analysis and processing, and the original message is still Continue processing normally in the microengine; if not set, only the original message is processed.
需要说明的是,对报文处理的当前状态信息的复制保存,如报文头的处理信息、寄存器状态、报文缓存信息的复制保存,不影响原始报文的转发,即不会对原有的业务处理有任何影响,在复制保存报文处理的当前状态信息时,报文的处理,即指令的执行仍在继续,二者互不影响。It should be noted that the copying and saving of the current state information of the message processing, such as the processing information of the packet header, the state of the register, and the copying and saving of the message buffering information, do not affect the forwarding of the original packet, that is, the original message will not be The business process has any influence. When copying and saving the current state information of the message processing, the processing of the message, that is, the execution of the instruction continues, and the two do not affect each other.
步骤S204:复制保存当前状态信息,可包括:当需要进行故障定位和分析时,从物理缓存中获取复制保存的当前状态信息,并通过人机交互界面呈现出该的当前状态信息。Step S204: Copying and saving current state information may include: when fault location and analysis are needed, obtaining current state information of the copy and save from the physical cache, and presenting the current state information through the human-machine interaction interface.
具体而言,物理缓存通常是微引擎上内存中分配的一小块特殊存储空间,仅用来缓存当前指定提取的当前状态信息。若再次指定一个新的报文提取位置,会将新的当前状态信息覆盖之前缓存中的存储的当前状态信息。人机交互界面,可以通过网管平台telnet远程登陆到对应的网络设备获得。Specifically, the physical cache is usually a small piece of special storage space allocated in memory on the micro engine, and is only used to cache current state information of the currently specified extraction. If a new message extraction location is specified again, the new current state information will be overwritten with the current state information stored in the previous cache. The human-computer interaction interface can be obtained by remotely logging in to the corresponding network device through the network management platform telnet.
步骤S205:获取保存的当前状态信息;Step S205: Acquire saved current state information.
步骤S206:对当前状态信息进行分析,包括:故障定位人员根据获取的报文处理信息进行诊断,判断当前提取的报文是否异常、微引擎处理逻辑是否存在问题、寄存器和存储空间当前状态是否正确等。Step S206: analyzing the current state information, including: the fault locating personnel performs diagnosis according to the obtained packet processing information, determines whether the currently extracted packet is abnormal, whether the microengine processing logic has a problem, whether the current state of the register and the storage space is correct. Wait.
第四实施例Fourth embodiment
本实施例提供了一种报文处理系统,请参考图4,包括: This embodiment provides a packet processing system. Referring to FIG. 4, the method includes:
分析装置20和报文处理装置10;其中,分析装置20配置为对报文处理装置10所保存的当前状态信息进行分析,并得出分析结果;报文处理装置10与上述实施例中的类似,这里不再赘述。The analyzing device 20 and the message processing device 10; wherein the analyzing device 20 is configured to analyze the current state information held by the message processing device 10 and obtain an analysis result; the message processing device 10 is similar to the above embodiment , no longer repeat them here.
第五实施例:Fifth embodiment:
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述任意一个实施例提供的报文处理方法;具体可如图1、图2及图4所示方法的至少其中之一。The embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the message processing method provided by any one of the foregoing embodiments; 1. At least one of the methods shown in Figures 2 and 4.
所述计算机存储介质可为各种类型的存储介质,具体可为:光盘、磁带、硬盘、随机存储介质、只读存储介质或闪存等;可选为非瞬间存储介质。The computer storage medium may be various types of storage media, specifically: an optical disk, a magnetic tape, a hard disk, a random storage medium, a read-only storage medium, or a flash memory; and the like may be a non-transitory storage medium.
以上内容是结合具体的实施方式对本发明所作的进一步详细说明,不能认定本发明的具体实施只局限于这些说明。凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。 The above is a further detailed description of the present invention in connection with the specific embodiments, and the specific embodiments of the present invention are not limited to the description. Modifications made in accordance with the principles of the invention are understood to fall within the scope of the invention.

Claims (15)

  1. 一种报文处理方法,包括:A packet processing method includes:
    在与报文对应的报文描述符中设置复制标记,并确定与所述复制标记对应的指定指令;Setting a copy mark in the message descriptor corresponding to the message, and determining a specified instruction corresponding to the copy mark;
    执行各个指令,对所述报文进行处理;Execute each instruction to process the message;
    当执行到所述指定指令时,根据所述报文对应的报文描述符对所述报文处理的当前状态信息进行保存。When the specified instruction is executed, the current state information of the message processing is saved according to the message descriptor corresponding to the message.
  2. 如权利要求1所述的报文处理方法,其中,在所述对报文处理的当前状态信息进行保存时,还包括:继续执行指令,对所述报文进行处理。The packet processing method according to claim 1, wherein when the current state information of the packet processing is saved, the method further includes: continuing to execute the instruction, and processing the packet.
  3. 如权利要求1所述的报文处理方法,其中,在所述执行到指定指令之前,还包括:对所述复制标记进行置位。The message processing method according to claim 1, further comprising: setting the copy flag before the executing to the specified instruction.
  4. 如权利要求3所述的报文处理方法,其中,在所述对复制标记进行置位之前,还包括:接收来自用户的复制请求。The message processing method according to claim 3, wherein before the setting of the copy flag, the method further comprises: receiving a copy request from the user.
  5. 如权利要求1至4任一项所述的报文处理方法,其中,在执行各个指令之前,还包括:对各个指令进行编译,生成与各个指令对应的序列号。The message processing method according to any one of claims 1 to 4, further comprising: compiling each instruction to generate a sequence number corresponding to each instruction before executing each instruction.
  6. 如权利要求5所述的报文处理方法,其中,所述确定与复制标记对应的指定指令之后,还包括:确定所述指定指令对应的序列号;所述执行到指定指令包括:根据所述序列号确定是否执行到所述指定指令。The message processing method according to claim 5, wherein the determining the specified instruction corresponding to the copy mark further comprises: determining a sequence number corresponding to the specified instruction; and the executing to the specified instruction comprises: The serial number determines whether to execute the specified instruction.
  7. 如权利要求1至4任一项所述的报文处理方法,其中,在对所述报文处理的当前状态信息进行保存之后,还包括:对保存的所述当前状态信息进行分析,得出分析结果。The message processing method according to any one of claims 1 to 4, further comprising: analyzing the saved current state information after the saving of the current state information of the message processing, Analysis results.
  8. 一种报文处理装置,其中,包括:A message processing device, comprising:
    标记设置模块,配置为在于报文对应的报文描述符中设置复制标记,并确定与所述复制标记对应的指定指令;a mark setting module configured to set a copy mark in a message descriptor corresponding to the message, and determine a specified instruction corresponding to the copy mark;
    指令执行模块,配置为执行各个指令,对所述报文进行处理; An instruction execution module configured to execute each instruction to process the message;
    保存模块,配置为当执行到指定指令时,根据所述报文对应的报文描述符对所述报文处理的当前状态信息进行保存。The saving module is configured to save the current state information of the packet processing according to the message descriptor corresponding to the packet when the specified instruction is executed.
  9. 如权利要求8所述的报文处理装置,其中,所述指令执行模块还配置为:在对所述报文处理的当前状态信息进行保存时,继续执行指令,对所述报文进行处理;The message processing device according to claim 8, wherein the instruction execution module is further configured to: when the current state information processed by the message is saved, continue to execute an instruction to process the message;
  10. 如权利要求8所述的报文处理装置,其中,还包括置位模块,配置为在所述执行到指定指令之前,对所述复制标记进行置位。The message processing apparatus of claim 8 further comprising a set module configured to set said copy flag prior to said executing to a specified instruction.
  11. 如权利要求10所述的报文处理装置,其中,还包括请求接收模块,配置为在所述对复制标记进行置位之前,接收来自用户的复制请求。The message processing apparatus according to claim 10, further comprising a request receiving module configured to receive a copy request from the user before said copying flag is set.
  12. 如权利要求8-11所述的报文处理装置,其中,还包括编译模块,配置为在执行各个指令之前,对各个指令进行编译,生成与各个指令对应的序列号。A message processing apparatus according to any of claims 8-11, further comprising a compiling module configured to compile each instruction prior to executing each instruction to generate a sequence number corresponding to each instruction.
  13. 如权利要求12所述的报文处理装置,其中,还包括序列确定模块,配置为确定所述指定指令对应的序列号,以及根据所述序列号确定是否执行到所述指定指令。The message processing apparatus according to claim 12, further comprising a sequence determining module configured to determine a sequence number corresponding to said specified instruction, and to determine whether to execute said specified instruction based on said serial number.
  14. 一种报文处理系统,其中,包括分析装置以及如权利要求8至13任一项所述的报文处理装置;所述分析装置配置为对所述保存的当前状态信息进行分析,并得出分析结果。A message processing system, comprising: an analysis device and a message processing device according to any one of claims 8 to 13; the analysis device configured to analyze the saved current state information and obtain Analysis results.
  15. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至7任一项所述报文处理方法。 A computer storage medium having stored therein computer executable instructions for performing the message processing method of any one of claims 1 to 7.
PCT/CN2017/078382 2016-05-16 2017-03-28 Packet processing method, device and system, and computer storage medium WO2017197982A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610323642.4 2016-05-16
CN201610323642.4A CN107395381A (en) 2016-05-16 2016-05-16 A kind of message processing method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2017197982A1 true WO2017197982A1 (en) 2017-11-23

Family

ID=60324786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/078382 WO2017197982A1 (en) 2016-05-16 2017-03-28 Packet processing method, device and system, and computer storage medium

Country Status (2)

Country Link
CN (1) CN107395381A (en)
WO (1) WO2017197982A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144736A (en) * 2018-09-30 2019-01-04 新华三信息安全技术有限公司 A kind of method and device exporting alert message

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110896391B (en) * 2018-09-13 2023-01-31 北京京东尚科信息技术有限公司 Message processing method and device
CN115550153A (en) * 2021-06-29 2022-12-30 中兴通讯股份有限公司 Message processing method, network processor and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020071450A1 (en) * 2000-12-08 2002-06-13 Gasbarro Dominic J. Host-fabric adapter having bandwidth-optimizing, area-minimal, vertical sliced memory architecture and method of connecting a host system to a channel-based switched fabric in a data network
CN102216909A (en) * 2011-05-27 2011-10-12 华为技术有限公司 A network processor and a diagnostic method of procedures stored in the network process
US20150143344A1 (en) * 2013-11-18 2015-05-21 Microsoft Corporation Diagnosing Production Applications
CN106452807A (en) * 2015-08-04 2017-02-22 深圳市中兴微电子技术有限公司 Network processor and message processing data acquisition method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020071450A1 (en) * 2000-12-08 2002-06-13 Gasbarro Dominic J. Host-fabric adapter having bandwidth-optimizing, area-minimal, vertical sliced memory architecture and method of connecting a host system to a channel-based switched fabric in a data network
CN102216909A (en) * 2011-05-27 2011-10-12 华为技术有限公司 A network processor and a diagnostic method of procedures stored in the network process
US20150143344A1 (en) * 2013-11-18 2015-05-21 Microsoft Corporation Diagnosing Production Applications
CN106452807A (en) * 2015-08-04 2017-02-22 深圳市中兴微电子技术有限公司 Network processor and message processing data acquisition method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109144736A (en) * 2018-09-30 2019-01-04 新华三信息安全技术有限公司 A kind of method and device exporting alert message

Also Published As

Publication number Publication date
CN107395381A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
US10841270B2 (en) Methods and devices for switching a virtual internet protocol address
CN107608852B (en) A kind of process monitoring method and device
US9817747B2 (en) Systems and methods for unit testing of functions on remote kernels
BR112013019824B1 (en) DATA PROCESSING APPARATUS AND METHOD, METHOD FOR COMPILING AN APPLICATION FOR RUNNING BY A DATA PROCESSOR, AND, COMPUTER-READABLE STORAGE MEANS
CN106201811B (en) The fault recovery method and terminal of application program
WO2017197982A1 (en) Packet processing method, device and system, and computer storage medium
WO2015154517A1 (en) Software failure locating method, apparatus and equipment
US11709756B2 (en) Dynamic distributed tracing instrumentation in a microservice architecture
US10108532B1 (en) Systems and methods for unit testing of operating system kernels from user space
CN105589764A (en) CPU (Central Processing Unit) abnormality processing method and apparatus
CN111950640B (en) Switch fault processing method and device
CN116743619B (en) Network service testing method, device, equipment and storage medium
JP7079241B2 (en) A device and method for generating and processing a trace stream indicating instruction execution by a processing circuit.
CN107436752B (en) Abnormal site recovery method and device and computer readable storage medium
US20170039124A1 (en) Method and apparatus for interception of synchronization objects in graphics application programming interfaces for frame debugging
JP6874253B2 (en) A device and method for generating and processing a trace stream indicating instruction execution by a processing circuit.
WO2017084402A1 (en) System and method for debugging plurality of application programs
US10374950B2 (en) Routing traffic between networks governed by different versions of the internet protocol
WO2017107014A1 (en) Network sub-health diagnosis method and apparatus
US10642710B2 (en) Apparatus and method for generating and processing a trace stream indicative of execution of predicated vector memory access instructions by processing circuitry
KR102075345B1 (en) Fuzzing system, execution flow information extracting apparatus and method for fuzzing
JP2016513309A (en) Control of error propagation due to faults in computing nodes of distributed computing systems
CN107529695A (en) The localization method and device that a kind of buffering area slowly leaks
CN115033337A (en) Virtual machine memory migration method, device, equipment and storage medium
US10419306B2 (en) Determining the causation of events across multiple nodes using message properties

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17798546

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17798546

Country of ref document: EP

Kind code of ref document: A1