CN112311619A - Network message delay detection method and device and electronic equipment - Google Patents

Network message delay detection method and device and electronic equipment Download PDF

Info

Publication number
CN112311619A
CN112311619A CN201910750917.6A CN201910750917A CN112311619A CN 112311619 A CN112311619 A CN 112311619A CN 201910750917 A CN201910750917 A CN 201910750917A CN 112311619 A CN112311619 A CN 112311619A
Authority
CN
China
Prior art keywords
message
transmission
server
time information
path
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.)
Granted
Application number
CN201910750917.6A
Other languages
Chinese (zh)
Other versions
CN112311619B (en
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.)
Beijing Volcano Engine Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910750917.6A priority Critical patent/CN112311619B/en
Publication of CN112311619A publication Critical patent/CN112311619A/en
Application granted granted Critical
Publication of CN112311619B publication Critical patent/CN112311619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Abstract

The embodiment of the disclosure provides a network message delay detection method, a device and an electronic device, wherein the method comprises the following steps: in response to the fact that the message transmission time length from the first server to the second server is larger than the preset time length, acquiring time information corresponding to message transmission; the time information comprises the time information of forwarding messages of all key transmission nodes in a transmission path from the first server to the second server, the transmission path comprises a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path; determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path. The method and the device realize accurate positioning of relevant key transmission nodes causing message delay for analysis of research and development personnel, and are beneficial to improving the network service quality.

Description

Network message delay detection method and device and electronic equipment
Technical Field
The present invention relates to internet technologies, and in particular, to a method and an apparatus for detecting network packet delay, and an electronic device.
Background
Cloud computing (cloud computing) is one type of distributed computing, and means that a huge data computing processing program is decomposed into countless small programs through a network "cloud", and then the small programs are processed and analyzed through a system consisting of a plurality of servers to obtain results and are returned to a user.
Cloud computing requires multiple servers to work in conjunction with each other. In the cloud computing process, messages are transmitted among different servers. When a server performance problem occurs, the speed of the whole cloud computing is affected.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for detecting network message delay and electronic equipment, so as to accurately position a relevant key transmission node causing message delay, and be beneficial to improving network service quality.
In a first aspect, an embodiment of the present disclosure provides a method for detecting network packet delay, which is applied to packet transmission from a first server to a second server, where a transmission path of the packet transmission includes multiple key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path, where the method includes: in response to the fact that the message transmission time length from the first server to the second server is larger than the preset time length, acquiring time information corresponding to message transmission; the time information comprises the time information of each key transmission node forwarding message in the transmission path; determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path.
In a second aspect, an embodiment of the present disclosure provides a network packet delay detection apparatus, which is applied to packet transmission from a first server to a second server, where a transmission path of the packet transmission includes a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path, where the apparatus includes: the acquisition unit is used for responding to the fact that the message transmission time length from the first server to the second server is larger than the preset time length, and acquiring time information corresponding to message transmission; the time information comprises the time information of each key transmission node forwarding message in the transmission path; the first determining unit is used for determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and the second determining unit is used for determining a target transmission sub-path causing message delay based on the message transmission time length used for transmitting the message in each transmission sub-path.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device, on which one or more programs are stored, which, when executed by one or more processors, cause the one or more processors to implement the network packet delay detection method disclosed in the first aspect.
In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium, on which executable instructions are stored, and when the executable instructions are run on a processor, the method for detecting network packet delay disclosed in the first aspect is implemented.
According to the network message delay detection method, the network message delay detection device and the electronic equipment, the time information corresponding to message transmission is obtained by responding to the fact that the message transmission time length from the first server to the second server is longer than the preset time length; the time information comprises the time information of each key transmission node forwarding message in the transmission path; then, determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and finally, determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path. The method and the device realize accurate positioning of relevant key transmission nodes causing message delay for analysis of research and development personnel, and are beneficial to improving the network service quality.
Drawings
The accompanying drawings are included to provide a better understanding of the present disclosure, and are not to be construed as limiting the present disclosure in any way, wherein:
fig. 1 is a flow diagram of one embodiment of a network message delay detection method according to the present disclosure;
FIG. 2 is a flow diagram of another embodiment of a network message delay detection method according to the present disclosure;
FIG. 3 is a schematic block diagram illustrating an embodiment of a network packet delay detection apparatus according to the present disclosure;
FIG. 4 is an exemplary system architecture to which the network message delay detection method of one embodiment of the present disclosure may be applied;
fig. 5 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, a flow diagram of one embodiment of a network packet delay detection method according to the present disclosure is shown. As shown in fig. 1, the network message delay detection method includes the following steps:
step 101, in response to detecting that the message transmission time length from the first server to the second server is greater than a preset time length, acquiring time information corresponding to message transmission.
To accommodate the needs of cloud computing, multiple servers are typically provided for the same task. The server here may be a physical server. Information interaction can be carried out among a plurality of servers which finish the same task.
The message is a data unit exchanged and transmitted in the network, and is also a unit transmitted by the network. The message contains complete data information to be sent, and the lengths of the data information may be different. The message is continuously encapsulated into packets, packets and frames for transmission during the transmission process. The encapsulation method can add some headers composed of control information, namely, headers in the messages.
The message may include a plurality of critical transfer nodes in a transfer path between the first server and the second server. Each key transport node may receive a packet forwarded from a last key transport node. Then, a key transmission node may forward the packet to a next key transmission node of the key transmission node in the transmission path that may lead to the destination address according to the destination address information in the packet header. The key transmission node at least comprises the following nodes: the system comprises an application program of a first server, a network protocol stack of the first server, a network card of the first server, a network bridge of the first server, a switch, a network bridge of a second server, a network card of the second server, a network protocol stack of the second server and an application program of the second server.
A transmission sub-path may be formed between two adjacent critical transmission nodes in a transmission path between a first server and a second server. The message transmission path from the first server to the second server may include a plurality of transmission sub-paths.
In some application scenarios, a user may set up a network protocol in a message. Information acquisition instructions may be set in the network protocol. The information may be, for example, time information. If the information is time information, the step 101 may include: and acquiring time information corresponding to message transmission by using a pre-configured network protocol for acquiring time information.
The network protocol can define the port number of a sending port used by a source end and the port number of a destination port when a message is sent from the source end to the destination end; when a message is replied from a destination end to a source end, the port number of a sending port used by the source end, the port number of the destination port and the like; the port numbers can be set according to the requirements of users. And are not limited herein. In addition, a message sequence number field can be set in the network protocol; an extension field. The field of the time information returned by each key transmission node, and the like. The source may be a first server and the destination may be a second server, or the source may be a second server and the destination may be a first server.
In addition, a function (or instruction) for acquiring information corresponding to the key transmission node may be set in the network protocol of the packet. When the message is transmitted to a key transmission node, the information corresponding to the key transmission node can be acquired according to an instruction which is set in the message and used for acquiring the relevant information of the key transmission node.
After each key transmission node receives the message forwarded by the previous key transmission node, the current time information can be read according to the time information acquisition instruction in the message. In some application scenarios, the time information may include a time displayed by an internal clock system of a server where the key transmission node is located when the key transmission node receives the upper packet.
In some optional implementations, the time information corresponding to each key transmission node is collected based on the following steps:
first, a port in a network protocol carried by a message is read.
And secondly, in response to the fact that the port is determined to be a preset port, matching the information of the key transmission node with a preset field of the network protocol, if the matching is successful, calling a preset time acquisition instruction to acquire the value of a timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
The port number may be preset in the network protocol carried in the message. The port number is used to identify different application processes located in the same server. The ports may include a source port and a destination port. Source port: the source port and the IP address serve to identify the return address of the message. Destination port: the destination port indicates an application program interface on the receiving server.
For example, the source end sends a packet to the destination end, and the source end uses the port 4 as a sending port and the port 6 as a destination port. Replying a message from a destination end to a source end, wherein the source end uses a port 6 as a sending port; port 4 serves as the destination port.
For each key transport node, for a packet transmitted to the key transport node, it may be first determined whether a port number set in a network protocol is a preset port number. If the number is the preset port number, the information of the key transmission node can be matched with the preset field of the network protocol. The information of the key transmission node may be, for example, an identifier of the key transmission node. The identification here serves to distinguish between different critical transmission nodes. The identity of the key transport node may for example comprise numbers and/or characters etc. And if the matching is successful, calling a time preset time acquisition instruction to acquire the time indicated by the clock system corresponding to the key transmission node.
In some optional implementation manners, the invoking a preset time acquisition instruction to acquire a value of a timestamp counter corresponding to the key transmission node includes: calling a time acquisition instruction included in a preset code segment in a system kernel corresponding to the key transmission node to acquire the value of a timestamp counter; or dynamically injecting a preset code segment including a time acquisition instruction into a system kernel corresponding to the key transmission node to dynamically acquire the value of the timestamp counter.
In these alternative implementations, a preset code segment, which may include a time acquisition instruction, is embedded in the system kernel corresponding to the key node. The key transmission node can read the port in the network protocol carried by the message transmitted to the key transmission node by executing the preset code segment. And if the port carried by the message is determined to be a preset port, acquiring the value of the timestamp counter by using the time acquisition instruction embedded in the preset code segment in the system kernel associated with the key transmission node.
In addition, before the message is used for detecting the network between the first server and the second server, a Kprobe technology, a bpf technology and the like can be used for injecting a preset code segment including a time acquisition instruction into a system kernel corresponding to each key transmission node, so that the time information can be acquired dynamically. Specifically, when a packet is transmitted to a key transmission node, the key transmission node may run the dynamically injected preset code segment to read a port in a network protocol carried in the packet transmitted to the key transmission node, and determine whether the port is a preset port. If the port carried by the message is determined to be a preset port, the value of the timestamp counter can be acquired by using a time acquisition instruction which is injected into the preset code segment of the key transmission node in advance.
And 102, determining the message transmission duration used for transmitting the message on each transmission sub-path according to the time information.
In this embodiment, the time information is analyzed and processed, so as to obtain the message transmission duration used for transmitting the message in each transmission sub-path.
The message transmission duration may be time information corresponding to a timestamp counter corresponding to a message received by a previous key transmission node on the same message transmission sub-path, and time information corresponding to a timestamp counter corresponding to a message received by a next key transmission node in the message transmission sub-path.
Step 103, determining a target transmission sub-path causing message delay based on the message transmission duration used for transmitting the message in each transmission sub-path.
In this embodiment, since the message transmission duration used by each transmission sub-path to transmit the message is obtained, a target transmission sub-path causing message delay can be determined.
For example, the transmission sub-path that takes the longest time may be determined as the target transmission sub-path.
In some optional embodiments, at least one transmission sub-path with a message transmission duration greater than a preset duration may be determined as the target transmission sub-path.
In the method provided by this embodiment, in response to detecting that the message transmission duration from the first server to the second server is greater than the preset duration, time information corresponding to the message transmission is obtained; the time information comprises the time information of forwarding the message by each key transmission node in a transmission path from the first server to the second server, the transmission path comprises a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path; then, determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and finally, determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path. And related key transmission nodes causing message delay are accurately positioned for research and development personnel to analyze, and the network service quality is favorably improved.
With continuing reference to fig. 2, fig. 2 shows a flow of another embodiment of a network packet delay detection method according to the present disclosure, including the following steps:
step 201, in response to detecting that the message transmission duration from the first virtual server to the second virtual server is greater than a preset duration, acquiring time information corresponding to message transmission.
In this embodiment, at least one of the servers is a virtual server.
A virtual server is an emulation of a computer system, the virtual server providing the functionality required to execute the entire operating system based on the computer architecture. On a physical server, virtualization technology (such as KVM/XEN) allows multiple virtual servers to be simulated, and the CPU, RAM, DISK, network, etc. of the physical server are shared among the multiple virtual servers.
In this embodiment, the first server and the second server may be both virtual servers. The first virtual server and the second virtual server may be provided in the same physical server, or may be provided in different physical servers.
In some application scenarios, the first virtual server may be considered as a source virtual server and the second virtual server may be considered as a destination virtual server. The network message is generated from a source end virtual server to a destination end virtual server to be received, and the whole process is as follows: the system comprises an application program of a source end virtual server, a network protocol stack of the source end virtual server, a virtual network card of the source end virtual server, a virtual network bridge of a source end physical server, a network protocol stack of the source end physical server, a network card, a switch of the source end physical server, a network card of a destination end physical server, a network protocol stack of the destination end physical server, a virtual network bridge of the destination end physical server, a network card of the destination end virtual server, a network protocol stack of the destination end virtual server, an application program of the destination end virtual server and the like.
The application program of the source end virtual server, the network protocol stack of the source end virtual server, the virtual network card of the source end virtual server, the virtual network bridge of the source end physical server, the network protocol stack of the source end physical server, the network card of the source end physical server, the switch, the network card of the destination end physical server, the network protocol stack of the destination end physical server, the virtual network bridge of the destination end physical server, the network card of the destination end virtual server, the network protocol stack of the destination end virtual server, and the application program of the destination end virtual server can be regarded as a key transmission node included in a transmission path from the source end server to the destination end server.
Each two adjacent key transmission nodes in the transmission path form a transmission sub-path. For example, a transmission sub-path is formed between an application program of the source end virtual server and a network protocol stack of the source end virtual server; and a transmission sub-path formed between the virtual network card of the source end virtual server and the virtual network bridge of the source end physical server, and the like.
The message may set the network protocol used. The network protocol can define the port number of a sending port used by a source end and the port number of a destination port when a message is sent from the source end to the destination end; when a message is replied from a destination end to a source end, the port number of a sending port used by the source end, the port number of the destination port and the like; the port numbers can be set according to the requirements of users. And are not limited herein. In addition, a message sequence number field can be set in the network protocol; an extension field. The field of the time information returned by each key transmission node, and the like.
In addition, a function (or an instruction) for acquiring information corresponding to a key transmission node may be set in a network protocol of a packet, and when the packet is transmitted to a key transmission node, information corresponding to the key transmission node may be acquired according to the instruction for acquiring related information of the key transmission node, which is set in the packet. The information may be, for example, time information.
After each key transmission node receives the message forwarded by the previous key transmission node, the current time information can be read according to the time information acquisition instruction in the message.
In some optional implementations, the time information corresponding to each key transmission node is collected based on the following steps:
first, a port in a network protocol carried by a message is read.
After reading the port in the network protocol carried by the packet, it may be determined whether the port is a preset port. The preset port may be a port number stated in advance here. For example port number 4, or port number 6.
And secondly, responding to the fact that the determined port is a preset port, matching the information of the key transmission node with a preset field of a network protocol, if the matching is successful, calling a preset time acquisition instruction to acquire the value of a timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
For each key transport node, for a packet transmitted to the key transport node, it may be first determined whether a port number set in a network protocol is a preset port number. If the number is the preset port number, the information of the key transmission node can be matched with the preset field of the network protocol. The information of the key transmission node may be, for example, an identifier of the key transmission node. The identification here serves to distinguish between different critical transmission nodes. The identity of the key transport node may for example comprise numbers and/or characters etc. And if the matching is successful, calling a time preset time acquisition instruction to acquire time information corresponding to the key transmission node.
Further, the invoking of the preset time acquisition instruction to acquire the time information corresponding to the key transmission node includes:
and calling a preset time acquisition instruction to acquire the value of the timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
Since each virtual server runs a complete operating system, there is a clock system internally. A complete operating system runs on the physical server, and the internal clock system and the clock systems of different operating systems are asynchronous.
The timestamp counter (TSC) is a 64-bit register that exists on all x86 processors since pentium. It records the number of clock cycles since reset. The method is a method for acquiring CPU time information by a high-resolution and low-overhead program. The rdtsc instruction may be used to measure the execution time of a certain piece of code. The precision of the execution time of a certain section of code obtained by the method can reach nanosecond level.
Since the virtual machine servers run on the physical server, they use the same timestamp counter, and the difference in timestamps read on the virtual server and on the physical server has a constant offset (TSC offset).
Step 202, determining the message transmission duration used for transmitting the message on each transmission sub-path according to the time information.
In step 201, the value of the timestamp counter corresponding to each key transmission node is obtained, so that the message transmission duration for transmitting the message in each transmission sub-path can be determined.
For example, the timestamp counter corresponding to the message received from the first key transfer node has a value of Q1, and the timestamp counter corresponding to the message forwarded by the second key transfer node has a value of Q2. If the Q1 and the Q2 are both read from the virtual machine server or the physical server, the message transmission time length for transmitting the message on the first transmission sub-path is (Q2-Q1)/K; if Q1 and Q2 are respectively read from the virtual machine server and the physical server, the message transmission time length for transmitting the message on the first transmission sub-path is (Q2-Q1-TSC offset)/K, wherein Q1 and Q2 are integers greater than 1, and K is the CPU clock rate of the physical server corresponding to the first transmission sub-path. Similarly, the message transmission duration for transmitting the message on each transmission sub-path can be obtained. Where TSC offset is the difference between the timestamps read on the virtual server and the physical server with a constant offset.
Step 203, determining a target transmission sub-path causing message delay based on the message transmission duration used for transmitting the message in each transmission sub-path.
In this embodiment, step 203 may be the same as or similar to step 103 in the embodiment shown in fig. 1, and is not described herein again.
As can be seen from fig. 2, compared with the embodiment corresponding to fig. 1, the flow of the network packet delay detection method in this embodiment highlights that the server is a virtual server, and the step of collecting the time information corresponding to the virtual server. Therefore, the scheme described in this embodiment can accurately locate the node where information delay occurs when information is transmitted between the virtual servers, which is beneficial to improving the performance of the virtual servers.
Referring to fig. 3, a schematic structural diagram of an embodiment of a network packet delay detection apparatus according to the present disclosure is shown.
As shown in fig. 3, the network packet delay detection apparatus is applied to packet transmission from a first server to a second server, where a transmission path of the packet transmission includes a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path; the device includes: an acquisition unit 301, a first determination unit 302, and a second determination unit 303. The acquiring unit 301 is configured to acquire time information corresponding to message transmission in response to detecting that a message transmission duration from a first server to a second server is greater than a preset duration; the time information comprises the time information of each key transmission node forwarding message in the transmission path; a first determining unit 302, configured to determine, according to the time information, a message transmission duration for transmitting a message on each transmission sub-path; a second determining unit 303, configured to determine, based on a message transmission duration used for transmitting a message in each transmission sub-path, a target transmission sub-path causing a message delay.
In this embodiment, specific processing of the obtaining unit 301, the first determining unit 302, and the second determining unit 303 of the network packet delay detection apparatus and technical effects brought by the processing can refer to related descriptions of step 101, step 102, and step 103 in the corresponding embodiment of fig. 1, which are not described herein again.
In some optional implementations, the obtaining unit 301 is further configured to: and acquiring time information corresponding to message transmission by using a pre-configured network protocol for acquiring time information.
In some optional implementations, the network packet delay detection apparatus further includes a time information acquisition unit (not shown in the figure). The time information acquisition unit is used for acquiring time information corresponding to each key transmission node according to the following steps: reading a port in a network protocol carried by the message; and responding to the fact that the port is determined to be a preset port, matching the information of the key transmission node with a preset field of a network protocol, and calling a preset time acquisition instruction to acquire time information corresponding to the key transmission node if matching is successful.
In some optional implementations, the time information acquisition unit is further configured to: and calling a preset time acquisition instruction to acquire the value of the timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
In some optional implementations, the time information acquisition unit is further configured to: calling a time acquisition instruction included in a preset code segment in a system kernel corresponding to the key transmission node to acquire the value of a timestamp counter; or dynamically injecting a preset code segment including a time acquisition instruction into a system kernel corresponding to the key transmission node to dynamically acquire the value of the timestamp counter.
In some alternative implementations, at least one of the first server and the second server is a virtual server.
In some alternative implementations, the first server and the second server are located in the same physical server.
In some optional implementations, the key transport node includes at least one of: the system comprises an application program of a first server, a network protocol stack of the first server, a network card of the first server, a network bridge of the first server, a switch, a network bridge of a second server, a network card of the second server, a network protocol stack of the second server and an application program of the second server.
Referring to fig. 4, fig. 4 shows an exemplary system architecture to which the network packet delay detection method of the present embodiment may be applied.
As shown in fig. 4, the system architecture may include terminal devices 401, 402, 403, servers 404, 405, 406. Communication connections are realized between the terminal devices 401, 402, 403 and the servers 404, 405, 406, and between the servers 404, 405, and 406 through networks. The network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices and servers described above may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with 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"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The terminal devices 401, 402, 403 may interact with the servers 404, 405, 406 over the network to receive or send messages or the like. The terminal devices 401, 402, 403 may have various client applications installed thereon, such as a video distribution application, a search-type application, and a news-information-type application.
The terminal devices 401, 402, and 403 may be hardware or software. When the terminal devices 401, 402, and 403 are hardware, they may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like. When the terminal devices 401, 402, and 403 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The servers 404, 405, and 406 may be servers that can provide various services, for example, receive information acquisition requests sent by the terminal devices 401, 402, and 403, and the server 404 may extract partial data that implements the information acquisition requests from the servers 405 and 406 according to the information acquisition requests, integrate the partial data acquired from the servers 405 and 406, and send the integrated data to the terminal devices 401, 402, and 403.
It should be noted that the network packet delay detection method provided in the embodiment is generally executed by the servers 404, 405, and 406, and accordingly, the network packet delay detection apparatus is generally disposed in the servers 404, 405, and 406.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of an electronic device (e.g., the server of FIG. 4) suitable for use in implementing the embodiments described herein is shown. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments described herein.
As shown in fig. 5, the electronic device may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 506 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage devices 508 including, for example, magnetic tape, hard disk, etc.; and a communication device 509. The communication means 509 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 501.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to the fact that the message transmission time length from the first server to the second server is larger than the preset time length, acquiring time information corresponding to message transmission; the time information comprises the time information of forwarding messages of all key transmission nodes in a transmission path from the first server to the second server, the transmission path comprises a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path; determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information; and determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. For example, the obtaining unit may be further described as a "unit that obtains time information corresponding to the message transmission in response to detecting that the message transmission duration between the first server and the second server is greater than a preset duration".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (14)

1. A network message delay detection method is applied to message transmission from a first server to a second server, a transmission path of the message transmission comprises a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path, and the method comprises the following steps:
in response to the detection that the message transmission time length from the first server to the second server is longer than a preset time length, acquiring time information corresponding to the message transmission; the time information comprises the time information of forwarding the message by each key transmission node in the transmission path;
determining the message transmission duration used for transmitting the message in each transmission sub-path according to the time information;
and determining a target transmission sub-path causing message delay based on the message transmission duration used for transmitting the message in each transmission sub-path.
2. The method of claim 1, wherein the obtaining time information corresponding to the message transmission in response to detecting that a message transmission duration between the first server and the second server is greater than a preset duration comprises:
and acquiring time information corresponding to the message transmission by utilizing a pre-configured network protocol for acquiring the time information.
3. The method of claim 1, wherein the time information corresponding to each key transmission node is collected based on the following steps:
reading a port in a network protocol carried by the message;
and in response to the fact that the port is determined to be a preset port, matching the information of the key transmission node with a preset field of the network protocol, and calling a preset time acquisition instruction to acquire time information corresponding to the key transmission node if matching is successful.
4. The method according to claim 3, wherein the invoking the preset time acquisition instruction to acquire the time information corresponding to the key transmission node comprises:
and calling a preset time acquisition instruction to acquire the value of a timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
5. The method of claim 1, wherein at least one of the first server and the second server is a virtual server.
6. The method according to one of claims 1 to 5, wherein the critical transmitting node comprises at least one of:
the system comprises an application program of a first server, a network protocol stack of the first server, a network card of the first server, a network bridge of the first server, a switch, a network bridge of a second server, a network card of the second server, a network protocol stack of the second server and an application program of the second server.
7. The method according to claim 4, wherein the invoking the preset time acquisition instruction to acquire the value of the timestamp counter corresponding to the key transmission node comprises:
calling a time acquisition instruction included in a preset code segment in a system kernel corresponding to the key transmission node to acquire the value of the timestamp counter; or
And dynamically injecting a preset code segment comprising a time acquisition instruction into a system kernel corresponding to a key transmission node to dynamically acquire the value of the timestamp counter.
8. A network message delay detection device is applied to message transmission from a first server to a second server, a transmission path of the message transmission comprises a plurality of key transmission nodes, and each two adjacent key transmission nodes form a transmission sub-path, and the device comprises:
the acquisition unit is used for responding to the fact that the message transmission time length from the first server to the second server is larger than the preset time length, and acquiring time information corresponding to the message transmission; the time information comprises the time information of forwarding the message by each key transmission node in the transmission path;
a first determining unit, configured to determine, according to the time information, a message transmission duration for transmitting the message in each transmission sub-path;
and the second determining unit is used for determining a target transmission sub-path causing message delay based on the message transmission duration used by the message in each transmission sub-path.
9. The apparatus of claim 8, wherein the obtaining unit is further configured to:
and acquiring time information corresponding to the message transmission by utilizing a pre-configured network protocol for acquiring the time information.
10. The apparatus according to claim 8, further comprising a time information collecting unit, wherein the time information collecting unit is configured to collect time information corresponding to each key transmission node according to the following steps:
reading a port in a network protocol carried by the message;
and in response to the fact that the port is determined to be a preset port, matching the information of the key transmission node with a preset field of the network protocol, and calling a preset time acquisition instruction to acquire time information corresponding to the key transmission node if matching is successful.
11. The apparatus of claim 10, wherein the time information collecting unit is further configured to:
and calling a preset time acquisition instruction to acquire the value of a timestamp counter corresponding to the key transmission node, and taking the acquired value of the timestamp counter as the time information corresponding to the key transmission node.
12. The apparatus of claim 11, wherein the time information collecting unit is further configured to:
calling a time acquisition instruction included in a preset code segment in a system kernel corresponding to the key transmission node to acquire the value of the timestamp counter; or
And dynamically injecting a preset code segment comprising a time acquisition instruction into a system kernel corresponding to a key transmission node to dynamically acquire the value of the timestamp counter.
13. An electronic device, comprising:
one or more processors;
storage means having one or more programs stored thereon which, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
14. A non-transitory computer readable storage medium having stored thereon executable instructions that, when executed on a processor, implement the method of any one of claims 1-7.
CN201910750917.6A 2019-08-14 2019-08-14 Network message delay detection method and device and electronic equipment Active CN112311619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910750917.6A CN112311619B (en) 2019-08-14 2019-08-14 Network message delay detection method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910750917.6A CN112311619B (en) 2019-08-14 2019-08-14 Network message delay detection method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112311619A true CN112311619A (en) 2021-02-02
CN112311619B CN112311619B (en) 2022-04-05

Family

ID=74486670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910750917.6A Active CN112311619B (en) 2019-08-14 2019-08-14 Network message delay detection method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112311619B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114826983A (en) * 2022-06-08 2022-07-29 深圳云豹智能有限公司 VIRTIO network equipment delay positioning method, processing unit and VIRTIO network equipment
CN114978947A (en) * 2022-05-20 2022-08-30 南方电网科学研究院有限责任公司 Power simulation communication time calculation method, device and equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070274227A1 (en) * 2006-05-24 2007-11-29 At&T Corp. Network latency analysis packet and method
CN102137414A (en) * 2010-06-25 2011-07-27 华为技术有限公司 Time-delay-evaluating method and device for mobile video service
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system
CN105049299A (en) * 2015-08-27 2015-11-11 北京百度网讯科技有限公司 Detection method and device for time delay state information and network architecture
CN105515895A (en) * 2015-11-30 2016-04-20 东南大学 Method for measuring hop-by-hop delay on end-to-end path based on software-defined network
CN106713074A (en) * 2016-12-30 2017-05-24 贵州电网有限责任公司信息中心 Data network quality piecewise detection method and system based on service content
CN106936657A (en) * 2015-12-30 2017-07-07 华为技术有限公司 A kind of methods, devices and systems for realizing time delay detection
CN108063653A (en) * 2016-11-08 2018-05-22 华为技术有限公司 A kind of delay control method, apparatus and system
CN109428785A (en) * 2017-09-01 2019-03-05 阿里巴巴集团控股有限公司 A kind of fault detection method and device
CN109617743A (en) * 2019-01-10 2019-04-12 北京新宇航星科技有限公司 network performance monitoring and service testing system and testing method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070274227A1 (en) * 2006-05-24 2007-11-29 At&T Corp. Network latency analysis packet and method
CN102137414A (en) * 2010-06-25 2011-07-27 华为技术有限公司 Time-delay-evaluating method and device for mobile video service
CN103401726A (en) * 2013-07-19 2013-11-20 华为技术有限公司 Network path detecting method, device and system
CN105049299A (en) * 2015-08-27 2015-11-11 北京百度网讯科技有限公司 Detection method and device for time delay state information and network architecture
CN105515895A (en) * 2015-11-30 2016-04-20 东南大学 Method for measuring hop-by-hop delay on end-to-end path based on software-defined network
CN106936657A (en) * 2015-12-30 2017-07-07 华为技术有限公司 A kind of methods, devices and systems for realizing time delay detection
CN108063653A (en) * 2016-11-08 2018-05-22 华为技术有限公司 A kind of delay control method, apparatus and system
CN106713074A (en) * 2016-12-30 2017-05-24 贵州电网有限责任公司信息中心 Data network quality piecewise detection method and system based on service content
CN109428785A (en) * 2017-09-01 2019-03-05 阿里巴巴集团控股有限公司 A kind of fault detection method and device
CN109617743A (en) * 2019-01-10 2019-04-12 北京新宇航星科技有限公司 network performance monitoring and service testing system and testing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114978947A (en) * 2022-05-20 2022-08-30 南方电网科学研究院有限责任公司 Power simulation communication time calculation method, device and equipment
CN114826983A (en) * 2022-06-08 2022-07-29 深圳云豹智能有限公司 VIRTIO network equipment delay positioning method, processing unit and VIRTIO network equipment
CN114826983B (en) * 2022-06-08 2023-11-17 深圳云豹智能有限公司 VIRTIO network equipment delay positioning method, processing unit and VIRTIO network equipment

Also Published As

Publication number Publication date
CN112311619B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
US11363046B2 (en) Network operation application monitoring
CN110377440B (en) Information processing method and device
CN112311619B (en) Network message delay detection method and device and electronic equipment
US10067862B2 (en) Tracking asynchronous entry points for an application
CN112287206A (en) Information processing method and device and electronic equipment
CN112448969A (en) Link tracking method, device, system, equipment and readable storage medium
CN108712299A (en) A kind of method, apparatus, equipment and the computer storage media of monitoring live streaming delay
CN110781066B (en) User behavior analysis method, device, equipment and storage medium
CN112732302A (en) Configuration updating method and device of application program and electronic equipment
CN112954056A (en) Monitoring data processing method and device, electronic equipment and storage medium
CN112152879A (en) Network quality determination method and device, electronic equipment and readable storage medium
CN111258917A (en) Software testing system, method and device, computer readable storage medium
CN112379967B (en) Simulator detection method, device, equipment and medium
CN111628913B (en) Online time length determining method and device, readable medium and electronic equipment
CN113139082A (en) Multimedia content processing method, apparatus, device and medium
CN112464039A (en) Data display method and device of tree structure, electronic equipment and medium
CN113176937A (en) Task processing method and device and electronic equipment
CN112306858A (en) Test method and device and electronic equipment
CN111831530A (en) Test method and device
CN113391860A (en) Service request processing method and device, electronic equipment and computer storage medium
CN111309323A (en) Parameter initialization method and device and electronic equipment
US11271838B2 (en) Timing synchronization
CN111274150B (en) Service instance access method and device and electronic equipment
CN116321397A (en) 5G network time delay determining method and device, electronic equipment and storage medium
CN113722206A (en) Data annotation method and device, electronic equipment and computer readable medium

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220712

Address after: 100190 1309, 13th floor, building 4, Zijin Digital Park, Haidian District, Beijing

Patentee after: Beijing volcano Engine Technology Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right