CN115811484A - Network detection method, device and storage medium - Google Patents

Network detection method, device and storage medium Download PDF

Info

Publication number
CN115811484A
CN115811484A CN202211408440.1A CN202211408440A CN115811484A CN 115811484 A CN115811484 A CN 115811484A CN 202211408440 A CN202211408440 A CN 202211408440A CN 115811484 A CN115811484 A CN 115811484A
Authority
CN
China
Prior art keywords
processing
function
message
detection
timestamp
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
CN202211408440.1A
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202211408440.1A priority Critical patent/CN115811484A/en
Publication of CN115811484A publication Critical patent/CN115811484A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a network detection method, equipment and a storage medium. In the network probing method, a packet filter is injected into the kernel of the operating system. When the operation system and the opposite terminal equipment carry out the transceiving operation of the detection message, the detection tool can utilize the data packet filter to acquire the processing timestamp of the detection message by the kernel, and determine the processing delay of the detection message according to the processing timestamp, wherein the processing delay of the detection message comprises the processing delay of the kernel. Therefore, the accurate and effective detection of the time delay information of the kernel is realized, and the analysis of the scheduling time delay, the abnormal interruption and the like of the operating system is facilitated.

Description

Network detection method, device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a network probing method, device, and storage medium.
Background
In a network communication scenario, a network message from a sending end to a receiving end consumes time for each component (virtual network, physical network) on a network link, and a kernel protocol stack of an operating system of the network message itself needs to undergo lengthy function call, thereby causing network delay. However, the existing network detection method cannot detect the time delay on the kernel protocol stack. Therefore, a new solution is yet to be proposed.
Disclosure of Invention
Aspects of the present disclosure provide a network probing method, device, and storage medium, which are used to probe a network delay caused on a kernel protocol stack.
The embodiment of the application provides a network detection method, which comprises the following steps: injecting a packet filter into a kernel of an operating system; performing the receiving and sending operation of the detection message with the opposite terminal equipment through the operating system; acquiring a timestamp of the kernel for processing the detection message by using the data packet filter; determining the processing time delay of the detection message according to the processing time stamp; the processing delay of the detection message comprises: processing latency of the kernel.
Optionally, the detection packet includes: port identification and/or serial number identification; acquiring the timestamp of the kernel for processing the detection message by using the data packet filter, wherein the timestamp comprises: identifying the detection message by using the data packet filter according to the port identifier and/or the serial number identifier; and recording the processing time stamp of the target processing function when the target processing function in the kernel processes the detection message.
Optionally, the method further comprises: reading a configuration file by using the data packet filter, and reading a function identifier of the target processing function from the configuration file; and the configuration file is obtained according to dynamic configuration of the detection target.
Optionally, the target processing function includes: at least one sending function for sending a detection request message to the opposite terminal equipment; and/or, at least one receiving function for receiving the detection reply message sent by the opposite terminal equipment; when the target processing function in the kernel processes the detection packet, recording a processing timestamp of the target processing function, including: recording the sending time stamp of each message sending function when the at least one message sending function sends the detection request message by using the data packet filter; and/or recording the receiving time stamp of each message receiving function when the at least one message receiving function receives the detection reply message.
Optionally, determining the processing delay of the probe packet according to the processing timestamp includes: determining a processing time sequence corresponding to the kernel according to the respective sending time stamp of the at least one sending function and/or the respective receiving time stamp of the at least one receiving function; and determining the processing time delay of the message processing link corresponding to any group of timestamps according to the difference value of any group of timestamps in the time sequence.
Optionally, the processing time stamp of any processing function in the target processing function includes: an entry timestamp and an end call timestamp of the processing function; determining the processing delay of the detection message according to the processing timestamp, including: and determining the processing time delay of the processing function according to the entry time stamp and the calling ending time stamp of the processing function.
Optionally, determining the processing delay of the probe packet according to the processing timestamp includes: determining an entry function and an exit function of any protocol layer in the kernel from the target processing function; and determining the processing time delay of the protocol layer according to the entry time stamp of the entry function and the end calling time stamp of the exit function.
Optionally, the method further comprises: acquiring a receiving timestamp of the network card equipment carried by the operating system to the detection message and a sending timestamp of the detection message by using the data packet filter; and determining the processing time delay on the network link where the network card device and the opposite terminal device are located according to the receiving time stamp and the sending time stamp of the network card device to the detection message.
An embodiment of the present application further provides an electronic device, including: a memory and a processor; the memory is to store one or more computer instructions; the processor is to execute the one or more computer instructions to: the steps in the method provided by the embodiments of the present application are performed.
Embodiments of the present application further provide a computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, can implement the steps in the method provided in the embodiments of the present application.
In the network detection method provided by the embodiment of the application, a data packet filter is injected into a kernel of an operating system. When the operation system and the opposite terminal equipment carry out the transceiving operation of the detection message, the detection tool can utilize the data packet filter to acquire the processing timestamp of the detection message by the kernel, and determine the processing delay of the detection message according to the processing timestamp, wherein the processing delay of the detection message comprises the processing delay of the kernel. Therefore, the accurate and effective detection of the time delay information of the kernel is realized, and the analysis of the scheduling time delay, the abnormal interruption and the like of the operating system is facilitated.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a network probing method according to an exemplary embodiment of the present application;
fig. 2 is a schematic diagram of a message processing flow of a kernel protocol stack according to an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a time series provided by an exemplary embodiment of the present application;
fig. 4 is a schematic diagram of a network probing method according to another exemplary embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrases "comprising one of \8230;" does not exclude the presence of additional like elements in an article or system comprising the element.
In some embodiments of the present application, a solution is provided, and the technical solutions provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a network probing method according to an exemplary embodiment of the present application, where the method may include the steps shown in fig. 1:
step 101, injecting a data packet filter into a kernel of an operating system.
And 102, performing the transceiving operation of the detection message with the opposite terminal equipment through the operating system.
And 103, acquiring a timestamp of the kernel for processing the detection message by using the data packet filter.
Step 104, determining the processing time delay of the detection message according to the processing time stamp; the processing delay of the detection message comprises the following steps: processing latency of the core.
The execution subject of the embodiment may be an electronic device, and the electronic device may be any device in a network communication link. For example, the electronic device may be a computer, a smart phone, a gateway device, and the like in a network communication link, and the embodiment is not limited. An operating system runs on the electronic device, and a kernel of the operating system can provide relevant codes of functions such as driving, memory management, network, I/O (Input/Output), and the like for the operating system.
The electronic equipment can run a detection tool for network detection. The instrumentation may be implemented as an application running in the operating system of the electronic device or as a plug-in or the like. The probe tool may provide a packet filter that may inject secure bytecode into the operating system kernel by means of code injection to implement kernel control. In some embodiments, the Packet Filter may be implemented as an Extended Berkeley Packet Filter (EBPF). Code injection is a technique for inserting and running independent running code into a target process.
After the data packet filter is injected into the kernel of the operating system, the message processed by the kernel can be identified according to the preset processing logic, the processing process of the message is tracked, and the processing time of the message is recorded. After the processing time of the message is obtained, the data packet filter can return the recording result to the detection tool, so that the detection tool can perform time delay analysis.
The detection tool can utilize the operation system to perform the receiving and sending operation of the detection message with the opposite terminal equipment. When the operating system receives and transmits the message, the detection tool can record the processing timestamp of the kernel on the detection message by using the data packet filter. According to the recorded processing timestamp, the detection tool can determine the processing delay of the detection message. The processing delay of the probe packet may include: and detecting the processing delay of the message in the kernel. Besides the kernel processing time delay, the detection time delay of the detection message in the network link and the processing time delay of the detection message in each layer of the kernel protocol stack can be determined according to the processing time stamp of the detection message.
The processing time stamp of the kernel on the packet may be determined by the processing time of each function of the kernel for processing the packet by the user, which will be specifically described in the subsequent embodiments and will not be described herein.
In this embodiment, the kernel of the operating system has a packet filter injected into it. When the operation system and the opposite terminal equipment carry out the transceiving operation of the detection message, the detection tool can utilize the data packet filter to acquire the processing timestamp of the detection message by the kernel, and determine the processing delay of the detection message according to the processing timestamp, wherein the processing delay of the detection message comprises the processing delay of the kernel. Therefore, the accurate and effective detection of the time delay information of the kernel is realized, and the analysis of the scheduling time delay, the abnormal interruption and the like of the operating system is facilitated.
In some exemplary embodiments, the sending, by the probe tool, the probe packet to the peer device through the operating system includes: port identification and/or sequence number identification. The port identifier and/or the serial number identifier are used for marking the detection message so that the data packet filter can identify and track the detection message in the kernel.
The detection message can be constructed according to a communication protocol adopted between the electronic device and the opposite terminal device. For example, when the electronic device and the peer device communicate with each other by using a Tcp/IP (Transmission Control Protocol/Internet Protocol ) Protocol, a Tcp message may be constructed as a probe message, and a port number, a serial number, and the like may be specified in the Tcp message.
Correspondingly, when the detection tool acquires the processing timestamp of the detection message by using the data packet filter, the detection tool can identify the detection message by using the data packet filter according to the port identifier and/or the serial number identifier, and record the processing timestamp of the target processing function when the target processing function in the kernel processes the detection message.
The target processing function refers to one or more functions used for processing the detection message in the kernel. The kernel may include at least one send function and/or at least one receive function. The target processing function may be one or more of the at least one sending function and/or the at least one receiving function, and may be specifically determined according to a detection requirement, which is not limited in this embodiment.
It is noted that, in some alternative embodiments, the target processing function may be dynamically configured according to the detection requirement. The dynamic configuration refers to dynamically configuring functions, which need to be tracked in the kernel, of the packet filter under different detection requirements, so as to realize the detection requirements on the kernel under different detection scenarios.
The target processing function can be configured through a configuration file. The tester can add the function identification of the target processing function to be detected in the kernel to the configuration file according to the detection target, and store the configuration file in the designated path. The specified path may be a storage path local to the operating system, or may be a storage path on a remote server, which is not limited in this embodiment.
The probe tool may read a configuration file using the packet filter and read a function identification of the target processing function from the configuration file. Therefore, in the subsequent detection process, the data packet filter can identify the target processing function through the function identifier of the target processing function and track the circulation process of the target processing function on the kernel.
In some embodiments, the operation of the packet filter to read the configuration file may be triggered by a user. For example, a user may send an instruction to read a configuration file to a packet filter through a probe tool. In other embodiments, the operation of reading the configuration file by the packet filter may be performed according to a fixed period. For example, the packet filter may read the configuration file every 30 minutes. In still other embodiments, the operation of reading the configuration file by the packet filter may be performed before each probing operation is performed, and is not described in detail.
In the embodiment, the detection target of the data packet filter can be customized through the configuration file, so that more flexible and convenient kernel time delay detection can be realized.
In some embodiments, when the probe tool performs a transceiving operation of a probe packet with an opposite-end device through an operating system, the probe tool may send a probe request packet to the opposite-end device through the operating system.
Accordingly, the probe tool may utilize the packet filter to record the respective transmission time stamp of the at least one messaging function when the at least one messaging function transmits the probe request message.
In other embodiments, when the probe tool performs a transceiving operation of a probe packet with the peer device through the operating system, the probe tool may receive a probe reply packet returned by the peer device through the operating system.
Accordingly, the probe tool may utilize the packet filter to record a respective receive timestamp of the at least one message receive function when the at least one message receive function receives the probe reply message.
In still other embodiments, when the probe tool performs a transceiving operation of a probe packet with the peer device through the operating system, the probe tool may send a probe request packet to the peer device through the operating system, and receive a probe reply packet returned by the peer device through the operating system.
Accordingly, the probe tool may record a transmission timestamp of the at least one message sending function when the at least one message sending function sends the probe request message, and may record a reception timestamp of the at least one message receiving function when the at least one message receiving function receives the probe reply message, using the packet filter.
Optionally, in the above embodiment, the sending timestamp and the receiving timestamp may be entry times of corresponding processing functions; alternatively, the sending timestamp and the receiving timestamp may be timestamps corresponding to an exit of the processing function (i.e., ending the call), and the embodiment is not limited thereto. After obtaining the respective transmission time stamp of the at least one transmission function and/or the respective reception time stamp of the at least one reception function based on the above embodiments, the probe tool may perform analysis of the latency information. The following exemplary description will be made in connection with different detection scenarios.
In some exemplary embodiments, the probe tool may determine the processing time delay of the packet according to the processing timestamp, and may determine the processing time sequence corresponding to the core according to the sending timestamp of each of the at least one sending function and/or the receiving timestamp of each of the at least one receiving function. Wherein, the processing time sequence can be arranged according to the time sequence. According to the difference value of any group of timestamps in the time sequence, the detection tool can determine the processing time delay of the message processing link corresponding to any group of timestamps. Any set of timestamps may be two timestamps or more than two timestamps.
Optionally, the sending delay of the kernel can be determined according to a plurality of timestamps in the message sending link. For example, the sending delay of the kernel may be determined according to a difference between a last sending timestamp and a first sending timestamp in a message sending link.
Optionally, the receiving delay of the kernel can be determined according to a plurality of timestamps in the message receiving link. For example, the receiving delay of the kernel may be determined according to a difference between a last receiving timestamp and a first receiving timestamp in a packet receiving link.
Optionally, according to the multiple timestamps in the packet sending link and the multiple timestamps in the packet receiving link, the processing delay of the entire packet processing link and the entire delay of the packet on the kernel can be determined. For example, the overall processing delay of the packet may be determined according to a difference between a last receiving timestamp in the packet receiving link and a first sending timestamp in the packet sending link. According to the difference value between the first receiving time stamp in the message receiving link and the last sending time stamp in the message sending link, the processing time delay of the message on the network link can be determined. And calculating the difference between the overall processing delay of the message and the processing delay on the network link to obtain the overall delay of the message on the kernel.
As shown in fig. 2, the kernel protocol stack of the operating system includes: transmission function 1, transmission function 2, reception function 1, and reception function 2. When the probe tool sends a probe request message, a packet filter in the kernel may record a processing timestamp t1 of the send function 1 and a processing timestamp t2 of the send function 2. And the detection request message is sent to the opposite terminal equipment through the network card equipment carried by the operating system. The opposite terminal device can return a detection reply message through the network card device. When the network card device sends the detection reply message to the detection tool through the operating system, the packet filter in the kernel can record the processing time stamp t3 of the receiving function 2 and the processing time stamp t4 of the receiving function 4. t1, t2, t3, t4 may form a processing time series. The processing time delay of each message processing link in the kernel can be determined based on the processing time sequence detection tool.
As shown in fig. 3, when the probe tool sends n probe messages to the peer device, for any probe message, the time delay of the processing stage 1 in the kernel can be determined according to the difference between t2 and t 1; the time delay of the processing stage 2 can be determined according to the difference between t3 and t 2; the delay of stage 3 may be determined based on the difference between t4 and t 3. The overall processing latency of the kernel can be determined by the latencies of processing stage 1 and processing stage 3. That is, the sum of the difference between t2 and t1 and the difference between t4 and t3 is calculated, and the processing delay of the entire kernel can be determined.
In this embodiment, the time delay information of different links in the kernel can be flexibly and accurately detected according to the time sequence formed by the processing time stamps of the sending function and/or the receiving function.
In some exemplary embodiments, the instrumentation may implement function-level latency instrumentation for the kernel of the operating system based on packet filters. As will be exemplified below.
Optionally, the packet filter may record an entry timestamp and an end-call timestamp of any processing function when recording the processing timestamp of the processing function. The entry timestamp is used for marking the time when the processing function starts to execute, and the time stamp for ending the call is used for marking the time when the function ends to execute.
Based on this, when the probe tool analyzes the kernel latency information based on the processing timestamp, the probe tool can determine the processing latency of the processing function according to the entry timestamp and the end call timestamp of the processing function.
For example, taking the sending function 1 illustrated in fig. 2 as an example, when the sending function 1 executes a sending operation of a probe request message, the packet filter may record an entry timestamp t11 of the sending function 1 and a timestamp t12 of an end call of the sending function 1. The probe tool may determine the execution time of the transmit function 1 based on the time difference between t12 and t11, and determine the delay of the transmit function 1 based on the execution time.
In this embodiment, by recording the entry timestamp and the call completion timestamp of any processing function, the delay detection at the function level is implemented, and the granularity of the kernel delay detection is further reduced.
In some exemplary embodiments, the probing tool may be based on packet filters and may probe for latency at the protocol layer level within the kernel. The following is an exemplary description of the TCP/IP protocol.
The protocol stack of the network model of the TCP/IP protocol comprises four protocol layers, which are respectively: a data link layer, a network layer, a transport layer, and an application layer. The data link layer is used for realizing a network driver of the network card interface so as to process the transmission of data on a physical medium. And the network layer is responsible for providing communication services for different hosts on the packet switching network so as to realize routing and forwarding of data packets. And the transmission layer is responsible for providing end-to-end data transmission service for the application programs on the two hosts. And the application layer is used for defining rules of communication and interaction between the application processes. When the detection tool sends the detection request message through the operating system, the detection request message passes through the application layer, the transmission layer, the network layer and the data link layer to reach the network card device, and the network card device sends the detection request message to the opposite terminal device.
In some embodiments, the target processing function comprises: an ingress function and an egress function of any one or more protocol stacks. For example, in some embodiments, during the transmission of the probe request message in each protocol layer, the packet filter may record an entry timestamp of an entry function and an end call timestamp of an exit function in each protocol layer in turn.
The probe tool determines the processing time delay of the kernel according to the processing time stamp, and may determine an entry function and an exit function of any protocol layer in the kernel from the target processing function, and determine the processing time delay of the protocol layer according to the entry time stamp of the entry function and the end call time stamp of the exit function.
For example, taking the data link layer as an example, the probe tool may determine the latency information of the data link layer from the target processing function by determining an entry timestamp of an entry function of the data link layer and a timestamp of an end call of an exit function.
In other embodiments, the configuration file of the packet filter may be configured such that the packet filter focuses on the ingress function and the egress function of any one or more protocol layers. For example, the function identifications of the ingress function and the egress function of the network layer may be configured in a configuration file to instruct the packet filter to timestamp the ingress function and the egress function of the network layer. When the probe request message passes through the network layer, the packet filter may record an entry time of an entry function of the network layer and a processing time of an exit function of the network layer. The probing tool may determine a processing delay of the network layer according to the entry timestamp of the entry function and the end call timestamp of the exit function. Based on the implementation mode, the processing time of one or more protocol layers can be directionally recorded, and the detection efficiency is further improved.
In this embodiment, based on the entry timestamp of the entry function and the timestamp of the end call of the exit function of any protocol layer, the latency of the protocol layer may be analyzed, that is, the latency detection at the protocol layer level is implemented, and the granularity of the kernel latency detection is further reduced.
In some exemplary embodiments, in addition to implementing latency probes on the kernel, the probe tool provided in the embodiments of the present application may also implement latency probes at a link level. As will be exemplified below.
Optionally, the detection tool may obtain, by using a data packet filter, a receiving timestamp of the network card device carried by the operating system to the detection message and a sending timestamp of the detection message; and determining the processing time delay on the network link where the network card device and the opposite terminal device are located according to the receiving time stamp and the sending time stamp of the network card device to the detection message.
The receiving timestamp of the detection message by the network card device can be determined by calling the timestamp after the last sending function in the kernel is finished. The sending time stamp of the detection message by the network card device can be determined by the entry time stamp of the first receiving function in the kernel. For example, with reference to fig. 2, the receiving timestamp of the network card device for the detection packet may be determined according to the exit timestamp t22 of the sending function 2; the sending timestamp of the detection reply message corresponding to the detection message by the network card device can be determined according to the entry timestamp t31 of the receiving function 1. Based on the time difference between t31 and t22, the processing delay on the network link where the network card device and the peer device are located can be determined.
In some optional embodiments, the data packet filter may be injected into the network card device to obtain a receiving timestamp of the receiving function to the probe request message and a sending timestamp of the sending function to the probe reply message in the network card device, which is not described again.
In this embodiment, by injecting the packet filter into the kernel, the detection of the delay information of other devices on the network link can be realized while the detection of the kernel delay information is realized, which is beneficial to further analyzing the delay cause.
The above-described embodiments of the present application will be further illustrated with reference to fig. 4.
As shown in fig. 4, after the probing is started, a packet filter (i.e., EBPF bytecode program) may be first injected into the os to track message receiving and sending functions related to the os kernel protocol.
Then, a Tcp detection message may be constructed, and information such as a message port and a serial number may be specified in the detection message. In the data packet filter, a detection message constructed by identifying a message port and a serial number can be used, and a target processing function of the detection message is tracked.
In some scenarios, because the Tcp message establishes a connection with complex interactive logic and state processing between the local terminal and the opposite terminal, the detection tool can send a syn (synchronization Sequence number) message of the Tcp as a detection message, so as to reduce the complexity of the detection operation. After receiving the syn message of the Tcp, the opposite terminal equipment can actively reply to a Tcp ack (ack message: a receiving confirmation message replied to the sending terminal when receiving the message of the sending terminal and used for informing the sending terminal that the message is received) or a Tcp rst (rst message used for closing abnormal connection) message so as to complete a complete detection event.
When the target processing function is processing a constructed Tcp message, the packet filter may record the execution time of the function as the dotting time for the message to be transmitted over the kernel protocol, as shown in FIG. 2. The dotting time of each packet is counted according to the time series dimension, and the time series shown in fig. 3 can be obtained. The time delay of each point on the message receiving and transmitting path can be determined by carrying out difference processing on each dotting time.
If the time consumed by processing the message in the network link and the opposite terminal needs to be detected, the execution time of the transceiving/receiving function of the network card device can be further obtained. The same is true. If it is necessary to detect the processing delay time of the message in each layer of the protocol stack of the kernel, the execution time of the function access of each protocol layer may be obtained as the dotting time, which may specifically refer to the description of the foregoing embodiments and is not described herein.
It should be noted that, the executing subjects of the steps of the method provided in the foregoing embodiments may be the same device, or different devices may also be used as the executing subjects of the method. For example, the execution subject of steps 101 to 104 may be device a; for another example, the execution subject of steps 101 and 102 may be device a, and the execution subject of step 103 may be device B; and so on.
In addition, in some of the flows described in the above embodiments and the drawings, a plurality of operations are included in a specific order, but it should be clearly understood that the operations may be executed out of the order presented herein or in parallel, and the sequence numbers of the operations, such as 101, 102, etc., are merely used for distinguishing different operations, and the sequence numbers do not represent any execution order per se. Additionally, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first", "second", etc. in this document are used for distinguishing different messages, devices, modules, etc., and do not represent a sequential order, nor limit the types of "first" and "second" to be different.
Fig. 5 illustrates a schematic structural diagram of an electronic device provided in an exemplary embodiment of the present application, where the electronic device is suitable for the detection method provided in the foregoing embodiment. As shown in fig. 5, the electronic apparatus includes: memory 501, processor 502, and communications component 503.
The memory 501 is used for storing computer programs and may be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device.
A processor 502, coupled to the memory 501, for executing computer programs in the memory 501 for: injecting a packet filter into a kernel of an operating system; carrying out the receiving and sending operation of the detection message with the opposite terminal equipment through the operating system; acquiring a processing timestamp of the kernel on the detection message by using the data packet filter; determining the processing time delay of the detection message according to the processing time stamp; the processing delay of the detection packet includes: processing latency of the kernel.
Optionally, the detection packet includes: port identification and/or serial number identification; optionally, when the processor 502 obtains the timestamp of the kernel for processing the probe packet by using the packet filter, the processor is specifically configured to: identifying the detection message by using the data packet filter according to the port identifier and/or the serial number identifier; and recording the processing time stamp of the target processing function when the target processing function in the kernel processes the detection message.
Optionally, the processor 502 is further configured to: reading a configuration file by using the data packet filter, and reading a function identifier of the target processing function from the configuration file; and the configuration file is obtained according to dynamic configuration of the detection target.
Optionally, the target processing function includes: at least one sending function used for sending the detection request message to the opposite terminal equipment; and/or, at least one receiving function for receiving the detection reply message sent by the opposite terminal equipment; when the processor 502 records the processing timestamp of the target processing function when the target processing function in the kernel processes the probe packet, the processing method is specifically configured to: recording the sending time stamp of each message sending function when the at least one message sending function sends the detection request message by using the data packet filter; and/or recording the receiving time stamp of each message receiving function when the at least one message receiving function receives the detection reply message.
Optionally, the processor 502 determines the processing time delay of the detection packet according to the processing timestamp, and is specifically configured to: determining a processing time sequence corresponding to the kernel according to the respective sending time stamp of the at least one sending function and/or the respective receiving time stamp of the at least one receiving function; and determining the processing time delay of the message processing link corresponding to any group of timestamps according to the difference value of any group of timestamps in the time sequence.
Optionally, the processing time stamp of any processing function in the target processing function includes: an entry timestamp and an end call timestamp of the processing function; the processor 502 determines, according to the processing timestamp, a processing time delay of the probe packet, and is specifically configured to: and determining the processing time delay of the processing function according to the entry time stamp and the calling ending time stamp of the processing function.
Optionally, the processor 502 determines, according to the processing timestamp, the processing time delay of the detection packet, and is specifically configured to: determining an entry function and an exit function of any protocol layer in the kernel from the target processing function; the processor 502 determines the processing delay of the protocol layer according to the entry timestamp of the entry function and the end call timestamp of the exit function.
Optionally, the processor 502 is further configured to: acquiring a receiving timestamp of the network card equipment carried by the operating system to the detection message and a sending timestamp of the detection message by using the data packet filter; and determining the processing time delay on the network link where the network card device and the opposite terminal device are located according to the receiving time stamp and the sending time stamp of the network card device to the detection message.
Further, as shown in fig. 5, the electronic device further includes: power supply components 504, and the like. Only some of the components are schematically shown in fig. 5, and it is not meant that the electronic device comprises only the components shown in fig. 5.
The memory 501 may be implemented by any type or combination of volatile and non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Wherein the communication component 503 is configured to facilitate communication between the device in which the communication component is located and other devices in a wired or wireless manner. The device in which the communication component is located may access a wireless network based on a communication standard, such as WiFi,2G, 3G, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component may be implemented based on Near Field Communication (NFC) technology, radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
The power supply 504 is configured to provide power to various components of the device in which the power supply is located. The power components may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device in which the power component is located.
In this embodiment, a packet filter is injected into the kernel of the operating system. When the operation system and the opposite terminal equipment carry out the transceiving operation of the detection message, the detection tool can utilize the data packet filter to acquire the processing timestamp of the detection message by the kernel, and determine the processing delay of the detection message according to the processing timestamp, wherein the processing delay of the detection message comprises the processing delay of the kernel. Therefore, the accurate and effective detection of the time delay information of the kernel is realized, and the analysis of the scheduling time delay, the abnormal interruption and the like of the operating system is facilitated.
Accordingly, the present application further provides a computer-readable storage medium storing a computer program, where the computer program is capable of implementing the steps that can be executed by the electronic device in the foregoing method embodiments when executed.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A network probing method, comprising:
injecting a packet filter into a kernel of an operating system;
performing the receiving and sending operation of the detection message with the opposite terminal equipment through the operating system;
acquiring a processing timestamp of the kernel on the detection message by using the data packet filter;
determining the processing delay of the detection message according to the processing timestamp, wherein the processing delay of the detection message comprises: processing latency of the kernel.
2. The method of claim 1, the probe packet comprising: port identification and/or serial number identification;
acquiring the timestamp of the kernel for processing the detection message by using the data packet filter, wherein the method comprises the following steps:
identifying the detection message by using the data packet filter according to the port identifier and/or the serial number identifier;
and recording a processing time stamp of the target processing function when the target processing function in the kernel processes the detection message.
3. The method of claim 2, further comprising:
reading a configuration file by using the data packet filter, and reading a function identifier of the target processing function from the configuration file; and the configuration file is obtained according to dynamic configuration of the detection target.
4. The method of claim 2, the target processing function, comprising: at least one sending function for sending a detection request message to the opposite terminal equipment; and/or, at least one receiving function for receiving the detection reply message sent by the opposite terminal equipment;
when the target processing function in the kernel processes the detection packet, recording a processing timestamp of the target processing function, including:
recording the respective sending time stamp of the at least one message sending function when the at least one message sending function sends the detection request message by using the data packet filter; and/or recording the receiving time stamp of each message receiving function when the at least one message receiving function receives the detection reply message.
5. The method of claim 4, determining the processing delay of the probe packet according to the processing timestamp, comprising:
determining a processing time sequence corresponding to the kernel according to the respective sending time stamp of the at least one sending function and/or the respective receiving time stamp of the at least one receiving function;
and determining the processing time delay of the message processing link corresponding to any group of timestamps according to the difference value of any group of timestamps in the time sequence.
6. The method of claim 2, wherein the processing time stamp of any one of the target processing functions comprises: an entry timestamp and an end call timestamp of the processing function;
determining the processing delay of the detection message according to the processing timestamp, including:
and determining the processing time delay of the processing function according to the entry time stamp and the calling ending time stamp of the processing function.
7. The method of claim 6, determining the processing delay of the probe packet according to the processing timestamp, comprising:
determining an entry function and an exit function of any protocol layer in the kernel from the target processing function;
and determining the processing time delay of the protocol layer according to the entry time stamp of the entry function and the end calling time stamp of the exit function.
8. The method of any of claims 1-7, further comprising:
acquiring a receiving timestamp of the network card equipment carried by the operating system to the detection message and a sending timestamp of the detection message by using the data packet filter;
and determining the processing time delay on the network link where the network card device and the opposite terminal device are located according to the receiving time stamp and the sending time stamp of the network card device to the detection message.
9. An electronic device, comprising: a memory and a processor;
the memory is to store one or more computer instructions;
the processor is to execute the one or more computer instructions to: performing the steps in the method of any one of claims 1-8.
10. A computer-readable storage medium storing a computer program which, when executed by a processor, is capable of implementing the network probing method of any one of claims 1-8.
CN202211408440.1A 2022-11-10 2022-11-10 Network detection method, device and storage medium Pending CN115811484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211408440.1A CN115811484A (en) 2022-11-10 2022-11-10 Network detection method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211408440.1A CN115811484A (en) 2022-11-10 2022-11-10 Network detection method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115811484A true CN115811484A (en) 2023-03-17

Family

ID=85483426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211408440.1A Pending CN115811484A (en) 2022-11-10 2022-11-10 Network detection method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115811484A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116321276A (en) * 2023-05-19 2023-06-23 阿里巴巴(中国)有限公司 Time delay determining method, communication network, device and storage medium
CN117997802A (en) * 2024-04-07 2024-05-07 浪潮电子信息产业股份有限公司 Network jitter detection method, device, equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116321276A (en) * 2023-05-19 2023-06-23 阿里巴巴(中国)有限公司 Time delay determining method, communication network, device and storage medium
CN116321276B (en) * 2023-05-19 2023-10-31 阿里巴巴(中国)有限公司 Time delay determining method, communication network, device and storage medium
CN117997802A (en) * 2024-04-07 2024-05-07 浪潮电子信息产业股份有限公司 Network jitter detection method, device, equipment and medium
CN117997802B (en) * 2024-04-07 2024-06-21 浪潮电子信息产业股份有限公司 Network jitter detection method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN115811484A (en) Network detection method, device and storage medium
CN109194551B (en) Method, device and system for testing performance of real-time Ethernet equipment
CN112714047B (en) Industrial control protocol flow based test method, device, equipment and storage medium
CN111400127B (en) Service log monitoring method and device, storage medium and computer equipment
CN108900374B (en) Data processing method and device applied to DPI equipment
CN111263377B (en) Network configuration method, device, equipment and system and distribution network testing method and system
CN108462598A (en) A kind of daily record generation method, log analysis method and device
CN111176941A (en) Data processing method, device and storage medium
WO2019144803A1 (en) Traffic statistics method and apparatus, storage medium, and electronic apparatus
CN111479287B (en) Simulation test method, device, equipment and storage medium for core network of non-independent networking
CN109802842B (en) Application topology generation method and related equipment
WO2017152880A1 (en) Method for testing performance of mobile network, mobile terminal, server and testing system
CN104767589B (en) A kind of method for sending information and device
CN109788251A (en) Method for processing video frequency, device and storage medium
CN107888690A (en) The statistical method and system of response time
CN109120541B (en) Method, device, terminal equipment and storage medium for limiting network speed
CN105577462B (en) The flow statistical method and device of mobile device
CN112291254B (en) Message processing method and device for reliable transaction
CN114726763A (en) Method and system for detecting service identification capability of DPI system
CN113434399B (en) Service node log processing method and device, storage medium and electronic device
CN116384956B (en) Message batch sending method, device, equipment and storage medium
CN114760188B (en) Abnormal node determination method and device
CN110196862B (en) Data scene construction method, device, server and system
CN114116490A (en) Automatic testing method and device, computer equipment and storage medium
CN116708243A (en) Message flow detection method and device, storage medium and electronic device

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