[go: up one dir, main page]

CN106301996B - A kind of method and device that PTP message is tested automatically - Google Patents

A kind of method and device that PTP message is tested automatically Download PDF

Info

Publication number
CN106301996B
CN106301996B CN201510363262.9A CN201510363262A CN106301996B CN 106301996 B CN106301996 B CN 106301996B CN 201510363262 A CN201510363262 A CN 201510363262A CN 106301996 B CN106301996 B CN 106301996B
Authority
CN
China
Prior art keywords
message
ptp
field
ptp message
delay
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
CN201510363262.9A
Other languages
Chinese (zh)
Other versions
CN106301996A (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
Priority to CN201510363262.9A priority Critical patent/CN106301996B/en
Publication of CN106301996A publication Critical patent/CN106301996A/en
Application granted granted Critical
Publication of CN106301996B publication Critical patent/CN106301996B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)

Abstract

本发明提供了一种PTP报文自动测试的方法及装置,应用于测试设备,所述方法包括:确定接收到被测试设备发送的PTP报文的报文类型;根据确定的所述报文类型,确定与所述报文类型对应的预先设置的PTP报文的全部或部分字段的标准字段值;将所述接收到的PTP报文中第一字段的字段值与第一字段的标准字段值进行比对;若所述PTP报文中第一字段的字段值与第一字段的标准字段值不一致,则输出所述PTP报文的第一字段不满足要求的第一测试结果。通过预先设置的标准字段值判断PTP报文互通的情况,避免了因现有技术中PTP相关设备在实现PTP功能时各个字段填充数值存在差异,而导致的不同网络系统和设备的互通造成一定困难的问题。

The present invention provides a method and device for automatic testing of PTP messages, which are applied to testing equipment. The method includes: determining a message type of a PTP message sent by a device under test; , determine the standard field value of all or part of the fields of the preset PTP message corresponding to the message type; compare the field value of the first field in the received PTP message with the standard field value of the first field Compare; if the field value of the first field in the PTP packet is inconsistent with the standard field value of the first field, output a first test result that the first field of the PTP packet does not meet the requirements. The pre-set standard field values are used to determine the intercommunication of PTP packets, which avoids certain difficulties caused by the intercommunication of different network systems and devices due to differences in the filling values of various fields when PTP-related devices implement the PTP function in the prior art. The problem.

Description

一种PTP报文自动测试的方法及装置A method and device for automatic testing of PTP messages

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种PTP(Precision Time Protocol,精确时间协议)报文自动测试的方法及装置。The present invention relates to the field of communication technologies, and in particular, to a method and device for automatic testing of PTP (Precision Time Protocol, Precision Time Protocol) messages.

背景技术Background technique

在通信网络中,许多业务的正常运行都要求网络时钟同步,即整个网络各设备之间的时间或频率差保持在合理的误差水平内。例如在移动通信领域的多种网络模式中要求基站空口之间满足时间同步才能正常工作,包括:TD-SCDMA(Time Division-SynchronousCode Division Multiple Access,时分同步码分多址)、TD-LTE(Time Division LongTerm Evolution,分时长期演进)、CDMA2000(Code Division Multiple Access 2000)、LTE-A(LTE Advanced)、MBMS(多媒体广播/组播服务)等。In a communication network, the normal operation of many services requires network clock synchronization, that is, the time or frequency difference between devices in the entire network is kept within a reasonable error level. For example, in various network modes in the field of mobile communication, time synchronization is required between the air interfaces of base stations to work normally, including: TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time division synchronous code division multiple access), TD-LTE (Time Division Division LongTerm Evolution), CDMA2000 (Code Division Multiple Access 2000), LTE-A (LTE Advanced), MBMS (Multimedia Broadcast/Multicast Service), etc.

PTP是一种时间同步的协议,其本身可用于设备之间的高精度时间同步。在一条PTP同步路径中,主时钟提供源时间,供下一级时钟同步,也就是供从时钟参考。从时钟则通过与主时钟互通报文消息,根据主时钟提供的时间校正本地时间。PTP is a time synchronization protocol that itself can be used for high-precision time synchronization between devices. In a PTP synchronization path, the master clock provides the source time for the synchronization of the next-level clock, that is, for the reference of the slave clock. The slave clock corrects the local time according to the time provided by the master clock by exchanging messages with the master clock.

参见图1,为现有技术中PTP报文交互流程图。PTP涉及多种PTP报文,包括:交互时间戳的同步(Sync)报文、延时请求(Delay_Req)报文、延时回应(Delay_Resp)报文和携带时间状态的通知(Announce)报文。PTP报文各个字段在应用时填充的具体数值与实际网络相关,因此在IEEE未作详细定义。Referring to FIG. 1 , it is a flowchart of PTP packet interaction in the prior art. PTP involves a variety of PTP packets, including: a synchronization (Sync) packet with interactive timestamps, a delay request (Delay_Req) packet, a delay response (Delay_Resp) packet, and an Announce packet carrying a time status. The specific value filled in each field of the PTP packet during application is related to the actual network, so it is not defined in detail in IEEE.

由于PTP相关设备在实现PTP功能时各个字段填充数值存在差异,为不同网络系统和设备的互通造成一定困难。为了更好的实现设备互通,有必要提出能够准确有效的判断PTP报文的互通情况的方案。When the PTP-related equipment implements the PTP function, there are differences in the filling values of each field, which causes certain difficulties for the intercommunication of different network systems and equipment. In order to better realize device interworking, it is necessary to propose a solution that can accurately and effectively judge the interworking situation of PTP packets.

发明内容SUMMARY OF THE INVENTION

鉴于上述问题,提出了本发明以便提供一种PTP报文自动测试的方法及装置,可以通过预先设置的标准字段值判断PTP报文互通的情况,避免了因现有技术中PTP相关设备在实现PTP功能时各个字段填充数值存在差异,而导致的不同网络系统和设备的互通造成一定困难的问题。In view of the above problems, the present invention is proposed in order to provide a method and device for automatic testing of PTP messages, which can judge the intercommunication situation of PTP messages by pre-setting standard field values, avoiding the need for PTP-related equipment in the prior art. In the PTP function, there are differences in the filled values of each field, which leads to certain difficulties in the intercommunication of different network systems and devices.

依据本发明的一个方面,提供了一种PTP报文自动测试的方法,应用于测试设备,所述方法包括:确定接收到被测试设备发送的PTP报文的报文类型;根据确定的所述报文类型,确定与所述报文类型对应的预先设置的PTP报文的全部或部分字段的标准字段值;将所述接收到的PTP报文中第一字段的字段值与第一字段的标准字段值进行比对;若所述PTP报文中第一字段的字段值与第一字段的标准字段值不一致,则输出所述PTP报文的第一字段不满足要求的第一测试结果。According to an aspect of the present invention, a method for automatic testing of PTP packets is provided, which is applied to a testing device, the method comprising: determining a packet type of a PTP packet sent by a device under test; Packet type, determine the standard field value of all or part of the fields of the preset PTP packet corresponding to the packet type; compare the field value of the first field in the received PTP packet with the value of the first field Standard field values are compared; if the field value of the first field in the PTP packet is inconsistent with the standard field value of the first field, output a first test result that the first field of the PTP packet does not meet the requirements.

可选地,所述方法还包括:记录接收到的每个PTP报文的时间,并根据接收到的每个PTP报文的时间,计算各种报文类型的PTP报文的第一发送频率;从接收到的PTP报文中提取logMessageInterval字段的字段值,得到接收到的PTP报文的第二发送频率;将与所述接收到的PTP报文的报文类型对应的PTP报文的第一发送频率,与所述接收到的PTP报文的第二发送频率进行比对;若不一致,则返回所述接收到的PTP报文的发送频率有问题的第二测试结果。Optionally, the method further includes: recording the time of each received PTP message, and calculating the first sending frequency of PTP messages of various message types according to the time of each received PTP message ; Extract the field value of the logMessageInterval field from the received PTP message, obtain the second transmission frequency of the received PTP message; Will be the first of the PTP message corresponding to the message type of the received PTP message The first sending frequency is compared with the second sending frequency of the received PTP message; if it is inconsistent, the second test result that the sending frequency of the received PTP message has a problem is returned.

可选地,所述方法还包括:记录发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率;将发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率,与被测试设备发送的Delay_Req报文的实际发送频率以及被测试设备发送的Delay_Req报文的logMessageInterval字段的字段值进行比对;若不一致,则返回Delay_Resp报文发送频率有问题的第三测试结果。Optionally, the method further includes: recording the field value of the logMessageInterval field carried in the Delay_Resp message sent and the sending frequency of the Delay_Resp message; recording the field value of the logMessageInterval field carried in the Delay_Resp message to send and the Delay_Resp The sending frequency of the message is compared with the actual sending frequency of the Delay_Req message sent by the device under test and the field value of the logMessageInterval field of the Delay_Req message sent by the device under test. the third test result.

可选地,所述方法还包括:根据预先设置存储的各种报文类型的PTP报文的发送频率的数值范围,调整发出的PTP报文的发送频率;若在预定时间内没有收到被测试设备回复的所述发出的PTP报文的响应报文,则返回所述被测试设备支持PTP报文的发送频率有问题的第四测试结果。Optionally, the method further includes: adjusting the sending frequency of the sent PTP message according to the preset numerical range of the sending frequency of the PTP messages of various message types stored; The response message of the sent PTP message returned by the test device returns the fourth test result that the device under test supports the sending frequency of the PTP message.

可选地,所述方法还包括:记录收到的PTP报文的时间戳信息;若所述时间戳信息为负值,或者时间戳信息小于所述收到的PTP报文的前一个报文的时间戳信息,则返回所收到的述PTP报文的时间戳信息错误的第五测试结果。Optionally, the method further includes: recording the timestamp information of the received PTP message; if the timestamp information is a negative value, or the timestamp information is smaller than the previous message of the received PTP message If the timestamp information of the received PTP packet is incorrect, the fifth test result is returned.

可选地,在确定接收到被测试设备发送的PTP报文的报文类型之前,所述方法还包括:根据以太网报文封装中以太网类型字段的数值,从被测试设备发送的报文中识别得到PTP报文。Optionally, before determining the packet type of the PTP packet sent by the device under test, the method further includes: according to the value of the Ethernet type field in the Ethernet packet encapsulation, from the packet sent by the device under test. The PTP message is obtained by identifying it.

依据本发明的另一个方面,还提供了一种PTP报文自动测试的装置,应用于测试设备,所述装置包括:类型确定模块,用于确定接收到被测试设备发送的PTP报文的报文类型;匹配模块,用于根据确定的所述报文类型,确定与所述报文类型对应的预先设置的PTP报文的全部或部分字段的标准字段值;第一比对模块,用于将所述接收到的PTP报文中第一字段的字段值与第一字段的标准字段值进行比对;第一输出模块,用于若所述PTP报文中第一字段的字段值与第一字段的标准字段值不一致,则输出所述PTP报文的第一字段不满足要求的第一测试结果。According to another aspect of the present invention, an apparatus for automatic testing of PTP messages is also provided, which is applied to test equipment, and the apparatus includes: a type determination module for determining a PTP message received by the device under test. a message type; a matching module, configured to determine, according to the determined message type, standard field values of all or part of the fields of the preset PTP message corresponding to the message type; a first comparison module, used for Compare the field value of the first field in the received PTP message with the standard field value of the first field; the first output module is used for if the field value of the first field in the PTP message is the same as the first field value in the PTP message. If the standard field value of a field is inconsistent, output the first test result that the first field of the PTP packet does not meet the requirements.

可选地,所述装置还包括:第一记录模块,用于记录接收到的每个PTP报文的时间,并根据接收到的每个PTP报文的时间,计算各种报文类型的PTP报文的第一发送频率;频率确定模块,用于从接收到的PTP报文中提取logMessageInterval字段的字段值,得到接收到的PTP报文的第二发送频率;第二比对模块,用于将与所述接收到的PTP报文的报文类型对应的PTP报文的第一发送频率,与所述接收到的PTP报文的第二发送频率进行比对;第二输出模块,用于若不一致,则返回所述接收到的PTP报文的发送频率有问题的第二测试结果。Optionally, the device further includes: a first recording module, configured to record the time of each received PTP message, and calculate the PTP of various message types according to the time of each received PTP message The first sending frequency of the message; the frequency determining module is used to extract the field value of the logMessageInterval field from the received PTP message to obtain the second sending frequency of the received PTP message; the second comparison module is used for Compare the first sending frequency of the PTP message corresponding to the message type of the received PTP message with the second sending frequency of the received PTP message; the second output module is used for If they are inconsistent, return the second test result that the sending frequency of the received PTP message is problematic.

可选地,所述装置还包括:第二记录模块,用于记录发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率;第三比对模块,用于将发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率,与被测试设备发送的Delay_Req报文的实际发送频率以及被测试设备发送的Delay_Req报文的logMessageInterval字段的字段值进行比对;第三输出模块,用于若不一致,则返回Delay_Resp报文发送频率有问题的第三测试结果。Optionally, the device further includes: a second recording module, used to record the field value of the logMessageInterval field carried in the Delay_Resp message sent and the sending frequency of the Delay_Resp message; a third comparison module, used to send the The field value of the logMessageInterval field carried by the Delay_Resp message and the sending frequency of the Delay_Resp message are compared with the actual sending frequency of the Delay_Req message sent by the device under test and the field value of the logMessageInterval field of the Delay_Req message sent by the device under test. Comparison; the third output module is used to return the third test result with a problem in the sending frequency of the Delay_Resp message if it is inconsistent.

可选地,所述装置还包括:调整模块,用于根据预先设置存储的各种报文类型的PTP报文的发送频率的数值范围,调整发出的PTP报文的发送频率;第四输出模块,用于若在预定时间内没有收到被测试设备回复的所述发出的PTP报文的响应报文,则返回所述被测试设备支持PTP报文的发送频率有问题的第四测试结果。Optionally, the device further includes: an adjustment module configured to adjust the transmission frequency of the sent PTP message according to the preset numerical range of the transmission frequency of the PTP messages of various message types stored; the fourth output module is used to return the fourth test result that the device under test supports the sending frequency of PTP messages if the response message of the sent PTP message is not received within a predetermined time.

可选地,所述装置还包括:第三记录模块,用于记录收到的PTP报文的时间戳信息;第五输出模块,用于若所述时间戳信息为负值,或者时间戳信息小于所述收到的PTP报文的前一个报文的时间戳信息,则返回所述收到的PTP报文的时间戳信息错误的第五测试结果。Optionally, the device further includes: a third recording module for recording the timestamp information of the received PTP message; a fifth output module for recording the timestamp information if the timestamp information is a negative value or the timestamp information If it is less than the timestamp information of the previous packet of the received PTP packet, the fifth test result that the timestamp information of the received PTP packet is incorrect is returned.

本发明的有益效果是:测试设备可以存储识别到的PTP报文,并预先设置存储每类PTP报文全部或者部分字段的标准字段值(相当于标准数值或者数值范围),与检测到PTP报文进行自动比对,如果检测到的PTP报文的某字段不满足测试设备中的标准字段值,则自动返回该PTP报文的字段不满足要求的第一测试结果,从而可以通过预先设置的标准字段值判断PTP报文互通的情况,避免了因现有技术中PTP相关设备在实现PTP功能时各个字段填充数值存在差异,而导致的不同网络系统和设备的互通造成一定困难的问题。并且还能够自动判断PTP报文发包速率、时间戳等关键数值是否存在问题。The beneficial effects of the present invention are as follows: the testing equipment can store the identified PTP messages, and pre-set standard field values (equivalent to standard values or value ranges) for storing all or part of the fields of each type of PTP message, and the detection of the PTP messages If a field of the detected PTP packet does not meet the standard field value in the test equipment, the first test result that the field of the PTP packet does not meet the requirements will be automatically returned, so that the preset test result can be passed. The standard field value judges the intercommunication of PTP messages, avoiding the problem of certain difficulties in intercommunication of different network systems and devices caused by differences in the filling values of various fields when PTP related devices implement the PTP function in the prior art. And it can also automatically determine whether there is a problem with key values such as PTP packet sending rate and time stamp.

附图说明Description of drawings

图1表示现有技术中PTP报文交互流程图;Fig. 1 shows the PTP message interaction flow chart in the prior art;

图2表示本发明的第一实施例中的PTP报文自动测试的方法的流程图;Fig. 2 shows the flow chart of the method for automatic testing of PTP message in the first embodiment of the present invention;

图3表示本发明的第一实施例中的测试环境的示意图之一;FIG. 3 shows one of the schematic diagrams of the test environment in the first embodiment of the present invention;

图4表示本发明的第一实施例中的测试环境的示意图之二;FIG. 4 shows the second schematic diagram of the test environment in the first embodiment of the present invention;

图5表示本发明的第二实施例中的PTP报文自动测试的方法的流程图;Fig. 5 shows the flow chart of the method for automatic testing of PTP message in the second embodiment of the present invention;

图6表示本发明的第三实施例中的PTP报文自动测试的方法的流程图;Fig. 6 shows the flow chart of the method for automatic testing of PTP message in the third embodiment of the present invention;

图7表示本发明的第四实施例中的PTP报文自动测试的方法的流程图;Fig. 7 shows the flow chart of the method for automatic testing of PTP message in the fourth embodiment of the present invention;

图8表示本发明的第五实施例中的PTP报文自动测试的方法的流程图;Fig. 8 shows the flow chart of the method for automatic testing of PTP message in the fifth embodiment of the present invention;

图9表示本发明的第六实施例中的PTP报文自动测试的装置的示意图。FIG. 9 is a schematic diagram of an apparatus for automatic testing of PTP packets in the sixth embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.

参见图2,为本发明的第一实施例中的PTP报文自动测试的方法的流程图,该方法的执行主体可以是测试设备,该方法包括如下步骤:Referring to FIG. 2, it is a flowchart of a method for automatic testing of PTP messages in the first embodiment of the present invention. The execution subject of the method may be a testing device, and the method includes the following steps:

步骤S201、确定接收到被测试设备发送的PTP报文的报文类型,然后进入步骤S203。Step S201: Determine the packet type of the received PTP packet sent by the device under test, and then proceed to step S203.

需要说明的是,该测试设备可以直接与被测试设备通过以太网接口等接口连接,被测试设备和测试设备之间交互PTP报文,或者测试设备提取两个被测试设备之间交互的PTP报文。It should be noted that the test device can be directly connected to the device under test through an interface such as an Ethernet interface, and the device under test and the device under test exchange PTP packets, or the test device extracts the PTP packets exchanged between the two devices under test. arts.

在本实施例中可以根据PTP报文中的字段值确定该PTP报文的报文类型。具体如下:测试设备在已检测到的PTP报文中,根据净荷中messageType字段匹配识别不同的PTP报文的报文类型,例如messageType字段为0x00,PTP报文的报文类型为Sync报文;messageType字段为0x01,PTP报文的报文类型为Delay_Req报文;messageType字段为0x09,PTP报文的报文类型为Delay_Resp报文;messageType字段为0x0B,PTP报文的报文类型为Announce报文。In this embodiment, the packet type of the PTP packet may be determined according to the field value in the PTP packet. The details are as follows: In the detected PTP packets, the test device identifies the packet types of different PTP packets according to the messageType field in the payload. For example, the messageType field is 0x00, and the packet type of the PTP packet is Sync packet. ;The messageType field is 0x01, the message type of the PTP message is Delay_Req message; the messageType field is 0x09, the message type of the PTP message is Delay_Resp message; The messageType field is 0x0B, the message type of the PTP message is Announce message arts.

需要说明的是,在本实施例中,可以根据以太网报文封装中以太网类型字段(Ethertype)的数值,从被测试设备发送的报文中识别得到PTP报文,例如以太网类型字段的数值为0x88F7。It should be noted that, in this embodiment, the PTP packet can be identified from the packet sent by the device under test according to the value of the Ethernet type field (Ethertype) in the Ethernet packet encapsulation, such as the value of the Ethernet type field. The value is 0x88F7.

步骤S203、根据确定的报文类型,确定与报文类型对应的预先设置的PTP报文的全部或部分字段的标准字段值,然后进入步骤S205。Step S203 , according to the determined message type, determine standard field values of all or part of the fields of the preset PTP message corresponding to the message type, and then proceed to step S205 .

需要说明的,在本实施例中可以预先存储多套PTP报文的全部或部分字段的标准字段值,在测试时支持选取其中任意一套PTP报文的全部或部分字段的标准字段值进行测试。It should be noted that in this embodiment, the standard field values of all or part of the fields of multiple sets of PTP packets may be pre-stored, and the standard field values of all or part of the fields of any set of PTP packets can be selected for testing during testing. .

步骤S205、将接收到的PTP报文中第一字段的字段值与第一字段的标准字段值进行比对,然后进入步骤S207。Step S205: Compare the field value of the first field in the received PTP message with the standard field value of the first field, and then proceed to step S207.

步骤S207、若PTP报文中第一字段的字段值与第一字段的标准字段值不一致,则输出PTP报文的第一字段不满足要求的第一测试结果。Step S207: If the field value of the first field in the PTP packet is inconsistent with the standard field value of the first field, output a first test result that the first field of the PTP packet does not meet the requirements.

在步骤S201~步骤S207中,测试设备可以存储识别到的PTP报文,并预先设置存储每类PTP报文全部或者部分字段的标准字段值(相当于标准数值或者数值范围),与检测到PTP报文进行自动比对,如果检测到的PTP报文的某字段不满足测试设备中的标准字段值,则自动返回该PTP报文的字段不满足要求的第一测试结果,从而可以通过预先设置的标准字段值判断PTP报文互通的情况,避免了因现有技术中PTP相关设备在实现PTP功能时各个字段填充数值存在差异,而导致的不同网络系统和设备的互通造成一定困难的问题。In steps S201 to S207, the testing device can store the identified PTP messages, and preset standard field values (equivalent to standard values or value ranges) for all or part of the fields of each type of PTP message, and the detected PTP messages The packets are automatically compared. If a field of the detected PTP packet does not meet the standard field value in the test device, the first test result that the field of the PTP packet does not meet the requirements will be automatically returned. The standard field value is used to judge the intercommunication of PTP messages, which avoids the problem of certain difficulties caused by the intercommunication of different network systems and devices due to differences in the filling values of various fields when PTP related devices implement the PTP function in the prior art.

需要说明的是,在本实施例中PTP报文可以是:Announce报文、Sync报文、Delay_Req报文、Delay_Resp报文。It should be noted that, in this embodiment, the PTP message may be: an Announce message, a Sync message, a Delay_Req message, and a Delay_Resp message.

其中,Announce报文检测字段包括以下字段的一部分或者全部:transportSpecific(传送协议类型)字段、versionPTP(PTP版本)字段、messageLength(消息长度)字段、domainNumber(时间域数值)字段、alternateMasterFlag(备用主标示)字段、unicastFlag(单播标示)字段、PTP profile Specific 1(PTP配置文件特性1)字段、PTPprofile Specific 2(PTP配置文件特性2)字段、leap61(是否时间秒值加一情形,即闰秒正值)字段、leap59(是否时间秒值减一情形,即闰秒负值)字段、currentUtcOffsetValid(当前闰秒值是否有效)字段、ptpTimescale(PTP时间标尺)、timeTraceable(时间可跟踪性)字段、frequencyTraceable(频率可跟踪性)字段、sourcePortIdentity(源端口号)字段、sequenceId(序列号)Field、controlField(控制字段)、logMessageInterval(报文时间间隔)字段、originTimestamp(原始时间戳)字段、currentUtcOffset(当前闰秒值,最优时钟的UTC时间相对于TAI时间的累计偏移量)字段、grandmasterPriority1(主设备时钟优先级一的值)字段、grandmasterClockQuality(主设备时钟质量特性)字段、grandmasterPriority2(主设备时钟优先级二的值)字段、grandmasterIdentity(主设备号)字段、stepsRemoved(最优时钟到本时钟节点的跳数)、timeSource(时间源属性)字段。The Announce message detection field includes part or all of the following fields: transportSpecific (transport protocol type) field, versionPTP (PTP version) field, messageLength (message length) field, domainNumber (time domain value) field, alternateMasterFlag (alternate master flag) ) field, unicastFlag (unicast flag) field, PTP profile Specific 1 (PTP profile feature 1) field, PTP profile Specific 2 (PTP profile feature 2) field, leap61 (whether the time second value is added by one, that is, the leap second is positive value) field, leap59 (whether the time second value is minus one, that is, a negative leap second value) field, currentUtcOffsetValid (whether the current leap second value is valid) field, ptpTimescale (PTP time scale), timeTraceable (time traceability) field, frequencyTraceable (frequency traceability) field, sourcePortIdentity (source port number) field, sequenceId (sequence number) Field, controlField (control field), logMessageInterval (message interval) field, originTimestamp (original timestamp) field, currentUtcOffset (current leap) Second value, the cumulative offset of the UTC time of the optimal clock relative to the TAI time) field, grandmasterPriority1 (the value of the master device clock priority one) field, grandmasterClockQuality (master device clock quality characteristics) field, grandmasterPriority2 (the master device clock priority) field Level 2) field, grandmasterIdentity (master device number) field, stepsRemoved (hops from the optimal clock to this clock node), and timeSource (time source attribute) field.

Sync报文检测字段包括以下字段的一部分或者全部:transportSpecific字段、versionPTP字段、messageLength字段、domainNumber字段、alternateMasterFlag字段、twoStepFlag(双步模式标示)字段、unicastFlag字段、PTP profile Specific1字段、PTPprofile Specific 2字段、sourcePortIdentity字段、sequenceId字段、controlField字段、logMessageInterval字段、originTimestamp字段。The Sync message detection field includes some or all of the following fields: transportSpecific field, versionPTP field, messageLength field, domainNumber field, alternateMasterFlag field, twoStepFlag (two-step mode flag) field, unicastFlag field, PTP profile Specific1 field, PTPprofile Specific 2 field, sourcePortIdentity field, sequenceId field, controlField field, logMessageInterval field, originTimestamp field.

Delay_Req报文检测字段包括以下字段的一部分或者全部:transportSpecific字段、versionPTP字段、messageLength字段、domainNumber字段、sourcePortIdentity字段、sequenceId(序列号)、controlField字段、logMessageInterval字段、originTimestamp字段。The Delay_Req message detection field includes part or all of the following fields: transportSpecific field, versionPTP field, messageLength field, domainNumber field, sourcePortIdentity field, sequenceId (sequence number), controlField field, logMessageInterval field, and originTimestamp field.

Delay_Resp报文检测字段包括以下字段的一部分或者全部:transportSpecific字段、versionPTP字段、messageLength字段、domainNumber字段、alternateMasterFlag字段、sourcePortIdentity字段、sequenceId字段、controlField字段、logMessageInterval字段、receiveTimestamp(接收时间戳)字段、requestingPortIdentity(接收端口标示)字段。The Delay_Resp message detection field includes some or all of the following fields: transportSpecific field, versionPTP field, messageLength field, domainNumber field, alternateMasterFlag field, sourcePortIdentity field, sequenceId field, controlField field, logMessageInterval field, receiveTimestamp (receive timestamp) field, requestingPortIdentity ( Receive port designation) field.

参见图3,为本发明的第一实施例中的测试环境的示意图之一。在第一种拓扑环境中,测试设备直接和被测试设备通过以太网接口等接口连接,被测试设备和测试设备之间交互PTP报文,根据测试的PTP报文的报文类型,确定由被测试设备作为主时钟,还是由测试设备系统作为主时钟。Referring to FIG. 3 , it is one of the schematic diagrams of the test environment in the first embodiment of the present invention. In the first topology environment, the test device is directly connected to the device under test through an interface such as an Ethernet interface, and PTP packets are exchanged between the device under test and the test device. The test equipment is used as the master clock, or the test equipment system is used as the master clock.

如果测试被测试设备的Announce/Sync/Delay_Resp报文,则由被测试设备作为主时钟,测试设备作为从时钟。被测试设备发出Announce/Sync/Delay_Resp报文,测试设备回应Delay_Req报文。If the Announce/Sync/Delay_Resp message of the device under test is tested, the device under test is used as the master clock, and the test device is used as the slave clock. The device under test sends an Announce/Sync/Delay_Resp message, and the test device responds with a Delay_Req message.

如果测试被测试设备的Delay_Req报文,则由测试设备作为主时钟,被测试设备作为从时钟。测试设备发出Announce/Sync/Delay_Resp报文,测试设备回应Delay_Req报文。If the Delay_Req message of the device under test is tested, the device under test is used as the master clock, and the device under test is used as the slave clock. The test device sends an Announce/Sync/Delay_Resp message, and the test device responds with a Delay_Req message.

参见图4,为本发明的第一实施例中的测试环境的示意图之二,在第二种拓扑环境中,被测试设备A和被测试设备B之间交互PTP报文,测试设备提取两者之间交互的PTP报文。Referring to FIG. 4, it is the second schematic diagram of the test environment in the first embodiment of the present invention. In the second topology environment, PTP messages are exchanged between the device under test A and the device under test B, and the test device extracts both PTP packets exchanged between them.

下面结合第二实施例、第三实施例和第四实施例描述测试设备对PTP报文发送频率的测试。The following describes the testing of the sending frequency of the PTP message by the testing device with reference to the second embodiment, the third embodiment and the fourth embodiment.

第二实施例Second Embodiment

参见图5,为本发明的第二实施例中PTP报文自动测试的方法流程图,在图2所示的第一实施例中的方法的基础上,在第二实施例中该方法还包括:Referring to FIG. 5 , it is a flowchart of a method for automatic testing of PTP packets in the second embodiment of the present invention. On the basis of the method in the first embodiment shown in FIG. 2 , in the second embodiment, the method further includes: :

步骤S501、记录接收到的每个PTP报文的时间,并根据接收到的每个PTP报文的时间,计算各种报文类型的PTP报文的第一发送频率,然后进入步骤S503。Step S501: Record the time of each received PTP message, and calculate the first sending frequency of PTP messages of various message types according to the time of each received PTP message, and then proceed to step S503.

步骤S503、从接收到的PTP报文中提取logMessageInterval字段的字段值,得到接收到的PTP报文的第二发送频率,然后进入步骤S505。Step S503, extract the field value of the logMessageInterval field from the received PTP message, obtain the second sending frequency of the received PTP message, and then proceed to step S505.

步骤S505、将与接收到的PTP报文的报文类型对应的PTP报文的第一发送频率,与接收到的PTP报文的第二发送频率进行比对,若不一致,则进入步骤S507。Step S505: Compare the first sending frequency of the PTP message corresponding to the message type of the received PTP message with the second sending frequency of the received PTP message, and if they are inconsistent, go to step S507.

在步骤S505中可以根据接收到的PTP报文的报文类型,得到与该接收到的PTP报文的报文类型对应的PTP报文的第一发送频率。In step S505, the first sending frequency of the PTP message corresponding to the message type of the received PTP message may be obtained according to the message type of the received PTP message.

步骤S507、返回接收到的PTP报文的发送频率有问题的第二测试结果。Step S507, returning the second test result that the received PTP message sending frequency has a problem.

在本实施例中,通过步骤S501~S507可以实现对测试设备的PTP报文的发送频率进行检测,促进同步网络互通和应用。In this embodiment, through steps S501 to S507, it is possible to detect the sending frequency of the PTP message of the test device, and to promote the interworking and application of the synchronous network.

第三实施例Third Embodiment

参见图6,为本发明的第三实施例中PTP报文自动测试的方法流程图,在图2所示的第一实施例中的方法的基础上,在第三实施例中该方法还包括:Referring to FIG. 6 , it is a flowchart of a method for automatic testing of PTP packets in a third embodiment of the present invention. On the basis of the method in the first embodiment shown in FIG. 2 , in the third embodiment, the method further includes: :

步骤S601、记录发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率,然后进入步骤S603。Step S601, record the field value of the logMessageInterval field carried in the sent Delay_Resp message and the sending frequency of the Delay_Resp message, and then proceed to step S603.

具体地,在如图3所示的测试环境中,测试设备和被测试设备直接交互PTP报文时,当测试设备作为主时钟时,测试设备记录发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率。Specifically, in the test environment shown in Figure 3, when the test device and the device under test directly exchange PTP messages, when the test device acts as the master clock, the test device records the field value of the logMessageInterval field carried in the Delay_Resp message sent and the sending frequency of the Delay_Resp message.

步骤S603、将发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率,与被测试设备发送的Delay_Req报文的实际发送频率以及被测试设备发送的Delay_Req报文的logMessageInterval字段的字段值进行比对,若不一致,则进入步骤S605。Step S603, the field value of the logMessageInterval field carried by the Delay_Resp message sent and the sending frequency of the Delay_Resp message, and the actual sending frequency of the Delay_Req message sent by the device under test and the logMessageInterval of the Delay_Req message sent by the device under test The field values of the fields are compared, and if they are inconsistent, go to step S605.

需要说明的是,被测试设备发送的Delay_Req报文的实际发送频率可以根据记录收到PTP报文的时间确定得到。It should be noted that the actual sending frequency of the Delay_Req message sent by the device under test can be determined by recording the time when the PTP message is received.

步骤S605、返回Delay_Resp报文发送频率有问题的第三测试结果。Step S605 , returning the third test result that the delay_Resp packet sending frequency is problematic.

在本实施例中,通过步骤S601~S605可以实现对测试设备的Delay_Resp报文的发送频率进行检测,促进同步网络互通和应用。In this embodiment, through steps S601 to S605, the detection of the sending frequency of the Delay_Resp message of the test device can be implemented, and the synchronization network interworking and application can be promoted.

第四实施例Fourth Embodiment

参见图7,为本发明的第四实施例中PTP报文自动测试的方法流程图。在图2所示的第一实施例中的方法的基础上,第四实施例中该方法还包括:Referring to FIG. 7 , it is a flowchart of a method for automatic testing of PTP packets in the fourth embodiment of the present invention. On the basis of the method in the first embodiment shown in FIG. 2 , the method in the fourth embodiment further includes:

步骤S701、根据预先设置存储的各种报文类型的PTP报文的发送频率的数值范围,调整发出的PTP报文的发送频率,然后进入步骤S703。Step S701: Adjust the sending frequency of the sent PTP message according to the preset and stored numerical ranges of the sending frequency of the PTP message of various message types, and then proceed to step S703.

步骤S703、若在预定时间内没有收到被测试设备回复的所述发出的PTP报文的响应报文,则返回被测试设备支持PTP报文的发送频率有问题的第四测试结果。Step S703: If the response message of the sent PTP message replied by the device under test is not received within a predetermined time, return a fourth test result that the device under test supports the sending frequency of the PTP message.

在本实施例中,通过步骤S701~S703可以实现对测试设备的PTP报文的发送频率进行检测,促进同步网络互通和应用。In this embodiment, through steps S701 to S703, the detection of the sending frequency of the PTP message of the test device can be implemented, and the communication and application of the synchronous network can be promoted.

第五实施例Fifth Embodiment

参见图8,为本发明的第四实施例中PTP报文自动测试的方法流程图,在图2所示的第一实施例中的方法的基础上,在第四实施例中该方法还包括:Referring to FIG. 8 , it is a flowchart of a method for automatic testing of PTP packets in the fourth embodiment of the present invention. On the basis of the method in the first embodiment shown in FIG. 2 , in the fourth embodiment, the method further includes: :

步骤S801、记录收到的PTP报文的时间戳信息,然后进入步骤S803。Step S801, record the timestamp information of the received PTP message, and then proceed to step S803.

步骤S803、若所述时间戳信息为负值,或者时间戳信息小于所述收到的PTP报文的前一个报文的时间戳信息,则返回所述收到的PTP报文的时间戳信息错误的第五测试结果。Step S803, if the timestamp information is a negative value, or the timestamp information is less than the timestamp information of the previous packet of the received PTP packet, return the timestamp information of the received PTP packet Incorrect fifth test result.

需要说明的是,术语“第一”、“第二”、“第三”、“第四”和“第五”仅用于描述目的,而不能理解为指示或暗示相对重要性或隐含指明所指示的技术特征的数量。It should be noted that the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implying that Number of technical features indicated.

在本实施例中,通过步骤S801~S805可以实现对测试设备的PTP报文的时间戳进行检测,促进同步网络互通和应用。In this embodiment, through steps S801 to S805, the time stamp of the PTP message of the test device can be detected, so as to promote synchronous network interworking and application.

第六实施例Sixth Embodiment

参见图9,为本发明的第六实施例中的PTP报文自动测试的装置的结构图,该装置应用于测试设备,所述装置900包括:类型确定模块901,用于确定接收到被测试设备发送的PTP报文的报文类型;匹配模块903,用于根据确定的所述报文类型,确定与所述报文类型对应的预先设置的PTP报文的全部或部分字段的标准字段值;第一比对模块905,用于将所述接收到的PTP报文中第一字段的字段值与第一字段的标准字段值进行比对;第一输出模块907,用于若所述PTP报文中第一字段的字段值与第一字段的标准字段值不一致,则输出所述PTP报文的第一字段不满足要求的第一测试结果。Referring to FIG. 9 , it is a structural diagram of an apparatus for automatic testing of PTP messages in the sixth embodiment of the present invention. The apparatus is applied to testing equipment. The apparatus 900 includes: a type determination module 901 for The packet type of the PTP packet sent by the device; the matching module 903 is configured to, according to the determined packet type, determine the standard field value of all or part of the fields of the preset PTP packet corresponding to the packet type The first comparison module 905 is used for comparing the field value of the first field in the received PTP message with the standard field value of the first field; the first output module 907 is used for if the PTP If the field value of the first field in the packet is inconsistent with the standard field value of the first field, the first test result that the first field of the PTP packet does not meet the requirements is output.

可选地,在另一个实施例中,所述装置还包括:第一记录模块,用于记录接收到的每个PTP报文的时间,并根据接收到的每个PTP报文的时间,计算各种报文类型的PTP报文的第一发送频率;频率确定模块,用于从接收到的PTP报文中提取logMessageInterval字段的字段值,得到接收到的PTP报文的第二发送频率;第二比对模块,用于将与所述接收到的PTP报文的报文类型对应的PTP报文的第一发送频率,与所述接收到的PTP报文的第二发送频率进行比对;第二输出模块,用于若不一致,则返回所述接收到的PTP报文的发送频率有问题的第二测试结果。Optionally, in another embodiment, the apparatus further includes: a first recording module, configured to record the time of each received PTP message, and calculate the time of each received PTP message according to the time of each received PTP message. The first sending frequency of PTP messages of various message types; the frequency determination module is used to extract the field value of the logMessageInterval field from the received PTP message, and obtain the second sending frequency of the received PTP message; Two comparison modules, configured to compare the first sending frequency of the PTP message corresponding to the message type of the received PTP message with the second sending frequency of the received PTP message; The second output module is configured to, if inconsistent, return the second test result in which the received PTP message has a problem with the sending frequency.

可选地,在另一个实施例中,所述装置还包括:第二记录模块,用于记录发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率;第三比对模块,用于将发送的Delay_Resp报文携带的logMessageInterval字段的字段值以及所述Delay_Resp报文的发送频率,与被测试设备发送的Delay_Req报文的实际发送频率以及被测试设备发送的Delay_Req报文的logMessageInterval字段的字段值进行比对;第三输出模块,用于若不一致,则返回Delay_Resp报文发送频率有问题的第三测试结果。Optionally, in another embodiment, the apparatus further includes: a second recording module configured to record the field value of the logMessageInterval field carried in the Delay_Resp message sent and the sending frequency of the Delay_Resp message; a third ratio For the module, it is used to compare the field value of the logMessageInterval field carried in the Delay_Resp message sent and the sending frequency of the Delay_Resp message, and the actual sending frequency of the Delay_Req message sent by the device under test and the Delay_Req message sent by the device under test. Compare the field values of the logMessageInterval field of the .

可选地,在另一个实施例中,所述装置还包括:调整模块,用于根据预先设置存储的各种报文类型的PTP报文的发送频率的数值范围,调整发出的PTP报文的发送频率;第四输出模块,用于若在预定时间内没有收到被测试设备回复的所述发出的PTP报文的响应报文,则返回所述被测试设备支持PTP报文的发送频率有问题的第四测试结果。Optionally, in another embodiment, the apparatus further includes: an adjustment module configured to adjust the sent PTP message according to the preset numerical range of the transmission frequency of the PTP messages of various message types. Sending frequency; the fourth output module is used to return the sending frequency of the PTP message supported by the tested device if the response message of the sent PTP message replied by the tested device is not received within a predetermined time. The fourth test result of the question.

可选地,在另一个实施例中,所述装置还包括:第三记录模块,用于记录收到的PTP报文的时间戳信息;第五输出模块,用于若所述时间戳信息为负值,或者时间戳信息小于所述收到的PTPPTP报文的前一个报文的时间戳信息,则返回所述PTP收到的PTP报文的时间戳信息错误的第五测试结果。Optionally, in another embodiment, the apparatus further includes: a third recording module for recording time stamp information of the received PTP message; a fifth output module for recording the time stamp information if the time stamp information is If the value is negative, or the timestamp information is smaller than the timestamp information of the previous packet of the received PTPPTP packet, the fifth test result that the timestamp information of the PTP packet received by the PTP is incorrect is returned.

在本实施例中,装置可以存储识别到的PTP报文,并预先设置存储每类PTP报文全部或者部分字段的标准字段值(相当于标准数值或者数值范围),与检测到PTP报文进行自动比对,如果检测到的PTP报文的某字段不满足测试设备中的标准字段值,则自动返回该PTP报文的字段不满足要求的第一测试结果,从而可以通过预先设置的标准字段值判断PTP报文互通的情况,避免了因现有技术中PTP相关设备在实现PTP功能时各个字段填充数值存在差异,而导致的不同网络系统和设备的互通造成一定困难的问题。并且可以自动判断PTP报文发送频率、时间戳等关键功能的检测,促进同步网络互通和应用。In this embodiment, the device may store the identified PTP messages, and preset standard field values (equivalent to standard values or value ranges) that store all or part of the fields of each type of PTP message, and carry out processing with the detected PTP messages. Automatic comparison, if a field of the detected PTP packet does not meet the standard field value in the test device, it will automatically return the first test result that the field of the PTP packet does not meet the requirements, so that the preset standard field can be passed. The value judges the intercommunication of PTP messages, which avoids certain difficulties in intercommunication of different network systems and devices caused by differences in the filling values of various fields when PTP related devices implement the PTP function in the prior art. And it can automatically determine the detection of key functions such as PTP packet sending frequency and time stamp, and promote synchronous network interoperability and application.

在本申请所提供的几个实施例中,应该理解到,所揭露方法和装置,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理包括,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included individually, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括如果干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include specific instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute some steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM for short), Random Access Memory (RAM for short), magnetic disk or CD, etc. that can store program codes medium.

以上所述的是本发明的优选实施方式,应当指出对于本技术领域的普通人员来说,在不脱离本发明所述的原理前提下还可以作出如果干改进和润饰,这些改进和润饰也在本发明的保护范围内。The above are the preferred embodiments of the present invention, and it should be pointed out that for those skilled in the art, further improvements and modifications can be made without departing from the principles described in the present invention, and these improvements and modifications are also within the protection scope of the present invention.

Claims (11)

1. a kind of method that PTP message is tested automatically is applied to test equipment, which is characterized in that the described method includes:
Determine the type of message for receiving the PTP message for being devices under transmission;
According to the determining type of message, determine pre-set PTP message corresponding with the type of message whole or The standard word segment value of part field;
The field value of first field in the PTP message received is compared with the standard word segment value of the first field;
If the field value of the first field and the standard word segment value of the first field are inconsistent in the PTP message, the PTP is exported First field of message is unsatisfactory for the first desired test result.
2. the method as described in claim 1, which is characterized in that the method also includes:
The time of each PTP message received is recorded, and according to the time of each PTP message received, calculates various reports The first of the PTP message of literary type sends frequency;
The field value of the record time interval logMessageInterval field of log is extracted from the PTP message received, The second of the PTP message received sends frequency;
Frequency is sent by the first of PTP message corresponding with the type of message of PTP message received, is received with described PTP message second transmission frequency be compared;
If inconsistent, problematic second test result of transmission frequency of the PTP message received described in return.
3. the method as described in claim 1, which is characterized in that the method also includes:
Record send delay respond Delay_Resp message carry logMessageInterval field field value and The transmission frequency of the Delay_Resp message;
The field value and the Delay_ for the logMessageInterval field that the Delay_Resp message of transmission is carried The transmission frequency of Resp message, with the practical transmission frequency of the latency request Delay_Req message that is devices under transmission and The field value for being devices under the logMessageInterval field of the Delay_Req message of transmission is compared;
If inconsistent, return to the Delay_Resp message and send the problematic third test result of frequency.
4. the method as described in claim 1, which is characterized in that the method also includes:
According to the numberical range of the transmission frequency of the PTP message for the various type of messages for presetting storage, the PTP of sending is adjusted The transmission frequency of message;
If not receiving the response message for being devices under the PTP message of the sending of reply in the given time, return It is described to be devices under problematic 4th test result of transmission frequency for supporting PTP message.
5. the method as described in claim 1, which is characterized in that the method also includes:
Record the timestamp information of the PTP message received;
If the timestamp information is the previous message that negative value or timestamp information are less than the PTP message received Timestamp information, then the 5th test result of the timestamp information mistake of the PTP message received described in return.
6. method as claimed in any one of claims 1 to 5, which is characterized in that be devices under transmission determining to receive Before the type of message of PTP message, the method also includes:
According to the numerical value of ethernet type field in the encapsulation of ether network packet, identifies and obtain from the message for be devices under transmission PTP message.
7. a kind of device that PTP message is tested automatically, it is applied to test equipment, which is characterized in that described device includes:
Determination type module, for determining the type of message for receiving the PTP message for being devices under transmission;
Matching module, for determining pre-set PTP corresponding with the type of message according to the determining type of message The standard word segment value of all or part of field of message;
First comparison module, for by the field value of the first field and the standard of the first field in the PTP message received Field value is compared;
First output module, if for the first field in the PTP message field value and the first field standard word segment value not Unanimously, then the first field for exporting the PTP message is unsatisfactory for the first desired test result.
8. device as claimed in claim 7, which is characterized in that described device further include:
First logging modle, for recording the time of each PTP message received, and according to each PTP message received Time, calculate the PTP message of various type of messages first send frequency;
Frequency determining module is obtained for extracting the field value of logMessageInterval field from the PTP message received Second to the PTP message received sends frequency;
Second comparison module, for by the hair of the first PTP message corresponding with the type of message of PTP message received Frequency is sent, is compared with the second transmission frequency of the PTP message received;
Second output module, if for inconsistent, the transmission frequency problematic second of the PTP message received described in return Test result.
9. device as claimed in claim 7, which is characterized in that described device further include:
Second logging modle, for recording the word for the logMessageInterval field that the Delay_Resp message sent carries The transmission frequency of segment value and the Delay_Resp message;
Third comparison module, the field for the logMessageInterval field that the Delay_Resp message for that will send carries The transmission frequency of value and the Delay_Resp message, the practical transmission with the Delay_Req message for being devices under transmission Frequency and the field value of logMessageInterval field of Delay_Req message for being devices under transmission are compared It is right;
Third output module, if returning to Delay_Resp message for inconsistent and sending the problematic third test knot of frequency Fruit.
10. device as claimed in claim 7, which is characterized in that described device further include:
Module is adjusted, the numberical range of the transmission frequency of the PTP message of the various type of messages of storage is preset for basis, Adjust the transmission frequency of the PTP message issued;
4th output module, if for not receiving the PTP message for being devices under the sending of reply in the given time Response message, then return described in be devices under support PTP message problematic 4th test result of transmission frequency.
11. device as claimed in claim 7, which is characterized in that described device further include:
Third logging modle, for recording the timestamp information of the PTP message received;
5th output module, if being that negative value or timestamp information are less than the PTP report received for the timestamp information The timestamp information of the previous message of text, then the 5th test of the timestamp information mistake of the PTP message received described in return As a result.
CN201510363262.9A 2015-06-26 2015-06-26 A kind of method and device that PTP message is tested automatically Active CN106301996B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510363262.9A CN106301996B (en) 2015-06-26 2015-06-26 A kind of method and device that PTP message is tested automatically

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510363262.9A CN106301996B (en) 2015-06-26 2015-06-26 A kind of method and device that PTP message is tested automatically

Publications (2)

Publication Number Publication Date
CN106301996A CN106301996A (en) 2017-01-04
CN106301996B true CN106301996B (en) 2019-10-08

Family

ID=57650941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510363262.9A Active CN106301996B (en) 2015-06-26 2015-06-26 A kind of method and device that PTP message is tested automatically

Country Status (1)

Country Link
CN (1) CN106301996B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656395B (en) * 2017-01-05 2018-12-18 西安电子科技大学 Based on the improved power grid time synchronized measurement system of self study and method
CN109327428A (en) * 2018-06-05 2019-02-12 中国移动通信有限公司研究院 A message transmission method, device, network side device and storage medium
US20220030533A1 (en) * 2018-11-26 2022-01-27 Telefonaktiebolaget Lm Ericsson (Publ) Devices and Methods for Handling Precise Timing Protocol Signaling from a Time Sensitive Network
CN111277349B (en) * 2018-12-04 2023-12-22 深圳市中兴微电子技术有限公司 Clock synchronization method and system
CN113067654B (en) * 2020-01-02 2022-04-15 中国移动通信有限公司研究院 A synchronous source selection port state testing method and testing equipment
CN117009998A (en) * 2023-08-29 2023-11-07 上海倍通医药科技咨询有限公司 Data inspection method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827098A (en) * 2010-03-31 2010-09-08 中兴通讯股份有限公司 Processing method and device for time synchronization
CN102377663A (en) * 2010-08-24 2012-03-14 华为技术有限公司 Method, device and system for processing clock message
CN103051406A (en) * 2011-10-17 2013-04-17 中兴通讯股份有限公司 Clock synchronization method and system in 1588-2008 protocol

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070070299A (en) * 2005-07-06 2007-07-04 삼성전자주식회사 How to Synchronize Time in Residential Ethernet Systems
CN103036848B (en) * 2011-09-29 2015-11-25 西门子公司 The reverse engineering approach of agreement and system
EP3053288A1 (en) * 2013-10-02 2016-08-10 Khalifa University of Science, Technology and Research Method and devices for time and frequency synchronization
CN103701581B (en) * 2013-12-06 2017-01-18 电信科学技术第五研究所 Method for realizing IEEE1588 master clock
CN104506296B (en) * 2014-12-08 2018-02-27 盛科网络(苏州)有限公司 One kind ensures the symmetrical implementation method of PTP packet routes

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101827098A (en) * 2010-03-31 2010-09-08 中兴通讯股份有限公司 Processing method and device for time synchronization
CN102377663A (en) * 2010-08-24 2012-03-14 华为技术有限公司 Method, device and system for processing clock message
CN103051406A (en) * 2011-10-17 2013-04-17 中兴通讯股份有限公司 Clock synchronization method and system in 1588-2008 protocol

Also Published As

Publication number Publication date
CN106301996A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN106301996B (en) A kind of method and device that PTP message is tested automatically
US8730867B2 (en) Clock synchronization aid device for communication station(s) of a wireless network, and associated clock synchronization device
CN101331736B (en) Using travel-time as means for improving the accuracy of simple network time protocol
CN112583477B (en) A delay measurement method, system and storage medium
WO2017101528A1 (en) Method and device for clock link switching and base station
EP2448168A1 (en) Method and system for bearing time synchronization protocol in optical transport network
CN101364863A (en) Time Synchronization Method, Device and System for Master and Slave Clock Sides in Synchronization Network
CN105680973A (en) A method of time synchronization of free running nodes in an avionics network
CN103067112A (en) Clock synchronization method and device and network equipment
CN108599888A (en) A kind of distributed network clock synchronizing system
CN104852828B (en) A kind of network delay detection method, apparatus and system
EP3249976A1 (en) Service discovery method and device in neighbor awareness network
CN102171966B (en) Method and apparatus for simulating packet delay jitter in current network
CN115208806A (en) Method and device for testing response capability of NTP (network time protocol) server
CN107682126B (en) An Ethernet network transmission performance testing device
CN108023656A (en) A kind of method for synchronizing time and equipment
CN105530698A (en) Time synchronization method and system among wireless devices
CN106027189A (en) A method and system for implementing message timestamps provided by Internet of Things devices
CN106549822B (en) Method and device for testing response time of time synchronization message and test equipment
CN108111365B (en) Time delay measurement processing method and system
CN105530139B (en) Self-checking method and device for 1588 equipment
CN108011778B (en) Method and device for acquiring message transmission delay time
CN102821457B (en) Clock synchronizing method based on software defined radio and software defined radio system
CN102983959B (en) Method for realizing one-step mode and two-step mode for PTP (precision time synchronization protocol) in a plurality of MAC
CN115551067A (en) Time synchronization method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant