CN106549822B - Method and device for testing response time of time synchronization message and test equipment - Google Patents

Method and device for testing response time of time synchronization message and test equipment Download PDF

Info

Publication number
CN106549822B
CN106549822B CN201510670173.9A CN201510670173A CN106549822B CN 106549822 B CN106549822 B CN 106549822B CN 201510670173 A CN201510670173 A CN 201510670173A CN 106549822 B CN106549822 B CN 106549822B
Authority
CN
China
Prior art keywords
time
packet
response
message
field
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
CN201510670173.9A
Other languages
Chinese (zh)
Other versions
CN106549822A (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.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Publication of CN106549822A publication Critical patent/CN106549822A/en
Application granted granted Critical
Publication of CN106549822B publication Critical patent/CN106549822B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method, a device and a test device for testing the response time of a time synchronization message, wherein the method for testing a device end comprises the following steps: acquiring occurrence time T1 of the test equipment executing the change operation which can enable the tested equipment to respond and return the message; acquiring time T2 when a response message returned by the tested equipment correctly responding to the change operation reaches the testing equipment; acquiring a first transmission delay of a first link for transmitting a message to a tested device by a test device and a second transmission delay of a second link for transmitting the message to the test device by the tested device; the time difference between T2 and T1 is subtracted from the sum of the first transmission delay and the second transmission delay, and the resultant is determined as the response time. Therefore, the response time can be measured, and the influence of message change on the time synchronization effect can be mastered on the basis of synchronous network deployment and troubleshooting through the response time, so that the user can conveniently improve the synchronous network performance.

Description

Method and device for testing response time of time synchronization message and test equipment
Technical Field
The present invention relates to the field of communication transmission, and in particular, to a method, an apparatus, and a test device for testing response time of a time synchronization packet.
Background
In many fields, for example, in the field of mobile communications, multiple communication systems require time synchronization between air interfaces of base stations to be satisfied for normal operation.
PTP (Precision Time Protocol) Protocol is a Time synchronization Protocol for high Precision between devices. In a PTP synchronization path, the master clock provides the source time for the next level clock to synchronize, i.e. for the slave clock to reference. The slave clock corrects the local time according to the time provided by the master clock by communicating message information with the master clock. Specifically, when the device responds and receives a message, for the response time of the PTP message, the synchronous network deployment and troubleshooting after a problem occurs can be determined according to the response time, but the prior art has no way to measure the response time.
Disclosure of Invention
the technical problem to be solved by the present invention is to provide a method, an apparatus and a testing device for testing response time of a time synchronization packet, so as to solve the problem that there is no way to measure response time in the prior art.
In order to solve the above technical problem, an embodiment of the present invention provides a method for testing response time of a time synchronization packet, where the method is used for testing a device side, and the method for testing response time of a time synchronization packet includes:
A first acquisition step of acquiring occurrence time T1 of the test equipment executing a change operation which enables the tested equipment to respond and return a message;
A second obtaining step of obtaining a time T2 when a response packet returned by the device under test correctly responds to the change operation reaches the test device;
a third obtaining step, obtaining a first transmission delay of a first link used for the test equipment to transmit the message to the tested equipment and a second transmission delay of a second link used for the tested equipment to transmit the message to the test equipment;
a response time determining step of determining the response time as a difference between a time difference between the T2 and the T1 and a sum of the first transmission delay and the second transmission delay.
Further, the time synchronization message is a precision time synchronization protocol PTP time synchronization message.
Further, the changing operation is specifically:
stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
Field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
When the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
Further, when the change operation is a stop operation and the first time synchronization packet is an Announce packet, in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of a clock class field and/or a clock identity field in the received packet.
Further, when the change operation is a field assignment operation, the second time synchronization packet is an Announce packet, the at least one field is a clock class Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock class Clockclass field in the received packet.
Further, the test equipment sends the second time synchronization packet and the third time synchronization packet to the device to be tested, and the field assignment operation is an operation capable of switching a time source.
Further, the second time synchronization packet is an Announce packet, the at least one field is a clock level Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock level Clockclass field and/or the clock identity field in the received packet.
Further, the second acquiring step specifically includes:
extracting the arrival time T2 of the response message returned by correctly responding to the change operation from the recorded arrival time of all the messages received from the tested device; or
And obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
Further, the first transmission delay and the second transmission delay are obtained according to a timestamp recorded in a time synchronization message transmitted between the test device and the device under test.
In order to solve the above technical problem, an embodiment of the present invention further provides a device for testing response time of a time synchronization packet, where the device is used for testing a device side, and the device for testing response time of a time synchronization packet includes:
the first acquisition module is used for acquiring the occurrence time T1 of the test equipment executing a change operation which can enable the tested equipment to respond and return a message;
A second obtaining module, configured to obtain time T2 when a response packet returned by the device under test correctly responds to the change operation reaches the testing device;
A third obtaining module, configured to obtain a first transmission delay of a first link used for the test device to transmit the packet to the device under test and a second transmission delay of a second link used for the device under test to transmit the packet to the test device;
A response time determining module, configured to determine the response time as a difference between the time difference between T2 and T1 and the sum of the first transmission delay and the second transmission delay.
Further, the time synchronization message is a precision time synchronization protocol PTP time synchronization message.
further, the changing operation is specifically:
Stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
When the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
Further, when the change operation is a stop operation and the first time synchronization packet is an Announce packet, the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to a value of a clock class field and/or a clock identity field in the received packet.
Further, when the change operation is a field assignment operation, the second time synchronization packet is an Announce packet, the at least one field is a clock class Clockclass field, and the second obtaining module determines whether the received packet is a response packet returned by correctly responding to the change operation according to a value of the clock class Clockclass field in the received packet.
Further, the test equipment sends the second time synchronization packet and the third time synchronization packet to the device to be tested, and the field assignment operation is an operation capable of switching a time source.
Further, the second time synchronization packet is an Announce packet, the at least one field is a clock level Clockclass field, and the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to the value of the clock level Clockclass field and/or the clock identity field in the received packet.
Further, the second obtaining module specifically includes:
The extraction submodule is used for extracting the arrival time T2 of a response message returned by correctly responding to the change operation from the recorded arrival time of all messages received from the tested device; or
and the obtaining submodule is used for obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
further, the first transmission delay and the second transmission delay are obtained according to a timestamp recorded in a time synchronization message transmitted between the test device and the device under test.
In order to solve the above technical problem, an embodiment of the present invention further provides a test apparatus, which includes the device for testing the response time of the time synchronization packet.
The technical scheme of the embodiment of the invention has the following beneficial effects:
In the scheme of the embodiment of the invention, the result of the response time of the message change operation of the test equipment is obtained by subtracting the first transmission time delay and the second transmission time delay from the obtained time difference between T1 and T2, so that the response time can be measured, the response performance of the equipment can be determined according to the result of the response time, the foundation can be laid for the deployment of the synchronous network and troubleshooting after problems occur, the influence of the time of PTP message change on the time synchronization effect can be further mastered, and the user can conveniently improve the performance and the stability of the synchronous network according to the troubleshooting result.
Drawings
Fig. 1 is a schematic diagram illustrating steps of a method for testing response time of a time synchronization packet according to an embodiment of the present invention;
Fig. 2 is a schematic diagram of calculating transmission delay of an interactive time synchronization packet according to an embodiment of the present invention;
Fig. 3 is a schematic structural diagram of an apparatus for testing response time of a time synchronization packet according to an embodiment of the present invention;
FIG. 4 is a simplified diagram of an interaction between a testing device and a device under test according to an embodiment of the present invention;
FIG. 5 is another interaction diagram of the testing device and the device under test according to the embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
The embodiment of the invention provides a method, a device and a test device for testing the response time of a time synchronization message, aiming at the problem that the response time of a PTP message cannot be tested in the prior art.
First embodiment
As shown in fig. 1, the method for testing the response time of the time synchronization packet is used for testing a device, and may include:
A first obtaining step 11 of obtaining an occurrence time T1 when the test device performs a change operation that enables the device under test to respond and return a message;
It should be noted that the above change operation refers to changing a certain message originally executed by the testing device, such as changing its type, terminating its transmission, or changing its parameters, so that the tested device responds to the above change. The above-described changing operation may cover various cases.
besides the above description of the change operation, the test device and the device under test need to be described, and the test device and the device under test are connected through interfaces such as an ethernet interface, and adopt the ethernet with the most common communication protocol standard, which facilitates the popularization and application of the method of the embodiment of the present invention.
a second obtaining step 12, obtaining time T2 when a response packet returned by the device under test correctly responding to the change operation reaches the test device;
It should be noted that, in the specific embodiment of the present invention, an IEEE 1588 (Institute of Electrical and Electronics Engineers ) protocol may be applied, and specifically, whether the device under test correctly responds to the change operation may be determined according to a correct response manner specified by the IEEE 1588 protocol for different messages. Therefore, whether the tested equipment correctly responds to the change operation can be judged directly through the stipulation of the protocol, and the timeliness of judging the response is improved.
A third obtaining step 13, obtaining a first transmission delay of a first link for the test device to transmit the message to the device under test and a second transmission delay of a second link for the test device to transmit the message to the test device;
It should be noted that, because the testing device and the device under test are connected by a plurality of connecting lines, the time synchronization packet from the master clock port of the testing device to the slave clock port of the device under test has a first transmission Delay 1; similarly, the time synchronization packet from the clock port of the device under test to the master clock port of the test device has a second transmission Delay 2; when calculating the response time of the message change operation, only the response time of the device itself needs to be judged, so that the transmission delay needs to be removed, and the accuracy of calculating the response time is improved.
further, it should be noted that, with respect to the first transmission delay and the second transmission delay: the first transmission delay and the second transmission delay may be obtained by using timestamp information of a message or other auxiliary means such as an auxiliary instrument. After the transmission Delay is obtained by using the auxiliary instrument for testing, the first transmission Delay1 and the second transmission Delay2 can be configured to the testing equipment manually, and the implementation mode is simple and reliable.
The above manner of obtaining the first transmission delay and the second transmission delay is only an example, and any other manner that can obtain the first transmission delay and the second transmission delay belongs to the protection scope of the embodiments of the present invention, which is not an example herein.
A response time determining step 14, determining the response time as the difference between the time difference between T2 and T1 and the sum of the first transmission delay and the second transmission delay.
the content of step 14 in the embodiment of the present invention can be described by a formula, and the specific formula is as follows:
The response time of the tested device is T2-T1-Delay1-Delay2
in the first embodiment of the present invention, the first transmission delay and the second transmission delay are subtracted from the obtained time difference between T1 and T2, so as to obtain the result of the response time to the message change operation of the test device, thereby realizing the measurement of the response time. The measured response time can be used for judging the response performance of the equipment, and can also be used as a basis for synchronous network deployment and troubleshooting after problems occur, and the performance of the synchronous network is improved by utilizing a troubleshooting result.
second embodiment
the Time synchronization message in the first embodiment may be a Network Time Protocol (NTP), but the NTP generally can only achieve a sub-second level of Time synchronization accuracy and cannot meet the requirement of Time synchronization with higher accuracy, so that the Time synchronization message in the second embodiment of the present invention is a precision Time synchronization Protocol (PTP) Time synchronization message based on the first embodiment.
it should be noted that PTP messages may be exchanged between the testing device and the device to be tested. The PTP message may include a Sync synchronization message of an interactive timestamp, a Delay _ Rep Delay request message, a Delay _ Resp Delay response message, and an Announce message (Announce message transmission time source information) carrying a time state.
Since the PTP message belongs to a message in a network of a PTP protocol, a network of a PTP protocol is described here: a network to which the PTP protocol is applied is generally referred to as a PTP domain; there is only one synchronous clock in the PTP domain, and all devices in the PTP domain keep synchronization with the clock; the nodes in the PTP domain are called clock nodes.
In the second embodiment of the present invention, since the PTP can reach the sub-microsecond level, the time synchronization requirement with higher accuracy can be satisfied, and meanwhile, since the PTP has lower construction and maintenance costs than a GPS (Global Positioning System), the PTP can get rid of the dependence on the GPS and has a special meaning in the aspect of national security.
Third embodiment
in a third embodiment of the present invention, based on the first embodiment or the second embodiment, the changing operation in the first obtaining step specifically includes:
Stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
Field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
when the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
It should be noted that: the periodicity in the behavior of stopping the test device from periodically sending the first time synchronization message to the tested device may be set to one second; the behavior of periodically sending the first time synchronization packet to the device under test by the test equipment may be that the test equipment sends 8 Announce packets per second to the device under test.
The stopping operation is a behavior of stopping the test equipment from periodically sending the first time synchronization message to the tested equipment, namely, the sending frequency of the message is adjusted, so that proper time can be reserved for message response, the situation that the previous message is not responded to and the next message needs to be responded is prevented, and the accuracy of response can be improved.
here, the contents of the above-described stop operation need to be explained: the method can comprise messages such as a Sync synchronization message stopping message and an Announce message, and can enable the tested equipment to enter a time keeping state after the Sync synchronization message stopping message and the Announce message are announced.
The predetermined transmission time in the above-described stop operation is explained here as follows. Specifically, the test device records an intended sending time of a first time synchronization packet that stops sending, and records the sending time as T1; the test equipment may also record the sending time of each first time synchronization message, and after the sending of the first time synchronization message is stopped, calculate and record the original sending time of the first time synchronization message stopped from being sent according to the recorded sending time of the first time synchronization message, and record the original sending time as the above T1.
In addition to the above-mentioned change operation of the stop operation, there is another field assignment operation, which is described here: the field assignment operation described above may be to change the quality parameter carried, such as changing the clock class clockclass value. After the field assignment operation, the message response time of the tested equipment entering the time keeping state can be tested; the message response time that the time source is still tracked and the time source is not switched can also be tested; the message response time of the tested equipment switched among the multi-path PTP time sources can also be tested.
in the third embodiment of the present invention, the response time of the message when the device under test enters the time keeping state can be tested by stopping the operation, so that the performance of the device under test can be tested when the device under test does not receive the external message; or the message response time of the tested equipment under various states can be tested through field assignment operation, so that preparation is made for subsequent deployment of a synchronous network and troubleshooting after problems occur through the message response time obtained from various aspects, and the response performance of the tested equipment can be evaluated.
fourth embodiment
a fourth embodiment of the present invention is, on the basis of the third embodiment, when the change operation is a stop operation and the first time synchronization packet is an Announce packet, in the second obtaining step, according to a value of a clock class Clockclass field and/or a clock identity field in a received packet, determines whether the received packet is a response packet returned in response to the change operation correctly.
it should be noted that: and judging whether the tested equipment correctly responds to the first time synchronous message or not according to a correct response mode for the sent first time synchronous message specified by an IEEE 1588 protocol. Thus, the judgment can be directly carried out according to the regulation of the protocol, and the timeliness of the judgment is improved.
for the IEEE 1588 protocol, according to the IEEE 1588 protocol, when the original clock class Clockclass field value of the testing device is 6 and the clock class Clockclass field value of the device under test is 187, the fourth embodiment of the present invention specifically determines whether to respond correctly as follows.
For example, one: and detecting the clock level Clockclass field of the Announce message returned by the tested device at the testing device, and if the value of the clock level Clockclass field is changed from 6 to 187 (because the tested device is in a holding state, the clock level Clockclass field is modified into a self field), judging that the tested device correctly responds and changes, and entering a time holding state. Otherwise, judging that the tested equipment does not respond correctly.
Example two: and the test equipment detects the clock identification ClockIdentity field of the Announce message returned by the tested equipment, and if the numerical value of the clock identification ClockIdentity field is changed from the clock identification ClockIdentity of the test equipment to the clock identification ClockIdentity of the tested equipment, the test equipment judges that the correct response of the tested equipment is changed, and enters a holding state. Otherwise, judging that the tested equipment does not respond correctly.
In the fourth embodiment of the present invention, by stopping the operation and when the first time synchronization packet is the Announce packet, whether the response is correct is determined according to the value of the clock class and/or clock identity field in the received packet, so that the correct response time can be obtained. If the tested equipment does not respond or responds to the output response of the testing equipment in error, the testing result is directly output to be abnormal, and the testing is not needed any more, so that invalid error testing is avoided, the testing efficiency is improved, and the effective message response time is obtained.
fifth embodiment
a fifth embodiment of the present invention is, on the basis of the third embodiment, that when the change operation is a field assignment operation, the second time synchronization packet is an Announce packet, and the at least one field is a clock level Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock level Clockclass field in the received packet.
it should be noted that the second time synchronization packet includes two: the last sent second time synchronization packet and the second time synchronization packet currently requiring field value modification are not limited herein, but whether the last sent second time synchronization packet is changed or not is also not limited herein.
in addition, it is also to be exemplified that: according to the IEEE 1588 protocol, when the value of the clock level Clockclass field in the second time synchronization message sent before in the test device is 6, and the value of the clock level Clockclass field in the modified second time synchronization message clock is 7, only changing the value of the clock level Clockclass field in the Announce message from 6 to 7, the device under test still tracks the time source, and the time source is not switched.
An example of a specific T1 in the fifth embodiment of the present invention is as follows.
For example, one: if the value of the clock level Clockclass field in the Announce message is changed from 6 to 7, the test device records that the sending time of the Announce message with the first Clockclass of 7 is T1 (the test device records that the value of the first field changes the original sending time of the PTP message, and records as T1).
example two: recording the sending time of each Announce message, and then extracting the sending time of the Announce message with the first clock level Clockclass of 7 and recording as T1 (equivalently, the test equipment records the sending time of each PTP message, and sends and changes the sending time of the PTP message in advance by the first field value).
for the test device, the embodiment of the present invention preferably records the preset sending time of the time synchronization packet when the first field value changes, and records the preset sending time as the above T1, so that the sending time of each Announce packet does not need to be recorded, thereby reducing the network load.
after the message sent to the device under test is changed, it is necessary to know whether the message has a correct response, so an example of specifically determining whether the message has a correct response in the fifth embodiment of the present invention is as follows.
And if the value of the clock level Clockclass field in the replied Announce Announce message is changed from 6 to 7, judging that the tested equipment correctly responds and changes, otherwise, judging that the tested equipment does not correctly respond and changes.
In the fifth embodiment of the present invention, the correct response time can be obtained by changing the time synchronization packet having at least one field as the clock level Clockclass field and then determining whether the received packet is a correct response by determining the change in the value of the clock level Clockclass field in the subsequent packet. If the tested equipment does not respond or responds to the output response of the testing equipment in error, the testing result is directly output to be abnormal, and the testing is not needed any more, so that invalid error testing is avoided, the testing efficiency is improved, and the effective message response time is obtained.
Sixth embodiment
in a sixth embodiment of the present invention, based on the third embodiment, the test device sends the second time synchronization packet and the third time synchronization packet to the device under test, and the field assignment operation is an operation capable of switching a time source.
The test equipment can send a second time synchronization message and a third time synchronization message to the tested equipment through different interfaces, and the field assignment operation is an operation capable of switching time sources.
in the sixth embodiment of the present invention, when the test device sends the second time synchronization packet and the third time synchronization packet corresponding to different time sources to the device under test, the time sources may be switched in multiple ways, such as:
Assuming that the current time source and the other time source have the same parameters except for the clock level parameter, the clock level of the current time source is A1, and the clock level of the other time source is B1 which is lower than the clock level A1, the clock level A1 of the current time source is reduced to be lower than the clock level B1, and then the time source switching can be realized; or
Assuming that the current time source and the other time source have the same parameters except for the clock priority parameter, and the clock priority of the current time source is a2, and the clock priority of the other time source having a clock priority lower than a2 is B2, the clock priority of the current time source is lowered to a2 lower than the clock priority of B2, and the time source switching can be realized.
in general, switching time sources may be accomplished by modifying parameters used by certain time source selection algorithms, which are not described herein.
In a specific implementation manner, when the method is used in a PTP protocol, the second time synchronization packet is an Announce packet, the at least one field is a clock level Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock level Clockclass field and/or the clock identification ClockIdentity field in the received packet.
in another specific implementation manner, when the method is used in a PTP protocol, the second time synchronization packet and the third time synchronization packet are Announce packets, the at least one field is a clock class Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock class Clockclass field and/or the clock identity field in the received packet.
The following is an example of identifying whether the clock source switching operation is correctly responded to by the clock class Clockclass field.
the test equipment outputs two paths of time synchronization messages to the tested equipment: the values of the clock level fields of the second time synchronization message and the third time synchronization message are different, so that the device to be tested can know which time source to switch to by responding to whether the message carries the value of the clock level Clockclass field of the third time synchronization message or the value of the clock level Clockclass field of the second time synchronization message.
according to the IEEE 1588 protocol, if the parameters other than the clock level parameter are the same, if the value of the clock level Clockclass field in the second time synchronization message sent before in the test device is 6, the value of the clock level Clockclass field in the modified second time synchronization message is 8, and the value of the clock level Clockclass field in the third time synchronization message clock is 7, the time sources tracked by the test device are switched.
An example of T1 specifically obtained in the sixth embodiment of the present invention is as follows.
For example, one: the test equipment changes the value of the clock level Clockclass field in the Announce message from 6 to 8, and records that the sending time of the Announce message with the first clock level Clockclass field of 8 is T1 (the test equipment records that the value of the first field changes the original sending time of the PTP message and records as T1);
Example two: the test equipment can also record the sending time of each Announce message, extract the sending time of the Announce message with the first clock level Clockclass field of 8 and record as T1.
For the test device, the embodiment of the present invention preferably records the preset sending time of the time synchronization packet when the first field value changes, and records the preset sending time as the above T1, so that the sending time of each Announce packet does not need to be recorded, thereby reducing the network load.
after the message sent to the device under test is changed, it is necessary to know whether the message has a correct response, so an example of specifically determining whether the message has a correct response in the sixth embodiment of the present invention is as follows.
For example, if the value of the clock class Clockclass field in the reply announcement message is changed from 6 to 7, it is determined that the device under test correctly responds and changes, and the device enters a time source switching state. Otherwise, judging that the tested equipment does not respond correctly.
For example, if the value of the clock identifier ClockIdentity field in the reply Announce message is changed from the clock identifier ClockIdentity of the second path of time source Announce message to the clock identifier ClockIdentity of the other path of time source Announce message, it is determined that the device under test correctly responds and changes, and enters a time source switching state. Otherwise, judging that the tested equipment does not respond correctly.
In the sixth embodiment of the present invention, whether the device under test correctly responds to the change is determined by determining the change of the value of the clock level Clockclass field in the received message, so as to obtain the correct response time. If the tested equipment does not respond or responds to the output response of the testing equipment in error, the testing result is directly output to be abnormal, and the testing is not needed any more, so that invalid error testing is avoided, the testing efficiency is improved, and the effective message response time is obtained.
seventh embodiment
In a seventh embodiment of the present invention, based on the first embodiment, the second obtaining step specifically includes:
Extracting the arrival time T2 of the response message returned by correctly responding to the change operation from the recorded arrival time of all the messages received from the tested device; or
And obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
It should be noted that, the correct time T2 of arrival of the response packet is extracted from the arrival times of all the packets received from the device under test, or T2 may be calculated by averaging the arrival times T2 of a plurality of response packets, so that the calculated T2 is more accurate.
In addition, after receiving the correct response message, the time T2 of the arrival of the response message is acquired and stored, so that a large storage space is not required to be reserved for storing the arrival time of all the response messages, the space is saved, and the time T2 can be acquired more quickly.
however, in order to obtain the above T2, it needs to be determined first whether the device under test has a correct response to the message change after the message sent to the device under test is changed, so an example of specifically obtaining a correct response time according to the seventh embodiment of the present invention is as follows.
For example, the arrival time of each announced Announce message is recorded, and the arrival time of the PTP message at which the value of the first field changes correctly is extracted and recorded as T2 (if the device to be tested responds correctly to the change of the PTP message output by the testing device, the device enters a hold state, and the testing device records the arrival time of each PTP message).
For example two, after it is determined that the PTP message returned by the device under test correctly responds to the change of the PTP message output by the test device for the first time, the arrival time of the returned message is recorded as T2.
For example, after the clock class or clock identity field of the announced Announce message is found to be correctly changed for the first time, the arrival time of the announced Announce message is recorded.
According to the seventh embodiment of the invention, multiple paths for acquiring T2 are added, so that the accuracy or real-time for acquiring correct response time is improved, and further the user experience effect is improved.
Eighth embodiment
An eighth embodiment of the present invention is based on the first embodiment, and the first transmission delay and the second transmission delay are obtained according to a timestamp recorded in a time synchronization message transmitted between the test device and the device under test.
it should be noted that: the test device and the device to be tested interact with each other according to the PTP message, including the timestamp information in the Sync message, the Delay _ Rep Delay request message, and the Delay _ Resp, and the test device may calculate the Delay times of the first transmission Delay1 and the second transmission Delay2, respectively, as shown in fig. 2, and the specific method of obtaining the transmission Delay by the timestamp information specifically is as follows:
By using PTP message interaction, the test equipment acquires timestamp information of each message, and the one-way transmission delay can be calculated by the following formula:
(1) The master clock sends a Sync synchronous message to the slave clock, and records the sending time t 1; after receiving the message from the clock, the time of receipt t2 is recorded.
(2) The slave clock sends a Delay _ Rep Delay request message to the master clock, which is used for initiating the calculation of reverse transmission Delay and recording the sending time t 3; after receiving the message, the master clock records the receiving time t 4.
(4) After receiving the Delay request message, the master clock replies a Delay response message carrying t4, Delay _ Resp.
At this time, the slave clock has four time stamps from t1 to t4, and the round-trip one-way delay of the master clock and the slave clock can be calculated as
Delay=[(t2-t1)+(t4-t3)]/2
as shown in fig. 2, if a plurality of links between the testing device and the device under test are substantially the same, the first transmission Delay1 of the time synchronization message from the testing device master clock port to the device under test slave clock port is the second transmission Delay Delay2 of the time synchronization message from the device under test slave clock port to the testing device master clock port. After the unidirectional transmission Delay is obtained through message interactive calculation, the sum of the transmission Delay can be obtained by multiplying 2.
In the eighth embodiment of the present invention, the offset and the delay between the slave clock and the master clock can be calculated by using the timestamp information carried in the PTP message, and the response time can be further measured, so that the local clock is adjusted to be synchronized with the master clock, and the synchronization information of the time of the transmitted data packet can be realized by using the timestamp, so that the data can be replied in a correct time sequence, and the accuracy of measuring the response time is also improved.
ninth embodiment
As shown in fig. 3, a device for testing response time of a time synchronization packet according to a ninth embodiment of the present invention is used for testing a device side, where the device for testing response time of a time synchronization packet includes:
The first obtaining module 31 is configured to obtain an occurrence time T1 when the test device performs a change operation that enables the device under test to respond and return a message;
It should be noted that the above change operation refers to changing a certain message that is originally executed by the testing device, for example, changing the type of the certain message, terminating the sending of the certain message, or changing the parameters of the certain message, so that the tested device responds to the change. The above-described changing operation may cover various cases.
Besides the above description of the change operation, the test device and the device under test need to be described, and the test device and the device under test are connected through interfaces such as an ethernet interface, and adopt the ethernet with the most common communication protocol standard, which facilitates the popularization and application of the method of the embodiment of the present invention.
A second obtaining module 32, configured to obtain time T2 when a response packet returned by the device under test correctly responds to the change operation reaches the testing device;
It should be noted that, in the embodiment of the present invention, an IEEE 1588 (Institute of Electrical and Electronics Engineers) protocol may be applied, and specifically, whether the device under test correctly responds to the change operation may be determined according to a correct response manner defined by the IEEE 1588 (Institute of Electrical and Electronics Engineers) protocol for different messages. Therefore, whether the tested equipment correctly responds to the change operation can be judged directly through the stipulation of the protocol, and the timeliness of judging the response is improved.
a third obtaining module 33, configured to obtain a first transmission delay of a first link used for the test device to transmit a packet to the device under test and a second transmission delay of a second link used for the device under test to transmit a packet to the test device;
It should be noted that, because the testing device and the device under test are connected by a plurality of connecting lines, the time synchronization packet from the master clock port of the testing device to the slave clock port of the device under test has a first transmission Delay 1; similarly, the time synchronization packet from the clock port of the device under test to the master clock port of the test device has a second transmission Delay 2; when calculating the response time of the message change operation, only the response time of the device itself needs to be judged, so that the transmission delay needs to be removed, and the accuracy of calculating the response time is improved.
Further, it should be noted that, with respect to the first transmission delay and the second transmission delay: the first transmission delay and the second transmission delay may be obtained by using timestamp information of a message or other auxiliary means such as an auxiliary instrument. After the transmission Delay is obtained by using the auxiliary instrument for testing, the first transmission Delay1 and the second transmission Delay2 can be configured to the testing equipment manually, and the implementation mode is simple and reliable.
However, the manner of obtaining the first transmission delay and the second transmission delay is only an example, and any other manner that can obtain the first transmission delay and the second transmission delay belongs to the protection scope of the embodiments of the present invention, which is not an example herein.
a response time determining module 34, configured to determine the response time as a difference between the time difference between T2 and T1 and the sum of the first transmission delay and the second transmission delay.
the content of the response time determining module 34 according to the embodiment of the present invention is described by a formula, and the specific formula is as follows:
The response time of the tested device is T2-T1-Delay1-Delay2
In the ninth embodiment of the present invention, the result of the response time to the message change operation of the test device is obtained by subtracting the first transmission delay and the second transmission delay from the obtained time difference between T1 and T2, thereby realizing the measurement of the response time. The measured response time can be used for judging the response performance of the equipment, and can also be used as a basis for synchronous network deployment and troubleshooting after problems occur, and the performance of the synchronous network is improved by utilizing a troubleshooting result.
it should be noted that the apparatus provided by the present invention is an apparatus applying the method for testing the response time of the time synchronization packet, and all embodiments of the method for testing the response time of the time synchronization packet are applicable to the apparatus and can achieve the same or similar beneficial effects.
A tenth embodiment of the present invention is a device for testing response time of a time synchronization packet based on the ninth embodiment, wherein the time synchronization packet is a precision time synchronization protocol PTP time synchronization packet.
in the eleventh embodiment of the present invention, in the apparatus for testing response time of a time synchronization packet based on the ninth or tenth embodiment, the changing operation specifically includes:
Stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
Field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
When the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
A twelfth embodiment of the present invention is the apparatus for testing response time of a time synchronization packet based on the eleventh embodiment, wherein when the change operation is a stop operation and the first time synchronization packet is an Announce packet, the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to a value of a clock class Clockclass field and/or a clock identity field in the received packet.
A thirteenth embodiment of the present invention is the apparatus for testing response time of a time synchronization packet based on the eleventh embodiment, wherein when the change operation is a field assignment operation, the second time synchronization packet is an Announce packet, the at least one field is a clock level Clockclass field, and the second obtaining module determines, according to a value of the clock level Clockclass field in the received packet, whether the received packet is a response packet returned in response to the change operation correctly.
A fourteenth embodiment of the present invention is the apparatus for testing response time of a time synchronization packet based on the eleventh embodiment, wherein the test device sends the second time synchronization packet and the third time synchronization packet to the device under test, and the field assignment operation is an operation capable of switching a time source.
And in the second acquisition module, determining whether the received message is a response message returned by correctly responding to the change operation according to the clock level Clockclass field and/or the clock identification ClockIdentity field in the received message.
When the device is used in a PTP protocol, the second time synchronization message and the third time synchronization message are Announce messages, the at least one field is a clock class Clockclass field, and the second obtaining module determines whether the received message is a response message returned by correctly responding to the change operation according to the value of the clock class Clockclass field and/or the clock identity field in the received message.
In the fifteenth embodiment of the present invention, in the apparatus for testing response time of a time synchronization packet based on the ninth embodiment, the second obtaining module specifically includes:
The extraction submodule is used for extracting the arrival time T2 of a response message returned by correctly responding to the change operation from the recorded arrival time of all messages received from the tested device; or
And the obtaining submodule is used for obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
A sixteenth embodiment of the present invention is the apparatus for testing response time of a time synchronization packet based on the ninth embodiment, wherein the first transmission delay and the second transmission delay are obtained according to a timestamp recorded in the time synchronization packet transmitted between the test device and the device under test.
In order to measure the response time, a seventeenth embodiment of the present invention further provides a testing apparatus, including the device for testing the response time of the time synchronization packet as described above.
As shown in fig. 4, the testing device and the device to be tested are connected through interfaces such as an ethernet interface, so as to exchange PTP messages between the testing device and the device to be tested, one interface of the testing device is used as a master clock interface to exchange PTP messages with the device to be tested, and the other interface is used as a slave clock interface to exchange PTP messages with the device to be tested; in addition, it should be further explained about the arrow direction in fig. 4, which refers to the direction in which the master clock interface points to the slave clock interface (instead of the transmission direction of the PTP message), and the PTP message may exchange messages through the connection between ethernet interfaces.
As shown in fig. 5, the testing device and the device to be tested are connected through interfaces such as an ethernet interface, so as to exchange PTP messages between the testing device and the device to be tested, two interfaces of the testing device both serve as a master clock interface to send PTP messages to the device to be tested, and a third interface serves as a slave clock interface to exchange PTP messages with the device to be tested; in addition, it should be further explained about the arrow direction in fig. 5, which refers to the direction in which the master clock interface points to the slave clock interface (instead of the transmission direction of the PTP message), and the PTP message may exchange messages through the connection between ethernet interfaces.
Correspondingly, because the device for testing the response time of the time synchronization message in the embodiment of the invention is applied to the test equipment, the embodiment of the invention also provides the test equipment, wherein the implementation embodiments of the device for testing the response time of the time synchronization message are all applicable to the embodiment of the test equipment, and the same technical effect can be achieved.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (19)

1. A method for testing the response time of a time synchronization message is used for testing a device end, and is characterized in that the method for testing the response time of the time synchronization message comprises the following steps:
A first acquisition step of acquiring occurrence time T1 of the test equipment executing a change operation which enables the tested equipment to respond and return a message;
a second obtaining step of obtaining a time T2 when a response packet returned by the device under test correctly responds to the change operation reaches the test device;
A third obtaining step, obtaining a first transmission delay of a first link used for the test equipment to transmit the message to the tested equipment and a second transmission delay of a second link used for the tested equipment to transmit the message to the test equipment;
A response time determining step of determining the response time as a difference between a time difference between the T2 and the T1 and a sum of the first transmission delay and the second transmission delay.
2. The method of claim 1, wherein the time synchronization packet is a precision time synchronization protocol (PTP) time synchronization packet.
3. The method for testing the response time of the time synchronization packet according to claim 1 or 2, wherein the changing operation specifically is:
Stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
Field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
when the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
4. The method according to claim 3, wherein when the change operation is a stop operation and the first time sync packet is an Announce packet, in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of a clock class Clockclass field and/or a clock identity field in the received packet.
5. The method according to claim 3, wherein when the change operation is a field assignment operation, the second time sync packet is an Announce packet, the at least one field is a clock level Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock level Clockclass field in the received packet.
6. The method according to claim 3, wherein the test device sends the second time sync packet and a third time sync packet to the device under test, and the field assignment operation is an operation capable of switching time sources.
7. The method according to claim 6, wherein the second time sync packet is an Announce packet, the at least one field is a clock class Clockclass field, and in the second obtaining step, it is determined whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock class Clockclass field and/or the clock identity field in the received packet.
8. the method for testing the response time of the time synchronization packet according to claim 1, wherein the second obtaining step specifically comprises:
Extracting the arrival time T2 of the response message returned by correctly responding to the change operation from the recorded arrival time of all the messages received from the tested device; or
And obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
9. The method of claim 1, wherein the first transmission delay and the second transmission delay are obtained from timestamps recorded in time synchronization messages transmitted between the testing device and the device under test.
10. A device for testing the response time of a time synchronization message is used for testing a device end, and is characterized in that the device for testing the response time of the time synchronization message comprises:
The first acquisition module is used for acquiring the occurrence time T1 of the test equipment executing a change operation which can enable the tested equipment to respond and return a message;
A second obtaining module, configured to obtain time T2 when a response packet returned by the device under test correctly responds to the change operation reaches the testing device;
a third obtaining module, configured to obtain a first transmission delay of a first link used for the test device to transmit the packet to the device under test and a second transmission delay of a second link used for the device under test to transmit the packet to the test device;
a response time determining module, configured to determine the response time as a difference between the time difference between T2 and T1 and the sum of the first transmission delay and the second transmission delay.
11. The apparatus for testing response time of a time synchronization message according to claim 10, wherein the time synchronization message is a precision time synchronization protocol, PTP, time synchronization message.
12. The apparatus for testing response time of a time synchronization packet according to claim 10 or 11, wherein the changing operation specifically is:
Stopping operation, namely stopping the behavior of periodically sending a first time synchronization message to the tested device by the testing device; or
field assignment operation, namely modifying the value of at least one field of a second time synchronization message to be sent to the tested device at present, so that the modified value of at least one field is different from the value of the corresponding field in the second time synchronization message sent to the tested device last time;
When the change operation is a stop operation, the T1 is a predetermined sending time of the first time synchronization packet;
When the change operation is a field assignment operation, the T1 is an actual transmission time of the second time synchronization packet that is first transmitted after the field value is modified.
13. The apparatus according to claim 12, wherein when the change operation is a stop operation and the first time sync packet is an Announce packet, the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to a value of a clock class Clockclass field and/or a clock identity field in the received packet.
14. The apparatus according to claim 12, wherein when the change operation is a field assignment operation, the second time sync packet is an Announce packet, the at least one field is a clock level Clockclass field, and the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock level Clockclass field in the received packet.
15. The apparatus according to claim 12, wherein the testing device sends the second time sync packet and a third time sync packet to the device under test, and the field assignment operation is an operation capable of switching a time source.
16. The apparatus according to claim 15, wherein the second time sync packet is an Announce packet, the at least one field is a clock class Clockclass field, and the second obtaining module determines whether the received packet is a response packet returned in response to the change operation correctly according to a value of the clock class Clockclass field and/or the clock identity field in the received packet.
17. The apparatus for testing response time of a time synchronization packet according to claim 10, wherein the second obtaining module is specifically:
The extraction submodule is used for extracting the arrival time T2 of a response message returned by correctly responding to the change operation from the recorded arrival time of all messages received from the tested device; or
And the obtaining submodule is used for obtaining the arrival time T2 of the response message after judging that the received message is the response message returned by correctly responding to the change operation.
18. the apparatus according to claim 10, wherein the first transmission delay and the second transmission delay are obtained according to a timestamp recorded in a time synchronization packet transmitted between the testing device and the device under test.
19. A test apparatus comprising means for testing the response time of a time synchronisation message as claimed in any one of claims 10 to 18.
CN201510670173.9A 2015-09-16 2015-10-13 Method and device for testing response time of time synchronization message and test equipment Active CN106549822B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2015105901668 2015-09-16
CN201510590166 2015-09-16

Publications (2)

Publication Number Publication Date
CN106549822A CN106549822A (en) 2017-03-29
CN106549822B true CN106549822B (en) 2019-12-06

Family

ID=58364625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510670173.9A Active CN106549822B (en) 2015-09-16 2015-10-13 Method and device for testing response time of time synchronization message and test equipment

Country Status (1)

Country Link
CN (1) CN106549822B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661878B (en) * 2019-10-06 2023-08-18 上海淡竹体育科技有限公司 Method and device for synchronously testing instructions and data in sports test system
CN113067654B (en) * 2020-01-02 2022-04-15 中国移动通信有限公司研究院 Method and equipment for testing state of synchronous source selection port
CN112134750B (en) * 2020-09-02 2022-06-03 中国信息通信研究院 Network time protocol pressure test method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478358A (en) * 2008-01-02 2009-07-08 中兴通讯股份有限公司 Method and device for optimized time synchronization correction
CN101977104A (en) * 2010-11-13 2011-02-16 上海交通大学 IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
CN102664726A (en) * 2012-04-26 2012-09-12 华为技术有限公司 Precision time protocol (PTP) clock source switching method, master and slave clock devices and system
EP2770678A1 (en) * 2011-10-17 2014-08-27 ZTE Corporation Clock synchronization method and system in 1588-2008 protocol
CN106330591A (en) * 2015-06-30 2017-01-11 中国移动通信集团公司 OAM test method and device for communication system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478358A (en) * 2008-01-02 2009-07-08 中兴通讯股份有限公司 Method and device for optimized time synchronization correction
CN101977104A (en) * 2010-11-13 2011-02-16 上海交通大学 IEEE1588 based accurate clock synchronization protocol system and synchronization method thereof
EP2770678A1 (en) * 2011-10-17 2014-08-27 ZTE Corporation Clock synchronization method and system in 1588-2008 protocol
CN102664726A (en) * 2012-04-26 2012-09-12 华为技术有限公司 Precision time protocol (PTP) clock source switching method, master and slave clock devices and system
CN106330591A (en) * 2015-06-30 2017-01-11 中国移动通信集团公司 OAM test method and device for communication system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"PTP协议时间同步精度测试";陈良华等;《仪器仪表用户》;20081231;全文 *
"精确时间协议PTP研究";葛宝珊等;《计算机工程与应用》;20121231;全文 *

Also Published As

Publication number Publication date
CN106549822A (en) 2017-03-29

Similar Documents

Publication Publication Date Title
EP2675102B1 (en) Communication system time synchronization method, slave station apparatus, master station apparatus, control apparatus, and program
JP5576747B2 (en) Communication system and time synchronization method
US9876596B2 (en) Method and device for detecting fault in synchronization link
EP2706686B1 (en) Method, terminal and system for measuring asymmetric delay of transmission link
US9270554B2 (en) Communication apparatus and delay detecting method
US9154292B2 (en) Communication apparatus, communication system, and time synchronization method
US8126333B2 (en) Optical transmission system and synchronization method using time reference pulse
CN106451763B (en) A kind of intelligent substation station level bus network system without global synchronization system
CN102638324B (en) Method and device for realizing precise time synchronization
CN105262555B (en) Time synchronization method, programmable logic device, single board and network element
CN102315985B (en) Time synchronization precision test method for intelligent device adopting IEEE1588 protocols
CN102412955B (en) Time deviation acquisition methods when optical fiber is asymmetric between master-slave equipment and communication system
US20030142696A1 (en) Method for ensuring access to a transmission medium
CN107786293B (en) Time synchronization method, master clock device, slave clock device and time synchronization system
WO2017101528A1 (en) Method and device for clock link switching and base station
CN103236893A (en) Network message synchronizing method for process levels of intelligent substation
CN103139002A (en) Detection method and device of 1588 time error between network elements
CN101621713A (en) Method for calculating synchronous time of passive optical network, system and optical network equipment
CN106549822B (en) Method and device for testing response time of time synchronization message and test equipment
CN103138887A (en) Processing method of 1588 event messages and processing method of 1588 event messages
KR20090071923A (en) Method for synchronization using single timesync frame in bridged local area network and appratus thereof
CN112751639B (en) Time synchronization method, communication equipment and system
Mahmood et al. Clock synchronization for IEEE 802.11 based wired-wireless hybrid networks using PTP
CN102917284A (en) Precise clock synchronization method based on PON (Passive Optical Network) system
CN102647782B (en) A kind of physical circuit time delay defining method, clock synchronizing method and equipment thereof

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