A network protocol testing method, system and storage medium

By acquiring test messages from the gateway and performing protocol identification and processing, the problem of testing difficulties caused by complex network topology in network protocol testing is solved, realizing efficient network protocol testing environment deployment and result verification, and supporting protocol testing in NFV cloud scenarios.

CN116668345BActive Publication Date: 2026-06-23CHINA TELECOM CORP LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD
Filing Date
2023-05-09
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In network protocol testing, due to the complexity of network topology and the difficulty of testing protocol processes, how to efficiently implement network protocol testing is an urgent problem to be solved.

Method used

By obtaining test packets from the system under test from the gateway, protocol identification and field attribute extraction are performed to obtain attribute data. Combined with protocol information, data retrieval and custom processing are carried out until the protocol processing node no longer exists, thereby realizing the forwarding and processing of intermediate protocols and simplifying the deployment of network protocol testing environment.

Benefits of technology

It simplifies the deployment of network protocol testing environments, improves the control of the testing process and the verification of results, increases the efficiency and reliability of network protocol testing, and supports protocol testing in NFV cloud scenarios under VXLAN tunnels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116668345B_ABST
    Figure CN116668345B_ABST
Patent Text Reader

Abstract

The application discloses a network protocol test method and system and a storage medium, and the method comprises the following steps: obtaining test messages of a system under test from a gateway; performing protocol identification on the test messages, extracting protocol information of a target protocol layer, and determining a protocol processing node according to the protocol information; when the protocol processing node exists, performing field attribute extraction on the protocol information, obtaining attribute data, and obtaining message verification data of a target object; performing data retrieval according to the protocol information, and determining a target processing message in combination with the attribute data; obtaining message processing data of the target object, and performing self-defined processing on the target processing message; taking a next protocol layer of the target protocol layer as the target protocol layer, then returning to the step of extracting protocol information of the target protocol layer, and determining the protocol processing node according to the protocol information until the protocol processing node does not exist. The application can simplify network protocol test environment deployment, and increase process control and result inspection control of network protocol test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of protocol testing technology, and in particular to a network protocol testing method, system, and storage medium. Background Technology

[0002] Throughout the development of computer networks, protocols have always held a central position. A key step in the evolution from ARPAnet to the Internet was the formation of internationally standardized protocols. Protocols are a set of rules that various communication entities in computer networks and distributed systems must follow to exchange information; much like a grammatical structure, they are the cornerstone of network construction.

[0003] With the advancement of network tunneling technology and network overlay modes, the testing of Complex Event Processing (CEP) scenarios has become increasingly diversified, leading to a wider range of network protocol testing networking methods. However, due to the complexity of network topology, protocol flow testing is challenging during network protocol testing. Therefore, how to efficiently implement network protocol testing is a problem that urgently needs to be solved. Summary of the Invention

[0004] This invention aims to at least partially address one of the technical problems in related technologies. To this end, this invention proposes a network protocol testing method, system, and storage medium.

[0005] On one hand, embodiments of the present invention provide a network protocol testing method, including:

[0006] Obtain test messages from the system under test from the gateway;

[0007] The test message is identified by protocol identification, the protocol information of the target protocol layer is extracted, and the protocol processing node is determined based on the protocol information.

[0008] When a protocol processing node exists, the protocol information is processed to extract field attributes, obtain attribute data, and acquire the message verification data of the target object.

[0009] Data retrieval is performed based on protocol information, and the target message is determined by combining attribute data.

[0010] Obtain message processing data from the target object and perform custom processing on the target message; the custom processing includes request comment protocol processing, message encapsulation processing, and message discarding processing.

[0011] The process involves taking the next protocol layer after the target protocol layer as the target protocol layer, then returning to extract the protocol information of the target protocol layer, and determining the protocol processing node based on the protocol information, until the protocol processing node no longer exists.

[0012] Optionally, the method further includes:

[0013] The gateway itself appends and saves messages based on a preset data packet capture format.

[0014] Optionally, the method further includes:

[0015] When the protocol processing node does not exist, the protocol information is delivered to the empty node for processing, and the test message is sent out.

[0016] Optionally, the protocol information is subjected to field attribute extraction to obtain attribute data, and the message verification data of the target object is obtained, including:

[0017] The protocol information is processed to extract field attributes, thereby obtaining the attribute data of the target protocol layer. The attribute data includes the path information and attribute information of the target protocol layer.

[0018] The path information is used as the key and the attribute information is used as the value to store the attribute data in the message data.

[0019] Based on the message data, a message data verification interface is provided to external parties; the message verification data of the target object is obtained through the message data verification interface.

[0020] Optionally, data retrieval is performed based on protocol information, and the target processing message is determined by combining attribute data, including:

[0021] Using protocol information as the key, retrieve the test data of the target protocol layer;

[0022] The test data and attribute data are compared, and the message of the target protocol layer is determined to be the target processing message based on the result of the comparison.

[0023] Optionally, the method further includes:

[0024] When the message from the target protocol layer is the target processing message, the message verification data and attribute data of the target object are compared, and the verification results of the data comparison are recorded.

[0025] Optionally, the method further includes:

[0026] Request comment protocol processing is applied to non-target processing messages.

[0027] On the other hand, embodiments of the present invention provide a network protocol testing system, including:

[0028] The first module is used to obtain test messages from the system under test from the gateway;

[0029] The second module is used to identify the protocol of the test message, extract the protocol information of the target protocol layer, and determine the protocol processing node based on the protocol information.

[0030] The third module is used to extract field attributes from protocol information, obtain attribute data, and acquire message verification data of the target object when a protocol processing node exists.

[0031] The fourth module is used to retrieve data based on protocol information and determine the target message to be processed by combining attribute data;

[0032] The fifth module is used to obtain the message processing data of the target object and perform custom processing on the target message; the custom processing includes request comment protocol processing, message encapsulation processing and message discarding processing.

[0033] The sixth module is used to take the next protocol layer of the target protocol layer as the target protocol layer, then return to the second module to extract the protocol information of the target protocol layer, and determine the protocol processing node based on the protocol information, until the protocol processing node no longer exists.

[0034] Optionally, the system also includes:

[0035] The seventh module is used to append and save the messages sent by the gateway itself based on a preset data packet capture format;

[0036] The eighth module is used to deliver protocol information to an empty node for processing when the protocol processing node does not exist, and to process test packets.

[0037] The ninth module is used to compare the message verification data and attribute data of the target object when the message of the target protocol layer is the target processing message, and record the verification results of the data comparison.

[0038] Module 10 is used for request comment protocol processing of non-target processing messages.

[0039] Optionally, the third module is also used for:

[0040] Field attributes are extracted from the protocol information to obtain attribute data of the target protocol layer; the attribute data includes path information and attribute information of the target protocol layer.

[0041] Using the path information as the key and the attribute information as the value, the attribute data is stored in the message data;

[0042] Based on the message data, a message data verification interface is provided to external parties; the message verification data of the target object is obtained through the message data verification interface.

[0043] Optionally, the fourth module is also used for:

[0044] Using the protocol information as a key, retrieve the verification data of the target protocol layer;

[0045] The test data and the attribute data are compared, and based on the result of the comparison being consistent, the message of the target protocol layer is determined to be the target processing message.

[0046] On the other hand, embodiments of the present invention provide a network protocol testing system, including: a processor and a memory; the memory is used to store a program; the processor executes the program to implement the above-described network protocol testing method.

[0047] On the other hand, embodiments of the present invention provide a computer storage medium storing a processor-executable program, which, when executed by a processor, is used to implement the above-described network protocol testing method.

[0048] This invention first obtains test packets from the system under test from the gateway; performs protocol identification on the test packets, extracts the protocol information of the target protocol layer, and determines the protocol processing node based on the protocol information; if the protocol processing node exists, extracts field attributes from the protocol information to obtain attribute data, and obtains the packet verification data of the target object; performs data retrieval based on the protocol information, and determines the target processing packet based on the attribute data; obtains the packet processing data of the target object, and performs custom processing on the target processing packet; wherein, the custom processing includes request comment protocol processing, packet encapsulation processing, and packet discarding processing; takes the next protocol layer of the target protocol layer as the target protocol layer, and then returns to the step of extracting the protocol information of the target protocol layer and determining the protocol processing node based on the protocol information, until the protocol processing node no longer exists. This invention, through the identification and data extraction of test packets, realizes the forwarding and processing of intermediate protocols, simplifies the deployment of network protocol testing environments, and further enhances the process control and result verification control of network protocol testing by obtaining the packet verification data and packet processing data of the target object. Attached Figure Description

[0049] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the technical solutions of the present invention, and do not constitute a limitation on the technical solutions of the present invention.

[0050] Figure 1 This is a schematic diagram of an implementation environment for network protocol testing provided in an embodiment of the present invention;

[0051] Figure 2 This is a flowchart illustrating a network protocol testing method provided in an embodiment of the present invention;

[0052] Figure 3 This is a schematic diagram of the principle framework of a network protocol testing system provided in an embodiment of the present invention;

[0053] Figure 4 A schematic diagram illustrating the principle framework of the protocol distribution processing module provided in an embodiment of the present invention;

[0054] Figure 5 A schematic diagram illustrating the principle framework of the protocol attribute identification module provided in an embodiment of the present invention;

[0055] Figure 6 This is a schematic diagram of the principle framework of the protocol verification module provided in an embodiment of the present invention;

[0056] Figure 7 A schematic diagram illustrating the principle framework of the protocol processing module provided in an embodiment of the present invention;

[0057] Figure 8 A schematic diagram illustrating the principle framework of the network protocol transceiver module provided in an embodiment of the present invention;

[0058] Figure 9 This is a schematic diagram of the data flow of the network protocol testing system provided in an embodiment of the present invention;

[0059] Figure 10 This is a schematic diagram illustrating the interaction between the network protocol testing system provided in this embodiment of the invention and the user and the system under test.

[0060] Figure 11 This is a schematic diagram of the structure of a network protocol testing system provided in an embodiment of the present invention;

[0061] Figure 12 This is a schematic diagram of a second network protocol testing system provided in an embodiment of the present invention;

[0062] Figure 13 This is a computer system architecture block diagram suitable for implementing the network testing system of this application, provided as an embodiment of the present invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0064] It should be noted that although functional modules are divided in the system diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100," "second / S200," etc., in the specification, claims, and the aforementioned figures are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0065] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0066] It is understood that the network protocol testing method provided in this embodiment of the invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet computer, laptop computer, or desktop computer, but it is not limited to these.

[0067] It should be further noted that the terminals involved in the embodiments of the present invention include, but are not limited to, smartphones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0068] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the invention. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.

[0069] Server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0070] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.

[0071] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.

[0072] Exemplary based on Figure 1 The implementation environment shown in this embodiment of the invention provides a network protocol testing method. The following description uses the application of this network protocol testing method in server 101 as an example. It can be understood that this network protocol testing method can also be applied to terminal 102.

[0073] Reference Figure 2 , Figure 2 This is a flowchart illustrating a network protocol testing method applied to a server, provided in an embodiment of the present invention. The executing entity of this network protocol testing method can be any of the aforementioned computer devices. (Refer to...) Figure 2 The method includes the following steps:

[0074] S100. Obtain the test message of the system under test from the gateway;

[0075] It should be noted that in some embodiments, the method further includes: appending and saving the messages sent by the gateway itself based on a preset data packet capture format.

[0076] Specifically, in some specific embodiments, the message is first identified. If the message is sent by the network card itself, a pcap file (based on a preset data packet capture format) is appended and saved to the message. Here, pcap is an abbreviation for PacketCapture, which is an industry-standard network data packet capture format. If not, the message is further processed.

[0077] S200. Perform protocol identification on the test message, extract the protocol information of the target protocol layer, and determine the protocol processing node based on the protocol information;

[0078] Specifically, in some embodiments, the protocol header is extracted, and the protocol processing node is queried based on the protocol information. First, the message is decapsulated and disassembled layer by layer, and then the corresponding processing node is found according to the protocol layer.

[0079] S300. When a protocol processing node exists, extract the field attributes of the protocol information to obtain attribute data, and obtain the message verification data of the target object.

[0080] It should be noted that some embodiments include the following steps: extracting field attributes from the protocol information to obtain attribute data of the target protocol layer; the attribute data includes path information and attribute information of the target protocol layer; storing the attribute data in message data using the path information as the key and the attribute information as the value; providing a message data verification interface to the outside world based on the message data; and obtaining the message verification data of the target object through the message data verification interface.

[0081] Specifically, in some embodiments, if a processing node exists, the protocol layer is delivered to the node for protocol node processing. This is done by delivering the protocol layer to the protocol attribute identification module for processing, while simultaneously shifting the protocol header pointer to the next protocol layer. Subsequently, data is extracted from the current protocol layer, and the extracted information is stored in a message attribute structure. The structure information is as follows, using the protocol layer as the key and the attribute information of that layer as a map, as shown in the following example:

[0082] {"Eth.ip.udp":{"dport":22,"sport":15432}};

[0083] Based on the aforementioned structure information, message attribute comparison can be achieved. Specifically, this includes the following steps: extracting field attributes from the current layer protocol data and storing the attribute data using the current layer as the key; and providing a protocol layer attribute data comparison function.

[0084] 1. Relying on their respective protocol layer processing functions, the current protocol layer path is used as the key, and the current protocol layer attribute key-value pair value is used as the value to extract and store the data into the message data;

[0085] 2. Based on the message data stored in step 1, provide a message data verification interface for external use to verify user message data.

[0086] S400: Retrieve data based on protocol information and determine the target message to be processed by combining attribute data;

[0087] It should be noted that some embodiments include the steps of: retrieving the inspection data of the target protocol layer using the protocol information as a key; comparing the inspection data and attribute data; and determining the message of the target protocol layer as the target processing message based on the result of the comparison being consistent.

[0088] In some embodiments, the method further includes: when the message of the target protocol layer is a target processing message, performing a data comparison between the message verification data and attribute data of the target object, and recording the verification results of the data comparison.

[0089] Specifically, in some embodiments, after processing the current protocol layer attributes, message verification begins. The user (i.e., the target object) can input expected message verification data through the API interface. The current protocol information is used as the key to retrieve data from the verification data pool. If data exists, protocol data verification begins. Message confirmation is performed, using the information from the preceding steps to compare message attributes, identify the current message, and determine if it is the target message. If it is, user-defined verification processing begins, and the result is recorded. If it is not the target message or no verification data exists, the next node is processed. Specifically, the following steps are included:

[0090] 1. By setting up inspection nodes, the protocol processing performs data retrieval to be inspected. When the current protocol layer finds that inspection data exists, it performs data inspection operations.

[0091] 2. Data validation is divided into two interrelated sub-nodes:

[0092] Sub-node 1: Compare the message data pool in the protocol layer attribute identification module with the pre-inspection data to confirm that the current message is the target message to be inspected, and trigger the processing of the second sub-node;

[0093] Sub-node 2: Perform expected message data verification. Compare the data with the message data pool in the protocol layer attribute identification module and the acquired post-verification data, and record the data verification results.

[0094] S500: Obtain the message processing data of the target object and perform custom processing on the target message;

[0095] It should be noted that custom processing includes request comment protocol processing, message encapsulation processing, and message discarding processing; message encapsulation processing is based on the message processing data of the target object.

[0096] In some embodiments, the method further includes: requesting comment protocol processing for non-target processing messages.

[0097] S600. Take the next protocol layer of the target protocol layer as the target protocol layer, then return to the step of extracting the protocol information of the target protocol layer and determining the protocol processing node based on the protocol information, until the protocol processing node no longer exists;

[0098] It should be noted that in some embodiments, the method further includes: when the protocol processing node does not exist, delivering the protocol information to an empty node for processing, and performing packet processing on the test message.

[0099] Specifically, in some embodiments, steps S500 and S600 can be implemented as follows: Determine whether the current message is the target processing message. If yes, proceed to user-defined protocol processing; otherwise, deliver the message for forwarding to the next node for processing. Continue until the processing node is empty, then perform message sending. Subsequently, based on the processed message data, discard or send the message according to the specified fields. This includes the following steps:

[0100] First, the current protocol layer checks the protocol processing pool to see if there is any data to be processed. If it exists, a pre-node verification is performed. If it does not exist or the pre-verification fails, the protocol layer processes it according to the RFC (Request For Comments) protocol. If the pre-verification passes, user-defined processing is triggered at the protocol layer. Protocol processing consists of two interconnected sub-nodes:

[0101] 1. Sub-node 1: Compare the message data pool in the protocol layer attribute identification module with the pre-inspection data to confirm that the current message is the target message to be inspected, and trigger the processing of the second sub-node;

[0102] 2. Byte Point Two: Based on the current protocol layer, data is retrieved from the protocol processing pool. According to the data processing type, it is divided into the following three types:

[0103] 1. Default Protocol Processing: According to the RFC protocol, the default processing protocol layer encapsulates the protocol data that makes up the current protocol layer message into a message;

[0104] II. Custom Encapsulation of Current Protocol: Encapsulates messages based on user-provided data to be processed;

[0105] Message discarding handling: No protocol operations are performed; the processing status is set to discard. If the processing status is checked, the next node is marked as an empty node; otherwise, the next node identification proceeds normally. If a node is processed as an empty node, it is delivered to the packet sending / receiving module for further processing.

[0106] To explain in detail the principle of the technical solution of the present invention, the present invention will be further described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.

[0107] This invention is based on the triggering principle and automates network protocol testing by parsing network protocols layer by layer and comparing protocol message field attributes in advance.

[0108] Based on the solution of this invention, the user completes the basic configuration and starts the network card listening. When the packet enters the network protocol transceiver processing module through the network card of the system under test, it then flows through the network protocol distribution module and is parsed layer by layer. When a specific protocol hits the rule in the protocol verification data pool or the protocol processing data pool, the protocol verification or protocol processing is performed. Otherwise, the Request For Comments (RFC) standard processing protocol is followed normally.

[0109] In some specific embodiments, such as Figure 3 As shown, this embodiment of the invention provides a network protocol testing system, which includes: a protocol distribution processing module, a protocol attribute identification module, a protocol verification module, a protocol processing module, and a network protocol transceiver processing module. The specific functions implemented by each module correspond to those in the above-described method embodiment. Each module will be described in detail below:

[0110] like Figure 4 As shown, the protocol distribution and processing module decapsulates the message, disassembles it layer by layer, finds the corresponding processing node according to the protocol layer, and delivers it to the empty node for processing if there is no processing node in the current protocol layer.

[0111] 1. Perform protocol identification, extract protocol information, and record the data;

[0112] 2. Locate the processing node based on the protocol information in section 1:

[0113] If a processing node exists, the protocol layer is delivered to the node for protocol node processing.

[0114] If it does not exist, the next node will be changed to an empty node, and then delivered to the next node for processing according to the protocol node.

[0115] like Figure 5 As shown in the diagram (the top labels Eth, ip, etc. represent test packets, while the bottom labels ethHandle, vxlanHandle, and UDPHandle represent handle identifiers in packet protocol testing, assisting in understanding module data processing; their meanings are the same / similar in subsequent diagrams), the protocol attribute identification module extracts field attributes from the current layer protocol data and stores the attribute data, using the current layer as the key value; it also provides a protocol layer attribute data comparison function.

[0116] 1. Relying on their respective protocol layer processing functions, the current protocol layer path is used as the key, and the current protocol layer attribute key-value pair value is used as the value to extract and store the data into the message data;

[0117] 2. Based on the message data stored in step 1, provide a message data verification interface for external use to verify user message data.

[0118] like Figure 6 As shown, the protocol verification module:

[0119] 1. By setting up inspection nodes, the protocol processing performs data retrieval to be inspected. When the current protocol layer finds that inspection data exists, it performs data inspection operations.

[0120] 2. Data validation is divided into two interrelated sub-nodes:

[0121] Sub-node 1: Compare the message data pool in the protocol layer attribute identification module with the pre-inspection data to confirm that the current message is the target message to be inspected, and trigger the processing of the second sub-node;

[0122] Sub-node 2: Perform expected message data verification. Compare the data with the message data pool in the protocol layer attribute identification module and the acquired post-verification data, and record the data verification results.

[0123] like Figure 7 As shown, the protocol processing module:

[0124] First, the current protocol layer checks the protocol processing pool to see if any data exists to be processed. If it does, a pre-node verification is performed. If it does not exist or the pre-verification fails, the protocol layer processes the data according to the RFC protocol specifications. If the pre-verification passes, user-defined processing is triggered at the protocol layer. Protocol processing consists of two interconnected sub-nodes:

[0125] 1. Sub-node 1: Compare the message data pool in the protocol layer attribute identification module with the pre-inspection data to confirm that the current message is the target message to be inspected, and trigger the processing of the second sub-node;

[0126] 2. Byte Point Two: Based on the current protocol layer, data is retrieved from the protocol processing pool. According to the data processing type, it is divided into the following three types:

[0127] 1. Default Protocol Processing: According to the RFC protocol, the default processing protocol layer encapsulates the protocol data that makes up the current protocol layer message into a message;

[0128] II. Custom Encapsulation of Current Protocol: Encapsulates messages based on user-provided data to be processed;

[0129] 3. Message Discarding: No protocol operations are performed; the processing status is set to discard. If the processing status is checked, the next node is marked as an empty node if it is discarded; otherwise, the next node identification proceeds normally. If a node is processed as an empty node, it is delivered to the packet sending / receiving module for further processing.

[0130] like Figure 8 As shown, the network protocol transceiver module:

[0131] The system manages network interface cards (NICs) and establishes Layer 2 or Layer 3 networks with the system under test. It enables the basic protocol processing library and stores protocol verification data and protocol processing data in real time via the HTTP interface. This allows for the expected verification and processing of the protocols under test, thus completing the automated testing process for network protocols.

[0132] Taking the application scenario of the aforementioned network protocol testing system as an example, such as Figure 9 and Figure 10 As shown, the process of the method embodiment of the present invention can be implemented through the following steps:

[0133] 1. Test packets enter the packet receiving module through the network card. The packet receiving module identifies the packets. If the packet is sent by the network card itself, it appends and saves the packet to a pcap file (based on a preset packet capture format). Otherwise, it delivers the packet to the packet distribution module for processing. Here, pcap is an abbreviation for Packet Capture, which is an industry-standard network packet capture format.

[0134] 2. When a message enters the distribution module, the protocol header is extracted, and the protocol processing node is queried based on the protocol information. If the protocol processing node does not exist, the message is delivered to an empty node for processing. If the protocol processing node exists, the protocol layer is delivered to the protocol attribute identification module for processing. At the same time, the protocol header pointer is shifted to the next protocol layer.

[0135] 3. When entering the protocol attribute identification module, it first determines whether the node to be processed is an empty node. If so, the verification module is skipped, and the processing module forwards the packet to the packet sending and receiving module for packet processing. If not, data is extracted from the current protocol layer, and the extracted information is stored in the message attribute structure. The structure information is as follows, with the protocol layer as the key and the attribute information of that layer as a map, as shown in the following example:

[0136] {"Eth.ip.udp":{"dport":22,"sport":15432}};

[0137] It also provides message attribute comparison functionality;

[0138] 4. After processing the current protocol layer attributes, the message verification process begins. Users can input expected message verification data via the API interface. The current protocol information is used as the key to retrieve data from the verification data pool. If data exists, protocol data verification begins. Message confirmation is performed, calling the message attribute comparison function from step 3 to identify the current message and determine if it is the target message. If it is, user-defined verification processing begins, and the result is recorded. If it is not the target message or no verification data exists, the process proceeds to the next node.

[0139] 5. After entering protocol processing, users can also input expected message processing data through the API interface. The current protocol information is used as the key to retrieve data from the verification data pool. If data exists, protocol data verification begins. Message confirmation is performed, calling the message attribute comparison function from step 3 to identify the current message and determine if it is the target message. If it is, user-defined protocol processing begins; otherwise, the message is forwarded to the next node for processing. This continues until an empty processing node is reached, at which point the message is delivered to the packet sending / receiving module for transmission.

[0140] 6. The packet sending and receiving module, based on the processed message data in step 5, determines whether to discard or send the message according to the fields.

[0141] 7. The above six steps complete the network protocol testing. Relying on the packet data extracted through protocol attribute identification and the provided protocol verification methods, the packets are inspected and processed to achieve the purpose of network protocol verification and control the protocol forwarding process. Furthermore, the verification results are output through an API interface, providing users with a complete protocol testing process and methodology.

[0142] In summary, the embodiments of this invention, through the methods provided, allow for the selection of physical or virtual network interface cards (NICs) for network configuration, eliminating the need for additional network devices for intermediate protocol forwarding and processing, thus simplifying the deployment of network protocol testing environments. Furthermore, the methods provided by this invention significantly improve work efficiency for enterprises, reducing labor costs. Moreover, the methods enrich network protocol testing scenarios and enhance process control and result verification. This invention supports protocols such as DHCP, PPPoE, UDP, and TCP forwarding in NFV cloud scenarios under VXLAN tunnels. It simplifies network protocol testing in NFV cloud scenarios, provides a reliable platform to support NFV testing, and enriches the automation tools for network protocols.

[0143] On the other hand, such as Figure 11As shown, this embodiment of the invention provides a network protocol testing system 1100, comprising: a first module 1110, used to obtain test packets of the system under test from a gateway; a second module 1120, used to identify the protocol of the test packets, extract the protocol information of the target protocol layer, and determine the protocol processing node based on the protocol information; a third module 1130, used to extract field attributes of the protocol information to obtain attribute data and obtain the packet verification data of the target object when the protocol processing node exists; a fourth module 1140, used to perform data retrieval based on the protocol information and determine the target processing packet in combination with the attribute data; a fifth module 1150, used to obtain the packet processing data of the target object and perform custom processing on the target processing packet; wherein, the custom processing includes request comment protocol processing, packet encapsulation processing and packet discarding processing; and a sixth module 1160, used to take the next protocol layer of the target protocol layer as the target protocol layer, and then return to the second module 1120 to extract the protocol information of the target protocol layer and determine the protocol processing node based on the protocol information, until the protocol processing node no longer exists.

[0144] It should be noted that some embodiments also include the following modules:

[0145] The seventh module is used to append and save the messages sent by the gateway itself based on a preset data packet capture format;

[0146] The eighth module is used to deliver protocol information to an empty node for processing when the protocol processing node does not exist, and to process test packets.

[0147] The ninth module is used to compare the message verification data and attribute data of the target object when the message of the target protocol layer is the target processing message, and record the verification results of the data comparison.

[0148] Module 10 is used for request comment protocol processing of non-target processing messages.

[0149] The content of the method embodiments of the present invention is applicable to the system embodiments. The specific functions implemented in the system embodiments are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above methods.

[0150] On the other hand, such as Figure 12 As shown, this embodiment of the invention also provides a network protocol testing system 1200, which includes at least one processor 1210 and at least one memory 1220 for storing at least one program; taking one processor 1210 and one memory 1220 as an example.

[0151] The processor 1210 and the memory 1220 can be connected via a bus or other means.

[0152] Memory 1220, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory 1220 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1220 may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0153] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0154] Specifically, Figure 13 A schematic block diagram of a computer system architecture for implementing a network protocol testing system according to embodiments of this application is shown.

[0155] It should be noted that, Figure 13 The computer system 1300 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0156] like Figure 13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1302 or programs loaded from storage section 1308 into random access memory (RAM). The RAM 1303 also stores various programs and data required for system operation. The CPU 1301, ROM 1302, and RAM 1303 are interconnected via a bus 1304. An input / output interface 1305 (I / O interface) is also connected to the bus 1304.

[0157] The following components are connected to the input / output interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a local area network card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the input / output interface 1305 as needed. Removable media 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 1310 as needed so that computer programs read from them can be installed into the storage section 1308 as needed.

[0158] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1309, and / or installed from removable medium 1311. When the computer program is executed by central processing unit 1301, it performs various functions defined in the system of this application.

[0159] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: 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), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, 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. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0160] The content of the method embodiments of the present invention is applicable to the system embodiments. The specific functions implemented in the system embodiments are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above methods.

[0161] Another aspect of this invention provides a computer-readable storage medium storing a program that is executed by a processor to implement the method described above.

[0162] The content of the method embodiments of the present invention is applicable to the computer-readable storage medium embodiments. The specific functions implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above methods.

[0163] This invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the aforementioned method.

[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0165] It should be noted that although several modules for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0166] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.

[0167] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.

[0168] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0169] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part 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 of the various embodiments of this invention. 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.

[0170] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution means, apparatus, or device (such as a computer-based device, a processor-including device, or other means that can fetch and execute instructions from, or in conjunction with, an instruction execution means, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution means, apparatus, or device.

[0171] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0172] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0173] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0174] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

[0175] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A network protocol testing method, characterized in that, include: Obtain test messages from the system under test from the gateway; The test message is subjected to protocol identification, the protocol information of the target protocol layer is extracted, and the protocol processing node is determined based on the protocol information; When the protocol processing node exists, the field attributes of the protocol information are extracted to obtain attribute data, and the message verification data of the target object is obtained. Data retrieval is performed based on the protocol information, and the target processing message is determined by combining the attribute data; Obtain message processing data of the target object, perform custom processing on the target processing message, and perform request comment protocol processing on non-target processing messages; wherein, the custom processing includes request comment protocol processing, message encapsulation processing, and message discarding processing; The next protocol layer after the target protocol layer is taken as the target protocol layer. Then, the step of extracting the protocol information of the target protocol layer and determining the protocol processing node based on the protocol information is returned until the protocol processing node does not exist. The protocol information of the non-existent protocol processing node is delivered to the empty node for processing, and the test message is sent. The step of extracting field attributes from the protocol information to obtain attribute data and acquiring message verification data of the target object includes: The target protocol layer is delivered to the protocol processing node for protocol attribute identification, and the protocol header pointer is shifted to the next protocol layer; Field attributes are extracted from the protocol information to obtain attribute data of the target protocol layer; the attribute data includes path information and attribute information of the target protocol layer. Using the path information as the key and the attribute information as the value, the attribute data is stored in a message attribute structure as message data. Based on the message data, a message data verification interface is provided to external parties; the message verification data of the target object is obtained through the message data verification interface.

2. The network protocol testing method according to claim 1, characterized in that, The method further includes: The messages sent by the gateway itself are appended and saved based on a preset data packet capture format.

3. The network protocol testing method according to claim 1, characterized in that, The step of retrieving data based on the protocol information and determining the target processing message in conjunction with the attribute data includes: Using the protocol information as a key, retrieve the verification data of the target protocol layer; The test data and the attribute data are compared, and the message of the target protocol layer is determined to be the target processing message based on the result of the comparison being consistent.

4. The network protocol testing method according to claim 3, characterized in that, The method further includes: When the message of the target protocol layer is a target processing message, the message verification data and the attribute data of the target object are compared, and the verification result of the data comparison is recorded.

5. A network protocol testing system, characterized in that, include: The first module is used to obtain test messages from the system under test from the gateway; The second module is used to identify the protocol of the test message, extract the protocol information of the target protocol layer, and determine the protocol processing node based on the protocol information. The third module is used to extract field attributes from the protocol information, obtain attribute data, and acquire message verification data of the target object when the protocol processing node exists. The step of extracting field attributes from the protocol information to obtain attribute data and acquiring message verification data of the target object includes: The target protocol layer is delivered to the protocol processing node for protocol attribute identification, and the protocol header pointer is shifted to the next protocol layer; Field attributes are extracted from the protocol information to obtain attribute data of the target protocol layer; the attribute data includes path information and attribute information of the target protocol layer. Using the path information as the key and the attribute information as the value, the attribute data is stored in a message attribute structure as message data. Based on the message data, a message data verification interface is provided to the outside world; the message verification data of the target object is obtained through the message data verification interface; The fourth module is used to retrieve data based on the protocol information and determine the target processing message by combining the attribute data; The fifth module is used to acquire message processing data of the target object, perform custom processing on the target processing message, and perform request comment protocol processing on non-target processing messages; wherein, the custom processing includes request comment protocol processing, message encapsulation processing, and message discarding processing; The sixth module is used to take the next protocol layer of the target protocol layer as the target protocol layer, then return to the second module to extract the protocol information of the target protocol layer, and determine the protocol processing node according to the protocol information, until the protocol processing node does not exist. The protocol information of the non-existent protocol processing node is delivered to the empty node for processing, and the test message is sent.

6. A network protocol testing system, characterized in that, Including the processor and memory; The memory is used to store programs; The processor executes the program to implement the method as described in any one of claims 1 to 4.

7. A computer storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to implement the method as described in any one of claims 1 to 4.