CN108011778B - Method and device for acquiring message transmission delay time - Google Patents

Method and device for acquiring message transmission delay time Download PDF

Info

Publication number
CN108011778B
CN108011778B CN201711238324.9A CN201711238324A CN108011778B CN 108011778 B CN108011778 B CN 108011778B CN 201711238324 A CN201711238324 A CN 201711238324A CN 108011778 B CN108011778 B CN 108011778B
Authority
CN
China
Prior art keywords
message
time
monitoring
packet
original
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.)
Active
Application number
CN201711238324.9A
Other languages
Chinese (zh)
Other versions
CN108011778A (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 Runke General Technology Co Ltd
Original Assignee
Beijing Runke General 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 Runke General Technology Co Ltd filed Critical Beijing Runke General Technology Co Ltd
Priority to CN201711238324.9A priority Critical patent/CN108011778B/en
Publication of CN108011778A publication Critical patent/CN108011778A/en
Application granted granted Critical
Publication of CN108011778B publication Critical patent/CN108011778B/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/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/106Active monitoring, e.g. heartbeat, ping or trace-route using time related information in packets, e.g. by adding timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames

Abstract

The invention provides a method and a device for acquiring message transmission delay time. Meanwhile, the monitoring equipment can monitor the original message and write the first time of receiving the original message in the monitored message to obtain a first monitored message; and sending the first monitoring message to the analysis equipment. The monitoring equipment can monitor the message corresponding to the original message from the target network again, namely, the target message; and writing the second time of receiving the target message into the target message to obtain a second monitoring message and sending the second monitoring message to the analysis equipment, and calculating the delay time of the original message by the analysis equipment according to the first time and the second time. The method does not introduce the receiving and sending time of the actual transmission message, so the transmission protocol of the message does not need to be modified; the method has the advantages of high usability, simple operation and high accuracy.

Description

Method and device for acquiring message transmission delay time
Technical Field
The present invention belongs to the field of communication technology, and in particular, to a method and an apparatus for obtaining message transmission delay time.
Background
The message transmission delay time refers to a time difference between the receiving time of the receiving end receiving the message and the sending time of the sending end sending the message. In the transmission process of the message, the message flow is not simply from the sending end to the receiving end, and often needs to be forwarded through a switch or other forwarding devices, and a time delay is generated in the forwarding process of the message.
One solution for calculating the delay time in the related art is: when a sending end sends a message, the sending time of the message is written into the message; and the receiving end records the acquisition time after acquiring the message at the driving layer or the application layer. And then, calculating the time difference between the message acquisition time and the message sending time. However, factors such as system time accuracy and message acquisition all affect the accuracy of the delay time, for example, the system time accuracy of the windows x operating system is ms level; the delay time obtained by the scheme has low accuracy. At present, no scheme for obtaining accurate delay time exists.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for obtaining a message transmission delay time, so as to obtain an accurate delay time in a message transmission process. The technical scheme is as follows:
in a first aspect, the present application provides a method for obtaining a message transmission delay time, which is applied to a monitoring device, and the method includes:
receiving an original message sent by sending equipment, and transparently transmitting the original message to a target network;
writing the first time when the original message is received into a preset field of the original message to obtain a first monitoring message;
sending the first monitoring message to an analysis device;
monitoring a target message sent by the target network, wherein the target message is a message corresponding to the original message and is re-monitored by the monitoring equipment after the original message is sent to the target network;
writing the second time of monitoring the target message into a preset field of the target message to obtain a second monitoring message;
and sending the second monitoring message to the analysis equipment so that the analysis equipment determines the delay time of the original message according to the first time and the second time.
Optionally, the preset field is the first three bytes of a source MAC address of the original packet or the destination packet.
Optionally, the method further comprises:
and sending a timing message for timing to the analysis equipment according to a preset period so that the analysis equipment obtains the delay time of the original message according to the first monitoring message, the timing message before the first monitoring message, the second monitoring message and the timing message before the second monitoring message.
In a second aspect, the present application further provides a method for obtaining a message transmission delay time, which is applied to an analysis device, and the method includes:
receiving a first monitoring message sent by monitoring equipment, wherein the first monitoring message carries the first time when the monitoring equipment receives an original message sent by sending equipment;
receiving a second monitoring message sent by the monitoring equipment, wherein the second monitoring message carries a second time for monitoring a target message corresponding to the original message from a target network after the monitoring equipment sends the original message to the target network;
and calculating the delay time of the original message according to the second time and the first time.
Optionally, the method further comprises:
and receiving a timing message sent by the monitoring equipment according to a preset period.
Optionally, the calculating the delay time of the original packet according to the second time and the first time includes:
judging whether the timing message exists between the first monitoring message and the second monitoring message;
when the timing message does not exist between the first monitoring message and the second monitoring message, calculating the time difference between the second time and the first time to obtain the delay time of the original message;
when the timing message exists between the first monitoring message and the second monitoring message, acquiring a third time corresponding to a previous timing message adjacent to the first time, and acquiring a fourth time corresponding to a previous timing message adjacent to the second time;
calculating a first difference between the third time and the fourth time, and a second difference between the second time and the first time;
and calculating the time sum of the first difference and the second difference to obtain the delay time of the original message.
Optionally, the method further comprises:
obtaining delay time corresponding to at least two original messages with the same message length;
and calculating to obtain the average delay time according to the delay time corresponding to each original message.
In a third aspect, the present application provides an apparatus for obtaining a message transmission delay time, where the apparatus is applied to a monitoring device, and the apparatus includes:
the receiving unit is used for receiving an original message sent by the sending equipment and transparently transmitting the original message to a target network;
the first writing unit is used for writing the first time when the original message is received into a preset field of the original message to obtain a first monitoring message;
a first sending unit, configured to send the first monitoring packet to an analysis device;
a monitoring unit, configured to monitor a target packet sent by the target network, where the target packet is a packet corresponding to the original packet and re-monitored by the monitoring device after the original packet is sent to the target network;
the second writing unit is used for writing the second time of monitoring the target message into a preset field of the target message to obtain a second monitoring message;
and the second sending unit is used for sending the second monitoring message to the analysis equipment so that the analysis equipment can determine the delay time of the original message according to the first time and the second time.
In a fourth aspect, the present application further provides an apparatus for obtaining a message transmission delay time, where the apparatus is applied to an analysis device, and the apparatus includes:
a first receiving unit, configured to receive a first monitoring message sent by a monitoring device, where the first monitoring message carries a first time when the monitoring device receives an original message sent by a sending device;
a second receiving unit, configured to receive a second monitoring packet sent by the monitoring device, where the second monitoring packet carries a second time when the monitoring device sends the original packet to a target network and then monitors a target packet corresponding to the original packet from the target network again;
and the first calculating unit is used for calculating the delay time of the original message according to the second time and the first time.
Optionally, the apparatus further comprises:
the acquiring unit is used for acquiring delay time corresponding to at least two original messages with the same message length;
and the second calculating unit is used for calculating and obtaining the average delay time according to the delay time corresponding to each original message.
In the method for acquiring the message transmission delay time provided by this embodiment, a monitoring device and an analysis device are connected between a sending device and a target network. The message sent by the sending equipment is transmitted to the target network through the monitoring equipment. After receiving the original message sent by the sending device, the monitoring device transparently transmits the original message to the target network. Meanwhile, the monitoring branch of the monitoring device can monitor the received original message and write the first time of receiving the original message into the monitored message to obtain a first monitoring message. The monitoring branch of the monitoring equipment can re-monitor the message corresponding to the original message from the target network and record the message as a target message; and writing the second time of receiving the target message into the target message to obtain a second monitoring message. The second time is the time when the receiving end in the target network receives the original message. The monitoring device sends the first monitoring message and the second monitoring message to the analysis device, and the analysis device calculates the delay time of the original message according to the first time carried by the first monitoring message and the second time carried by the second monitoring message. The method does not introduce the receiving and sending time of the actual transmission message, so the transmission protocol of the message does not need to be modified; the method has the advantages of high usability, simple operation and high accuracy.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a block diagram of a system for obtaining a message delay time according to an embodiment of the present application;
fig. 2 is a flowchart of a method for obtaining a message delay time according to an embodiment of the present application;
fig. 3 is a flowchart of another method for obtaining a message transmission delay time according to an embodiment of the present application;
FIG. 4 is a flow chart of a process for calculating a delay time according to an embodiment of the present application;
fig. 5 is a block diagram of an apparatus for obtaining a message transmission delay time according to an embodiment of the present application;
fig. 6 is a block diagram of another apparatus for obtaining a message transmission delay time according to an embodiment of the present application;
fig. 7 is a block diagram of an apparatus for obtaining a message transmission delay time according to an embodiment of the present application;
fig. 8 is a block diagram of another apparatus for obtaining a message transmission delay time according to an embodiment of the present application;
fig. 9 is a block diagram of another apparatus for obtaining a message transmission delay time according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
Referring to fig. 1, a block diagram of a system for obtaining a message delay time according to an embodiment of the present application is shown. The system can be used to obtain the delay time of Avionics Full Duplex switched Ethernet (AFDX) messages. Of course, the system is also suitable for obtaining the delay time of any other network transmission message with the same mechanism as the AFDX.
As shown in fig. 1, the system includes a transmitting device 110, a listening device 120, a network device 130, and an analyzing device 140. The present embodiment takes AFDX messages as an example for explanation.
The transmitting device 110 includes a transmitting port Tx and a receiving port Rx, and transmits an AFDX message to the outside through the Tx and receives the AFDX message through the Rx.
Listening device 120 includes listening ports and sets of pass-through port pairs, e.g., ports 1 and 2, ports 3 and 4, ports 5 and 6, and ports 7 and 8.
In this embodiment, the port 5 is connected to the Tx port of the transmitting device 110, the port 6 is connected to any port of the network device 130, and the network device 130 is connected to the AFDX network. Port 7 is connected to a port of the network device 130 and port 8 is connected to an Rx port of the transmitting device. Meanwhile, the listening port is connected to the Rx port of the analysis device 140.
Wherein the network device 130 and the necessary networks form a target network for transmitting messages.
The monitoring device 120 has a transparent transmission function, a bypass monitoring function, and a message receiving time stamp recording function.
Transparent transmission means that in the process of data transmission, the group of data is not changed in any form, i.e. is not disconnected, grouped, encoded, encrypted or confused, and the like, and the received data is transmitted to the receiving end as it is. The inherent delay generated by the transparent transmission of the monitoring device 120 is less than 1 μ s, which can be ignored, so that the transparent transmission of the monitoring device 120 itself has no influence on the delay time of the packet.
The bypass monitoring function is realized through a monitoring port, and the monitoring port can monitor the message transmitted through the transparent transmission port. In this embodiment, the port 5 and the port 6 are used to monitor a message sent by the sending device 110, which is called an original message; the port 7 and the port 8 are used to monitor a destination message corresponding to the original message in the AFDX network, wherein the monitoring device 120 monitors the original message from the AFDX network again through the port 7 after transmitting the original message to the AFDX network, and records the original message as the destination message.
Meanwhile, the listening device 120 can also record the timestamp of the message received. That is, the timestamp of receiving the original message can be recorded, and the timestamp of receiving the destination message can be recorded. After the original packet and the destination packet are acquired by the monitoring device 120, the receiving time is written into the monitored packet by a Field-Programmable Gate Array (FPGA) in the monitoring device 120. Generally, the operation speed of the FPGA chip is ns level, and the delay time generated by the FPGA is negligible, so as to ensure the accuracy of the receiving time of the original message and the destination message recorded by the monitoring device 120.
In this embodiment, the AFDX message uses a User Datagram Protocol (UDP) message, and a timestamp of the received message may be written into the first three bytes of a source Multimedia Access Control (MAC) address of the UDP message, because the first three bytes of the source MAC address of the UDP message are not used.
For example, when receiving the original message, the monitoring device 120 writes the timestamp of the received original message into the first three bytes of the source MAC address of the monitored original message to obtain a first monitored message, and sends the first monitored message to the analysis device 140; meanwhile, when receiving the destination message, the monitoring device 120 writes the timestamp of the received destination message into the first three bytes of the source MAC address of the monitored destination message to obtain a second monitoring message, and sends the second monitoring message to the analysis device 140.
In addition, the first monitoring message and the second monitoring message are sent to the analysis device 140 through the monitoring port on the monitoring device 120, and do not interfere with the transparent transmission port, so that the AFDX network topology is not affected, and therefore, the validity of the delay time of the finally obtained message is ensured.
The analysis device 140 calculates the delay time of the original packet according to the receiving timestamp of the original packet and the receiving timestamp of the destination packet recorded by the monitoring device 120. The analysis software on the analysis device 140 calculates the delay time from these two receive timestamps.
Referring to fig. 2, a flowchart of a method for obtaining a message delay time according to an embodiment of the present application is shown, where the method is applied to the listening device 120 of the system shown in fig. 1, and as shown in fig. 2, the method may include the following steps:
s110, receiving the original message sent by the sending device, and transparently transmitting the original message to the target network.
For example, the listening device may receive an original message sent by the sending device through the port 5, and send the original message to the network device of the target network through the port 6.
S120, writing the first time when the original message is received into a preset field of the original message to obtain a first monitoring message.
In an application scene of an AFDX message, writing the first time of receiving an original message into the first three bytes of a source MAC address of the AFDX message. The first time is the time when the listening device receives the original message from the sending device.
S130, the first monitoring message is sent to the analysis equipment.
The monitoring equipment sends the first monitoring message to the analysis equipment through the monitoring port.
S140, monitoring the destination message sent by the network equipment.
The target message is a message corresponding to the original message, which is sent to the target network and then is monitored by the monitoring equipment again. For example, the destination message is the original message, or the destination message is obtained by slightly changing the data portion of the original message.
And determining whether the monitored message is the message corresponding to the original message according to the characteristics of the message.
S150, writing the second time of monitoring the target message into a preset field of the target message to obtain a second monitoring message.
And writing the second time of receiving the target message into the first three bytes of the source MAC address of the monitored target message under the application scene of the AFDX message to obtain a second monitored message. The second time is the time when the monitoring device receives the destination message from the network device.
Wherein, since the time unit in the source MAC address in the message is microsecond, the units of the first time and the second time are microsecond.
And S160, sending the second monitoring message to the analysis equipment.
The monitoring device sends the second monitoring message to the analysis device through the monitoring port, and the analysis device determines the delay time of the original message according to the first time carried by the first monitoring message and the second time carried by the second monitoring message.
In an embodiment of the present application, the first time is a real time of receiving the original packet, and the second time is a real time of receiving the destination packet. In this application scenario, as shown in table 1, the difference between the second time and the first time is directly calculated as the delay time of the packet.
In another application scenario of the present application, the first three bytes of the source MAC address of the AFDX message are not enough to record the complete time of receiving the AFDX message, and therefore, the time of monitoring the message is not the real receiving time of the message. In this application scenario, the monitoring device may send a timing message to the analysis device according to a preset period, for example, 1 s. The analysis equipment determines the receiving time of the message according to the monitoring message and the previous timing message of the monitoring message. Thus, the analysis device can obtain the delay time of the original message according to the determined receiving time of the original message and the receiving time of the target message. For example, the time stamps of the timing messages are shown in table 2.
TABLE 1
Figure BDA0001489424110000091
TABLE 2
Figure BDA0001489424110000092
In the method for obtaining the message transmission delay time provided by this embodiment, after receiving the original message sent by the sending device, the monitoring device transparently transmits the original message to the target network. Meanwhile, the monitoring branch of the monitoring device can monitor the received original message and write the first time of receiving the original message into the monitored message to obtain a first monitoring message. The monitoring branch of the monitoring equipment can re-monitor the message corresponding to the original message from the target network and record the message as a target message; and writing the second time of receiving the target message into the target message to obtain a second monitoring message. The second time is the time when the monitoring device receives the target packet from the target network, that is, the time when the receiving end in the target network receives the original packet. The monitoring device sends the first monitoring message and the second monitoring message to the analysis device, and the analysis device calculates the delay time of the original message according to the first time carried by the first monitoring message and the second time carried by the second monitoring message. The method does not introduce the receiving and sending time of the actual transmission message, so the transmission protocol of the message does not need to be modified; the method has the advantages of high usability, simple operation and high accuracy.
In addition, the method can be used for testing the actual use time of the message in the network under different propagation modes (such as unicast, broadcast and multicast) of each network node; and, actual use in a multi-network node cascading environment. The actual delay time of the message after the delay time is injected by the fault injection equipment can be accurately tested.
Referring to fig. 3, a flowchart of another method for obtaining a message transmission delay time according to an embodiment of the present application is shown, where the method is applied to the analysis device 140 of the system shown in fig. 1. As shown in fig. 3, the method may include the steps of:
s210, the analysis device receives a first monitoring message sent by the monitoring device.
The first monitoring message carries the first time when the monitoring device receives the original message sent by the sending device.
S220, the analysis device receives a second monitoring message sent by the monitoring device.
And after the second monitoring message carries the monitoring equipment to send the original message to the target network, monitoring the second time of the target message corresponding to the original message from the target network again.
And S230, calculating the delay time of the original message by the analysis equipment according to the second time and the first time.
In an application scenario, the second time in the second monitoring message is the accurate time for receiving the target message, and the first time in the first monitoring message is the accurate time for receiving the original message; in this application scenario, as shown in table 1, the difference between the second time and the first time is the delay time of the packet.
In an application scenario of the present application, the first three bytes of the source MAC address of the AFDX message are not enough to record the complete time of receiving the AFDX message, and therefore, the time of monitoring the message is not the real receiving time of the message. In this application scenario, the monitoring device may send a timing message according to a preset period, for example, 1 s. The analysis equipment determines the receiving time of the message according to the monitoring message and the previous timing message of the monitoring message. In this application scenario, as shown in fig. 4, S230 may include the following steps:
s231, the analysis equipment judges whether a timing message exists between the first monitoring message and the second monitoring message; if so, go to S232; if not, S235 is performed.
S232, obtain a third time corresponding to a previous timing packet adjacent to the first time, and obtain a fourth time corresponding to a previous timing packet adjacent to the second time.
If a timing message exists between the second monitoring message and the first monitoring message, determining the receiving time of the message according to the monitoring message and the previous timing message of the monitoring message, and then calculating the delay time of the original message by using the receiving time of the target message and the receiving time of the original message.
The sum of the time corresponding to the previous timing message adjacent to the first monitoring message and the time carried by the first verification message is the time for receiving the original message; similarly, the sum of the time corresponding to the previous timing message adjacent to the second monitoring message and the time carried by the second monitoring message is the time for receiving the target message.
S233, a first difference between the third time and the fourth time, and a second difference between the second time and the first time are calculated.
And S234, calculating the time sum of the first difference value and the second difference value to obtain the delay time of the original message.
For example, the second timing message is a timing message before the second monitoring message, and the first timing message is a timing message before the first monitoring message; the difference value of the second timing message and the first timing message is recorded as a first difference value; the difference value between the first three bytes of the source MAC address of the second monitoring message and the first three bytes of the source MAC address of the first monitoring message is recorded as a second difference value; the sum of the first difference and the second difference is the delay time of the message. The calculated message delay time is shown in table 3:
TABLE 3
Figure BDA0001489424110000111
S235, calculating the time difference between the second time and the first time to obtain the delay time of the original message.
If no timing message exists between the first monitoring message and the second monitoring message, the second time carried by the second monitoring message is the time for receiving the target message, and the first time in the first monitoring message is the time for receiving the original message. At this time, the delay time of the original message is obtained by directly calculating the difference value between the second time and the first time.
In the method for acquiring message transmission delay time provided by this embodiment, a message sent by a sending device is transmitted to a network through a monitoring device; the monitoring device can monitor the original message sent by the sending device and monitor the target message corresponding to the original message from the network device. Meanwhile, the receiving time of the original message and the target message can be recorded in the monitoring message, and then the monitoring message is sent to the analysis equipment. And the analysis equipment calculates the delay time of the message according to the receiving time of the original message and the receiving time of the target message recorded in the monitoring message. The method does not introduce the receiving and sending time of the actual transmission message, so the transmission protocol of the message does not need to be modified, and the method has the advantages of high usability, simple operation and high accuracy.
In another embodiment of the present application, the average delay time of the message may be calculated by using the above method.
The sending equipment sends N original messages through the Tx port, and the message length of each original message is the same.
The monitoring equipment can monitor each original message and generate a first monitoring message corresponding to each original message; meanwhile, the monitoring equipment can monitor the target messages corresponding to the original messages and generate second monitoring messages corresponding to the target messages.
The analysis device can identify a first monitoring message corresponding to each original message and a second monitoring message corresponding to each target message. Then, the delay time corresponding to each original message is calculated by the method shown in step S230. And finally, calculating the average value of the delay time of each original message to obtain the average delay time of the original message.
If the delay time of a single message is greatly different from the average delay time of the message, the AFDX network is proved to have at least one of instability, blockage, message loss and the like.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present invention is not limited by the illustrated ordering of acts, as some steps may occur in other orders or concurrently with other steps in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Corresponding to the method embodiment for obtaining the message transmission delay time, the application also provides a device embodiment for obtaining the message transmission delay time.
Referring to fig. 5, a block diagram of an apparatus for obtaining a message transmission delay time according to an embodiment of the present application is shown, where the apparatus is applied to the monitoring device shown in fig. 1. As shown in fig. 5, the apparatus includes: a receiving unit 110, a first writing unit 120, a first transmitting unit 130, a listening unit 140, a second writing unit 150, and a second transmitting unit 160.
The receiving unit 110 is configured to receive an original packet sent by a sending device, and transparently transmit the original packet to a target network.
The monitoring device can receive the original message sent by the sending device through the port 5, and transmit the original message through the port 6 to the network device.
The first writing unit 120 is configured to write the first time when the original packet is received into a preset field of the original packet, so as to obtain a first monitoring packet.
Wherein, the preset field is the first three bytes of the source MAC address of the original message.
A first sending unit 130, configured to send the first monitoring packet to the analysis device.
The monitoring unit 140 is configured to monitor a destination packet sent by a target network.
The target message is a message corresponding to the original message, which is sent to the target network and then is monitored by the monitoring equipment again. For example, the destination message is the original message, or the destination message is obtained by slightly changing the data portion of the original message. Wherein, it can be determined whether the monitored message is the message corresponding to the original message according to the characteristics of the message.
The second writing unit 150 is configured to write the second time when the destination packet is monitored into the preset field of the destination packet, so as to obtain a second monitored packet.
The preset field is the first three bytes of the source MAC address of the destination message.
Wherein, since the time unit in the source MAC address in the message is microsecond, the units of the first time and the second time are microsecond.
A second sending unit 160, configured to send the second monitoring packet to the analysis device.
And the analysis equipment determines the delay time of the original message according to the first time carried by the first monitoring message and the second time carried by the second monitoring message.
In an embodiment of the present application, the first time is a real time of receiving the original packet, and the second time is a real time of receiving the destination packet. In this application scenario, the difference between the second time and the first time is calculated as the delay time of the packet.
In the apparatus for obtaining the message transmission delay time provided in this embodiment, after receiving the original message sent by the sending device, the monitoring device transparently transmits the original message to the target network. Meanwhile, the monitoring branch of the monitoring device can monitor the received original message and write the first time of receiving the original message into the monitored message to obtain a first monitoring message. The monitoring branch of the monitoring equipment can re-monitor the message corresponding to the original message from the target network and record the message as a target message; and writing the second time of receiving the target message into the target message to obtain a second monitoring message. The second time is the time of receiving the destination message, that is, the time of receiving the original message by the receiving end in the destination network. The monitoring device sends the first monitoring message and the second monitoring message to the analysis device, and the analysis device calculates the delay time of the original message according to the first time carried by the first monitoring message and the second time carried by the second monitoring message. The device does not introduce the receiving and sending time of the actual transmission message, so the transmission protocol of the message does not need to be modified; the method has the advantages of high usability, simple operation and high accuracy.
In another application scenario of the present application, the first three bytes of the source MAC address of the AFDX message are not enough to record the complete time of receiving the AFDX message, and therefore, the time of monitoring the message is not the real receiving time of the message. In this application scenario, the monitoring device may send a timing message according to a preset period, for example, 1 s.
Referring to fig. 6, a block diagram of another apparatus for acquiring a message transmission delay time according to an embodiment of the present application is shown, where the apparatus of this embodiment further includes, on the basis of the embodiment corresponding to fig. 5: and a third transmitting unit 210.
The third sending unit 210 is configured to send a timing packet for timing to the analysis device according to a preset period, so that the analysis device obtains the delay time of the original packet according to the first monitored packet, the previous timing packet of the first monitored packet, the second monitored packet, and the previous timing packet of the second monitored packet.
The second timing message is the previous timing message of the second monitoring message, and the first timing message is the previous timing message of the first monitoring message; the difference value of the second timing message and the first timing message is recorded as a first difference value; the difference value between the first three bytes of the source MAC address of the second monitoring message and the first three bytes of the source MAC address of the first monitoring message is recorded as a second difference value; the sum of the first difference and the second difference is the delay time of the message.
In the apparatus for obtaining a message transmission delay time provided in this embodiment, when a preset field of a message is not sufficient to record a complete time of receiving a timestamp, at this time, a monitoring device sends a timing message to an analysis device according to a preset period. And determining the real receiving time of the message according to the timing message and the time recorded in the message. And determining the message transmission delay time according to the real receiving time of the message. Thus, the application range of the device is expanded.
Corresponding to the embodiment of the device applied to the monitoring equipment, the application also provides the embodiment of the device applied to the analysis equipment.
Referring to fig. 7, a block diagram of an apparatus for obtaining a message transmission delay time according to an embodiment of the present application is shown, where the apparatus is applied to an analysis device, and as shown in fig. 7, the apparatus includes: a first receiving unit 310, a second receiving unit 320, and a first calculating unit 330. 0
The first receiving unit 310 is configured to receive a first monitoring packet sent by a monitoring device.
The first monitoring message carries the first time when the monitoring device receives the original message sent by the sending device.
The second receiving unit 320 is configured to receive a second monitoring packet sent by the monitoring device.
And after the second monitoring message carries the monitoring equipment to send the original message to the target network, monitoring the second time of the target message corresponding to the original message from the target network again.
The first calculating unit 330 is configured to calculate the delay time of the original packet according to the second time and the first time.
In an application scenario, the second time in the second monitoring message is the accurate time for receiving the target message, and the first time in the first monitoring message is the accurate time for receiving the original message; in this application scenario, as shown in table 1, the difference between the second time and the first time is the delay time of the packet.
In another application scenario, the receiving time of the message is determined according to the monitoring message and the previous timing message of the monitoring message. And calculating the delay time of the message by using the receiving time of the target message and the receiving time of the original message.
Referring to fig. 8, a block diagram of another apparatus for obtaining a message transmission delay time according to an embodiment of the present application is shown, where the apparatus is applied to an analysis device. The apparatus further includes a third receiving unit 410 on the basis of the embodiment shown in fig. 7.
A third receiving unit 410, configured to receive a timing packet sent by the monitoring device according to a preset period.
As shown in fig. 8, in a specific implementation manner of the embodiment of the present application, the first calculating unit 330 may include: a judgment sub-unit 331, a first calculation sub-unit 332, an acquisition sub-unit 333, a second calculation sub-unit 334, and a third calculation sub-unit 335.
The determining subunit 331 is configured to determine whether a timing packet exists between the first monitoring packet and the second monitoring packet.
The first calculating subunit 332 is configured to calculate a time difference between the second time and the first time to obtain a delay time of the original packet when no timing packet exists between the first monitored packet and the second monitored packet.
An obtaining subunit 333, configured to, when a timing packet exists between the first monitored packet and the second monitored packet, obtain a third time corresponding to a previous timing packet adjacent to the first time, and obtain a fourth time corresponding to a previous timing packet adjacent to the second time.
A second calculating subunit 334, configured to calculate a first difference between the third time and the fourth time, and a second difference between the second time and the first time.
And a third calculating subunit 335, configured to calculate a time sum of the first difference and the second difference, so as to obtain the delay time.
In the apparatus for acquiring a message transmission delay time provided in this embodiment, a message sent by a sending device is transmitted to a network through a monitoring device; the monitoring device can monitor the original message sent by the sending device and the target message corresponding to the original message from the network. Meanwhile, the receiving time of the original message and the target message can be recorded in the monitoring message, and then the monitoring message is sent to the analysis equipment. And the analysis equipment calculates the delay time of the original message according to the receiving time of the original message and the receiving time of the target message recorded in the monitoring message. The device does not introduce the message receiving and sending time into the actually transmitted message, so the transmission protocol of the message does not need to be modified; the method has the advantages of high usability, simple operation and high accuracy.
In another application scenario of the present application, the above apparatus may be used to calculate an average delay time of a packet.
As shown in fig. 9, a block diagram of another apparatus for acquiring a message transmission delay time according to an embodiment of the present application is applied to an analysis device. The device further comprises, on the basis of the embodiment shown in fig. 7: an acquisition unit 510 and a second calculation unit 520.
An obtaining unit 510, configured to obtain delay times corresponding to at least two original messages with the same message length.
The sending equipment sends N original messages through the Tx port, and the message length of each original message is the same.
The monitoring equipment can monitor each original message and generate a first monitoring message corresponding to each original message; meanwhile, the monitoring equipment can monitor the target messages corresponding to the original messages and generate second monitoring messages corresponding to the target messages.
The analysis device can identify a first monitoring message corresponding to each original message and a second monitoring message corresponding to each target message. Then, the delay time corresponding to each original message is calculated by the method.
The second calculating unit 520 is configured to calculate an average delay time according to the delay time corresponding to each original packet.
The second calculating unit calculates the average value of the delay time of each message to obtain the average delay time of the message.
And judging whether the network for transmitting the message has certain defects or not according to the difference between the delay time of the single message and the average delay time of the message. For example, if the delay time of a single message and the average delay time of the message are different greatly, the AFDX is proved to have at least one of instability, blocking and losing of the message.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (7)

1. A method for obtaining message transmission delay time is applied to monitoring equipment, and the method comprises the following steps:
receiving an original message sent by sending equipment, and transparently transmitting the original message to a target network;
writing the first time when the original message is received into a preset field of the original message to obtain a first monitoring message;
sending the first monitoring message to an analysis device;
monitoring a target message sent by the target network, wherein the target message is a message corresponding to the original message and is re-monitored by the monitoring equipment after the original message is sent to the target network;
writing the second time of monitoring the target message into a preset field of the target message to obtain a second monitoring message;
sending the second monitoring message to the analysis equipment so that the analysis equipment determines the delay time of the original message according to the first time and the second time;
when the preset field of the original message is not enough to record the first time, sending a timing message for timing to the analysis device according to a preset period, so that the analysis device obtains the delay time of the original message according to the first monitored message, the timing message before the first monitored message, the second monitored message and the timing message before the second monitored message.
2. The method of claim 1, wherein the predetermined field is the first three bytes of a source Media Access Control (MAC) address of the original packet or the destination packet.
3. A method for obtaining message transmission delay time is applied to analysis equipment, and the method comprises the following steps:
receiving a first monitoring message sent by monitoring equipment, wherein the first monitoring message carries the first time when the monitoring equipment receives an original message sent by sending equipment;
receiving a second monitoring message sent by the monitoring equipment, wherein the second monitoring message carries a second time for monitoring a target message corresponding to the original message from a target network after the monitoring equipment sends the original message to the target network;
judging whether a timing message exists between the first monitoring message and the second monitoring message, wherein the timing message is sent by the monitoring equipment according to a preset period;
when the timing message does not exist between the first monitoring message and the second monitoring message, calculating the time difference between the second time and the first time to obtain the delay time of the original message;
when the timing message exists between the first monitoring message and the second monitoring message, acquiring a third time corresponding to a previous timing message adjacent to the first time, and acquiring a fourth time corresponding to a previous timing message adjacent to the second time;
calculating a first difference between the third time and the fourth time, and a second difference between the second time and the first time;
and calculating the time sum of the first difference and the second difference to obtain the delay time of the original message.
4. The method of claim 3, further comprising:
obtaining delay time corresponding to at least two original messages with the same message length;
and calculating to obtain the average delay time according to the delay time corresponding to each original message.
5. An apparatus for obtaining message transmission delay time, which is applied in a monitoring device, the apparatus comprising:
the receiving unit is used for receiving an original message sent by the sending equipment and transparently transmitting the original message to a target network;
the first writing unit is used for writing the first time when the original message is received into a preset field of the original message to obtain a first monitoring message;
a first sending unit, configured to send the first monitoring packet to an analysis device;
a monitoring unit, configured to monitor a target packet sent by the target network, where the target packet is a packet corresponding to the original packet and re-monitored by the monitoring device after the original packet is sent to the target network;
the second writing unit is used for writing the second time of monitoring the target message into a preset field of the target message to obtain a second monitoring message;
a second sending unit, configured to send the second monitoring packet to the analysis device, so that the analysis device determines the delay time of the original packet according to the first time and the second time;
a third sending unit, configured to send, when a preset field of the original packet is not sufficient to record the first time, a timing packet for timing to the analysis device according to a preset cycle, so that the analysis device obtains a delay time of the original packet according to the first monitored packet, the timing packet before the first monitored packet, the second monitored packet, and the timing packet before the second monitored packet.
6. An apparatus for obtaining a message transmission delay time, applied to an analysis device, the apparatus comprising:
a first receiving unit, configured to receive a first monitoring message sent by a monitoring device, where the first monitoring message carries a first time when the monitoring device receives an original message sent by a sending device;
a second receiving unit, configured to receive a second monitoring packet sent by the monitoring device, where the second monitoring packet carries a second time when the monitoring device sends the original packet to a target network and then monitors a target packet corresponding to the original packet from the target network again;
a first calculating unit, configured to calculate a delay time of the original packet according to the second time and the first time;
wherein the first calculation unit includes: the system comprises a judgment subunit, a first calculation subunit, an acquisition subunit, a second calculation subunit and a third calculation subunit;
the judging subunit is configured to judge whether a timing packet exists between the first monitoring packet and the second monitoring packet, where the timing packet is sent by the monitoring device according to a preset period;
the first calculating subunit is configured to calculate a time difference between the second time and the first time to obtain a delay time of the original packet when the timing packet does not exist between the first monitored packet and the second monitored packet;
the acquiring subunit is configured to, when the timing packet exists between the first monitored packet and the second monitored packet, acquire a third time corresponding to a previous timing packet adjacent to the first time, and acquire a fourth time corresponding to a previous timing packet adjacent to the second time;
the second calculating subunit is configured to calculate a first difference between the third time and the fourth time, and a second difference between the second time and the first time;
and the third calculating subunit is configured to calculate a time sum of the first difference and the second difference, so as to obtain the delay time of the original packet.
7. The apparatus of claim 6, further comprising:
the acquiring unit is used for acquiring delay time corresponding to at least two original messages with the same message length;
and the second calculating unit is used for calculating and obtaining the average delay time according to the delay time corresponding to each original message.
CN201711238324.9A 2017-11-30 2017-11-30 Method and device for acquiring message transmission delay time Active CN108011778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711238324.9A CN108011778B (en) 2017-11-30 2017-11-30 Method and device for acquiring message transmission delay time

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711238324.9A CN108011778B (en) 2017-11-30 2017-11-30 Method and device for acquiring message transmission delay time

Publications (2)

Publication Number Publication Date
CN108011778A CN108011778A (en) 2018-05-08
CN108011778B true CN108011778B (en) 2020-08-04

Family

ID=62055280

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711238324.9A Active CN108011778B (en) 2017-11-30 2017-11-30 Method and device for acquiring message transmission delay time

Country Status (1)

Country Link
CN (1) CN108011778B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404840A (en) * 2019-01-03 2020-07-10 华为技术有限公司 Message processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2355901B (en) * 1999-11-01 2003-10-01 Mitel Corp Marker packet system and method for measuring audio network delays
CN103220701A (en) * 2013-03-21 2013-07-24 深信服网络科技(深圳)有限公司 Method and device for access point (AP) fault detection
CN103236744A (en) * 2013-05-07 2013-08-07 国家电网公司 Intelligent transformer substation information optical fiber transmission delay detection method
CN103546336A (en) * 2013-09-24 2014-01-29 许继集团有限公司 Method for monitoring transmission delay on basis of link-layer communication transmission mode of Ethernet
CN105743729A (en) * 2014-12-12 2016-07-06 杭州迪普科技有限公司 Method and device for time delay calculation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7937470B2 (en) * 2000-12-21 2011-05-03 Oracle International Corp. Methods of determining communications protocol latency

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2355901B (en) * 1999-11-01 2003-10-01 Mitel Corp Marker packet system and method for measuring audio network delays
CN103220701A (en) * 2013-03-21 2013-07-24 深信服网络科技(深圳)有限公司 Method and device for access point (AP) fault detection
CN103236744A (en) * 2013-05-07 2013-08-07 国家电网公司 Intelligent transformer substation information optical fiber transmission delay detection method
CN103546336A (en) * 2013-09-24 2014-01-29 许继集团有限公司 Method for monitoring transmission delay on basis of link-layer communication transmission mode of Ethernet
CN105743729A (en) * 2014-12-12 2016-07-06 杭州迪普科技有限公司 Method and device for time delay calculation

Also Published As

Publication number Publication date
CN108011778A (en) 2018-05-08

Similar Documents

Publication Publication Date Title
EP1931084B1 (en) A method for getting the link estimating parameters
CN107508719B (en) Method and device for measuring network time delay and network node
EP2320580B1 (en) System for measuring transmission bandwidth for media streaming and method for same
US11133884B2 (en) Determining required processing time of a data network
US20080186906A1 (en) Clock synchronization aid device for communication station(s) of a wireless network, and associated clock synchronization device
US9088492B2 (en) Method for devices in a network to participate in an end-to-end measurement of latency
KR101451194B1 (en) Method and apparatus for measuring distance in contents delivery network
CN101547063B (en) Method and system for testing forward delay
FR2883117B1 (en) ARCHITECTURE OF COMMUNICATION NODE IN A GLOBALLY ASYNCHRONOUS CHIP NETWORK SYSTEM.
CN105634840A (en) Method and device for measuring packet loss
US20140003454A1 (en) Method and system for recording, synchronizing and analysing data by means of analysis devices which are spatially distributed in a communication network
CN108011778B (en) Method and device for acquiring message transmission delay time
WO2017005118A1 (en) Method, device, terminal and server for maintaining communication connection
TWI542164B (en) Blue-tooth communication system and broadcasting method thereof
CN106936664B (en) Software defined network path performance testing device and method
US11575590B2 (en) Method for devices in a network to participate in an end-to-end measurement of latency
US11483122B2 (en) Time transfer using passive tapping
US7466654B1 (en) Method of detecting intermediary communication device
JP2004088289A (en) Network quality evaluating device
CN112636861A (en) Clock synchronization method, device, equipment and storage medium
CN113810243B (en) Delay testing method and device
KR100724680B1 (en) Performance meansurement apparatus of transfering packet and method thereof
Hynek et al. Ultra high resolution jitter measurement method for Ethernet based networks
CN115208806B (en) Method and device for testing NTP server response capability
KR101627796B1 (en) Device Indicator Data Transmitting Method for Network based AV System

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