Network communication behavior simulation method, system, device, equipment and storage medium
By obtaining the traffic packet to be played back for the network communication behavior to be simulated, unpacking it to obtain the terminal operation execution plan, and establishing a communication relationship with the dial-test target station through the dial-test platform, it solves the need to rely on the traffic monitoring system for network communication in the existing technology. The problem of behavioral simulation realizes the simulation of network communication behavior without connecting to the traffic monitoring system.
Patent Information
- Application Number
- CN202410762071.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-06-13
AI Technical Summary
The simulation of network communication behavior in the prior art requires a traffic monitoring system, and it is impossible to simulate when the traffic monitoring system is not connected.
By obtaining the traffic packet to be played back corresponding to the network communication behavior to be simulated, the dial test target station that can establish communication with the dial test terminal is determined based on the dial test platform, the traffic packet to be played back is unpacked, and the terminal operation execution plan is obtained, and through the The scheduler sends data packets to the target station, receives response content, and simulates network communication behavior.
It realizes the simulation of network communication behavior without connecting to the traffic monitoring system, and can simulate network communication behavior in multi-region, multi-network rate, and multi-communication terminal scenarios.
Smart Images

Figure CN118337641B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of wireless communication technology, and in particular to a network communication behavior simulation method, system, device, equipment and storage medium. Background Art
[0002] Currently, there are network devices in operator communication networks, enterprise networks, and home networks. Some of these network devices are responsible for communication transmission, while others are responsible for recording network behaviors to prevent security risks in network behaviors, such as recording the traffic rate of a certain terminal, the accumulated traffic used, and monitoring whether there are security risks in communications. In real communication networks, enterprise networks, and other environments, when verifying the completeness, real-time performance, and accuracy of specific functions of monitoring equipment or monitoring systems, it is necessary to simulate a specific network communication behavior to trigger the functions of the monitoring equipment or monitoring system.
[0003] Usually, when simulating network communication behavior, the flow is tested through a network flow test instrument, and the captured flow packets are played back on the flow monitoring system. That is, the existing technology cannot simulate network communication behavior when not connected to the flow monitoring system. Summary of the invention
[0004] The present invention provides a network communication behavior simulation method, system, device, equipment and storage medium to solve the problem in the prior art that the simulation of network communication behavior needs to rely on a flow monitoring system.
[0005] According to one aspect of the present invention, a network communication behavior simulation method is provided, which is applied to a dial-up test terminal, and the method comprises:
[0006] Obtain the traffic packets to be replayed corresponding to the network communication behavior to be simulated;
[0007] Determine, based on the dial test platform, a dial test target station capable of establishing communication with the dial test terminal;
[0008] Unpacking the traffic packet to be replayed to obtain a terminal operation execution schedule;
[0009] The terminal operation execution schedule is used to send the data packets in the traffic packet to be replayed to the dialing target station, and the response content of the dialing target station is received.
[0010] According to another aspect of the present invention, a network communication behavior simulation system is provided, the system comprising: a dial test terminal, a dial test platform and a dial test target station, wherein the dial test terminal, the dial test platform and the dial test target station are connected to each other in pairs;
[0011] The dial-up test terminal is used to obtain the traffic packet to be replayed corresponding to the network communication behavior to be simulated, and send a replay request to the dial-up test platform;
[0012] The dial test platform is used to determine a dial test target station that can establish communication with the dial test terminal according to the playback request;
[0013] The dial-test target station is used to receive and respond to data packets sent by the dial-test terminal after establishing communication with the dial-test terminal.
[0014] According to another aspect of the present invention, a network communication behavior simulation device is provided, the device comprising:
[0015] An acquisition module is used to acquire the traffic packets to be replayed corresponding to the network communication behavior to be simulated;
[0016] A determination module, used to determine a dialing test target station capable of establishing communication with the dialing test terminal based on a dialing test platform;
[0017] An unpacking module, used to unpack the traffic packet to be replayed to obtain a terminal operation execution schedule;
[0018] The transmission module is used to send the data packet in the traffic packet to be replayed to the dialing target station through the terminal operation execution plan table, and receive the response content of the dialing target station.
[0019] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising: at least one processor; and
[0020] a memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the network communication behavior simulation method described in any embodiment of the present invention.
[0022] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the network communication behavior simulation method described in any embodiment of the present invention when executed.
[0023] A network communication behavior simulation method, system, device, equipment and storage medium of an embodiment of the present invention obtains a traffic packet to be replayed corresponding to the network communication behavior to be simulated; determines a dialing test target station that can establish communication with the dialing test terminal based on a dialing test platform; unpacks the traffic packet to be replayed to obtain a terminal operation execution schedule; sends data packets in the traffic packet to be replayed to the dialing test target station through the terminal operation execution schedule, and receives the response content of the dialing test target station. This method establishes a communication relationship between the dialing test terminal and the dialing test target station through the dialing test platform, sends data packets in the traffic packet to be replayed through the dialing test terminal, and receives the response content returned by the dialing test target station, and can simulate network communication behavior when not connected to a traffic monitoring system.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 A schematic diagram of a flow chart of a network communication behavior simulation method provided in Embodiment 1 of the present invention;
[0027] Figure 2 A schematic diagram of a flow chart of a network communication behavior simulation method provided by an embodiment of the present invention;
[0028] Figure 3 A flowchart of another network communication behavior simulation method provided by an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of a process for unpacking a data packet to be replayed provided by an embodiment of the present invention;
[0030] Figure 5 A schematic diagram of the structure of a network communication behavior simulation system provided in Embodiment 2 of the present invention;
[0031] Figure 6 A schematic diagram of the structure of a network communication behavior simulation device provided in Embodiment 3 of the present invention;
[0032] Figure 7 Schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention. It should be understood that the various steps recorded in the method implementation of the present invention can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0034] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0037] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0038] At present, the method of simulating communication traffic is to use network traffic test instruments to test the traffic, and to replay the captured pcap traffic packets on the traffic monitoring system in the tcpreplay mode. This test method requires the network traffic test instrument to be connected to the switch or router mirrored by the traffic monitoring system. It is usually used for high-performance, high-density, and high-speed traffic simulation tests on high-end routers and high-end switches. The general rate matches the port rate of the communication equipment, such as the test of 400G / 100G / 40G / 25G / 10G / 5G / 2.5G / GE ports.
[0039] Tcpreplay is a traffic packet playback tool that can replay the traffic packets captured by ethreal and wireshark tools as is or after any modification. The playback tool can make any modification to the message (mainly refers to the layer 2, layer 3, and layer 4 message headers), as well as specify the speed of replaying the message, etc. However, it needs to be associated with the network card for playback, which means that this playback tool can only simulate the network card sending and receiving packets. Therefore, the playback tool usually runs on the network card monitored by the traffic monitoring system. However, the above method is not applicable to application scenarios where it is not possible to directly connect to the traffic monitoring system for traffic simulation, and it cannot be installed and run on the traffic monitoring system for communication traffic simulation. Therefore, this solution proposes a network communication behavior simulation method in a scenario where there is no serial connection of multiple communication network elements and no simulation of multiple regions, multiple network rates, and multiple communication terminals of the real communication network and enterprise network.
[0040] Embodiment 1
[0041] Figure 1 A flow chart of a network communication behavior simulation method provided in Embodiment 1 of the present invention is provided. The method can be applied to situations where communication behaviors in a network are simulated. The method can be executed by a network communication behavior simulation device, wherein the device can be implemented by software and / or hardware and is generally integrated on an electronic device. In this embodiment, the electronic device includes but is not limited to: a dialing test terminal, which can be a computer or other device.
[0042] like Figure 1 As shown, a network communication behavior simulation method provided in Embodiment 1 of the present invention is applied to a dial-up test terminal, and includes the following steps:
[0043] S110: Obtain the traffic packets to be replayed corresponding to the network communication behavior to be simulated.
[0044] Among them, the network communication behavior to be simulated can be a network communication behavior that needs to be simulated. This embodiment does not limit the type of network communication behavior. For example, the network communication behavior that needs to be simulated can be simulating the transmission of heartbeats from a home IoT device to an IoT cloud platform, simulating the communication with a controlled terminal after a Trojan in a car's onboard terminal, simulating the use of traffic in a mobile phone to access the Internet for malicious program email sending and receiving, and the like. The traffic packet to be replayed can be a traffic packet generated when a network communication behavior occurs. When a network communication behavior occurs, some network data packet storage data will be generated. By replaying these data, the network communication behavior can be simulated. Replay refers to the network interaction behavior of restoring and sending a data packet after modification. The traffic packet to be replayed can be a file in the format of pcap, cap, pcapng, etl, etc. This embodiment does not limit this. Among them, a pcap file is a network data packet storage file format, which is usually used to store network packet capture data. The pcap file contains the original data of the network data packet and some metadata information, such as timestamp, data packet length, etc. By parsing the pcap file, the content of the data packet can be obtained and the network communication situation can be analyzed.
[0045] The dial test terminal refers to a terminal device used to initiate network communication behavior. The dial test is a means of testing the quality of a network link. In this embodiment, it can refer to a test used to describe the simulated user terminal device's Internet access behavior. The dial test terminal can be used to simulate mobile phone terminals surfing the Internet, simulate computer terminals surfing the Internet, simulate vehicle terminals surfing the Internet, simulate Internet of Things terminals surfing the Internet, and simulate server equipment networking. The dial test terminal can be a mobile phone, a computer, or other devices, and this embodiment does not limit this.
[0046] In this embodiment, after the network communication behavior to be simulated is determined, the traffic packets generated when the network communication behavior occurs can be obtained as the traffic packets to be replayed.
[0047] S120: Determine, based on the dialing test platform, a dialing test target station that can establish communication with the dialing test terminal.
[0048] The dial test platform may be a platform for coordinating the communication relationship between the dial test terminal and the dial test target station. The dial test target station may be a device for receiving data sent by the dial test terminal and giving a response.
[0049] In this embodiment, when determining the to-be-played traffic packet that needs to be played back, the dial-test terminal may determine a dial-test target station that can establish communication with the dial-test terminal based on the dial-test platform.
[0050] S130: Unpack the traffic packet to be replayed to obtain a terminal operation execution schedule.
[0051] The terminal operation execution plan table may be a plan table for recording the data packets that the dial-up terminal needs to send and the sending order of the data packets. The terminal operation execution plan table may include data packet identifiers and the corresponding packet sending order.
[0052] In this embodiment, since the traffic packet to be replayed includes many data packets, it is necessary to unpack the traffic packet to be replayed, determine which data packets in the traffic packet to be replayed the data packets to be sent by the dial-up terminal are, and build a terminal operation execution plan table based on the unpacking results.
[0053] S140. Send the data packet in the traffic packet to be replayed to the dialing target station through the terminal operation execution schedule, and receive the response content of the dialing target station.
[0054] The response content may be the response content of the dial-up target station.
[0055] In this embodiment, after obtaining the terminal operation execution schedule, the dial test terminal can send the corresponding data packets in the traffic packet to be replayed to the dial test target station in sequence according to the terminal operation execution schedule, and receive the response content of the dial test target station according to the data packet. When all data packets are sent and responded between the dial test terminal and the dial test target station, the simulation of a network communication behavior is completed.
[0056] A network communication behavior simulation method provided in a first embodiment of the present invention includes: obtaining a traffic packet to be replayed corresponding to the network communication behavior to be simulated; determining a dialing test target station that can establish communication with the dialing test terminal based on a dialing test platform; unpacking the traffic packet to be replayed to obtain a terminal operation execution schedule; sending a data packet in the traffic packet to be replayed to the dialing test target station through the terminal operation execution schedule, and receiving a response from the dialing test target station. The dialing test terminal establishes a communication relationship with the dialing test target station through the dialing test platform, and simulates network communication behavior with the dialing test target station. The participation of the traffic monitoring system is not required, and the network communication behavior can be simulated when the traffic monitoring system is not connected.
[0057] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0058] In one embodiment, the dialing test target station that can establish communication with the dialing test terminal is determined based on the dialing test platform, including: sending a playback request to the dialing test platform, the playback request including the dialing test terminal address; receiving the dialing test target station address returned by the dialing test platform based on the dialing test terminal address and the address of the traffic packet to be played back; and establishing communication with the corresponding dialing test target station based on the dialing test target station address.
[0059] The playback request may be a request sent by the dial test terminal to the dial test platform to request the playback of a data packet, and the playback request may include the dial test terminal address. The dial test terminal address may be the IP address of the dial test terminal. The address of the traffic packet to be played back may be the identifier of the traffic packet to be played back. The dial test target station address may be the IP address of the dial test target station.
[0060] In this embodiment, the dialing test terminal can send a playback request to the dialing test platform, so that the dialing test platform determines the dialing test target station that can establish a communication connection with the dialing test terminal from all the dialing test target stations based on the dialing test terminal address included in the playback request and the address of the traffic packet to be played back; when the dialing test platform determines the dialing test target station, it can return the dialing test target station address of the dialing test target station to the dialing test terminal, and the dialing test terminal can establish communication with the corresponding dialing test target station based on the dialing test target station address.
[0061] For example, Figure 2 A flow chart of a network communication behavior simulation method provided by an embodiment of the present invention is as follows: Figure 2 As shown, the dial test terminal, the dial test target station, and the dial test platform can be connected through the Internet. The dial test platform is used to coordinate and maintain the communication relationship between the dial test terminal and the dial test target station, that is, under what circumstances a dial test terminal and a dial test target station will establish a peer-to-peer communication relationship. Taking the PCAP data packet as an example, when the dial test terminal (dial test mobile phone or dial test computer) receives the PCAP packet playback task, before starting the playback, it first requests the dial test platform to coordinate before the playback, and completes the playback negotiation action between the dial test terminal and the dial test target station through the dial test platform to prevent the direct communication between the dial test terminal and the dial test target station from causing useless data to be generated during the packet playback, affecting the playback effect. When the three-party negotiation is completed, the dial test terminal starts to play back the packet to the dial test target station, and the dial test target station returns the packet according to the actual situation until all packets are played back, disconnect the connection, and the playback is completed.
[0062] Figure 3 A flow chart of another network communication behavior simulation method provided by an embodiment of the present invention is as follows: Figure 3 As shown in the figure, taking the PCAP data packet as the data packet to be replayed as an example, the negotiation process of the dial test terminal applying to the dial test platform for the dial test target station is as follows:
[0063] 1. The dial-up test terminal sends an http request for replaying a pcap file to the dial-up test platform, requesting the dial-up test platform to negotiate and apply for an available target station. This communication behavior adopts a synchronous waiting state mechanism until the dial-up test platform responds, and then this communication is completed.
[0064] 2. At this time, the communication between the dial test terminal and the dial test platform is not disconnected, but the dial test platform continues to establish communication with the dial test target station, and based on the Transmission Control Protocol (TCP), it attaches the pcap information to be replayed and the IP address of the client, that is, the dial test terminal, to ask the target station whether it can establish a relationship with the dial test terminal of the IP to replay the specified pcap. The dial test platform can ask different dial test target stations in turn until it finds the corresponding dial test target station.
[0065] 3. After the dial-up test target station confirms that it can be replayed, download the corresponding pcap file through the dial-up test platform.
[0066] 4. The dial test target station unpacks the downloaded pcap file and caches it into memory, and responds to the dial test platform that the dial test platform is ready for playback.
[0067] 5. The dial test platform sends the negotiation success information back to the dial test terminal. After receiving the response information, the dial test terminal completes the negotiation according to the dial test target station IP.
[0068] In one embodiment, the unpacking of the traffic packets to be replayed to obtain a terminal operation execution plan includes: for each data packet in the traffic packets to be replayed, obtaining the destination address of the data packet and the corresponding packet sending order; taking the data packet whose destination address is the same as the dialing target station address as the data packet that the dialing terminal needs to send; and constructing a terminal operation execution plan based on the data packet that the dialing terminal needs to send and the corresponding packet sending order.
[0069] The data packet includes a destination address and a source address. The destination address of the data packet refers to the address of the target device to which the data packet is to be sent, while the source address is the address of the device that sends the data packet. The packet sending order refers to the order in which the data packets are sent. The packet issuance order can be determined by the order record in the original traffic packet to be replayed.
[0070] In this embodiment, when the dial test platform records the data packet to be replayed, it will record the target IP of the packet actually to be replayed in the data packet to be replayed in advance, that is, the address of the target device to which the data packet is to be sent. In this embodiment, the device that sends the data packet refers to the dial test terminal, and the target device refers to the dial test target station. Therefore, the address of the dial test target station can be used as the target address. Before simulating network communication behavior, the dial test terminal can first unpack the traffic packet to be replayed, and use the data packet associated with the dial test terminal as the data packet that the dial test terminal needs to send, and build a terminal operation execution plan table based on the data packet and the packet sending order.
[0071] For example, Figure 4 A schematic diagram of a process for unpacking a data packet to be replayed provided by an embodiment of the present invention, such as Figure 4 As shown in the figure, taking the pcap file as an example, when the dial test platform records the data packet to be played back, it will record the target IP of the packet to be played back in advance. After the negotiation between the dial test terminal and the dial test target station is successful, they will perform packet processing according to the target IP, as follows:
[0072] 1. Traverse each package data in the PCAP file, extract the source IP and destination IP, and compare them with the target IP in turn;
[0073] 2. If the source IP in the package is equal to the target IP, and the payload is not empty, then the package will be assigned and recorded as the package played back by the target station; payload refers to the part of the network data packet that actually carries useful information, which is the actual data content after removing the header and other protocol related information. In this embodiment, the validity of the data packet can also be determined by judging the payload;
[0074] 3. If the destination IP in the package is equal to the target IP, and the payload is not empty, the package will be assigned and recorded as the package that needs to be sent by the test terminal;
[0075] 4. If the source IP and destination IP in the package are different from the target IP, it is redundant data and can be discarded.
[0076] After the above unpacking and arrangement, the dial test terminal and the dial test target station respectively get a one-to-one corresponding operation execution plan table. The two corresponding execution plans will record the actions of establishing a communication connection, sending packets, and receiving packets in the order of the original pcap. The execution plan table of the dial test terminal mainly records the actions of establishing a connection, sending messages, receiving response messages, and disconnecting in sequence. The execution plan table of the dial test target station can be stored according to the IP of the dial test terminal, and records the actions of receiving messages and responding to messages, responding to messages, and only receiving messages in sequence.
[0077] In one embodiment, the method of sending the data packet in the traffic packet to be replayed to the dial test target station through the terminal operation execution plan table and receiving the response content of the dial test target station includes: sending the data packet in the traffic packet to be replayed through the data packet identifier and packet sending order recorded in the terminal operation execution plan table; after receiving the response content returned by the dial test target station based on the data packet, continuing to send the next data packet until all the data packets recorded in the terminal operation execution plan table are sent.
[0078] The data packet identifier may be a unique identifier of the data packet.
[0079] In this embodiment, after constructing the terminal operation execution plan table, the dialing test terminal can send data packets in sequence according to the data packet identifiers and packet sending order recorded in the terminal operation execution plan table, and receive the response content returned by the dialing test target station based on the data packets. After completing one packet sending and receiving, the dialing test terminal can continue to send the next data packet until all the data packets recorded in the terminal operation execution plan table are sent.
[0080] Exemplarily, a process of data packet playback is as follows:
[0081] 1. After the dial test terminal actively connects to the dial test target station IP, it sends packages one by one according to the pcap package content;
[0082] 2. When the target station receives any message, it searches the local package cache with the sender's source public network IP (i.e. the dial-up terminal IP); if the corresponding IP is found, it takes out the corresponding cache content and pops the top element of the stack to return; otherwise, it replies with the default message configured by the system;
[0083] 3. After receiving the response message, the dial-up terminal continues to send the next package until the end;
[0084] 4. When the playback is finished, the dial test terminal actively disconnects the connection with the dial test target station and requests the dial test platform to release the target station interface. The dial test platform notifies the target station to clear the corresponding cached operation execution plan table and other information, and clears the negotiation information between the dial test terminal and the dial test target station. The dial test target station in this embodiment can establish communication with multiple dial test terminals at the same time, but one dial test terminal can only establish communication with one dial test target station at the same time.
[0085] The network communication behavior simulation method in this embodiment can realize two-way playback of traffic messages by building the communication between the dial test terminal and the dial test target station, that is, the dial test terminal and the dial test target station perform simultaneous response playback to achieve the behavior of simulating specific network communication. And by building a dial test system including a dial test platform, a dial test terminal and a dial test target station, there is no need to perform packet playback on the traffic monitoring system, and the dial test system can be decoupled from the traffic monitoring system, that is, the two systems do not need to be physically associated to realize the simulation of communication behavior. When the traffic detection system is connected for testing, the test can be performed without the perception of the traffic monitoring system, which meets the scenario of the assessment of the traffic monitoring and analysis system. Moreover, the network communication behavior in this embodiment is not limited to specific communication behaviors, and any communication behavior of the network layer and above protocols can be simulated, such as simulating the communication behavior in the large network of communication operators and enterprise office networks such as the mobile Internet, the Internet of Things, the Industrial Internet, and the Internet Data Center (IDC) related networks. Users can also assemble a variety of verification scenarios based on the traffic message files to be replayed.
[0086] Embodiment 2
[0087] Figure 5 This is a schematic diagram of the structure of a network communication behavior simulation system provided by Embodiment 2 of the present invention. For details not yet fully described in this embodiment, please refer to Embodiment 1.
[0088] like Figure 5 As shown, a network communication behavior simulation system provided by the second embodiment of the present invention includes: a dial test terminal 10, a dial test platform 20 and a dial test target station 30, and the dial test terminal 10, the dial test platform 20 and the dial test target station 30 are connected to each other in pairs;
[0089] The dial-up test terminal 10 is used to obtain the traffic packet to be replayed corresponding to the network communication behavior to be simulated, and send a replay request to the dial-up test platform 20;
[0090] The dialing test platform 20 is used to determine the dialing test target station 30 that can establish communication with the dialing test terminal 10 according to the playback request;
[0091] The dialing target station 30 is used to receive the data packet sent by the dialing terminal 10 and respond after establishing communication with the dialing terminal 10.
[0092] Among them, the dialing test terminal 10 refers to a terminal device used to initiate network communication behavior. The dialing test terminal 10 can be a mobile phone, a computer or other device, and this embodiment does not limit this. The network communication behavior to be simulated can be a network communication behavior that needs to be simulated, and the traffic packet to be replayed can be a traffic packet generated when the network communication behavior occurs. The dialing test platform 20 can be a platform for coordinating the communication relationship between the dialing test terminal and the dialing test target station. The playback request can be a request sent by the dialing test terminal to the dialing test platform to request the replay of the data packet, and the playback request can include the dialing test terminal address. The dialing test target station 30 can be a device for receiving data sent by the dialing test terminal and giving a response. The dialing test terminal 10, the dialing test platform 20 and the dialing test target station 30 can be connected to each other in communication, and the connection method is not limited to this in this embodiment. For example, it can be connected through the Internet.
[0093] In this embodiment, the dialing test terminal 10 can send a playback request to the dialing test platform 20 based on the acquired traffic packet to be played back. After receiving the playback request, the dialing test platform 20 can search for a dialing test target station 30 that can establish a communication connection with the dialing test terminal 10 based on the information included in the playback request. After confirmation, the dialing test terminal 10 can establish communication with the dialing test target station 30, and the dialing test target station 30 can receive the data packet sent by the dialing test terminal 10 and respond.
[0094] A network communication behavior simulation system provided by the second embodiment of the present invention includes: a dialing test terminal, a dialing test platform and a dialing test target station, wherein the dialing test terminal, the dialing test platform and the dialing test target station are connected to each other; the dialing test terminal is used to obtain the traffic packet to be replayed corresponding to the network communication behavior to be simulated, and send a replay request to the dialing test platform; the dialing test platform is used to determine the dialing test target station that can establish communication with the dialing test terminal according to the replay request; the dialing test target station is used to receive the data packet sent by the dialing test terminal and respond after establishing communication with the dialing test terminal. The dialing test terminal establishes a communication relationship with the dialing test target station through the dialing test platform, and simulates the network communication behavior with the dialing test target station. The participation of the traffic monitoring system is not required, and the network communication behavior can be simulated when the traffic monitoring system is not connected.
[0095] This embodiment simulates a certain network communication behavior by dialing a test. The dialing test terminal is responsible for initiating a communication request, and the dialing test target station is responsible for receiving the request from the dialing test terminal and responding to it, thus forming a set of network communication behaviors. The network communication behavior simulation system of this embodiment can also be connected to a traffic monitoring system to trigger whether the function of the traffic monitoring system is hit, so as to detect whether the traffic monitoring system can work normally. For example, by simulating specific network communication behaviors to trigger specific functions of the traffic monitoring system, such as: monitoring the industrial protocols used by industrial equipment, monitoring whether mobile phones download malicious programs, monitoring whether home Internet of Things devices are maliciously controlled, etc.
[0096] In one embodiment, the playback request includes a dialing test terminal address, and the dialing test platform 20 is specifically used to: send the dialing test terminal address and the address of the traffic packet to be played back to the dialing test target station 30 to determine whether the dialing test target station 30 can establish communication with the dialing test terminal 10.
[0097] The dialing test terminal address may be the IP address of the dialing test terminal, the address of the traffic packet to be replayed may be the identifier of the traffic packet to be replayed, and the dialing test target station address may be the IP address of the dialing test target station.
[0098] In this embodiment, after receiving the playback request, the dialing test platform 20 can send the dialing test terminal address and the address of the traffic packet to be played back to the dialing test target station 30 to determine the dialing test target station 30 that can establish a communication connection with the dialing test terminal 10.
[0099] In one embodiment, the target dialing station 30 is specifically used for:
[0100] Obtaining the dialing test terminal address and the traffic packet to be replayed;
[0101] For each data packet in the traffic packet to be replayed, obtain the source address, destination address and corresponding packet sending order of the data packet;
[0102] The data packets with the same destination address as the dial test target station address in the traffic packets to be replayed are used as the data packets that need to be sent by the dial test terminal 10, and the data packets with the same source address as the dial test target station address are used as the data packets corresponding to the dial test target station 30;
[0103] Based on the data packets to be sent by the dialing test terminal 10 and the data packets corresponding to the dialing test target station 30, a target station operation execution schedule corresponding to the dialing test terminal 10 is constructed;
[0104] The target station operation execution schedule is used to make the dialing target station respond to the data packet of the corresponding dialing terminal.
[0105] Among them, the destination address of the data packet refers to the address of the target device to which the data packet is to be sent, and the source address is the address of the device that sends the data packet. The packet sending order refers to the order in which the data packets are sent, and the packet issuance order can be determined by the sequence record in the original traffic packet to be replayed. The target station operation execution plan is an operation execution plan associated with the dialing terminal stored at the dialing target station. In addition to recording the data packets to be replayed and the playback order of the dialing target station, the target station operation execution plan can also record the data packets to be sent by the corresponding dialing terminal and the sending order. Depending on the number of dialing terminals that establish communication with the dialing target station 30, multiple target station operation execution plan tables can be stored on the dialing target station 30.
[0106] In this embodiment, after determining that communication can be established with the dialing terminal 10, the dialing target station 30 can obtain the traffic packet to be replayed and unpack the traffic packet to be replayed. The unpacking process is similar to that of the dialing terminal 10, and this embodiment will not be repeated here.
[0107] Embodiment 3
[0108] Figure 6 This is a schematic diagram of the structure of a network communication behavior simulation device provided in Embodiment 3 of the present invention. The device can be used to simulate communication behaviors in a network, wherein the device can be implemented by software and / or hardware and is generally integrated on an electronic device.
[0109] like Figure 6 As shown, the device comprises:
[0110] An acquisition module 310 is used to acquire a traffic packet to be replayed corresponding to the network communication behavior to be simulated;
[0111] A determination module 320, configured to determine, based on a dialing test platform, a dialing test target station capable of establishing communication with the dialing test terminal;
[0112] The unpacking module 330 is used to unpack the traffic packet to be replayed to obtain a terminal operation execution schedule;
[0113] The transmission module 340 is used to send the data packet in the traffic packet to be replayed to the dialing target station through the terminal operation execution schedule, and receive the response content of the dialing target station.
[0114] The present embodiment provides a network communication behavior simulation device, the device comprising: an acquisition module, used to acquire the traffic packet to be replayed corresponding to the network communication behavior to be simulated; a determination module, used to determine the dialing test target station that can establish communication with the dialing test terminal based on the dialing test platform; an unpacking module, used to unpack the traffic packet to be replayed to obtain a terminal operation execution schedule; a transmission module, used to send the data packet in the traffic packet to be replayed to the dialing test target station through the terminal operation execution schedule, and receive the response content of the dialing test target station. The dialing test terminal establishes a communication relationship with the dialing test target station through the dialing test platform, and simulates the network communication behavior with the dialing test target station. It does not require the participation of the traffic monitoring system and can simulate the network communication behavior when it is not connected to the traffic monitoring system.
[0115] Furthermore, the determination module 320 includes:
[0116] Sending a playback request to the dialing test platform, wherein the playback request includes a dialing test terminal address;
[0117] Receiving the dialing test target station address returned by the dialing test platform according to the dialing test terminal address and the address of the traffic packet to be replayed;
[0118] Establish communication with the corresponding dialing target station according to the dialing target station address.
[0119] Furthermore, the unpacking module 330 includes:
[0120] For each data packet in the traffic packet to be replayed, obtain the destination address of the data packet and the corresponding packet sending order;
[0121] Taking the data packet with the same destination address as the dialing target station address as the data packet that needs to be sent by the dialing terminal;
[0122] A terminal operation execution schedule is constructed based on the data packets that the dial-up terminal needs to send and the corresponding packet sending sequence.
[0123] Furthermore, the transmission module 340 includes:
[0124] Send the data packets in the traffic packets to be replayed by executing the data packet identifiers and the packet sending order recorded in the terminal operation plan table;
[0125] After receiving the response content returned by the dial-up target station based on the data packet, continue to send the next data packet until all the data packets recorded in the terminal operation execution plan table are sent.
[0126] The above-mentioned network communication behavior simulation device can execute the network communication behavior simulation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0127] Embodiment 4
[0128] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0129] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0130] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0131] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a network communication behavior simulation method.
[0132] In some embodiments, the network communication behavior simulation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the network communication behavior simulation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the network communication behavior simulation method in any other appropriate manner (e.g., by means of firmware).
[0133] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0134] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0135] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0136] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0137] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0138] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0139] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0140] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A network communication behavior simulation method, characterized in that: Applied to a dial-up test terminal, the method comprises: Obtain the traffic packets to be replayed corresponding to the network communication behavior to be simulated; Determine, based on the dial test platform, a dial test target station capable of establishing communication with the dial test terminal; Depacketizing the traffic packets to be replayed to obtain a terminal operation execution schedule; the terminal operation execution schedule includes data packet identifiers of data packets to be sent by the dial-up terminal and corresponding packet sending sequences; Sending the data packet in the traffic packet to be replayed to the dial test target station through the terminal operation execution schedule, and receiving the response content of the dial test target station; The unpacking of the traffic packet to be replayed to obtain a terminal operation execution plan table includes: For each data packet in the traffic packet to be replayed, obtain the destination address of the data packet and the corresponding packet sending order; Taking the data packet with the same destination address as the dialing target station address as the data packet that needs to be sent by the dialing terminal; A terminal operation execution schedule is constructed based on the data packets that the dial-up terminal needs to send and the corresponding packet sending sequence.
2. The method according to claim 1, characterized in that: The step of determining a dialing test target station capable of establishing communication with the dialing test terminal based on the dialing test platform includes: Sending a playback request to the dialing test platform, wherein the playback request includes a dialing test terminal address; Receiving the dialing test target station address returned by the dialing test platform according to the dialing test terminal address and the address of the traffic packet to be replayed; Establish communication with the corresponding dialing target station according to the dialing target station address.
3. The method according to claim 1, characterized in that The step of sending the data packet in the traffic packet to be replayed to the dial test target station through the terminal operation execution schedule, and receiving the response content of the dial test target station, includes: Send the data packets in the traffic packets to be replayed by executing the data packet identifiers and the packet sending order recorded in the terminal operation plan table; After receiving the response content returned by the dial-up target station based on the data packet, continue to send the next data packet until all the data packets recorded in the terminal operation execution plan table are sent.
4. A network communication behavior simulation system, characterized in that: The system comprises: a dialing test terminal, a dialing test platform and a dialing test target station, wherein the dialing test terminal, the dialing test platform and the dialing test target station are connected to each other in pairs; The dial-up test terminal is used to obtain the traffic packet to be replayed corresponding to the network communication behavior to be simulated, and send a replay request to the dial-up test platform; The dial test platform is used to determine a dial test target station that can establish communication with the dial test terminal according to the playback request; The dial test target station is used to receive and respond to a data packet sent by the dial test terminal after establishing communication with the dial test terminal; The dial-test terminal is further used to: unpack the traffic packets to be replayed to obtain a terminal operation execution schedule; the terminal operation execution schedule includes data packet identifiers of data packets to be sent by the dial-test terminal and corresponding packet sending sequences; Sending the data packet in the traffic packet to be replayed to the dial test target station through the terminal operation execution schedule, and receiving the response content of the dial test target station; The unpacking of the traffic packet to be replayed to obtain a terminal operation execution plan table includes: For each data packet in the traffic packet to be replayed, obtain the destination address of the data packet and the corresponding packet sending order; Taking the data packet with the same destination address as the dialing target station address as the data packet that needs to be sent by the dialing terminal; A terminal operation execution schedule is constructed based on the data packets that the dial-up terminal needs to send and the corresponding packet sending sequence.
5. The system according to claim 4, characterized in that The playback request includes a dialing test terminal address, and the dialing test platform is specifically used to send the dialing test terminal address and the address of the traffic packet to be played back to the dialing test target station to determine whether the dialing test target station can establish communication with the dialing test terminal.
6. The system according to claim 4, characterized in that The dialing target station is specifically used for: Obtaining the dialing test terminal address and the traffic packet to be replayed; For each data packet in the traffic packet to be replayed, obtain the source address, destination address and corresponding packet sending order of the data packet; The data packets whose destination addresses are the same as the dial test target station address in the traffic packets to be replayed are used as the data packets that the dial test terminal needs to send, and the data packets whose source addresses are the same as the dial test target station address are used as the data packets corresponding to the dial test target station; Based on the data packet to be sent by the dialing test terminal and the data packet corresponding to the dialing test target station, construct a target station operation execution plan table corresponding to the dialing test terminal; The target station operation execution schedule is used to make the dial test target station respond to the data packet of the corresponding dial test terminal.
7. A network communication behavior simulation device, characterized in that: The device comprises: An acquisition module is used to acquire the traffic packets to be replayed corresponding to the network communication behavior to be simulated; A determination module, used to determine a dial test target station capable of establishing communication with the dial test terminal based on the dial test platform; An unpacking module is used to unpack the traffic packet to be replayed to obtain a terminal operation execution schedule; the terminal operation execution schedule includes a data packet identifier of the data packet to be sent by the dial-up terminal and a corresponding packet sending order; A transmission module, used for sending the data packets in the traffic packets to be replayed to the dial test target station through the terminal operation execution schedule, and receiving the response content of the dial test target station; Unpack modules, including: For each data packet in the traffic packet to be replayed, obtain the destination address of the data packet and the corresponding packet sending order; Taking the data packet with the same destination address as the dialing target station address as the data packet that needs to be sent by the dialing terminal; A terminal operation execution schedule is constructed based on the data packets that the dial-up terminal needs to send and the corresponding packet sending sequence.
8. An electronic device, characterized in that: The device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the network communication behavior simulation method according to any one of claims 1 to 3.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the network communication behavior simulation method according to any one of claims 1 to 3 when executed.
Citation Information
Patent Citations
Dial measuring method and apparatus for data traffic unified payment services
CN105634849A
Software testing method, flow playback device, terminal equipment and readable storage medium
CN111045952A