CN117411955A - Robustness testing method and device, electronic equipment and medium - Google Patents

Robustness testing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN117411955A
CN117411955A CN202311327063.3A CN202311327063A CN117411955A CN 117411955 A CN117411955 A CN 117411955A CN 202311327063 A CN202311327063 A CN 202311327063A CN 117411955 A CN117411955 A CN 117411955A
Authority
CN
China
Prior art keywords
test
protocol stack
robustness
transmission control
control protocol
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311327063.3A
Other languages
Chinese (zh)
Inventor
王凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yusur Technology Co ltd
Original Assignee
Yusur Technology Co ltd
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 Yusur Technology Co ltd filed Critical Yusur Technology Co ltd
Priority to CN202311327063.3A priority Critical patent/CN117411955A/en
Publication of CN117411955A publication Critical patent/CN117411955A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/24Testing correct operation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

The application provides a robustness testing method, a device, electronic equipment and a medium. The method comprises the following steps: in the process of interacting with the special data processor based on the transmission control protocol stack, constructing abnormal message data by utilizing an abnormal message construction module in the test equipment, and sending the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test; and receiving response message data returned by the transmission control protocol stack to obtain a robustness test result based on the response message data. According to the robustness testing scheme provided by the embodiment of the application, the interaction process with the transmission control protocol stack in the special data processor can be simulated based on the abnormal message data constructed by the abnormal message construction module in the testing equipment, so that the interactive abnormal behavior robustness testing of the transmission control protocol stack is automatically realized, the complexity of the testing process is reduced, and the testing efficiency is effectively improved.

Description

Robustness testing method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of protocol testing, and in particular, to a method, an apparatus, an electronic device, and a medium for testing robustness.
Background
The TCP protocol (Transmission Control Protocol transmission control protocol) is a relatively widely used communication protocol over the internet, which is essentially a generic term for a large protocol stack, the TCP protocol stack. Robustness of the TCP protocol stack refers to when an abnormal condition is encountered, such as: the ability of the TCP protocol stack to function properly in the event of various malicious attacks, unreasonable messages, random fragmentation messages, high-speed traffic, or human error and contingency. The robustness test of the TCP protocol stack is important for guaranteeing the safety of the network environment.
In the related art, in order to release the CPU resource of the device, a technology of transferring the related functions of the TCP protocol stack to a dedicated data processor such as an intelligent network card or an accelerator card to execute, that is: the TCP protocol stack is hardwired.
However, how to perform robustness testing on the above-mentioned hardware TCP protocol stack transferred to the dedicated data processor is a technical problem to be solved.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method, an apparatus, an electronic device, and a medium for testing robustness, so as to reduce complexity of a testing process and effectively improve testing efficiency.
According to a first aspect of an embodiment of the present application, there is provided a robustness testing method for a testing device connected to a network of a dedicated data processor, the dedicated data processor having a transmission control protocol stack running therein, the robustness testing method comprising:
Constructing abnormal message data by utilizing an abnormal message construction module in the test equipment in the process of interacting with the special data processor based on a transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test;
and receiving response message data returned by the transmission control protocol stack so as to obtain a robustness test result based on the response message data.
According to a second aspect of embodiments of the present application, there is provided a robustness testing arrangement for a testing device in network connection with a dedicated data processor having a transmission control protocol stack running therein, the robustness testing arrangement comprising:
the abnormal message sending module is used for constructing abnormal message data by utilizing an abnormal message construction module in the test equipment in the process of interacting with the special data processor based on a transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test;
And the response message receiving module is used for receiving response message data returned by the transmission control protocol stack so as to obtain a robustness test result based on the response message data.
According to a third aspect of embodiments of the present application, there is provided a special electronic device, including: a memory and a processor, wherein the memory has stored therein a computer program which, when executed by the processor, implements the robustness testing method as described above.
According to a fourth aspect of embodiments of the present application, there is provided a computer storage medium storing computer program code which, when executed by a processor, causes the processor to perform the robustness test method as described above.
According to the embodiment of the application, in the process of carrying out transmission control protocol connection with the special data processor, the transmission control protocol stack is subjected to robustness test in a mode of constructing and sending the abnormal message data to the transmission control protocol stack operated in the special data processor by utilizing the abnormal message construction module in the test equipment, so that a response message which is returned by the transmission control protocol stack and is specific to the abnormal message data is obtained, and further, a robustness test result can be obtained based on analysis of the response message data. According to the robustness testing scheme provided by the embodiment of the application, the interaction process with the transmission control protocol stack in the special data processor can be simulated based on the abnormal message data constructed by the abnormal message construction module in the testing equipment, so that the interactive abnormal behavior robustness testing of the transmission control protocol stack is automatically realized, other equipment besides the testing equipment is not needed in the process, manual participation is not needed, the complexity of the testing process is reduced, and the testing efficiency is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following description will briefly introduce the drawings that are required to be used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present disclosure, and other drawings may also be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a system architecture diagram of a method of performing a robustness test according to an embodiment of the present application;
FIG. 2 is a flow chart of a process of establishing a TCP connection between a client and a server;
FIG. 3 is a flow chart of a process of disconnecting TCP between a client and a server;
FIG. 4 is a flow chart of a method of testing robustness according to one embodiment of the present application;
FIG. 5 is a diagram of the types of exception messages in the TCP connection establishment phase with test equipment as a client;
FIG. 6 is a diagram of the types of exception messages in the TCP connection disconnection phase with test equipment as a client;
FIG. 7 is a diagram of the types of exception messages in the TCP connection establishment phase with the test device as the server;
FIG. 8 is a diagram of the types of exception messages in the TCP connection disconnection phase with the test device as the server;
FIG. 9 is another system architecture diagram for implementing a robustness testing method according to an embodiment of the present application;
FIG. 10 is a block diagram of a robustness testing device according to one embodiment of the present application;
FIG. 11 is a block diagram of an electronic device implementing the robustness testing method shown in FIG. 4.
Detailed Description
In order to better understand the technical solutions in the embodiments of the present application, the following descriptions will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the embodiments of the present application shall fall within the scope of protection of the embodiments of the present application.
In the related art, in order to release the CPU resource of the device, a technology of transferring the related functions of the TCP protocol stack to a dedicated data processor such as an intelligent network card or an accelerator card to execute, that is: taking a special data processor running with a TCP protocol stack as a client, and performing interactive communication with the server equipment based on the TCP protocol stack; or, the special data processor running with the TCP protocol stack is used as a server to perform interactive communication with the client equipment based on the TCP protocol stack.
For the above technology, how to perform robustness test on the TCP protocol stack running in the special data processor, namely: how to test the capability of the TCP protocol stack to normally run when encountering abnormal conditions (such as malicious attack, unreasonable messages, malformed messages and special messages in abnormal scenes) is a technical problem to be solved.
Referring to FIG. 1, FIG. 1 is a system architecture diagram for implementing a method of testing robustness according to an embodiment of the present application. The system architecture includes: a special data processor running with a transmission control protocol stack and a test device connected with the special data processor through a network.
The test equipment is used for carrying out robustness test on a transmission control protocol stack in the special data processor, and comprises an abnormal message construction module used for constructing abnormal message data, wherein the test equipment can be a client or a server. In particular, it may be embodied as a desktop computer, a laptop computer, a mobile phone, a PDA, a dedicated terminal, or as a cluster of several terminals, or it may be a part of a terminal, such as a virtual machine, that is divided.
In the robustness test process, a special data processor running with a TCP protocol stack can be used as a client, test equipment is used as a server, and interaction is performed based on the TCP protocol stack; otherwise, a special data processor running with a TCP protocol stack can be used as a server, the test equipment can be used as a client, and interaction can be performed based on the TCP protocol stack.
For easy understanding, the following explanation will be given based on the process of interaction between the client and the server through the TCP stack:
for clients and servers that interact based on the TCP protocol stack, the complete interaction process between the two can typically involve three phases: TCP connection establishment procedure, data transmission procedure, and TCP connection disconnection procedure.
Referring to fig. 2, fig. 2 is a flowchart of a process for establishing a TCP connection between a client and a server. In the process of establishing the TCP connection, three message data (commonly called as three-way handshake) are sent between the client and the server. Specifically:
initially, both the client and the server are in a connection closing state; when the server creates a monitoring socket, the state of the server is changed from a connection closing state to a monitoring state; after that, the client sends a connection establishment request message to the server, and the client is in a connection request state (the first handshake is completed so far); after receiving the connection establishment request message, the server returns a connection establishment confirmation message to the client as a response to indicate that ' I agree to establish the connection with you ' that the connection is initiated by you ', and the server is in a synchronous receiving state (the second handshake is completed so far); after the client receives the connection establishment confirmation message sent by the server, the client also returns a secondary confirmation message to the server to indicate that 'I have received your confirmation', and the client is in a connection establishment state (the third handshake is completed so far); after receiving the secondary confirmation message, the server is also in a connection establishment state, and at this time, the TCP connection establishment process between the two parties is ended.
Referring to fig. 3, fig. 3 is a flowchart of a process of disconnecting a TCP connection between a client and a server. In the process of disconnecting the TCP connection, four message data (commonly called four waving hands) are sent between the client and the server. Specifically:
initially, both a client and a server are in a connection establishment state; assuming that the client initiates the disconnection request message (the server may also initiate, here taking the client initiation as an example), the four hand waving process includes: the client sends a disconnection request message, and the client is in a disconnection request state (the first time the hand swing is finished so far); after the server receives the disconnection request message, the server returns a disconnection confirmation message to the client as a response to indicate that the server is in a closing waiting state (the second time of waving is finished) when the server receives the disconnection request initiated by the user; in the time period between the second hand waving and the third hand waving, the TCP connection is only in a semi-closed state, so that data can be transmitted from the server side to the client side; when the server side also wants to disconnect after the data transmission is finished, a disconnection request message can be sent to the client side, and the disconnection request message indicates that the connection can be disconnected (the third time of hand waving is finished so far); after receiving the disconnection request message, the client also returns a disconnection confirmation message as a response, and the client is in a time waiting state, and then needs to wait for a period of time to determine that the server enters a connection closing state after determining that the disconnection confirmation message is received by the client (the fourth time waving is completed so far); after receiving the disconnection confirmation message returned by the client, the server closes the connection and is in a connection closing state.
The robustness testing process of the embodiment of the application is mainly that a special data processor and testing equipment are respectively used as a client and a server (or the server and the client) and carry out the complete interaction process through a TCP protocol stack, an abnormal message construction module in the testing equipment constructs abnormal message data and sends the abnormal message data so as to obtain response message data returned by the special data processor, and thus a robustness testing result can be obtained through analysis of the returned response message data.
Specific implementations of embodiments of the present application are further described below with reference to the accompanying drawings of embodiments of the present application.
Referring to fig. 4, fig. 4 is a flow chart of a method of testing robustness according to one embodiment of the present application. The method is performed by the test apparatus of fig. 1. The robustness testing method comprises the following steps:
step 402, in the process of interacting with the special data processor based on the transmission control protocol stack, constructing abnormal message data by using an abnormal message construction module in the test equipment, and sending the abnormal message data to the transmission control protocol stack running in the special data processor.
The abnormal message data is used for carrying out the robustness test of the transmission control protocol stack.
Specifically, as described above, in the process that the test device and the dedicated data processor interact based on the transmission control protocol stack, the two devices respectively send message data meeting the requirements of the corresponding stages to each other according to the difference of the interaction stages.
In the embodiment of the application, an abnormal message construction module in the test equipment is utilized to construct abnormal message data for performing robustness test on the transmission protocol stack in the process of interacting with the special data processor based on the transmission control protocol stack, and the abnormal message data is sent to the transmission control protocol stack in the special data processor.
Since the message data sent by the test equipment to the special purpose data processor is typically associated with the message data it receives from the special purpose data processor during the actual interaction of the test equipment and the special purpose data processor. That is, the specific content of the message data that the test device sends to the special purpose data processor is generated based on the content of the message data that it receives from the special purpose data processor. Therefore, when the abnormal message data is constructed through the abnormal message construction module, the message data sent by the special data processor can be firstly monitored, and the monitored message data is analyzed to obtain an analysis result; and constructing abnormal message data based on the analysis result through an abnormal message construction module. Therefore, the constructed abnormal message data is more close to the abnormal message generated in the real interaction process, and further, the robustness test is carried out based on the abnormal message data more close to the real condition, so that the accuracy of the robustness test result can be improved.
And step 404, receiving response message data returned by the transmission control protocol stack to obtain a robustness test result based on the response message data.
According to the embodiment of the application, in the process of carrying out transmission control protocol connection with the special data processor, the transmission control protocol is subjected to robustness test in a mode of constructing and sending the abnormal message data to the transmission control protocol stack operated in the special data processor by utilizing the abnormal message construction module in the test equipment, so that a response message which is returned by the transmission control protocol stack and aims at the abnormal message data is obtained, and further, a robustness test result can be obtained based on analysis of the response message data. According to the robustness testing scheme provided by the embodiment of the application, the interaction process with the transmission control protocol stack in the special data processor can be simulated based on the abnormal message data constructed by the abnormal message construction module in the testing equipment, so that the interactive abnormal behavior robustness testing of the transmission control protocol stack is automatically realized, other equipment besides the testing equipment is not needed in the process, manual participation is not needed, the complexity of the testing process is reduced, and the testing efficiency is effectively improved.
Alternatively, in some embodiments, the step 402 may be specifically implemented as:
executing an automatic test script to call an abnormal message construction module in the test equipment to construct abnormal message data in the process of interacting with the special data processor based on the transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor.
Specifically, an automation script for performing the robustness test may be generated in advance, and when the robustness test is required, the above-described automation test script may be executed in the test apparatus, i.e., the robustness test process may be completed. Therefore, the test efficiency can be effectively improved.
In the embodiment of the application, the scripting language adopted by the automated test script is not limited, and can be selected according to actual conditions. For example: the python language, or shell language, etc. may be used.
When the automated test script is a python script generated using a python language, the abnormal message construction module in the test device may be a scapy module. The scapy module is a powerful interactive data packet processing program in python, and can forge or unpack data packets, including the functions of constructing data packets, sending data packets, analyzing data packets, packet sniffing, responding, feedback matching and the like. Therefore, in the embodiment of the application, the scapy module can be utilized to construct abnormal message data so as to perform robustness test of the TCP protocol stack.
Referring to fig. 2 and fig. 3, in the process that the test device and the special data processor perform complete interaction based on the transmission control protocol stack, the test device sends more messages to the special data processor, for example: a connection establishment request message, a secondary confirmation message, a disconnection request message, a disconnection confirmation message, and the like. In addition, even for the same kind of message, a plurality of abnormal messages corresponding thereto may occur, specifically:
referring to fig. 5, fig. 5 is a schematic diagram of an abnormal message type when the test device is used as a client and in the TCP connection establishment phase. Specifically: for the connection establishment request message, the interior of the connection establishment request message generally comprises a flag bit message segment and a specific content message segment which characterize the action of the message, so that an abnormal message corresponding to the connection establishment request message can be: the message with abnormal flag bit may be a message with abnormal content, such as abnormal payload, abnormal optional field, abnormal message segment, disordered confirmation number, disordered message sequence number, etc. For the secondary acknowledgement message, the corresponding exception message may be: abnormal messages generated due to loss of a disconnected acknowledgement message, abnormal messages generated due to loss of a secondary acknowledgement message, and messages with abnormal contents (out of order acknowledgement numbers, out of order message sequence numbers, etc.).
Referring to fig. 6, fig. 6 is a schematic diagram of the types of abnormal messages by the test device as a client and in the TCP connection disconnection phase. Specifically: in the case of the disconnection request message, the inside of the disconnection request message also generally contains a flag bit message segment and a specific content message segment, so that an abnormal message corresponding to the disconnection request message may be: the message with abnormal flag bit may be a message with abnormal content, such as abnormal payload, abnormal optional field, abnormal message segment, disordered confirmation number, disordered message sequence number, etc. The abnormal message corresponding to the disconnection confirmation message may be: abnormal messages generated due to loss of the disconnection confirmation message. In addition, the exception sent by the test device may further include: abnormal messages generated by loss of the disconnection confirmation message returned by the special data processor, abnormal messages generated by retransmission of the disconnection confirmation message returned by the special data processor, and abnormal messages generated by loss of the disconnection confirmation message sent by the test equipment.
Referring to fig. 7, fig. 7 is a schematic diagram of an abnormal packet type of the test device as a server and in the TCP connection establishment stage. In this stage, the message sent by the test device is a disconnection confirmation message. Because the disconnection confirmation message generally includes a flag bit message segment and a specific content message segment, the corresponding abnormal message may be: the message with abnormal flag bit may be a message with abnormal content, such as abnormal payload, abnormal optional field, abnormal message segment, disordered confirmation number, disordered message sequence number, etc.
Referring to fig. 8, fig. 8 is a schematic diagram of an abnormal packet type of the test device as a service end and in a TCP connection disconnection stage. The test equipment sends the following messages: disconnection confirmation message and disconnection request message. Specifically: for a disconnection confirmation message, the corresponding exception message may include: acknowledgement number out-of-order messages or message sequence number out-of-order messages. For the disconnection request message, the corresponding exception message may be: the message with abnormal flag bit may be a message with abnormal content, such as abnormal payload, abnormal optional field, abnormal message segment, disordered confirmation number, disordered message sequence number, etc.
Therefore, based on the different types of messages sent by the test device to the special data processor, and the fact that multiple abnormal messages corresponding to the same type of messages may occur in the same type of messages, correspondingly, the robustness test can be divided into different test types, and among the different test types, the abnormal messages sent by the test device to the special data processor are different. Specifically: for two specific test types, different abnormal messages can be constructed and used for the messages of the same type sent by the test equipment; the abnormal messages corresponding to the various types of messages can be constructed and used for the different types of messages sent by the test equipment.
Optionally, in some of these embodiments, the test type of the robustness test may be determined prior to executing the automated test script; wherein, different test types correspond to different automated test scripts; determining a target test script corresponding to the test type from a plurality of candidate test scripts generated in advance according to the test type; further, the target test script is executed to construct and transmit abnormal message data corresponding to the test type.
Specifically, in the present example, multiple candidate test scripts for performing different types of robustness tests are generated in advance. When the test is required, the test type can be determined first, then a target test script corresponding to the test type is selected from the multiple candidate test scripts according to the test type, and then the target test script is executed, so that the robustness test of the type is completed. In this way, the testing efficiency of the robustness test and the flexibility of selecting the testing scene (kind) can be improved.
Further, to fully understand the robustness of the TCP protocol stack, the user may need to perform all existing test types on the TCP protocol stack, namely: the robustness testing process covers all of the existing test types. In this case, the more traditional way may be: and manually selecting and executing the candidate test scripts one by one from various candidate test scripts. However, this method has the problems of complex operation and low test efficiency, and may cause some or some candidate test scripts to be missed due to the error of manual operation.
Based on the above, in the embodiment of the present application, a global test script may also be generated in advance, where the global test script is a script that may call each candidate test script in sequence according to a preset sequence.
Thus, prior to the step of determining the test type of the robustness test, it is also possible to: firstly, determining whether a current robustness test is a global test or not; the global test characterizes that the current robustness test comprises all test types; if the current robustness test is not the global test, executing the subsequent test type for determining the robustness test, determining a target test script corresponding to the test type from a plurality of candidate test scripts according to the test type, and executing the target test script; however, if the current robustness test is a global test, the previously generated global test script may be executed, and each candidate test script is sequentially called according to a preset sequence in the execution process of the global test script. Therefore, the complexity of operation can be reduced, the testing efficiency is improved, and more importantly, the problem that the coverage of the testing type or the testing scene is incomplete can be avoided.
In the embodiment of the application, the scripting language adopted by the global test script is not limited either, and can be selected according to actual conditions. For example: the python language, or shell language, etc. may be used.
In the embodiment of the application, different candidate test scripts can be set for different test types (different abnormal test cases), so that when a specific abnormal test case needs to be performed, the candidate test script corresponding to the abnormal test case can be executed. Further, when multiple abnormal test cases need to be performed at the same time, shell language scripts can also be used for performing batch call on multiple candidate test scripts corresponding to the multiple abnormal test cases, wherein which candidate test scripts are called can be set in a self-defined mode according to actual test requirements, and the embodiment of the application is not limited to the above.
Additionally, referring to FIG. 9, FIG. 9 is another system architecture diagram for implementing the robustness testing method of embodiments of the present application. Referring to fig. 9, in some alternative embodiments, a dedicated data processor may also be coupled to the first device and network-connected to the second device, such that the first device and the second device communicate via the dedicated data processor with a transmission control protocol stack. The first device and the second device may be clients or servers. In particular, they may be embodied as desktop computers, laptop computers, mobile phones, PDAs, dedicated terminals, as clusters of several terminals, and they may be part of a division on terminals, such as virtual machines.
Referring to fig. 10, fig. 10 is a block diagram of a robustness testing arrangement for a testing device in network connection with a dedicated data processor having a transmission control protocol stack running therein, according to one embodiment of the present application, the robustness testing arrangement comprising:
an abnormal message sending module 1002, configured to construct abnormal message data by using an abnormal message construction module inside the test device in the process of interacting with the special data processor based on the transmission control protocol stack, and send the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test;
the response message receiving module 1004 is configured to receive response message data returned by the transmission control protocol stack, so as to obtain a robustness test result based on the response message data.
Optionally, in some embodiments, the abnormal message sending module 1002 is specifically configured to:
executing an automatic test script to call an abnormal message construction module in the test equipment to construct abnormal message data in the process of interacting with the special data processor based on the transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor.
Optionally, in some embodiments, the exception message sending module 1002 is specifically configured to, when executing the step of calling the exception message construction module inside the test apparatus to construct the exception message data:
monitoring message data sent by a special data processor;
analyzing the message data sent by the special data processor to obtain an analysis result;
and calling an abnormal message construction module in the test equipment to construct abnormal message data based on the analysis result.
Optionally, in some embodiments, the exception message sending module 1002 is further configured to, prior to executing the automated test scripts:
determining a test type of the robustness test; different test types correspond to different automated test scripts;
determining a target test script corresponding to the test type from a plurality of candidate test scripts generated in advance according to the test type;
correspondingly, the abnormal message sending module 1002 is specifically configured to, when executing the automated test script:
and executing the target test script to construct and send abnormal message data corresponding to the test type.
For ease of understanding, two different types of robustness testing procedures are listed below:
first kind: with reference to fig. 5 and 6, the test device is used as a client, the dedicated data processor is used as a server, and the test type (test scenario) is: the complete test process is described by taking the exception of the connection establishment request message as an example:
The first step, a special data processor (server) opens a monitoring state; secondly, the test equipment (client) calls an abnormal message construction module to construct an abnormal connection establishment request message and sends the abnormal connection establishment request message to a special data processor; the test equipment receives a connection establishment confirmation message returned by the special data processor; thirdly, the test equipment analyzes the received connection establishment confirmation message and sends a secondary confirmation message (the TCP connection establishment process is ended so far); fourth step: the test equipment sends a preset data packet to the special data processor and receives a returned data packet confirmation message; fifthly, the test equipment sends a disconnection request message and receives a disconnection confirmation message returned by the special data processor; sixthly, the test equipment sniffs and receives a disconnection request message sent by the special data processor; and seventhly, after receiving the disconnection request message, the test equipment returns a disconnection confirmation message (so far, the TCP connection disconnection process is ended). The testing process is finished, if the testing equipment can respectively receive the connection establishment confirmation message in the second step, the data packet confirmation message in the fourth step, the disconnection confirmation message in the fifth step and the disconnection request message in the sixth step, the robustness of the TCP protocol stack is good aiming at the current testing type; otherwise, if the TCP protocol stack is not robust, the TCP protocol stack is indicated to be poor.
Second kind: in connection with fig. 7 and 7, the test device is used as a server, the dedicated data processor is used as a client, and the test type (test scenario) is: the complete test process is described by taking the exception of the connection establishment confirmation message as an example:
firstly, starting a monitoring state by test equipment; step two, the special data processor sends a connection establishment request message; thirdly, the test equipment receives the connection establishment request message and invokes an abnormal message construction module to construct an abnormal connection establishment confirmation message; the fourth step, the special data processor returns a secondary confirmation message (the TCP connection establishment process is ended so far); fifthly, the special data processor sends a preset data packet, and the test equipment returns a data packet confirmation message; sixthly, the special data processor sends a disconnection request message; seventh, the test equipment receives the disconnection request message and returns a disconnection confirmation message; the test equipment sends a disconnection request message and receives a disconnection confirmation message returned by the special data processor (so far, the TCP connection disconnection process is ended). The testing process is finished, if the testing equipment can respectively receive the secondary confirmation message returned by the special data processor in the fourth step, the preset data packet sent by the special data processor in the fifth step and the disconnection confirmation message returned by the special data processor in the seventh step, the robustness of the TCP protocol stack is good aiming at the current testing type; otherwise, if the TCP protocol stack is not robust, the TCP protocol stack is indicated to be poor.
Optionally, in some embodiments, the exception message sending module 1002 is further configured, before determining the test type of the robustness test, to:
determining whether the current robustness test is a global test; the global test characterizes that the current robustness test comprises all test types; if yes, a step of determining a test type of the robustness test is performed.
Optionally, in some embodiments, the abnormal message sending module 1002 is further configured to:
and if the current robustness test is a global test, executing the global test script so as to call each candidate test script in sequence according to a preset sequence in the execution process of the global test script.
Optionally, in some embodiments, the dedicated data processor is coupled to the first device, and the first device and the second device communicate via the dedicated data processor a transmission control protocol stack.
The robustness testing device in the embodiment of the present application is configured to implement the corresponding robustness testing method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the robustness testing device of the embodiment of the present application may refer to the description of the corresponding portion in the foregoing method embodiment, which is not repeated herein.
Referring to fig. 11, fig. 11 is a block diagram of an electronic device implementing the robustness testing method shown in fig. 4.
The electronic device shown in fig. 11 is only an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
The electronic device shown in fig. 11 may include, but is not limited to: at least one processing unit 1110, at least one memory unit 1120, a bus 1130 that connects the different system components, including the memory unit 1120 and the processing unit 1110. The storage unit 1120 stores program codes that can be executed by the processing unit 1110 such that the processing unit 1110 performs the steps according to various exemplary embodiments of the present invention described in the description part of the exemplary method described above in the present specification.
The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a Random Access Memory (RAM) 11201 and/or a cache memory 11202, and may further include a Read Only Memory (ROM) 11203.
The storage unit 1120 may also include a program/utility 11204 having a set (at least one) of program modules 11205, such program modules 11205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus 1130 may be a local bus representing one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a bus using any of a variety of bus architectures.
The electronic device can also communicate with one or more external devices 1200 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the special purpose data processor 500, and/or any device (e.g., router, modem, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 1150. Also, the special purpose data processor 1100 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network such as the Internet via a network adapter 1160. As shown, network adapter 1160 communicates with other modules of the electronic device via bus 1130. It should be appreciated that, although not shown in the figures, the electronic device may be implemented using other hardware and/or software modules, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer program medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method described in the method embodiment section above.
According to an embodiment of the present disclosure, there is also provided a program product for implementing the method in the above method embodiments, which may employ a portable compact disc read only memory (CD-ROM) and comprise program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A method of robustness testing, characterized by a testing device for network connection with a dedicated data processor having a transmission control protocol stack running therein, comprising:
constructing abnormal message data by utilizing an abnormal message construction module in the test equipment in the process of interacting with the special data processor based on a transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test;
and receiving response message data returned by the transmission control protocol stack so as to obtain a robustness test result based on the response message data.
2. The method according to claim 1, wherein constructing the abnormal message data by using an abnormal message construction module inside the test device and transmitting the abnormal message data to a transmission control protocol stack running in the special data processor during the interaction with the special data processor based on the transmission control protocol stack comprises:
Executing an automatic test script, calling an abnormal message construction module in the test equipment to construct abnormal message data in the process of interacting with the special data processor based on a transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor.
3. The method of claim 2, wherein the invoking the exception message construction module within the test device to construct exception message data comprises:
monitoring message data sent by the special data processor;
analyzing the message data sent by the special data processor to obtain an analysis result;
and calling an abnormal message construction module in the test equipment to construct abnormal message data based on the analysis result.
4. A method according to claim 2 or 3, wherein prior to the step of executing an automated test script, the method further comprises:
determining a test type of the robustness test; different test types correspond to different automated test scripts;
determining a target test script corresponding to the test type from a plurality of candidate test scripts generated in advance according to the test type;
The executing an automated test script comprises:
and executing the target test script to construct and send abnormal message data corresponding to the test type.
5. The method of claim 4, wherein prior to the step of determining a test type for the robustness test, the method further comprises:
determining whether the current robustness test is a global test; the global test characterizes that the current robustness test comprises all test types;
and if not, executing the step of determining the test type of the robustness test.
6. The method of claim 5, wherein after said determining whether the current robustness test is a global test, the method further comprises:
and if the current robustness test is a global test, executing a global test script to call each candidate test script in sequence according to a preset sequence in the execution process of the global test script.
7. A method according to any of claims 1-3, wherein the dedicated data processor is coupled to a first device, the first device and a second device communicating via the dedicated data processor a transmission control protocol stack.
8. A robustness testing arrangement for network connection to a dedicated data processor having a transmission control protocol stack running therein, the robustness testing arrangement comprising:
the abnormal message sending module is used for constructing abnormal message data by utilizing an abnormal message construction module in the test equipment in the process of interacting with the special data processor based on a transmission control protocol stack, and sending the abnormal message data to the transmission control protocol stack running in the special data processor; the abnormal message data is used for carrying out a transmission control protocol stack robustness test;
and the response message receiving module is used for receiving response message data returned by the transmission control protocol stack so as to obtain a robustness test result based on the response message data.
9. An electronic device, comprising:
a memory and a processor, wherein the memory has stored therein a computer program which, when executed by the processor, implements the robustness testing method according to any one of claims 1-7.
10. A computer storage medium storing computer program code which, when executed by a processor, causes the processor to perform the robustness test method according to any one of claims 1-7.
CN202311327063.3A 2023-10-13 2023-10-13 Robustness testing method and device, electronic equipment and medium Pending CN117411955A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311327063.3A CN117411955A (en) 2023-10-13 2023-10-13 Robustness testing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311327063.3A CN117411955A (en) 2023-10-13 2023-10-13 Robustness testing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117411955A true CN117411955A (en) 2024-01-16

Family

ID=89488152

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311327063.3A Pending CN117411955A (en) 2023-10-13 2023-10-13 Robustness testing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117411955A (en)

Similar Documents

Publication Publication Date Title
CN107026764B (en) Remote debugging method, device, server and system
US8732694B2 (en) Method and system for performing services in server and client of client/server architecture
US10367894B2 (en) Information processing apparatus, method for controlling the same, non-transitory computer-readable storage medium, and information processing system
CN109818910A (en) A kind of data transmission method, device and medium
CN114518969A (en) Inter-process communication method, system, storage medium and computer device
CN111385068B (en) Data transmission method, device, electronic equipment and communication system
CN113595927A (en) Method and device for processing mirror flow in bypass mode
CN113328877A (en) Method and device for determining port protocol
CN117411955A (en) Robustness testing method and device, electronic equipment and medium
CN109445806B (en) Ble-based multi-device upgrading method, device, system and terminal
Narita et al. Reliable cloud-based robot services
CN110572438A (en) network connection establishing method, device, network equipment and storage medium
CN111265852A (en) Low-delay information transmission method and device based on UDP (user Datagram protocol)
US7529812B2 (en) Socket connections over a serial link
CN112398718A (en) Network transmission method and device, electronic equipment and storage medium
CN113810264A (en) Information transmission method and device, electronic equipment and storage medium
JP2001147868A (en) Remote transmission and reception system for control equipment
KR100914308B1 (en) TCP processing system and method of controlling the same
US8601106B2 (en) Remote command execution over a network
CN113032123B (en) Thread scheduling method, system and related device of remote NPL running environment
CN114785603B (en) MQTT protocol-based safety protection method, device, equipment and storage medium
CN115373927B (en) Product testing method, device, electronic equipment and computer readable medium
CN117201577B (en) Communication method and system of cross-platform API and SPI based on PISA
WO2024093534A1 (en) Npn identification method and apparatus, and related device
CN111371723B (en) Method and device for realizing PPTP VPN network isolation under DPDK framework

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination