Precision time protocol (PTP) message processing method, PTP message sending method, communication system and device

By adding identification to PTP messages, the problem of delay measurement in the communication network is solved, the accuracy and efficiency of time synchronization are improved, and the accurate measurement of link transmission delay is achieved.

CN120342531APending Publication Date: 2025-07-18HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410080065.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When performing time synchronization, existing communication networks are difficult to effectively perform delay measurement, especially in link transmission delay measurement between different communication devices, resulting in limited synchronization accuracy and efficiency.

Method used

By adding an identifier to the PTP message, the delay measurement function message and the synchronization function message are distinguished, allowing the communication device to perform corresponding processing according to the identifier, including termination, transmission or delay measurement, to realize delay measurement under the peer-to-peer delay mechanism and end-to-end delay mechanism.

Benefits of technology

It realizes effective support for delay measurement in the communication network, improves the accuracy and efficiency of time synchronization, and ensures that the communication device can accurately measure the link transmission delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342531A_ABST
    Figure CN120342531A_ABST
Patent Text Reader

Abstract

The invention discloses a PTP (Precision Time Protocol) message processing method, a PTP message sending method, a communication system and a communication device, and belongs to the technical field of communication. According to the method, whether the PTP message is the time delay measurement function message is indicated through the identifier in the PTP message, so that the communication device receiving the PTP message can process the PTP message based on the indication of the identifier, and because the communication device can process the time delay measurement function message, the communication device can support the time delay measurement function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a method for processing PTP messages, a method for sending PTP messages, a communication system, and a device. Background Art

[0002] With the development of the 4th Generation mobile communication technology (4G) and the 5th Generation mobile communication technology (5G), the communication technology has an increasingly high requirement for time synchronization of communication networks. Therefore, it is necessary to perform time synchronization on communication networks. Among them, the Precision Time Protocol (PTP) is a technology for time synchronization of standard Ethernet devices, also known as the Institute of Electrical and Electronics Engineers (IEEE) 1588 synchronization technology, abbreviated as 1588 synchronization technology.

[0003] Currently, for a communication network that supports running the PTP protocol, different communication devices in the communication network can perform time synchronization by means of PTP messages. Taking communication device 1 and communication device 2 in the communication network as an example, assuming that communication device 1 is the master clock device of communication device 2 and communication device 2 is the slave clock device of communication device 1, communication device 1 can send a PTP message to communication device 2, and communication device 2 performs time synchronization with communication device 1 based on the PTP message. Summary of the Invention

[0004] Embodiments of this application provide a method for processing PTP messages, a method for sending PTP messages, a communication system, and a device, which can enable a communication device to support delay measurement based on the PTP protocol. The technical solution is as follows:

[0005] In a first aspect, a method for processing PTP messages is provided. The method is executed by a certain communication device (referred to as the first communication device) in a communication system that supports the PTP protocol. The method includes: first obtaining a PTP message from another communication device (referred to as the second communication device), and processing the PTP message based on an identifier in the PTP message, where the identifier indicates whether the PTP message is a delay measurement function message;

[0006] In this method, the identification in the PTP message indicates whether the PTP message is a delay measurement function message, so that the communication device receiving the PTP message can process the PTP message based on the indication of the identification. Since the communication device can process the delay measurement function message, the communication device can support the delay measurement function.

[0007] In a possible implementation manner, when the first communication device is a service bearer device, the above-mentioned processing of the PTP message based on the identification includes: if the identification indicates that the PTP message is not a delay measurement function message, perform termination processing on the PTP message; if the identification indicates that the PTP message is a delay measurement function message, send the PTP message.

[0008] Based on the above possible implementation manner, the service bearer device in the communication system will send out the received delay measurement function message, so that the delay measurement function message can be sent to non-service bearer devices in the communication network, and the non-service bearer devices perform delay measurement based on the delay measurement function message. A non-service bearer device refers to a communication device in the communication network that is not a service bearer device, such as Figures 1 to 3 communication devices 101 and 102 in

[0009] In a possible implementation manner, when the first communication device is not a service bearer device, the above-mentioned processing of the PTP message based on the identification includes: if the identification indicates that the PTP message is not a delay measurement function message, perform termination processing on the PTP message; if the identification indicates that the PTP message is a delay measurement function message, perform delay measurement based on the PTP message.

[0010] Based on the above possible implementation manner, non-service bearer devices in the communication system can perform delay measurement by means of this PTP message.

[0011] In a possible implementation manner, the PTP message is a synchronization message involved in the delay request response mechanism and includes an identification. Based on this, the above-mentioned step of performing delay measurement based on the PTP message includes: in response to the PTP message, first send a first delay measurement request message, then obtain a first delay measurement response message of the first delay measurement request message, and then, based on the timestamp of the PTP message and / or the timestamp of the first delay measurement request message, determine the link transmission delay between the first communication device and the second communication device, where the first delay measurement request message is a delay request message involved in the delay request response mechanism and includes an identification, the first delay measurement response message is a delay response message involved in the delay request response mechanism and includes an identification, and the first delay measurement response message includes the timestamp of the first delay measurement request message.

[0012] Among the above possible implementation manners, the link transmission delay between the first communication device and the second communication device can be measured.

[0013] In a possible implementation manner, before sending the first delay measurement request message in response to the PTP message, the method further includes: obtaining a delay measurement follow-up message of PTP, where the delay measurement follow-up message is a follow-up message involved in the delay request response mechanism and includes an identifier, and the delay measurement follow-up message includes the timestamp of the PTP message.

[0014] Among the above possible implementation manners, so that the first communication device can obtain the timestamp of the PTP message, and further enable the first communication device to measure the link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message.

[0015] In a possible implementation manner, the PTP message is a delay request message involved in the peer delay mechanism and includes an identifier. Based on this, the step of measuring the delay based on the PTP message includes: in response to the PTP message, sending a second delay measurement response message, where the second delay measurement response message is a delay response message involved in the peer delay mechanism and includes an identifier.

[0016] Based on the above possible implementation manner, so that the device for measuring the delay based on the PTP message can measure the link transmission delay between the first communication device and the second communication device based on the timestamp of the second delay measurement response message and / or the timestamp of the PTP message.

[0017] In a possible implementation manner, after sending the second delay measurement response message, the method includes:

[0018] Sending a delay measurement response follow-up message to the second delay measurement response message, where the delay measurement response follow-up message is a delay response follow-up message involved in the peer delay mechanism and includes an identifier, and the delay measurement response follow-up message includes the timestamp of the second delay measurement response message.

[0019] Among the above possible implementation manners, so that the device for measuring the delay based on the PTP message can obtain the timestamp of the second delay measurement response message, so that the device can measure the link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message and / or the timestamp of the second delay measurement response message.

[0020] In a possible implementation manner, the PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

[0021] In a possible implementation, the PTP message includes a message type field and multiple timestamp fields. The identifier is located in the message type field, and the multiple timestamp fields correspond to different delay measurement function messages. Each timestamp field is used to store the timestamp of the corresponding delay measurement function message.

[0022] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier and a second sub-identifier. The first sub-identifier and the second sub-identifier are located in different fields among the domain number field, the message type field, and the identifier domain field respectively. If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the message type field, any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the identifier domain field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

[0023] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier. The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message. The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. The third sub-identifier is located in the identifier domain field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

[0024] In a possible implementation, the PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

[0025] In a possible implementation, the delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

[0026] Based on the above-mentioned multiple possible implementations, multiple situations where the PTP message carries the identifier are provided to meet the requirements of multiple application scenarios.

[0027] In a possible implementation, the identifier is a reserved value of the above-mentioned field.

[0028] Based on the above possible implementation, it is possible to avoid the identifier occupying a value that has already been occupied in the field where it is located, and avoid the communication device that receives the PTP message misidentifying the PTP message as another message indicated by the occupied value in the field, resulting in the device being unable to perform delay measurement based on the identifier.

[0029] Second aspect, a method for sending a PTP message is provided. This method is executed by a second communication device, and the method includes: first obtaining a PTP message, and then sending the PTP message, where the PTP message includes an identifier, and the identifier indicates whether the PTP message is a delay measurement function message.

[0030] In a possible implementation, the above identifier indicates that the PTP message is a delay measurement function message, and the PTP message is a synchronization message involved in the delay request response mechanism and includes an identifier. Based on this, after sending the PTP message, the method further includes: obtaining a first delay measurement request message of the PTP message, and in response to the first delay measurement request message, sending a second delay measurement response message, where the first delay measurement request message is a delay request message involved in the delay request response mechanism and includes an identifier, and the second delay measurement response message is a delay response message involved in the delay request response mechanism and includes an identifier.

[0031] In a possible implementation, after sending the PTP message, the method further includes: sending a delay measurement follow-up message of the delay measurement synchronization message, where the delay measurement follow-up message is a follow-up message involved in the delay request response mechanism and includes an identifier.

[0032] In a possible implementation, the above identifier indicates that the PTP message is a delay measurement function message, and the PTP message is a delay request message involved in the peer delay mechanism and includes an identifier. Based on this, after sending the PTP message, the method further includes: obtaining a second delay measurement response message of the PTP message, where the second delay measurement response message is a delay response message involved in the peer delay mechanism and includes an identifier; determining the link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message and / or the timestamp of the second delay measurement response message.

[0033] In a possible implementation, after obtaining the second delay measurement response message of the PTP message, the method further includes: obtaining a delay measurement response follow-up message of the second delay measurement response message, where the delay measurement response follow-up message is a delay response follow-up message involved in the peer delay mechanism and includes an identifier, and the delay measurement response follow-up message includes the timestamp of the second delay measurement response message.

[0034] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field, and the identifier is located in any one of the domain number field, the message type field, or the identifier domain field.

[0035] In a possible implementation, the PTP message includes a message type field and multiple timestamp fields. The identifier is located in the message type field, and the multiple timestamp fields correspond to different delay measurement function messages. Each timestamp field is used to store the timestamp of the corresponding delay measurement function message.

[0036] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier and a second sub-identifier. The first sub-identifier and the second sub-identifier are located in different fields among the domain number field, the message type field, and the identifier domain field respectively. If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the message type field, any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the identifier domain field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

[0037] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier. The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message. The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. The third sub-identifier is located in the identifier domain field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

[0038] In a possible implementation, the PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

[0039] In a possible implementation, the delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

[0040] In a possible implementation, the identifier is the reserved value of the field where it is located.

[0041] For the beneficial effects achieved by the second aspect or any possible implementation manner of the second aspect, reference can be made to the beneficial effects achieved by the first aspect or the corresponding implementation manner of the first aspect, which will not be elaborated here.

[0042] In a third aspect, a communication system is provided. The communication system includes the first communication device in the first aspect and the second communication device in the second aspect. Among them, the first communication device is used to execute the method provided by the first aspect or any optional manner of the first aspect, and the second communication device is used to execute the method provided by the second aspect or any optional manner of the second aspect.

[0043] In a fourth aspect, a PTP message processing apparatus is provided, which is used to execute the method provided in the above first aspect or any optional implementation manner of the above first aspect.

[0044] In a fifth aspect, a PTP message sending apparatus is provided, which is used to execute the method provided in the above second aspect or any optional implementation manner of the above second aspect.

[0045] In a sixth aspect, a communication device is provided. The communication device includes a processor, and the processor is used to execute program code so that the communication device executes to implement the method provided in the above first aspect or any optional implementation manner of the above first aspect, or to implement the method provided in the above second aspect or any optional implementation manner of the above second aspect.

[0046] In a seventh aspect, a computer-readable storage medium is provided. At least one piece of program code is stored in the storage medium, and the program code is read by a processor so that the communication device executes the method provided in the above first aspect or any optional implementation manner of the above first aspect, or to implement the method provided in the above second aspect or any optional implementation manner of the above second aspect.

[0047] In an eighth aspect, a computer program product or a computer program is provided. The computer program product or the computer program includes program code, the program code is stored in a computer-readable storage medium, the processor reads the program code from the computer-readable storage medium, and the processor executes the program code so that the communication device executes the method provided in the above first aspect or various optional implementation manners of the above first aspect, or executes the method provided in the above second aspect or any optional implementation manner of the above second aspect.

[0048] Based on the implementation manners provided in the above aspects of the present application, further combinations can be made to provide more implementation manners. Description of the Drawings

[0049] Figure 1 is a schematic diagram of the architecture of a communication system provided by an embodiment of the present application;

[0050] Figure 2 is a schematic diagram of the architecture of another communication system provided by an embodiment of the present application;

[0051] Figure 3 is a schematic diagram of the architecture of another communication system provided by an embodiment of the present application;

[0052] Figure 4 is a schematic diagram of a PTP message with a first message format provided by an embodiment of the present application;

[0053] Figure 5 It is a schematic structural diagram of a message header 401 provided by an embodiment of the present application;

[0054] Figure 6 It is a schematic diagram of the value taken by the message type identifier in a message type field provided by an embodiment of the present application;

[0055] Figure 7 It is a schematic diagram of the value taken by the domain number in a domain number field provided by an embodiment of the present application;

[0056] Figure 8 It is a schematic diagram of the value taken by the identification domain in an identification domain field provided by an embodiment of the present application;

[0057] Figure 9 It is a schematic structural diagram of each delay measurement message involved in a PTP mechanism provided by an embodiment of the present application;

[0058] Figure 10 It is a schematic structural diagram of each delay measurement message involved in an ETE mechanism provided by an embodiment of the present application;

[0059] Figure 11 It is a schematic diagram of the tlv type as a suffix 403 provided by an embodiment of the present application;

[0060] Figure 12 It is a schematic structural diagram of a delay measurement TLV provided by an embodiment of the present application;

[0061] Figure 13 It is a schematic structural diagram of another delay measurement TLV provided by an embodiment of the present application;

[0062] Figure 14 It is a schematic diagram of a PTP message with a second message format provided by an embodiment of the present application;

[0063] Figure 15 It is a flowchart of a method for processing a PTP message provided by an embodiment of the present application;

[0064] Figure 16 It is a flowchart of another method for processing a PTP message provided by an embodiment of the present application;

[0065] Figure 17 It is a flowchart of PTP message interaction in the one-step mode of a PTP mechanism provided by an embodiment of the present application;

[0066] Figure 18 It is a flowchart of PTP message interaction in the two-step mode of a PTP mechanism provided by an embodiment of the present application;

[0067] Figure 19It is a PTP message interaction flowchart in the single-step mode of an ETE mechanism provided by an embodiment of the present application;

[0068] Figure 20 It is a PTP message interaction flowchart in the two-step mode of an ETE mechanism provided by an embodiment of the present application;

[0069] Figure 21 It is a schematic structural diagram of a PTP message processing device provided by an embodiment of the present application;

[0070] Figure 22 It is a schematic structural diagram of a PTP message sending device provided by an embodiment of the present application;

[0071] Figure 23 It is a schematic structural diagram of a communication device provided by an embodiment of the present application;

[0072] Figure 24 It is a schematic structural diagram of another communication device provided by an embodiment of the present application. Detailed implementation manners

[0073] For the convenience of understanding the detailed implementation manners of the present application, the detailed implementation manners of the present application are introduced as follows in combination with the accompanying drawings.

[0074] The present application provides a method for processing PTP messages. Next, the application environment of this method is introduced as follows in combination with the accompanying drawings.

[0075] Figure 1 It is a schematic architecture diagram of a communication system provided by the present application. Figure 1 As shown, the communication system 100 is a clock synchronization network supporting the PTP protocol. The communication system 100 includes multiple communication devices. The multiple communication devices are networked into a peer-to-peer (P2P) network in the communication system 100 in a peer-to-peer networking manner. For example Figure 1 As shown, the communication device 101 and the communication device 102 in the communication system are networked into a P2P network. In another possible implementation manner, the P2P network may also include more than 2 communication devices. Here, the number of communication devices used to form the P2P network in the communication system 100 is not limited.

[0076] Different communication devices in the P2P network can be directly connected. Any two directly connected communication devices are adjacent communication devices in the P2P network. Adjacent communication devices can send PTP messages to each other. For example Figure 1 the communication device 101 and the communication device 102 in

[0077] Adjacent communication devices in a P2P network can also be indirectly connected through at least one service-bearing device. A service-bearing device refers to a communication device that provides service-bearing services for communication devices in the P2P network. For example, a service-bearing device can provide an information transmission channel for communication devices in the P2P network, and forward or transparently transmit PTP messages sent by a certain communication device in the P2P network to another communication device in the P2P network.

[0078] In the case where any adjacent communication devices in the P2P network are indirectly connected through a service-bearing device, PTP messages are sent to each other between the adjacent communication devices through the connected service-bearing device. As Figure 2 and Figure 3 shown, the communication system 100 further includes a service-bearing device 110 and a service-bearing device 120. The communication device 101 is indirectly connected to the communication device 102 through the service-bearing device 110 and the service-bearing device 120. The communication device 101 can send PTP messages to the communication device 102 through the service-bearing device 110 and the service-bearing device 120. The communication device 102 can send PTP messages to the communication device 101 through the service-bearing device 120 and the service-bearing device 110.

[0079] Figure 2 and Figure 3 are both illustrated by taking the example that the communication device 101 and the communication device 102 are indirectly connected through two service-bearing devices. In another possible implementation, adjacent communication devices in the P2P network can also be indirectly connected through one service-bearing device. In the case where the communication system 100 includes service-bearing devices, the service-bearing devices in the communication system 100 can be networked into the underlying physical (underlay) network of the P2P network to provide service-bearing services for communication devices in the P2P network.

[0080] In summary, the communication system 100 includes a P2P network, and the P2P network includes multiple communication devices that are directly connected. In another possible implementation, the communication system 100 further includes an underlay network. The underlay network includes multiple service-bearing devices. The underlay network may also include one service-bearing device. Any adjacent communication devices in the P2P network are indirectly connected through at least one service-bearing device in the underlay network. Of course, the adjacent communication devices can also be directly connected without being indirectly connected through a service-bearing device. Here, the number of communication devices in the P2P network and the number of service-bearing devices in the underlay network are not limited.

[0081] For any communication device in a P2P network or an underlay network, the communication device may be a network device. Exemplarily, the network device may be a packet forwarding device, such as a switch, a router, an Internet protocol radio access network (IPRAN), a packet transport network (PTN) device, a slicing packet network (SPN) device, and a metro transport network (MTN) device. The network device may also be a network device with optical signal transmission function, such as an optical transport network (OTN) device. The communication device may also be an end-side device. Exemplarily, a network processing module supporting the PTP protocol is installed in the end-side device. Through this network processing module, the end-side device can interact with other communication devices to exchange PTP messages. The end-side device may be, for example, a server, a computer device, etc. Figure 1 and Figure 2 are both illustrated by taking the communication device in the P2P network as a router as an example. Figure 3 is illustrated by taking the communication device in the P2P network as a switch as an example. Figure 2 is illustrated by taking the communication device (i.e., the service-bearing device) in the underlay network as an OTN device as an example. Figure 3 is illustrated by taking the communication device in the underlay network as a router as an example. Here, the device types of the communication devices in the P2P network and the device types of the communication devices in the underlay network are not limited.

[0082] Each communication device (including the communication devices in the P2P network and the service-bearing devices in the underlay network) in the communication system 100 has the time synchronization function (referred to as the synchronization function for short) in the PTP protocol by running the PTP protocol. The adjacent communication devices (i.e., two directly connected communication devices) in the communication system 100 exchange PTP messages with each other in pairs to complete time synchronization. Exemplarily, in the scenario where different communication devices in the P2P network are directly connected, taking Figure 1 as an example, the communication device 101 sends a PTP message with the synchronization function to the communication device 102, and the communication device 102 synchronizes its clock with the communication device 101 based on this PTP message. In the scenario where adjacent communication devices in the P2P network are indirectly connected, taking Figure 2 and Figure 3Taking the communication device in as an example, the communication device 101 sends a PTP message with synchronization function to the service bearing device 110. The service bearing device 110 performs time synchronization with the communication device 101 based on this PTP message. The service bearing device 110 sends another PTP message with synchronization function to the service bearing device 120. The service bearing device 120 performs time synchronization with the service bearing device 110 based on this PTP message of the service bearing device 110. The service bearing device 120 sends another PTP message with clock synchronization function to the communication device 102. The communication device 102 performs time synchronization with the service bearing device 120 based on this PTP message of the service bearing device 120.

[0083] The clock of the communication device that publishes the clock signal through the PTP message is the master clock, and the clock of the communication device that performs time synchronization based on this PTP message is the slave clock. The communication device to which the master clock belongs is the master clock device, and the communication device to which the slave clock belongs is the slave clock device. Taking Figure 1 as an example, the communication device 101 is the master clock device of the communication device 102, and the communication device 102 is the slave clock device of the communication device 101. Taking Figure 2 and Figure 3 as an example, the communication device 101 is the master clock device of the service bearing device 110, and the service bearing device 110 is the slave clock device of the communication device 101 and the master clock device of the service bearing device 120.

[0084] As Figure 2 and Figure 3 shown, since the PTP message with synchronization function of the communication device 101 will not be sent by the service bearing device 110 to other communication devices, equivalently, the service bearing device 110 performs termination processing on this PTP message of the communication device 101. This PTP message of the communication device 101 is terminated at the service bearing device 110. Correspondingly, the PTP message with synchronization function sent by the service bearing device 110 to the service bearing device 120 is terminated at the service bearing device 120, and the PTP message with synchronization function sent by the service bearing device 120 to the communication device 102 is terminated at the communication device 102.

[0085] In the case where any adjacent communication devices in the P2P network have a delay measurement requirement, these adjacent communication devices can measure the link transmission delay between them by sending PTP messages with delay measurement function to each other. This link transmission delay refers to the transmission duration of the PTP message between these adjacent communication devices. Exemplarily, in the scenario where adjacent communication devices in the P2P network are directly connected, taking Figure 1For example, communication device 101 sends a PTP message with a delay measurement function to communication device 102, and communication device 102 performs delay measurement based on the PTP message, or communication device 102 sends a PTP message with a delay measurement function to communication device 101, and communication device 101 performs delay measurement based on the PTP message. In a scenario where adjacent communication devices in a P2P network are indirectly connected, the service bearer device is also responsible for forwarding service messages of the adjacent communication devices between adjacent communication devices in the P2P network. The PTP message with a delay measurement function is a service message of the P2P network in the delay measurement scenario. Therefore, in the delay measurement scenario, the service bearer device is responsible for forwarding the PTP messages with a delay measurement function sent between adjacent communication devices in the P2P network. Figure 2 and Figure 3 Taking the communication device in as an example, the communication device 101 sends a PTP message with a delay measurement function to the service bearing device 110, the service bearing device 110 sends the PTP message to the service bearing device 120, and the service bearing device 120 sends the PTP message to the communication device 102, and the communication device 102 performs delay measurement based on the PTP message.

[0086] Next, the PTP message involved in this application is introduced.

[0087] Functionally, the present application divides PTP messages into PTP messages with delay measurement function and PTP messages with synchronization function. For the convenience of description, the PTP message with delay measurement function is called delay measurement function message, and the PTP message with synchronization function is called synchronization function message. In other words, the PTP message without delay measurement function is called synchronization function message.

[0088] The present application adds an identifier to the PTP message so that the PTP message has a delay measurement function or a time synchronization function. The identifier indicates whether the PTP message is a delay measurement function message. For example, if the identifier indicates that the PTP message is a delay measurement function message, the PTP message has a delay measurement function. If the identifier indicates that the PTP message is not a delay measurement function message, the PTP message does not have a delay measurement function, and the PTP message is a synchronization function message. The PTP message also includes other identifiers in addition to the identifier. In order to distinguish it from other identifiers and for the convenience of description, the identifier indicating whether the PTP message is a delay measurement function message is called a delay measurement identifier.

[0089] The PTP message including the delay measurement identifier may have a first message format or a second message format. Next, these two message formats are introduced respectively in conjunction with the accompanying drawings.

[0090] 1. The first message format of PTP message

[0091] Figure 4 It is a schematic diagram of a PTP message with a first message format provided by an embodiment of the present application. As Figure 4 shown, the PTP message 400 includes a message header 401, a message body 402, and a suffix 403. The delay measurement identifier is located in the message header 401 or the suffix 403. The message header 401, the message body 402, and the suffix 403 are introduced respectively through the following 1.1 to 1.3.

[0092] 1.1. Message header 401

[0093] Among them, the message header 401 is used to define the version of the PTP protocol and the message type of the PTP message, and is also used to define other contents of the PTP message. Exemplarily, Figure 5 This is a schematic diagram of the structure of a message header 401 provided by an embodiment of the present application. As Figure 5 shown, the message header 401 occupies 34 bytes. The message header 401 includes:

[0094] Major standards development organization identification (majorSdoId) field: Occupies 4 bits (Bit), and is used to store the identification of the major standards development organization in the domain where the generating device of the PTP message is located. The domain consists of one or more PTP instances (such as communication devices running the PTP protocol). The domain has two attribute identifications, namely, standards development organization identification (SdoId) and domain number (domainNumber). Among them, SdoId is the identification of the standard organization that specifies the PTP protocol. SdoId takes values in the range of 0 to 4095. The value of SdoId is a 12-bit integer. The highest 4 bits in this 12-bit integer are called majorSdoId, and the last 8 bits in this 12-bit integer are called minor standards development organization identification (minorSdoId);

[0095] Message type (messageType) field: Occupies 4 Bit, and is used to store the message type identification of the PTP message. As Figure 6As shown, the message type identifier indicates the message type of the PTP message. Different values of the message type identifier represent different message types. The highest bit of the message type field indicates whether the PTP message is an important (Event) message or a general (General) message;

[0096] Minor PTP version (minorVersionPTP) field: Occupies 4 bits and is used to store the minor version number. The minor version number and the major PTP version number in the PTP version field together represent the version of the PTP protocol run by the PTP instance that issued this PTP message;

[0097] PTP version (versionPTP) field: Occupies 4 bits and is used to store the major version number of the PTP protocol;

[0098] Message length (messageLength) field: Occupies 8 bits and is used to store the message length, which is the length of the PTP message;

[0099] Domain number (domainNumber) field: Occupies 8 bits and is used to store the domain number. The domain number indicates the domain to which the communication device that sent this PTP message belongs. The values of the domain number are as Figure 7 shown;

[0100] minorSdoId field: Occupies 8 bits and is used to store minorSdoId;

[0101] Flag field (flagField): Occupies 8 bits and is used to store the flag field. As Figure 8 shown, different values of the flag field have different meanings;

[0102] Correction field (correctionField): Occupies 8 bits and is used to store the correction field, which is used to compensate for the link transmission delay between adjacent transmission devices in the P2P network;

[0103] Message type specific (messageTypeSpecific) field: Occupies 8 bits and is used to store the message type specific identifier. The value of the message type specific identifier depends on the message type of this PTP message;

[0104] Source port identity (sourcePortIdentity) field: Occupies 8 bits and is used to store the source port identity, which indicates the device identity (Identity, ID) of the communication device that sent this PTP message and the port number of the port on this communication device that sent this PTP message;

[0105] Sequence Identification (sequenceId) field: Occupies 8 bits and is used to store the sequence identification, which indicates the sequence number of the PTP message and the correspondence between the PTP message and the associated message;

[0106] Control Field (controlField) field: Occupies 8 bits and is used to store the control field. The value of the control field depends on the message type of the PTP message;

[0107] Log Message Interval (logMessageInterval) field: Occupies 8 bits and is used to store the log message interval. The log message interval refers to the transmission time interval of the PTP message, and the size of the log message interval depends on the message type of the PTP message.

[0108] In a possible implementation, the delay measurement identifier is located in the message header 401 and not in the suffix 403. For this implementation, the delay measurement identifier is located in any one of the message type field, domain number field, or identifier field in the message header 401. Next, the values of the delay measurement identifier when it is located in these three fields are introduced separately in 1.1.1 to 1.1.3 below.

[0109] 1.1.1. The delay measurement identifier is located in the message type field

[0110] As Figure 6 shown, in terms of message type, the PTP protocol classifies PTP messages into Sync messages, Delay Request (Delay_Req) messages, Peer to Peer DelayRequest (Pdelay_Req) messages under the peer delay mechanism, Peer to Peer Delay Response (Pdelay_Resp) requests, Follow_Up messages, Peer toPeer Delay Response Follow Up (Pdelay_Resp_Follow_Up) requests, DelayResponse (Delay_Resp) messages, Announce messages, Signaling, Management messages, and Reserved messages. Among them, Reserved messages refer to PTP messages of message types that have not been used yet. These are all PTP messages that do not include the delay measurement identifier.

[0111] The PTP protocol supports two delay measurement mechanisms, namely, the delay request-response mechanism and the peer-to-peer delay mechanism. These two delay measurement mechanisms involve PTP messages of different message types. Among them, the delay request-response mechanism is also called the end-to-end (ETE) mechanism. The PTP messages involved in the ETE mechanism include Sync messages, Delay_Req messages, Delay_Resp messages, and Follow_Up messages. The peer-to-peer delay mechanism is simply called the peer-to-peer (PTP) mechanism. The PTP messages involved in the PTP mechanism include Pdelay_Req messages, Pdelay_Resp messages, and Pdelay_Resp_Follow_Up messages. Adjacent communication devices in the P2P network of the communication system 100 can measure the link transmission delay between adjacent PTP ports through any one of these two delay measurement mechanisms. The adjacent PTP ports are the port pairs of the adjacent communication devices for receiving and sending the same PTP message.

[0112] When the delay measurement identifier is located in the message type field, the delay measurement identifier can also be used as the message type identifier. At this time, the delay measurement identifier indicates that the PTP message is a delay measurement function message and the message type of the PTP message. In a possible implementation, the delay measurement identifier corresponds to multiple values, and these multiple values are different. When the delay measurement identifier takes any one of these multiple values, the delay measurement identifier indicates that the PTP message is a delay measurement function message.

[0113] These multiple values can all be reserved values of the message type field (i.e., reserved values of the message type identifier). As Figure 6 shown, the reserved values of the message type field include 4-7 and E-F, and these multiple values are the values among 4-7 and E-F.

[0114] Alternatively, these multiple values can also be custom values other than the values already occupied by the message type field. Among them, the values already occupied by the message type field refer to the values already used by the message type identifier and the reserved values in the related art. For example, Figure 6 the 0-F shown in

[0115] is the value already occupied by the message type field. Alternatively, at least one of these multiple values is a reserved value of the message type field, and the remaining values are the custom values. Here, this application does not limit the values taken by the delay measurement identifier in the message type field.

[0116] When the value of the delay measurement identifier is a reserved value or a custom value of the message type field, it is possible to avoid occupying the value of the message type of the synchronization function message, so that the communication device can distinguish whether the PTP message where the delay measurement identifier is located is a delay measurement function message or a synchronization function message according to the value of the delay measurement identifier.

[0117] In a possible implementation, the multiple values correspond to different message types, and the message types corresponding to the multiple values are the message types of the PTP messages involved in the same delay measurement mechanism. Taking the PTP mechanism as an example, the message types of the PTP messages involved in the PTP mechanism include Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up. Suppose the multiple values are respectively the reserved values {4, 5, 6} of the message type field. Among them, the message types corresponding to 4, 5, and 6 are Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up respectively. If the delay measurement identifier is 4, then the PTP message 400 is a delay measurement function message and the Pdelay_Req message involved in the PTP mechanism. If the delay measurement identifier is 5, then the PTP message 400 is a delay measurement function message and the Pdelay_Resp message involved in the PTP mechanism. If the delay measurement identifier is 6, then the PTP message 400 is a delay measurement function message and the Pdelay_Resp_Follow_Up message involved in the PTP mechanism. Taking the ETE mechanism as an example, the message types of the PTP messages involved in the ETE mechanism include Sync, Delay_Req, Delay_Resp, and Follow_Up. Suppose the multiple values are respectively the reserved values {4, 5, 6, 7} of the message type field. Among them, the message types corresponding to 4, 5, 6, and 7 are Sync, Delay_Req, Delay_Resp, and Follow_Up respectively. If the delay measurement identifier is 4, then the PTP message is a delay measurement function message and the Sync message involved in the ETE mechanism. If the delay measurement identifier is 5, then the PTP message 400 is a delay measurement function message and the Delay_Req message involved in the ETE mechanism. If the delay measurement identifier is 6, then the PTP message 400 is a delay measurement function message and the Delay_Resp message involved in the ETE mechanism. If the delay measurement identifier is 7, then the PTP message 400 is a delay measurement function message and the Follow_Up message involved in the ETE mechanism.

[0118] To distinguish the delay measurement function messages involved in different delay measurement mechanisms, for the ETE mechanism, the synchronization message involved in the ETE mechanism and including the delay measurement identifier is called the delay measurement synchronization message, that is, the Sync message including the delay measurement identifier; the delay request message involved in the ETE mechanism and including the delay measurement identifier is called the first delay measurement request message, that is, the Delay_Req message including the delay measurement identifier; the delay response message involved in the ETE mechanism and including the delay measurement identifier is called the first delay measurement response message, that is, the Delay_Resp message including the delay measurement identifier; the follow-up message involved in the ETE mechanism and including the delay measurement identifier is called the delay measurement follow-up message, that is, the Follow_Up message including the delay measurement identifier. To distinguish them from the Sync message, Delay_Req message, Delay_Resp message, Delay_Resp message, and Follow_Up message, the delay measurement synchronization message, the first delay measurement request message, the first delay measurement response message, and the delay measurement follow-up message are respectively represented as: Sync_dm message, Delay_Req_dm message, Delay_Resp_dm message, Follow_Up_dm message, where dm represents delay measurement.

[0119] For the PTP mechanism, the delay request message involved in the PTP mechanism and including the delay measurement identifier is called the second delay measurement request message, that is, the Pdelay_Req message including the delay measurement identifier; the delay response message involved in the PTP mechanism and including the delay measurement identifier is called the second delay measurement response message, that is, the Pdelay_Resp message including the delay measurement identifier; the delay response follow-up message involved in the PTP mechanism and including the delay measurement identifier is called the delay measurement response follow-up message, that is, the Pdelay_Resp_Follow_Up message including the delay measurement identifier. To distinguish them from the Pdelay_Resp message, Pdelay_Resp message, and Pdelay_Resp_Follow_Up message, the second delay measurement request message, the second delay measurement response message, and the delay measurement response follow-up message are respectively represented as: Pdelay_Req_dm message, Pdelay_Resp_dm message, Pdelay_Resp_Follow_Up_dm message, where dm represents delay measurement.

[0120] 1.1.2. The delay measurement identifier is located in the domain number field

[0121] When the delay measurement identifier is located in the domain number field, the delay measurement identifier indicates whether the PTP message is a delay measurement function message. In this case, the delay measurement identifier corresponds to two values, and these two values are different. One of these two values represents that the PTP message is a delay measurement function message, and the other value represents that the PTP message is not a delay measurement function message. The delay measurement identifier can take a value from these two values.

[0122] These two values can both be reserved values of the domain number field (i.e., reserved values of the domain number), such as Figure 7 As shown, the reserved values of the domain number field include 201 - 2FF. These two values can be any two values within 201 - 2FF. For example, if the delay measurement identifier is 201, the delay measurement identifier indicates that the PTP message is a delay measurement function message. If the delay measurement identifier is 202, the delay measurement identifier indicates that the PTP message is not a delay measurement function message.

[0123] Alternatively, these two values can also both be custom values other than the values already occupied in the domain number field. Among them, the values already occupied in the domain number field refer to the values already used in the related art for the domain number and the reserved values, such as Figure 7 the allowed domain number values and reserved values shown in

[0124] Alternatively, one of these two values is a reserved value of the domain number field, and the other value is the custom value. Here, this application does not limit the value taken by the delay measurement identifier in the domain number field.

[0125] In another possible implementation, there is only one value of the delay measurement identifier in the domain number field, and the value of the delay measurement identifier is a reserved value of the domain number field or the custom value. Taking the reserved value as an example, if the value in the domain number field is 201, then 201 is the delay measurement identifier, and this delay measurement identifier indicates that the PTP message is a delay measurement synchronization message. If the value in the domain number field is not 201, then the value in the domain number field is the domain number, not the delay measurement identifier. At this time, the PTP message does not include the delay measurement identifier, and this PTP message is not a delay measurement function message.

[0126] When the value taken by the delay measurement identifier is a reserved value or a custom value of the domain number field, it is possible to avoid occupying known domain number values, so that the communication device can distinguish whether the value in the domain number is the domain number or the delay measurement identifier according to the value in the domain number. When the value in the domain number is the delay measurement identifier, the communication device can determine whether the PTP message is a delay measurement function message according to the value taken by the delay measurement identifier. When the PTP message is a delay measurement function message, the communication device can also further combine the value taken by the message type identifier in the message type field to determine which delay measurement mechanism the PTP message is related to for the delay measurement function message.

[0127] 1.1.3. The delay measurement identifier is located in the identifier field

[0128] When the delay measurement identifier is located in the identifier field, the delay measurement identifier indicates whether the PTP message is a delay measurement function message. The delay measurement identifier is the value of any reserved bit in the identifier field, and the reserved bit is a bit that has not been defined in the identifier field by the related technology. For Figure 8 example, the 7th bit and the 15th bit of the identifier field are both reserved bits. Assuming that the 7th bit of the identifier field is the delay measurement identifier, when the value of the 7th bit is 1, it indicates that the PTP message is a delay measurement function message; when the value of the 7th bit is 0, it indicates that the PTP message is not a delay measurement function message.

[0129] Alternatively, the delay measurement identifier consists of the values of 2 reserved bits in the identifier field. The 2 reserved bits can be combined into 4 values such as 00, 01, 10, and 11. Any 2 of these 4 values are used as the delay measurement identifier. One of these 2 values indicates that the PTP message is a delay measurement function message, and the other value indicates that the PTP message is not a delay measurement function message. Still taking Figure 8 as an example, assuming that the values of the 7th bit and the 15th bit of the identifier field form the delay measurement identifier, when the value of the 7th bit is 1 and the value of the 15th bit is 1, it indicates that the PTP message is a delay measurement function message; when the value of the 7th bit is 1 and the value of the 15th bit is 0, it indicates that the PTP message is not a delay measurement function message.

[0130] When the delay measurement identifier is a specific value of the reserved field in the identifier field, it is possible to avoid the delay measurement identifier occupying the defined bits in the identifier field, so that the communication device can determine whether the PTP message is a delay measurement function message according to whether the reserved bit in the identifier field is the specific value. When the PTP message is a delay measurement function message, the communication device can also combine the value of the message type identifier in the message type field to determine which delay measurement mechanism the PTP message is related to. Among them, the value of the reserved field in the identifier field is the reserved value of the identifier field. When the delay measurement identifier is a specific value of the reserved field in the identifier field, the delay measurement identifier is the reserved value of the identifier field.

[0131] The above 1.1.1 takes the case where the delay measurement identifier occupies all bits of the message type field as an example, and the above 1.1.2 takes the case where the delay measurement identifier occupies all bits of the field number field as an example. In another possible implementation, when the delay measurement identifier is located in any one of the message type field and the field number field, 1 or 2 bits are extended for this field, and the extended bits are called extended bits. The extended bits can be located at the end of this field. The delay measurement identifier is represented by the value of the extended bits. The value-taking situation of the extended bits can refer to the situation where the delay measurement identifier is located in the identifier field in the above 1.1.3, and the value of the reserved bits is the delay measurement identifier, which will not be elaborated here. When the value of the extended bits is used as the delay measurement identifier, if the delay measurement identifier indicates that the PTP message is a delay measurement function message, the communication device can also combine the value of the message type identifier in the message type field to determine which delay measurement mechanism the PTP message is related to for the delay measurement function message.

[0132] The above 1.1.1 to 1.1.3 are all introduced with the delay measurement identifier located in a field in the message header as an example. In another possible implementation, the delay measurement identifier can also be located in multiple fields in the message header, such as the following 1.1.4.

[0133] 1.1.4. The delay measurement identifier includes multiple sub-identifiers, and these multiple sub-identifiers are located in at least two fields among the message type field, the field number field, and the identifier field.

[0134] In a possible implementation, the delay measurement identifier includes a first sub-identifier and a second sub-identifier, and the first sub-identifier and the second sub-identifier are located in different fields among the field number field, the message type field, and the identifier field respectively. For example, the first sub-identifier and the second sub-identifier are located in the field number field and the message type field respectively, or the first sub-identifier and the second sub-identifier are located in the identifier field and the message type field respectively, or the first sub-identifier and the second sub-identifier are located in the field number field and the identifier field respectively.

[0135] If any one of the first sub-identifier and the second sub-identifier is located in the field number field, this any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message. At this time, the value of this any one of the sub-identifiers and the meanings represented by different values can refer to the value of the delay measurement identifier in the field number field and the meanings represented by different values in the above 1.1.2, or the value of this any one of the sub-identifiers can also be the value of the extended bits of the field number field, which will not be elaborated here. For example, assuming that this any one of the sub-identifiers is located in the field number field and this any one of the sub-identifiers is the reserved value 201 of the field number field, this any one of the sub-identifiers indicates that the PTP message is a delay measurement function message.

[0136] If any of the sub-identifiers is located in the message type field, the sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. At this time, the value of the sub-identifier and the meanings represented by different values can refer to the values of the delay measurement identifier in the message type field and the meanings represented by different values in 1.1.1 above. Alternatively, the value of the sub-identifier can be the value of the extended bit of the message type field, which will not be elaborated here. For example, assuming that the sub-identifier is the reserved value 4, 5, or 6 of the message type field, the second sub-identifier indicates that the PTP message is a Pdelay_Req_dm message, a Pdelay_Resp_dm message, or a Pdelay_Resp_Follow_Up_dm message, respectively. Although the sub-identifier indicates that the PTP message is a delay measurement type identifier at this time, whether the PTP message is a delay measurement type identifier depends on another sub-identifier.

[0137] If any of the sub-identifiers is located in the identifier field, the sub-identifier indicates whether the PTP message is a delay measurement function message. At this time, the value of the sub-identifier and the meanings represented by different values can refer to the values of the delay measurement identifier in the identifier field and the meanings represented by different values in 1.1.3 above, which will not be elaborated here. For example, assuming that the 7th bit of the identifier field is the sub-identifier, when the value of the 7th bit is 1, it indicates that the PTP message is a delay measurement function message, and when the value of the 7th bit is 0, it indicates that the PTP message is not a delay measurement function message.

[0138] For this implementation method, when both the first sub-identifier and the second sub-identifier indicate that the PTP message is a delay measurement function message, the delay measurement identifier indicates that the PTP message is a delay measurement function message. For example, assume that the first sub-identifier is located in the domain number field and the second sub-identifier is located in the message type field. When the first sub-identifier is the reserved value 201 of the domain number field and the second sub-identifier is the reserved value 4 of the message type field, the delay measurement identifier indicates that the PTP message is a delay measurement function message. When at least one of the first sub-identifier and the second sub-identifier indicates that the PTP message is not a delay measurement function message, the delay measurement identifier indicates that the PTP message is not a delay measurement function message. For example, assume that the reserved value 201 of the domain number field is the first sub-identifier, and the reserved value 201 indicates that the PTP message is a delay measurement function message. Assume that the reserved value 4 of the message type field is the second sub-identifier, and the reserved value 4 indicates that the PTP message is a delay measurement function message and the message type of the PTP message is Pdelay_Req. Based on this, when the value in the domain number field is not the reserved value 201 and the value in the message type field is the reserved value 4, since the value in the domain number field is not the reserved value 201, the delay measurement identifier jointly represented by the first sub-identifier and the second sub-identifier indicates that the PTP message is not a delay measurement function message. Then, based on the indication of the reserved value 4 in the message type field, it can be known that the PTP message is a Pdelay_Req message.

[0139] In another possible implementation method, the delay measurement identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier. Among them, the first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message. At this time, the value of the first sub-identifier and the meanings represented by different values can refer to the value of the delay measurement identifier in the domain number field and the meanings represented by different values in 1.1.2 above. Or, the value of the first sub-identifier can also be the value of the extended bit of the domain number field, which will not be elaborated here. The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. At this time, the value of the second sub-identifier and the meanings represented by different values can refer to the value of any sub-identifier located in the message type field and the meaning represented by it, which will not be elaborated here. The third sub-identifier is located in the identifier domain field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message. At this time, the value of the third sub-identifier and the meanings represented by different values can refer to the value of the delay measurement identifier in the identifier domain field and the meanings represented by different values in 1.1.3 above, which will not be elaborated here.

[0140] For this implementation method, when the first sub-identifier, the second sub-identifier, and the third sub-identifier all indicate that the PTP message is a delay measurement function message, the delay measurement identifier indicates that the PTP message is a delay measurement function message; when at least one of the first sub-identifier, the second sub-identifier, and the third sub-identifier indicates that the PTP message is not a delay measurement function message, the delay measurement identifier indicates that the PTP message is not a delay measurement function message.

[0141] 1.2. Message body 402

[0142] The structures of the message bodies 402 of the delay measurement messages involved in different delay measurement mechanisms are different. Next, the structures of the message bodies 402 of the delay measurement messages involved in the PTP mechanism and the ETE mechanism are introduced separately in 1.2.1 and 1.2.2 below.

[0143] 1.2.1. Message body 402 of the delay measurement message involved in the PTP mechanism

[0144] Figure 9 is a schematic diagram of the structures of the various delay measurement messages involved in the PTP mechanism provided by the embodiments of the present application. As Figure 9 shown, the message body 402 of the Pdelay_Req_dm message includes the following fields:

[0145] Source timestamp (originTimestamp) field: used to store the source timestamp, and the source timestamp is 0;

[0146] Reserved field: with a value of 0 to facilitate further expansion of the functions of the Pdelay_Req_dm message based on the reserved field in the future.

[0147] The message body 402 of the Pdelay_Resp_dm message includes the following fields:

[0148] Request receipt timestamp (requestReceiptTimestamp) field: used to store the request receipt timestamp. In the one-step method mode of the PTP mechanism, the value of the request receipt timestamp is the duration for the communication device that sends the Pdelay_Resp_dm message to respond to the Pdelay_Req_dm, that is, the processing duration of the Pdelay_Req_dm in this communication device; in the two-step method mode of the PTP mechanism, the request receipt timestamp is the timestamp of the reception time of the Pdelay_Req_dm message. In the present application, the reception time of any PTP message refers to the time when the communication device receives the PTP message;

[0149] Requesting Port Identity field: used to store the requesting port identity, which is the identity of the port that sends the Pdelay_Resp_dm message in response to the Pdelay_Req_dm message.

[0150] The message body 402 of the Pdelay_Resp_Follow_Up_dm message includes the following fields:

[0151] Response Origin Timestamp field: used to store the response origin timestamp. In the two-step mode of the PTP mechanism, the response origin timestamp is the timestamp of the sending time of the Pdelay_Resp_dm message that the Pdelay_Resp_Follow_Up_dm message follows. In this application, the sending time of any PTP message refers to the time when the communication device that generates the PTP message sends the PTP message.

[0152] Requesting Port Identity field: used to store the requesting port identity, which is the identity of the port that sends the Pdelay_Resp_dm message.

[0153] 1.2.2. Message body 402 of the delay measurement message involved in the ETE mechanism

[0154] Figure 10 It is a schematic structural diagram of a delay measurement message involved in the ETE mechanism provided by an embodiment of this application. As Figure 10 shown, the message body 402 of the Sync_dm message includes the following fields:

[0155] Origin Timestamp field: used to store the origin timestamp. In the one-step mode of the ETE mechanism, the origin timestamp is the timestamp of the sending time of the Sync_dm message. In the two-step mode of the ETE mechanism, the value of the origin timestamp is 0.

[0156] The message body 402 of the Delay_Req_dm message includes the following fields:

[0157] Origin Timestamp field: used to store the origin timestamp, and the value of the origin timestamp is 0.

[0158] The message body 402 of the Follow_Up_dm message includes the following fields:

[0159] Precise Origin Timestamp field: used to store the precise origin timestamp, which is the timestamp of the sending time of the Sync_dm message that the Follow_Up_dm message follows.

[0160] The message body 402 of the Delay_Resp_dm message includes the following fields:

[0161] Response Origin Timestamp field: used to store the response origin timestamp, which is the timestamp of the receiving time of the Delay_Req_dm message that the Delay_Resp_dm message responds to;

[0162] Requesting Port Identity field: used to store the requesting port identity, which is the identity of the port that receives this Delay_Resp_dm message.

[0163] The above Figure 9 and Figure 10 The message headers of various time measurement messages shown in can all be the message header 401 including the delay measurement identifier.

[0164] 1.3. Suffix 403

[0165] Among them, the suffix 403 can be Figure 11 Any one of the type length Value (TLV) shown. The suffix 403 is an optional item in the PTP message 400 and is located at the end of the PTP message 400. In another possible implementation, the PTP message 400 may also not include the suffix 403.

[0166] When the delay measurement identifier is located in the suffix 403, the delay measurement identifier is located in the delay measurement type length Value (TLV), and the delay measurement TLV is the suffix 403. As described in 1.3.1 and 1.3.2 below, the delay measurement TLV can be a reserved TLV or a vendor TLV supported by the PTP message 400. Using this reserved TLV or vendor TLV to carry the delay measurement identifier avoids the delay measurement identifier occupying other fields in the PTP message 400 and can avoid interference with other fields.

[0167] 1.3.1. The delay measurement TLV is a reserved TLV supported by the PTP message 400

[0168] At this time, the delay measurement TLV can be Figure 11Any reserved TLV supported by the PTP message shown, such as the reserved TLV corresponding to the value of the tlv type (Type) being 000A - 1FFF, or the reserved TLV corresponding to the value of TLVType being FFF0 - FFFF.

[0169] Taking this reserved TLV as the delay measurement TLV as an example, as Figure 12 shown, the delay measurement TLV1200 includes the following fields:

[0170] The tlvType field: used to store the tlvType identifier of the delay measurement TLV. The tlvType identifier indicates that the TLV where it is located is a reserved TLV. Assuming the TLV where it is located is the reserved TLV corresponding to 000A - 1FFF, the value of the TLV type identifier is any value in 000A - 1FFF;

[0171] The length field (lengthField) field: used to store the length of the value field of the delay measurement TLV1200;

[0172] The data field (dataField) field: used to store the data announced by the delay measurement TLV1200.

[0173] The delay measurement identifier is located in the tlvType field of the delay measurement TLV1200. At this time, the delay measurement identifier is the tlvType identifier of the delay measurement TLV1200. At this time, this delay measurement identifier is also used to indicate that the TLV type of the TLV where it is located is the delay measurement TLV. The PTP message 400 including the delay measurement TLV is the delay measurement function message. If the PTP message 400 does not include the delay measurement TLV, the PTP message 400 is not the delay measurement function message.

[0174] In the case where the delay measurement identifier is located in the TLV type field of the delay measurement TLV1200, the delay measurement identifier also indicates the message type of this PTP message. In a possible implementation, this delay measurement identifier corresponds to multiple values, and these multiple values are different. These multiple values correspond to different message types, and the message types corresponding to these multiple values are the message types of the PTP messages involved in at least one delay measurement mechanism. Taking the PTP mechanism as an example, assuming these multiple values are the reserved values {000A, 000B, 000C} of the tlvType field, as Figure 12As shown, the message types corresponding to 000A, 000B, and 000C are Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up respectively. If the delay measurement identifier is 000A, then the PTP message 400 is a Pdelay_Req_dm message. If the delay measurement identifier is 000B, then the PTP message 400 is a Pdelay_Resp_dm message. If the delay measurement identifier is 000C, then the PTP message 400 is a Pdelay_Resp_Follow_Up_dm message. Taking the ETE mechanism as an example, assume that these multiple values are the reserved values of the tlvType field {000C, 000D, 000E, 000F}. Among them, the message types corresponding to 000C, 000D, 000E, and 000F are Sync, Delay_Req, Delay_Resp, and Follow_Up respectively. If the delay measurement identifier is 000C, then the PTP message 400 is a Sync_dm message. If the delay measurement identifier is 000D, then the PTP message 400 is a Delay_Req_dm message. If the delay measurement identifier is 000E, then the PTP message 400 is a Delay_Resp_dm message. If the delay measurement identifier is 000F, then the PTP message 400 is a Follow_Up_dm message.

[0175] The data announced by the value field in the delay measurement TLV1200 depends on the message type indicated by the delay measurement identifier in the tlvType field. The announced data includes the message body 402 of the delay measurement function message of this message type. As Figure 12 shown, if the delay measurement identifier is 00A, indicating a Pdelay_Req_dm message, then the value field includes the message body 402 of the Pdelay_Req_dm message as shown in Figure 9 . If the delay measurement identifier is 00B, indicating a Pdelay_Resp_dm message, then the value field includes the message body 402 of the Pdelay_Resp_dm message as shown in Figure 9 . If the delay measurement identifier is 00C, indicating a Pdelay_Resp_Follow_Up_dm message, then the value field includes the message body 402 of the Pdelay_Resp_Follow_Up_dm message as shown in Figure 9 . If the message type indicated by the delay measurement identifier is a message type involved in the ETE mechanism, the data announced by the value field includes the message body 402 of the delay measurement function message involved in the ETE mechanism, which will not be elaborated here.

[0176] 1.3.2. The delay measurement TLV is a vendor TLV supported by the PTP message 400

[0177] At this time, the delay measurement TLV can be Figure 11 any vendor TLV supported by the PTP message shown, for example, the ORGANIZATION_EXTENSION_PROPAGATE TLV with a tlv type value of 4000 for broadcasting.

[0178] Taking the vendor TLV as the delay measurement TLV as an example, as Figure 13 shown, the delay measurement TLV 1300 includes the following fields:

[0179] TLV type field: Used to store the tlvType identifier of the delay measurement TLV. The tlvType identifier indicates that the TLV where it is located is a vendor TLV. For example, the value of the TLV type identifier is 4000;

[0180] Length field: Used to store the length of the value field of the delay measurement TLV 1200;

[0181] Organization ID field: Used to store the organization ID, which is the identifier of the delay measurement TLV applied to the vendor;

[0182] Organization subtype field: Used to store the subtype identifier within the range of the organization ID field. The value of the subtype identifier is assigned by the vendor or standard organization identified by the organization ID;

[0183] Data field: Used to store the data advertised by the delay measurement TLV 1300.

[0184] The delay measurement identifier is located in the tlvType field of the delay measurement TLV 1300. At this time, the delay measurement identifier is the tlvType identifier of the delay measurement TLV 1300. The value of the delay measurement identifier is the reserved value of the tlvType field of the delay measurement TLV 1300. Since there is only one reserved value in the tlvType field of the delay measurement TLV 1300, at this time, the delay measurement identifier only indicates that the PTP message is a delay function measurement message, and the message type is indicated by the message type identifier in the message header 402 of the PTP message. For example, if the delay measurement identifier in the delay measurement TLV 1300 is 4000 and the message type identifier in the message header 402 is 0 (indicating the message type Sync), then the PTP message 400 is a Sync_dm message.

[0185] The data announced by the data field in the delay measurement TLV1300 depends on the message type indicated by the message type identifier in the message header 402. Exemplarily, the data announced by the data field in the delay measurement TLV1300 includes the message body 402 of the delay measurement function message of this message type. Similar to the data field of the delay measurement TLV1200, it will not be elaborated here.

[0186] II. The second message format of the PTP message

[0187] Figure 14 is a schematic diagram of a PTP message with a second message format provided by an embodiment of the present application. As Figure 14 shown, the PTP message 1400 includes a message type (messageType) field 1401 and multiple timestamp fields 1402. The delay measurement identifier is located in the message type field 1401. The multiple timestamp fields 1402 correspond to different delay measurement function messages, and each timestamp field 1402 is used to store the timestamp of the corresponding delay measurement function message.

[0188] Among them, the multiple timestamp fields 1402 correspond to the same delay measurement mechanism, and the multiple timestamp fields 1402 are the timestamp fields in each delay measurement function message under the corresponding delay measurement mechanism. As Figure 14 shown, taking the PTP mechanism as an example, the multiple timestamp fields 1402 are respectively the source timestamp field in the Pdelay_Req_dm message, the request reception timestamp field in the Pdelay_Resp_dm message, and the response source timestamp field in the Pdelay_Resp_Follow_Up_dm message. Taking the ETE mechanism as an example, the multiple timestamp fields 1402 are respectively the source timestamp field in the Sync_dm message, the source timestamp field in the Delay_Req_dm message, the response source timestamp field in the Delay_Resp_dm message, and the precise source timestamp field in the Follow_Up_dm message.

[0189] In a possible implementation, the PTP message 1400 further includes at least one non-timestamp field 1403. The non-timestamp field 1403 is a field other than the timestamp field in the message body 402 of each delay measurement function message under the corresponding delay measurement mechanism. As Figure 14 shown, taking the PTP mechanism as an example, the non-timestamp field 1403 is the request port identifier field in the Pdelay_Resp_dm message and the request port identifier field in the Pdelay_Resp_Follow_Up_dm.

[0190] The lengths of the timestamp fields 1402 and the non-timestamp fields 1403 in the same PTP message 1400 may be the same. For example, the length of each timestamp field 1402 and the length of each non-timestamp field 1403 are both 10 bytes. Alternatively, the lengths of the timestamp field 1402 and the non-timestamp field 1403 are different, and here, the lengths of the timestamp field 1402 and the non-timestamp field 1403 are not limited.

[0191] Figure 14 The arrangement of the timestamp field 1402 and / or the non-timestamp field 1403 in the PTP message 1400 is an example. The timestamp field 1402 and / or the non-timestamp field 1403 may also be arranged in other ways in the PTP message 1400. Here, the arrangement of the timestamp field 1402 and / or the non-timestamp field 1403 in the PTP message 1400 is not limited.

[0192] The message type field 1401 may be the message type field in the message header 401 of the PTP message 400. The delay measurement identifier is located in the message type field as the message type identifier. The value-taking method of the delay measurement identifier and the definition of each value of the delay measurement identifier can refer to the delay measurement identifier when the delay measurement identifier is located in the message type field in 1.1.1. The difference is that in the PTP message 400, the value of the delay measurement identifier can be 2. One value (such as 4) indicates that the PTP message 400 is a delay measurement function message in the PTP mechanism, and the other value (such as 5) indicates that the PTP message 400 is a delay measurement function message in the ETE mechanism.

[0193] Next, based on the communication system 100 introduced above, a detailed introduction to the processing method of the PTP message (such as the PTP message 400 or the PTP message 1400) introduced above is given.

[0194] Figure 15 is a flowchart of a processing method of a PTP message provided by an embodiment of the present application. This method is implemented through information interaction between a first communication device and a second communication device. The second communication device is any communication device in the communication system 100. For example, the second communication device is any communication device in the P2P network in the communication system 100. For another example, the second communication device is any service-bearing device in the underlay network in the communication system 100. The first communication device is a communication device directly connected to the second communication device in the communication system 100. For example, Figure 1 the communication device 101 in Figure 2 and Figure 3The communication device 101 therein is the second communication device, and the service bearer device 110 is the first communication device. The method includes the following steps.

[0195] 1501. The second communication device obtains a PTP message, which includes an identifier indicating whether the PTP message is a delay measurement function message.

[0196] Wherein, the PTP message is any one of the PTP messages 400 or any one of the PTP messages 1400 introduced above. Here, the message format of the PTP message is not limited. The identifier in the PTP message refers to the delay measurement identifier introduced above. The PTP message may be a PTP message sent by a fourth communication device in the communication system to the second communication device, or a PTP message generated by the second communication device.

[0197] Taking the PTP message sent by the fourth communication device as an example, the process of obtaining the PTP message is introduced as follows.

[0198] Wherein, the fourth communication device is a communication device directly connected to the second communication device in the communication system 100. For example, Figure 1 the communication device 101 therein is the fourth communication device, and the communication device 102 is the second communication device. Or, Figure 2 and Figure 3 the communication device 101 therein is the fourth communication device, and the service bearer device 110 is the second communication device.

[0199] The fourth communication device obtains the PTP message. Wherein, the process of the fourth communication device obtaining the PTP message is the same as that of the second communication device obtaining the PTP message. The fourth communication device sends the obtained PTP message to the second communication device, and the second communication device receives the PTP message from the fourth communication device, thereby obtaining the PTP message. After receiving the PTP message from the fourth communication device, the second communication device processes the PTP message based on the identifier in the PTP message. The processing process can refer to the process of the first communication device processing the PTP message based on the identifier in the PTP message in step 1504 below, which will not be elaborated here.

[0200] Taking the PTP message generated by the second communication device as an example, the process of obtaining the PTP message is introduced as follows.

[0201] In the time synchronization scenario, the second communication device can be any communication device in the communication system 100, and the PTP message generated by the second communication device is not a delay measurement function message. For example, the second communication device generates a PTP message based on the local clock according to the above first message format. The identifier in the PTP message indicates that the PTP message is not a delay measurement function message, and this identifier is located in the message header of the PTP message. Alternatively, the second communication device generates a PTP message according to the above first message format. The PTP message does not include a delay measurement TLV and the message header of the PTP message does not include this identifier. At this time, the PTP message is not a delay measurement function message but a synchronization function message.

[0202] In the delay measurement scenario, assume that the second communication device is not a service-bearing device. For example, the second communication device is a communication device within the P2P network in the communication system 100. Assume further that the second communication device uses a measurement mode under a certain delay measurement mechanism to measure the link transmission delay between the second communication device and the adjacent communication device in the P2P network. Then the second communication device generates a PTP message according to the first message format or the second message format. Among them, the identifier in the PTP message indicates that the PTP message is a delay measurement function message. At this time, the message type of the PTP message depends on the measurement mode under this delay measurement mechanism. For example, assume that the measurement mode is the one-step method mode or the two-step method mode under the PTP mechanism, and the second communication device is a delay measurement request end. The PTP message is a Pdelay_Req_dm message, that is, the second delay measurement request message. For another example, assume that the measurement mode is the one-step method mode or the two-step method mode under the ETE mechanism, and the second communication device is a delay measurement request end. The PTP message is a Sync_dm message, that is, a delay measurement synchronization message.

[0203] In the delay measurement scenario, the second communication device performs delay measurement based on the generated PTP message. The process of the second communication device performing delay measurement is introduced below Figures 17 to 20 and will not be elaborated here.

[0204] 1502. The second communication device sends a PTP message.

[0205] For example, the second communication device sends the PTP message to the first communication device.

[0206] 1503. The first communication device obtains the PTP message from the second communication device.

[0207] After obtaining the PTP message, the first communication device parses the PTP message, obtains the identifier from the PTP message, and then processes the PTP message based on the identifier as in step 1504 below.

[0208] 1504. The first communication device processes the PTP message based on the identifier in the PTP message.

[0209] Among them, the PTP message may or may not be a delay measurement function message. The first communication device determines whether the PTP message is a delay measurement function message based on the indication of the identifier. For example, if the identifier indicates that the PTP message is a delay measurement function message, it is determined that the PTP message is a delay measurement function message; if the identifier indicates that the PTP message is not a delay measurement function message, it is determined that the PTP message is not a delay measurement function message but a synchronization function message.

[0210] The first communication device may or may not be a service bearer device. The processing method of the PTP message by the first communication device depends on two aspects. One aspect is whether the PTP message is a delay measurement function message, and the other aspect is whether the first communication device is a service bearer device. Next, taking Figure 16 as an example, the processing method of the PTP message will be introduced.

[0211] As Figure 16 shown, for the PTP message sent by the second communication device, when the first communication device is a service bearer device, if the PTP message is a delay measurement function message, then the PTP message is a service message in the delay measurement scenario, and the first communication device sends the PTP message. For example, the first communication device sends the PTP message to the third communication device, and the third communication device processes the PTP message based on the identifier in the PTP message. Among them, the third communication device is a communication device directly connected to the first communication device in the communication system 100. The third communication device may or may not be a service bearer device. For example, taking Figure 2 and Figure 3 as an example, the service bearer device 110 is the first communication device, and the service bearer device 120 is the third communication device, or the service bearer device 120 is the first communication device, and the communication device 102 is the third communication device. The process of the third communication device processing the PTP message based on the identifier in the PTP message is the same as the process of the first communication device processing the PTP message based on the identifier in the PTP message, which will not be elaborated here.

[0212] As Figure 16 shown, when the first communication device is a service bearer device, if the PTP message is not a delay measurement function message, the first communication device terminates the processing of the PTP message. Still taking Figure 2 and Figure 3For example, assume that the communication device 101 is the second communication device and the service bearer device 110 is the first communication device. If the PTP message sent by the communication device 101 is not a delay measurement function message, the service bearer device 110 terminates the delay measurement function message.

[0213] As Figure 16 shown, when the first communication device is not a service bearer device, if the PTP message is not a delay measurement function message, the first communication device terminates the PTP message. Still taking Figure 2 and Figure 3 as an example, assume that the service bearer device 120 is the second communication device and the communication device 102 is the first communication device. The service bearer device 120 sends a PTP message to the communication device 102. If the PTP message is not a delay measurement function message but a synchronization function message, the communication device 102 terminates the PTP message. Taking Figure 1 as an example again, assume that the communication device 101 is the second communication device and the communication device 102 is the first communication device. The communication device 101 sends a PTP message to the communication device 102. If the PTP message is not a delay measurement function message but a synchronization function message, the communication device 102 terminates the PTP message.

[0214] When the first communication device is not a service bearer device, if the PTP message is a delay measurement function message, the first communication device performs delay measurement based on the PTP message to measure the link transmission delay between the first communication device and the PTP message generation device. The PTP message generation device refers to the device that generates the PTP message. Still taking Figures 1 - 3 as an example, assume that the PTP message is a delay measurement function message generated by the communication device 101 and the first communication device is the communication device 102. Then the communication device 101 is the PTP message generation device, and the communication device 102 performs delay measurement based on the PTP message.

[0215] When the first communication device is not a service bearer device, if the PTP message is a delay measurement function message, the first communication message determines the delay measurement mechanism and delay measurement mode to which the PTP message belongs according to the message type of the PTP message, and performs delay measurement according to the delay measurement mode to which the PTP message belongs. Still taking Figure 16For example, if the message type of the PTP message is Pdelay_Req_dm, then the PTP message is a Pdelay_Req_dm message, and the delay measurement mechanism to which the PTP message belongs is the PTP mechanism. If the message type of the PTP message is Sync_dm, then the PTP message is a Sync_dm message, and the delay measurement mechanism to which the PTP message belongs is the ETE mechanism. For the delay measurement mechanism to which the PTP message belongs, if the first communication device enables the one-step method mode under this delay measurement mechanism, then the PTP message is configured for one-step method processing, and the first communication device processes the PTP message according to the one-step method mode under this delay measurement mechanism. If the first communication device enables the two-step method mode under this delay measurement mechanism, then the PTP message is configured for two-step method processing, and the first communication device processes the PTP message according to the two-step method mode under this delay measurement mechanism. The same delay measurement mode under different measurement mechanisms has different processing methods for PTP messages. Subsequently, in combination with Figures 17 - 20 each delay measurement mode under the PTP mechanism and each delay measurement mode under the ETE mechanism, the processing methods of PTP messages will be introduced and will not be elaborated here.

[0216] For the PTP message from the second communication device, the above takes determining whether the PTP message is a delay measurement function message according to the indication of the identifier in the PTP message as an example to introduce the processing process of the PTP message. In another possible implementation, the first communication device determines whether the PTP message is a delay measurement function message according to whether the identifier exists in the PTP message. At this time, the identifier indicates that the PTP message is a delay measurement function message. Exemplarily, the first communication device queries whether the identifier exists in the PTP message. If the identifier exists in the PTP message, it is determined that the PTP message is a delay measurement function message. If the identifier does not exist in the PTP message, it is determined that the PTP message is not a delay measurement function message. Among them, the process of querying the identifier is as follows. For example, the first communication device first queries whether the identifier exists in the message header. If the identifier exists in the message header, the identifier is obtained from the message header. If the identifier does not exist in the message header, the first communication device compares the message length in the message length field of the message header with the actual length of the PTP message. If the message length in the message length field is less than the actual length of the PTP message, it means that there is a TLV as a suffix at the end of the PTP message. If the TLV is a delay measurement TLV, the value in the tlvType field of the delay measurement TLV is the identifier. If the TLV is not a delay measurement TLV, it means that the identifier does not exist in the PTP message. For this implementation, after determining whether the PTP message is a delay measurement function message, the first communication device then processes the PTP message according to whether the PTP message is a delay measurement function message. For example, if the PTP message is a delay measurement function message, the first communication device processes the PTP message according to the processing method of the delay measurement function message in Figure 16 If the PTP message is not a delay measurement function message, the first communication device processes the PTP message according to the processing method of the non-delay measurement function message in Figure 16 .

[0217] The above is described by taking the step of the first communication device determining whether the PTP message is a delay measurement function message as an example. In another possible implementation manner, the first communication device does not need to execute the step of determining whether the PTP message is a delay measurement function message, and processes the PTP message according to the indication of the identifier in the PTP message, or whether the identifier exists in the PTP message. Taking the identifier in the PTP message being used to indicate whether the PTP message is a delay measurement function message as an example, if the identifier indicates that the PTP message is a delay measurement function message, the first communication device processes the PTP message as a delay measurement function message; if the identifier indicates that the PTP message is not a delay measurement function message, the first communication device processes the PTP message as a synchronization function message. Taking the identifier in the PTP message indicating that the PTP message is a delay measurement function message as an example again, if the PTP message includes the identifier, the first communication device processes the PTP message as a delay measurement function message; if the PTP message does not include the identifier, the first communication device processes the PTP message as a synchronization function message.

[0218] Figure 15 The method shown indicates whether the PTP message is a delay measurement function message through the identifier in the PTP message, so that the communication device receiving the PTP message can process the PTP message based on the indication of the identifier. Since the communication device can process the delay measurement function message, the communication device can support the delay measurement function.

[0219] Regarding step 1504 above, when the PTP message obtained by the first communication device is a delay measurement function message, assuming that the second communication device is the generating device of the PTP message, the first communication device is an adjacent communication device of the second communication device in the PTP network, the second communication device is a delay measurement request end, and the first communication device acts as a delay measurement response end, and performs delay measurement with the second communication device based on the PTP message. This PTP message may be a delay measurement function message involved in the PTP mechanism or a delay measurement function message involved in the PTP mechanism. Under different delay measurement mechanisms, the process of the first communication device performing delay measurement with the second communication device based on this PTP message is different. Next, through the following delay measurement process 1 to measurement process 2, the processes of performing delay measurement using the one-step mode and the two-step mode under the PTP mechanism are introduced respectively, and through the following delay measurement process 3 to measurement process 4, the processes of performing delay measurement using the one-step mode and the two-step mode under the ETE mechanism are introduced respectively.

[0220] Measurement process 1: Using the one-step mode under the PTP mechanism, perform delay measurement based on this PTP message. At this time, the PTP message received by the first communication device is the second delay measurement request message, that is, the Pdelay_Req_dm message.

[0221] Figure 17 It is a flowchart of PTP message interaction between adjacent communication devices in the single-step mode of the PTP mechanism provided by an embodiment of the present application. The process includes the following steps.

[0222] 1701. The second communication device sends a second delay measurement request message.

[0223] Among them, the second delay measurement request message can be any of the above-described Pdelay_Req_dm messages. For example, the PTP message 400 with the delay measurement identifier located in the message header 401, where the delay measurement identifier indicates that the PTP message is a Pdelay_Req_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Pdelay_Req_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 4 in the message type field.

[0224] The second communication device uses 0 as the source timestamp in the Pdelay_Req_dm message and generates a second delay measurement request message according to the first message format or the second message format, and sends the second delay measurement request message (for example, sends the second delay measurement request message to the first communication device). The second delay measurement request message includes the source timestamp and an identifier indicating that the PTP message is a delay measurement function message.

[0225] In the PTP mechanism, the delay measurement request end is responsible for determining the link transmission delay between the delay measurement request end and the delay measurement response end. The second communication device serves as the delay measurement request end, and the second communication device also stores the sending timestamp of the second delay measurement request at its own end. This sending timestamp indicates the time when the second communication device sends the second delay measurement request, that is, the sending time of this second delay measurement request (for example, t1).

[0226] 1702. The first communication device obtains the second delay measurement request message and, in response to the second delay measurement request message, sends a second delay measurement response message.

[0227] Among them, the second delay measurement response message can be any of the above-described Pdelay_Resp_dm messages. For example, the PTP message 400 with the delay measurement identifier located in the message header 401, where the delay measurement identifier indicates that the PTP message is a Pdelay_Resp_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Pdelay_Resp_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 4 in the message type field.

[0228] After receiving the second delay measurement request message, the first communication device uses the time when it receives the second delay measurement request message as the reception time of the second delay measurement request message, and uses the time when it sends the second delay measurement response message as the transmission time of the second delay measurement response message. The first communication device determines the processing duration of the second delay measurement request message at its end as the time duration between the transmission time of the second delay measurement response message and the reception time of the second delay measurement request message. For example, if the reception time of the second delay measurement request message is t2 and the transmission time of the second delay measurement response message is t3, the processing duration = t3 - t2.

[0229] The first communication device uses this processing duration as the request reception timestamp in the Pdelay_Resp_dm message, and uses the identifier of the port at its end for sending the second delay measurement response message as the request port identifier in the Pdelay_Resp_dm message. According to the first message format or the second message format, the first communication device generates a second delay measurement response message and sends the second delay measurement response message (for example, sends the second delay measurement response message to the second communication device). The second delay measurement response message includes the request reception timestamp, the request port identifier, and an identifier indicating that the PTP message is a delay measurement function message.

[0230] The second communication device receives the second delay measurement response message, and obtains the request reception timestamp of the second delay measurement request message from the second delay measurement response message. The second communication device also uses the time when it receives the second delay measurement response message as the reception time of the second delay measurement response message, and obtains the reception timestamp of the second delay measurement response message based on this reception time. This reception timestamp is used to indicate this reception time. In this way, during this delay measurement process, the timestamps obtained by the second communication device are: the transmission timestamp of the second delay measurement request message, the request reception timestamp in the second delay measurement response request message, and the reception timestamp of the second delay measurement response message.

[0231] The second communication device determines the link transmission delay between the first communication device and the second communication device based on the timestamp of the second delay measurement request message and / or the timestamp of the second delay measurement response message. The link transmission delay can be a one-way link transmission delay or an average link transmission delay.

[0232] The single-step method mode of the PTP mechanism is applicable to measuring the average link transmission delay. For example, the second communication device determines the average link transmission delay according to the following formula (1) based on the reception timestamp of the second delay measurement response request message, the request reception timestamp in the second delay measurement response request message, and the reception timestamp of the second delay measurement response message.

[0233]

[0234] Among them, is the average link transmission delay, t1 is the transmission time indicated by the transmission timestamp of the second delay measurement request, t3 - t2 is the processing duration of the first delay measurement request indicated by the receive timestamp of this request, and t4 is the receive time indicated by the receive timestamp of the second delay measurement response.

[0235] The two-step mode of the PTP mechanism is applicable to measuring the average link transmission delay and the one-way link transmission delay. The following will be introduced in combination with Figure 18 and will not be elaborated here.

[0236] In Figure 17 the application embodiment shown, the steps performed by the second communication device, that is, the process of the second communication device performing delay measurement based on the second delay measurement request message, and the steps performed by the first communication device, that is, the process of the first communication device performing delay measurement based on the second delay measurement request message. Through the above process, the link transmission delay between the first communication device and the second communication device can be measured.

[0237] Measurement process 2: Using the two-step mode of the PTP mechanism, perform delay measurement based on this PTP message. At this time, the PTP message received by the first communication device is the second delay measurement request message, that is, the Pdelay_Req_dm message.

[0238] Figure 18 This is the PTP message interaction flowchart between adjacent communication devices in the two-step mode of the PTP mechanism provided by the application embodiment. This process includes the following steps.

[0239] 1801. The second communication device sends a second delay measurement request message.

[0240] Among them, this step 1801 is the same as step 1701 and will not be elaborated here.

[0241] 1802. The first communication device obtains the second delay measurement request message and, in response to the second delay measurement request message, sends a second delay measurement response message.

[0242] Among them, this step 1802 is the same as step 1702. The difference is that in this step 1802, when generating the second delay measurement request message, the first communication device obtains the request receive timestamp in the second delay measurement response message based on the receive time of the second delay measurement request. At this time, the time indicated by the request receive timestamp is the receive time of the second delay measurement request, not the processing duration of the second delay measurement request in the first communication device. The receive time of the second delay measurement request refers to the time when the first communication device obtains the first delay measurement request (such as t2).

[0243] The difference is also that, after sending the second delay measurement response message, the first communication device further performs the following step 1803.

[0244] 1803. The first communication device sends a delay measurement response follow-up message for the second delay measurement response message.

[0245] Among them, the delay measurement response follow-up message can be any one of the Pdelay_resp_follow_up_dm messages introduced above. For example, the PTP message 400 with the delay measurement identifier located in the message header 401, and the delay measurement identifier indicates that the PTP message is a Pdelay_resp_follow_up_dm message. Or, the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Pdelay_resp_follow_up_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 4 in the message type field.

[0246] The first communication device uses the time when the second delay measurement response message is sent as the sending time of the second delay measurement response message. Based on this sending time, it determines the response source timestamp in the Pdelay_resp_follow_up_dm message, uses the identifier of the port where the first communication device sends the second delay measurement response message as the request port identifier in the Pdelay_resp_follow_up_dm message, generates a delay measurement response follow-up message according to the first message format or the second message format, and sends the delay measurement response follow-up message (for example, sends the delay measurement response follow-up message to the second communication device). Among them, the delay measurement response follow-up message includes the accurate source timestamp, the request port identifier, and an identifier indicating that the PTP message is a delay measurement function message, and the response source timestamp indicates the sending time of the second delay measurement response message (such as t3).

[0247] The second communication device first obtains a second time delay measurement response message, and then obtains a time delay measurement response follow-up message. After obtaining the second time delay measurement response message, the second communication device uses the acquisition request reception timestamp in the second time delay measurement response message as the reception timestamp of the second time delay measurement request message, and stores the reception timestamp of the second time delay measurement request at its own end. After obtaining the time delay measurement response follow-up message, the second communication device uses the response source timestamp in the time delay measurement response follow-up message as the reception timestamp of the second time delay measurement response message, and stores the reception timestamp of the second time delay measurement response message at its own end. During this time delay measurement process, the timestamps obtained by the second communication device are: the transmission timestamp and reception timestamp of the second time delay measurement request, and the transmission timestamp and reception timestamp of the second time delay measurement response message. The second communication device can determine the link transmission delay between the first communication device and the second communication device based on the timestamp of the second time delay measurement request and / or the timestamp of the second time delay measurement response message.

[0248] Taking this link transmission delay as the average link transmission delay as an example, the second communication device determines the average link transmission delay according to the above formula (1) based on the transmission timestamp and reception timestamp of the second time delay measurement request and the transmission timestamp and reception timestamp of the second time delay measurement response message. At this time, t2 and t3 in the above formula (1) are respectively the reception time indicated by the reception timestamp of the second time delay measurement request and the transmission time indicated by the transmission timestamp of the second time delay measurement response message.

[0249] Taking this link transmission delay as the one-way link transmission delay as an example, the second communication device determines the one-way link transmission delay according to the following formula (2) based on the transmission timestamp and reception timestamp of the second time delay measurement request Alternatively, the second communication device determines the one-way link transmission delay according to the following formula (3) based on the transmission timestamp and reception timestamp of the second time delay measurement response message

[0250]

[0251]

[0252] In Figure 18 In the application embodiment shown, the steps performed by the second communication device, that is, the process of the second communication device performing time delay measurement based on the second time delay measurement request message, and the steps performed by the first communication device, that is, the process of the first communication device performing time delay measurement based on the second time delay measurement request message, can measure the link transmission delay between the first communication device and the second communication device through the above process.

[0253] Measurement process 3. Using the single-step mode under the ETE mechanism, delay measurement is performed based on this PTP message. At this time, the PTP message received by the first communication device is a delay measurement synchronization message, that is, the Sync_dm message.

[0254] Figure 19 It is a PTP message interaction flowchart between adjacent communication devices in the single-step mode of an ETE mechanism provided by an embodiment of the present application. This process includes the following steps.

[0255] 1901. The second communication device sends a delay measurement synchronization message.

[0256] Among them, the delay measurement synchronization message can be any of the Sync_dm messages introduced above. For example, the PTP message 400 with the delay measurement identifier located in the message header 401, where the delay measurement identifier indicates that the PTP message is the Sync_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is the Sync_dm message. Another example is the message 1400 with the delay measurement identifier 5 in the message type field.

[0257] The second communication device uses the time when it sends the delay measurement synchronization message as the sending time of the delay measurement synchronization message, determines the source timestamp in the Sync_dm message based on this sending time, and generates a delay measurement synchronization message according to the first message format or the second message format based on this source timestamp, and sends this delay measurement synchronization message (for example, sends this delay measurement synchronization message to the first communication device). Among them, this delay measurement synchronization message includes this source timestamp and an identifier indicating that the PTP message is a delay measurement function message, and this source timestamp indicates the sending time of the delay measurement synchronization message (for example, t1).

[0258] Under the ETE mechanism, the delay measurement end responds to determine the link transmission delay between the delay measurement request end and the delay measurement response end. The second communication device acts as the delay measurement request end and does not need to store the timestamps during the delay measurement locally. The first communication device stores the timestamps during the delay measurement.

[0259] 1902. The first communication device obtains the delay measurement synchronization message and sends a first delay measurement request message in response to the delay measurement synchronization message.

[0260] Among them, the first delay measurement request message can be any of the Delay_Req_dm messages introduced above. For example, for the PTP message 400 with the delay measurement identifier located in the message header 401, the delay measurement identifier indicates that the PTP message is a Delay_Req_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Delay_Req_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 5 in the message type field.

[0261] After obtaining the delay measurement synchronization message, the first communication device uses the source timestamp in the delay measurement synchronization message as the transmission timestamp of the delay measurement synchronization message, stores this transmission timestamp at the local end, and this transmission timestamp indicates the transmission time of the delay measurement synchronization message. Using the time when the local end obtains the delay measurement synchronization message as the reception time of the delay measurement synchronization message, based on this reception time, determine the reception timestamp of the delay measurement synchronization message, and this reception timestamp indicates this reception time (such as t2).

[0262] In response to the delay measurement synchronization message, the first communication device uses 0 as the source timestamp in the Delay_Req_dm message. Based on this source timestamp, generate a first delay measurement request message according to the first message format or the second message format, and send the first delay measurement request message (such as sending the first delay measurement request message to the second communication device). The first delay measurement request message includes this source timestamp and an identifier indicating that the PTP message is a delay measurement function message.

[0263] The first communication device also uses the time when it sends the first delay measurement request message as the transmission time of the first delay measurement request message. Based on this transmission time, generate a transmission timestamp of the first delay measurement request message, and store this transmission timestamp at the local end. This transmission timestamp indicates this transmission time (such as t2).

[0264] 1903. The second communication device obtains this first delay measurement request message and, in response to the first delay measurement request message, sends a first delay measurement response message.

[0265] Among them, the first delay measurement response message can be any of the Delay_Resp_dm messages introduced above. For example, for the PTP message 400 with the delay measurement identifier located in the message header 401, the delay measurement identifier indicates that the PTP message is a Delay_Resp_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Delay_Resp_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 5 in the message type field.

[0266] In response to the acquired first delay measurement request message, the second communication device uses the time when it acquires the first delay measurement request message as the reception time of the first delay measurement request message. Based on this reception time, it determines the response source timestamp in the Delay_Resp_dm message, uses the identifier of the port through which it acquires the first delay measurement request message as the request port identifier in the Delay_Resp_dm message, and generates a first delay measurement response message according to the first message format or the second message format, and sends this first delay measurement response message (for example, sends this first delay measurement response message to the first communication device). This first delay measurement response message includes the response source timestamp, the request port identifier, and an identifier indicating that the PTP message is a delay measurement function message. Among them, the response source timestamp indicates the reception time of the first delay measurement request message (for example, t4).

[0267] After the first communication device acquires the first delay measurement response message, the first communication device uses the response source timestamp in the first delay measurement response message as the reception timestamp of the first delay measurement request message and stores this reception timestamp at its own end. In this way, during this delay measurement process, the timestamps acquired by the first communication device are: the transmission timestamp and reception timestamp of the delay measurement synchronization request, and the transmission timestamp and reception timestamp of the first delay measurement request message.

[0268] The first communication device determines the link transmission delay between the first communication device and the second communication device based on the timestamp of the delay measurement synchronization request and / or the timestamp of the first delay measurement request message. For example, it uses the time indicated by the transmission timestamp of the delay measurement synchronization request as t1 in formulas (1) to (3), uses the time indicated by the reception timestamp of the delay measurement synchronization request as t2 in formulas (1) to (3), uses the time indicated by the transmission timestamp of the first delay measurement request message as t3 in formulas (1) to (3), and uses the time indicated by the reception timestamp of the first delay measurement request message as t4 in formulas (1) to (3). According to the above formula (1), it determines the average link transmission delay between the first communication device and the second communication device, or according to the above formula (2) or (3), it determines the one-way link transmission delay between the first communication device and the second communication device.

[0269] In Figure 19 In the application embodiment shown, the steps performed by the second communication device, that is, the process of the second communication device performing delay measurement based on the delay measurement synchronization request, and the steps performed by the first communication device, that is, the process of the first communication device performing delay measurement based on the delay measurement synchronization request. Through the above process, the link transmission delay between the first communication device and the second communication device can be measured.

[0270] Measurement process 4. Using the two-step mode under the ETE mechanism, delay measurement is performed based on this PTP message. At this time, the PTP message received by the first communication device is a delay measurement synchronization message, that is, the Sync_dm message.

[0271] Figure 20 It is a flowchart of PTP message interaction between adjacent communication devices in the two-step mode of the ETE mechanism provided by an embodiment of the present application. This process includes the following steps.

[0272] 2001. The second communication device sends a delay measurement synchronization message.

[0273] Among them, this step 2001 is the same as step 1901. The difference is that in this step 2001, the source timestamp value in the delay measurement synchronization message is 0, and the sending time of the delay measurement synchronization message is notified to the first communication device through the delay measurement response follow-up message (as in the following step 2002). Therefore, this step 2001 will not be elaborated here.

[0274] 2002. The second communication device sends a delay measurement follow-up message of the delay measurement synchronization message.

[0275] Among them, this delay measurement follow-up message can be any of the above-introduced Follow_Up_dm messages. For example, for the PTP message 400 with the delay measurement identifier located in the message header 401, the delay measurement identifier indicates that the PTP message is a Follow_Up_dm message, or the delay measurement identifier and the message type identifier in the message header jointly indicate that the PTP message is a Follow_Up_dm message. Another example is the PTP message 1400 with the delay measurement identifier being 5 in the message type field.

[0276] The second communication device uses the time when it sends the delay measurement synchronization message as the sending time of the delay measurement synchronization message, determines the accurate source timestamp in the Follow_Up_dm based on this sending time, and generates a delay measurement follow-up message according to the first message format or the second message format based on this accurate timestamp, and sends the delay measurement follow-up message (for example, sends the delay measurement follow-up message to the first communication device). This delay measurement follow-up message includes this accurate source timestamp and an identifier indicating that the PTP message is a delay measurement function message. This accurate source timestamp indicates the sending time of the delay measurement synchronization message (for example, t1).

[0277] 2003. The first communication device obtains the delay measurement synchronization message and the delay measurement follow-up message, and in response to the delay measurement synchronization message, sends a first delay measurement request message.

[0278] Among them, this step 2003 is the same as step 1902. The difference is that after obtaining the delay measurement synchronization message, the first communication device also obtains a delay measurement following message, uses the precise source timestamp in the delay measurement following message as the reception timestamp of the delay measurement synchronization message, and stores this reception timestamp at the local end.

[0279] 2004. The second communication device obtains this first delay measurement request message and, in response to the first delay measurement request message, sends a first delay measurement response message.

[0280] Among them, this step 2004 is the same as step 1903 and is similar to the Figure 19 shown delay measurement process. In the Figure 20 delay measurement process, the timestamps obtained by the first communication device are: the transmission timestamp and reception timestamp of the delay measurement synchronization request, and the transmission timestamp and reception timestamp of the first delay measurement request message. So that the first communication device can execute the steps in the above step 1903 to determine the link transmission delay between the first communication device and the second communication device based on the timestamp of the delay measurement synchronization request and / or the timestamp of the first delay measurement request message, which will not be elaborated here.

[0281] In the Figure 20 shown application embodiment, the steps executed by the second communication device, that is, the process of the second communication device performing delay measurement based on the delay measurement synchronization request, and the steps executed by the first communication device, that is, the process of the first communication device performing delay measurement based on the delay measurement synchronization request. Through the above process, the link transmission delay between the first communication device and the second communication device can be measured.

[0282] The above Figures 17 to 20 are all described by taking the first communication device and the second communication device as directly connected adjacent communication devices in a P2P network as an example. In the case where the first communication device and the second communication device are connected through a service bearing device, for each of the delay measurement function messages sent by the first communication device in the above Figures 17 to 20 , the first communication device will not send these delay measurement function messages to the second communication device, but send these delay measurement function messages to the service bearing device connected to the first communication device. The service bearing device between the first communication device and the second communication device will send these delay measurement function messages of the first communication device to the second communication device so that the second communication device can respond to these delay measurement function messages. For the above Figures 17 to 20For each delay measurement function message sent by the second communication device, the second communication device does not send these delay measurement function messages to the first communication device, but sends these delay measurement function messages to the service bearer device connected to the second communication device. The service bearer device between the first communication device and the second communication device will send these delay measurement function messages of the second communication device to the first communication device so that the second communication device can respond to these delay measurement function messages.

[0283] As introduced above, for the delay measurement function message sent by any communication device in the P2P network of the communication system 100, in the direct connection scenario, the delay measurement function message is directly sent to the adjacent communication device of the communication device in the P2P network. In the indirect connection scenario, the delay measurement function message is forwarded to the adjacent communication device through the service bearer device. After the adjacent communication device obtains the delay measurement function message, it performs delay measurement based on the delay measurement function message.

[0284] In the above method embodiments, different communication devices directly sending PTP messages are taken as examples for illustration. In the scenario of sending PTP messages, the communication device can also encapsulate the PTP message into a MAC packet and send the PTP message by sending the MAC packet. For example, taking any communication device in the communication system 100 as an example, for any PTP message to be sent, the communication device generates a MAC packet based on the PTP message. The MAC packet includes the PTP message. At this time, the PTP message is the payload of the MAC packet. The PTP message includes a delay measurement identifier. The communication device sends the MAC packet. The communication device that receives the MAC packet obtains the PTP message from the MAC packet and processes the PTP message based on the identifier of the PTP message (such as termination processing or delay measurement).

[0285] The above description takes the identification in the PTP message indicating whether the PTP message is a delay measurement function message as an example. In another possible implementation, the identification indicates whether the PTP message is a synchronization function message. The communication device that receives the PTP message can also process the PTP message based on the identification, and the processing method is similar to the method embodiments described above. For example, when the communication device is in the P2P network of the communication system 100, if the identification indicates that the PTP message is a synchronization function message, the communication device terminates the processing of the PTP message; if the identification indicates that the PTP message is not a synchronization function message, the communication device performs corresponding processing based on the PTP message (such as performing delay measurement); when the communication device is a service-bearing device in the communication system 100, if the identification indicates that the PTP message is a synchronization function message, the communication device terminates the processing of the PTP message; if the identification indicates that the PTP message is not a synchronization function message, the communication device sends the PTP message to another communication device connected to it.

[0286] The method of the embodiments of the present application is introduced above. The devices of the embodiments of the present application are introduced below. It should be understood that the devices introduced below have any functions of the communication device in the above method. As described above in conjunction with Figures 15 to 20 The processing method and sending method of the PTP message according to the embodiments of the present application are described in detail. Based on the same inventive concept, the devices for the above methods will be described below in conjunction with Figures 21 to 24 It should be understood that the technical features described in the method embodiments are equally applicable to the following device embodiments.

[0287] Figure 21 is a schematic structural diagram of a PTP message processing device provided by the embodiments of the present application. As shown in Figure 21 shown, the device 2100 includes:

[0288] An obtaining module 2101, configured to obtain a PTP message from a second communication device, where the PTP message includes an identification, and the identification indicates whether the PTP message is a delay measurement function message;

[0289] A processing module 2102, configured to process the PTP message based on the identification.

[0290] In a possible implementation, the processing module 2102 is configured to: if the identification indicates that the PTP message is not a delay measurement function message, terminate the processing of the PTP message; if the identification indicates that the PTP message is a delay measurement function message, send the PTP message.

[0291] In a possible implementation, the processing module 2102 includes:

[0292] A termination unit, configured to terminate a PTP message if the identifier indicates that the PTP message is not a delay measurement function message;

[0293] A measurement unit, configured to perform a delay measurement based on the PTP message if the identifier indicates that the PTP message is a delay measurement function message.

[0294] In a possible implementation, the PTP message is a synchronization message involved in a delay request response mechanism and includes an identifier, and the measurement unit is configured to:

[0295] In response to the PTP message, send a first delay measurement request message, where the first delay measurement request message is a delay request message involved in the delay request response mechanism and includes an identifier; obtain a first delay measurement response message of the first delay measurement request message, where the first delay measurement response message is a delay response message involved in the delay request response mechanism and includes an identifier, and the first delay measurement response message includes a timestamp of the first delay measurement request message; determine a link transmission delay between a first communication device and a second communication device based on the timestamp of the PTP message and / or the timestamp of the first delay measurement request message.

[0296] In a possible implementation, the measurement unit is further configured to: obtain a delay measurement follow-up message of PTP, where the delay measurement follow-up message is a follow-up message involved in the delay request response mechanism and includes an identifier, and the delay measurement follow-up message includes a timestamp of the PTP message.

[0297] In a possible implementation, the PTP message is a delay request message involved in a peer delay mechanism and includes an identifier, and the measurement unit is configured to: in response to the PTP message, send a second delay measurement response message, where the second delay measurement response message is a delay response message involved in the peer delay mechanism and includes an identifier.

[0298] In a possible implementation, the measurement unit is further configured to: send a delay measurement response follow-up message of the second delay measurement response message, where the delay measurement response follow-up message is a delay response follow-up message involved in the peer delay mechanism and includes an identifier, and the delay measurement response follow-up message includes a timestamp of the second delay measurement response message.

[0299] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

[0300] In a possible implementation, the PTP message includes a message type field and multiple timestamp fields, the identifier is located in the message type field, the multiple timestamp fields correspond to different delay measurement function messages, and each timestamp field is used to store a timestamp of the corresponding delay measurement function message.

[0301] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identification domain field. The identification includes a first sub-identification and a second sub-identification. The first sub-identification and the second sub-identification are located in different fields among the domain number field, the message type field, and the identification domain field respectively. If any one of the first sub-identification and the second sub-identification is located in the domain number field, any one of the sub-identifications indicates whether the PTP message is a delay measurement function message. If any one of the sub-identifications is located in the message type field, any one of the sub-identifications indicates the message type of the PTP message and that the PTP message is a delay measurement function message. If any one of the sub-identifications is located in the identification domain field, any one of the sub-identifications indicates whether the PTP message is a delay measurement function message.

[0302] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identification domain field. The identification includes a first sub-identification, a second sub-identification, and a third sub-identification. The first sub-identification is located in the domain number field, and the first sub-identification indicates whether the PTP message is a delay measurement function message. The second sub-identification is located in the message type field, and the second sub-identification indicates the message type of the PTP message and that the PTP message is a delay measurement function message. The third sub-identification is located in the identification domain field, and the third sub-identification indicates whether the PTP message is a delay measurement function message.

[0303] In a possible implementation, the PTP message includes a delay measurement type length value TLV, and the identification is located in the type field of the delay measurement TLV.

[0304] In a possible implementation, the delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

[0305] In a possible implementation, the identification is a reserved value of the field where it is located.

[0306] The above device 2100 corresponds to the first communication device in the above method embodiment. The device 2100 can be configured as the first communication device or a part of the device that configures the first communication device, that is, the device 2100 is applied to the first communication device. Each module in the device 2100 and the above other operations and / or functions are respectively for implementing the various steps and methods implemented by the first communication device in the method embodiment. For specific details, refer to the above method embodiment. For the sake of brevity, it will not be elaborated here.

[0307] Figure 22 It is a schematic structural diagram of a sending device of a PTP message provided by an embodiment of the present application. As Figure 22 shown, the device 2200 includes:

[0308] An obtaining module 2201, configured to obtain a PTP message, where the PTP message includes an identifier, and the identifier indicates whether the PTP message is a delay measurement function message;

[0309] A sending module 2202, configured to send the PTP message.

[0310] In a possible implementation, the identifier indicates that the PTP message is a delay measurement function message, and the PTP message is a synchronization message involved in a delay request response mechanism and includes the identifier;

[0311] The obtaining module 2201 is further configured to obtain a first delay measurement request message of the PTP message, where the first delay measurement request message is a delay request message involved in a delay request response mechanism and includes the identifier;

[0312] The sending module 2202 is further configured to, in response to the first delay measurement request message, send a second delay measurement response message, where the second delay measurement response message is a delay response message involved in a delay request response mechanism and includes the identifier.

[0313] In a possible implementation, the sending module 2202 is further configured to: send a delay measurement follow-up message of the delay measurement synchronization message, where the delay measurement follow-up message is a follow-up message involved in a delay request response mechanism and includes the identifier.

[0314] In a possible implementation, the identifier indicates that the PTP message is a delay measurement function message, the PTP message is a delay request message involved in a peer delay mechanism and includes the identifier, and the apparatus 2200 further includes a determination module:

[0315] The obtaining module 2201 is further configured to obtain a second delay measurement response message of the PTP message, where the second delay measurement response message is a delay response message involved in a peer delay mechanism and includes the identifier;

[0316] The determination module is configured to determine a link transmission delay between a first communication device and a second communication device based on a timestamp of the PTP message and / or a timestamp of the second delay measurement response message.

[0317] In a possible implementation, the obtaining module 2201 is further configured to obtain a delay measurement response follow-up message of the second delay measurement response message, where the delay measurement response follow-up message is a delay response follow-up message involved in a peer delay mechanism and includes the identifier, and the delay measurement response follow-up message includes a timestamp of the second delay measurement response message.

[0318] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

[0319] In a possible implementation, the PTP message includes a message type field and multiple timestamp fields. The identifier is located in the message type field, and the multiple timestamp fields correspond to different delay measurement function messages. Each timestamp field is used to store the timestamp of the corresponding delay measurement function message.

[0320] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier and a second sub-identifier. The first sub-identifier and the second sub-identifier are located in different fields among the domain number field, the message type field, and the identifier domain field respectively. If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the message type field, any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message. If any one of the sub-identifiers is located in the identifier domain field, any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

[0321] In a possible implementation, the PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier. The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message. The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. The third sub-identifier is located in the identifier domain field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

[0322] In a possible implementation, the PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

[0323] In a possible implementation, the delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

[0324] In a possible implementation, the identifier is the reserved value of the field where it is located.

[0325] The above device 2200 corresponds to the second communication device in the above method embodiment. The device 2200 can be configured as the second communication device or a part of the device that configures the second communication device. That is, the device 2200 is applied to the first communication device. Each module in the device 2200 and the above other operations and / or functions are respectively for implementing the various steps and methods implemented by the second communication device in the method embodiment. For specific details, refer to the above method embodiment. For the sake of brevity, it will not be elaborated here.

[0326] When any one of the above-mentioned device 2100 and device 2200 processes PTP messages, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be allocated to different functional modules according to needs, that is, the internal structure of any one of the devices is divided into different functional modules to complete all or part of the functions described above. In addition, any one of the devices provided in the above embodiments and the method embodiments belong to the same concept, and the specific implementation process can be seen in the above method embodiments, which will not be elaborated here.

[0327] Both the above-mentioned first communication device and the second communication device are communication devices. Next, in combination with Figure 22 and Figure 23 , the structures of the communication devices will be introduced respectively.

[0328] Figure 23 is a schematic structural diagram of a communication device provided by an embodiment of the present application. As Figure 23 shown, the communication device 2300 includes a main control board 2301 and an interface board 2302.

[0329] The main control board 2301 is also called the main processing unit (MPU) or the route processor card. The main control board 2301 controls and manages each component in the communication device 2300, including routing calculation, device management, device maintenance, and protocol processing functions. As Figure 23 shown, the main control board 2301 includes a processor 2311 and a memory 2312. The processor 2311 is used to call the program code in the main control board memory to execute the PTP message processing method or the PTP message sending method provided by the method embodiment of the present application. The processor 2311 is used to call the program code of the memory 2322 and can execute the PTP message processing method or the PTP message sending method provided by the method embodiment of the present application.

[0330] The interface board 2302 is also called the line processing unit card (LPU), linecard or service board. The interface board 2302 is used to provide various service interfaces and implement the forwarding of PTP messages or data packets. The service interfaces include but are not limited to Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc. The Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients).

[0331] As Figure 23As shown in the figure, interface board 2302 includes a processor 2321, a memory 2322, and an interface card 2323. The processor 2321 is used to control and manage the interface board 2302 and communicate with the processor 2311. Exemplarily, the processor 2321 is used to call the program code in the memory 2322 to receive and send PTP messages or data packets. The processor 2321 is used to call the program code in the main control board memory to execute Flexible Ethernet Clients (FlexE Clients) provided in the method embodiment of this application. For example, if the electronic device 2300 is an electronic device configured as an edge network device in an autonomous domain, the processor 2321 is used to call the program code in the memory 2322 and can also execute the PTP message processing method or the PTP message sending method provided in the method embodiment of this application.

[0332] The interface card 2323 is used to implement the docking function at the physical layer, through which the original traffic enters the interface board 2302, and the processed data packets are sent out from the interface card 2323. The interface card 2323 includes at least one physical interface, also known as a physical port, which can serve as an external interface or an internal interface in a network device. The interface card 2323 is also called a daughter card and can be installed on the interface board 2302.

[0333] The main control board 2301 and the interface board 2302 are coupled. For example, the main control board 2301 and the interface board 2302 are interconnected through a system bus and a system backplane. In a possible implementation manner, an inter-process communication (IPC) channel is established between the main control board 2301 and the interface board 2302, and the main control board 2301 and the interface board 2302 communicate through the IPC channel.

[0334] There may be one or more main control boards 2301. When there are multiple main control boards, it may include an active main control board and a standby main control board. There may be one or more interface boards 2302. The stronger the data processing capacity of the communication device 2300, the more interface boards 2302 are provided. There may also be one or more interface cards 2323 on the interface board 2302. In a distributed forwarding architecture, the communication device 2300 may also have at least one switching network board, through which data exchange between multiple interface boards 2302 is realized, providing a large-capacity data exchange and processing capacity. Therefore, the data access and processing capacity of the network device with a distributed architecture is greater than that of the device with a centralized architecture. Optionally, the form of the communication device 2300 may also be a single board card, that is, without a switching network board, and the functions of the interface board and the main control board are integrated on this single board card. At this time, the processors on the interface board and the main control board can be combined into a central processing unit on this single board card to execute the functions after the superposition of the two. The data exchange and processing capacity of this form of device is relatively low (for example, network devices such as low-end switches or routers). Which architecture is specifically adopted depends on the specific networking deployment scenario and is not limited here.

[0335] Figure 24 It is a schematic structural diagram of another communication device provided by an embodiment of the present application. As Figure 24 shown, the communication device 2400 includes a transceiver 2401, a processor 2402, and a memory 2403. Among them, the transceiver 2401 is used to transmit and receive data packets, PTP messages, data information, or notification packets, etc.

[0336] The processor 2402 is used to execute the relevant steps performed by the first communication device or the second communication device in the above method embodiments. The processor 2402 may include one or more processing cores. The processor 2402 may be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), or programmable logic array (PLA). The processor 2402 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor used to process data in the standby state.

[0337] The memory 2403 may include one or more computer-readable storage media, which may be non-transitory. The memory 2403 further includes high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2403 is used to store at least one program code, and the at least one program code is used to be executed by the processor 2402 to implement the method for processing PTP messages or the method for sending PTP messages provided in the method embodiments of this application.

[0338] In an exemplary embodiment, a computer-readable storage medium is further provided, such as a memory including program code, and the above program code can be executed by a processor in a communication device to complete the method for processing PTP messages or the method for sending PTP messages in the above embodiments. For example, the computer-readable storage medium is a non-temporary computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device.

[0339] An embodiment of this application further provides a computer program product or a computer program. The computer program product or the computer program includes program code. The computer instructions are stored in a computer-readable storage medium. The processor in the communication device reads the program code from the computer-readable storage medium, and the processor executes the program code, so that the communication device executes the method for processing PTP messages or the method for sending PTP messages.

[0340] In addition, an embodiment of this application further provides a device, which may specifically be a chip, a component or a module. The device may include a processor and a memory connected to each other. The memory is used to store computer-executable instructions. When the device runs, the processor may execute the computer-executable instructions stored in the memory, so that the chip executes the method for processing PTP messages or the method for sending PTP messages in the above method embodiments.

[0341] Among them, the device, equipment, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be elaborated here.

[0342] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the devices or units can be in electrical, mechanical or other forms.

[0343] The units described as separate components may or may not be physically separated. The components displayed as units can be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0344] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0345] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, ROM, RAM, magnetic disks or optical discs and other various media that can store program codes.

[0346] In the description of this application, unless otherwise specified, " / " means "or". For example, A / B can represent A or B. The "and / or" herein is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not necessarily limit to be different.

[0347] In this application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0348] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the PTP messages involved in this application are obtained under full authorization.

[0349] All of the above optional technical solutions can be combined arbitrarily to form alternative embodiments of the present disclosure, which will not be elaborated one by one here.

[0350] The above are only alternative embodiments of this application and are not intended to limit this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims

1. A method for processing Precision Time Protocol (PTP) messages of an accurate clock synchronization protocol, characterized in that The method is executed by a first communication device, and the method includes: Obtaining a PTP message from a second communication device, where the PTP message includes an identifier, and the identifier indicates whether the PTP message is a delay measurement function message; Processing the PTP message based on the identifier.

2. The method according to claim 1, wherein The processing the PTP message based on the identifier includes: If the identifier indicates that the PTP message is not a delay measurement function message, performing termination processing on the PTP message; If the identifier indicates that the PTP message is a delay measurement function message, sending the PTP message.

3. The method according to claim 1, characterized in that, The processing the PTP message based on the identifier includes: If the identifier indicates that the PTP message is not a delay measurement function message, performing termination processing on the PTP message; If the identifier indicates that the PTP message is a delay measurement function message, performing delay measurement based on the PTP message.

4. The method according to claim 3, wherein The PTP message is a synchronization message involved in a delay request response mechanism and includes the identifier, and the performing delay measurement based on the PTP message includes: In response to the PTP message, sending a first delay measurement request message, where the first delay measurement request message is a delay request message involved in the delay request response mechanism and includes the identifier; Obtaining a first delay measurement response message of the first delay measurement request message, where the first delay measurement response message is a delay response message involved in the delay request response mechanism and includes the identifier, and the first delay measurement response message includes a timestamp of the first delay measurement request message; Determining a link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message and / or the timestamp of the first delay measurement request message.

5. The method according to claim 4, wherein Before the sending the first delay measurement request message in response to the PTP message, the method further includes: Obtaining a delay measurement follow-up message of the PTP, where the delay measurement follow-up message is a follow-up message involved in the delay request response mechanism and includes the identifier, and the delay measurement follow-up message includes a timestamp of the PTP message.

6. The method according to claim 3, wherein The PTP message is a delay request message involved in a peer delay mechanism and includes the identifier, and the performing delay measurement based on the PTP message includes: In response to the PTP message, sending a second delay measurement response message, where the second delay measurement response message is a delay response message involved in the peer delay mechanism and includes the identifier.

7. The method according to claim 6, characterized in that After the sending the second delay measurement response message, the method includes: Sending a delay measurement response follow-up message of the second delay measurement response message, where the delay measurement response follow-up message is a delay response follow-up message involved in the peer delay mechanism and includes the identifier, and the delay measurement response follow-up message includes a timestamp of the second delay measurement response message.

8. The method according to any one of claims 1-7, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

9. The method according to any one of claims 1-7, characterized in that The PTP message includes a message type field and multiple timestamp fields. The identifier is located in the message type field, and the multiple timestamp fields correspond to different delay measurement function messages. Each timestamp field is used to store the timestamp of the corresponding delay measurement function message.

10. The method according to any one of claims 1-7, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier and a second sub-identifier. The first sub-identifier and the second sub-identifier are located in different fields among the domain number field, the message type field, and the identifier domain field respectively. If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message. If the any one of the sub-identifiers is located in the message type field, the any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message. If the any one of the sub-identifiers is located in the identifier domain field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

11. The method according to any one of claims 1-7, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier domain field. The identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier. The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message. The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message. The third sub-identifier is located in the identifier domain field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

12. The method according to any one of claims 1-7, characterized in that, The PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

13. The method according to claim 12, wherein The delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

14. The method according to any one of claims 8-13, characterized in that, The identifier is a reserved value of the field where it is located.

15. A method for sending Precision Time Protocol (PTP) messages for precise clock synchronization, characterized in that, The method is executed by a second communication device. The method includes: Obtaining a PTP message, where the PTP message includes an identifier that indicates whether the PTP message is a delay measurement function message. Sending the PTP message.

16. The method according to claim 15, characterized in that, The identifier indicates that the PTP message is a delay measurement function message. The PTP message is a synchronization message involved in the delay request response mechanism and includes the identifier. After sending the PTP message, the method further includes: Obtaining a first delay measurement request message of the PTP message, where the first delay measurement request message refers to a delay request message involved in the delay request response mechanism and includes the identifier. In response to the first delay measurement request message, sending a second delay measurement response message, where the second delay measurement response message refers to a delay response message involved in the delay request response mechanism and includes the identifier.

17. The method according to claim 16, characterized in that, After sending the PTP message, the method further includes: Send a delay measurement follow-up message for the delay measurement synchronization message, where the delay measurement follow-up message refers to a follow-up message involved in the delay request response mechanism and includes the identifier.

18. The method according to claim 15, characterized in that The identifier indicates that the PTP message is a delay measurement function message. The PTP message is a delay request message involved in the peer delay mechanism and includes the identifier. After sending the PTP message, the method further includes: Obtain a second delay measurement response message for the PTP message, where the second delay measurement response message refers to a delay response message involved in the peer delay mechanism and includes the identifier; Based on the timestamp of the PTP message and / or the timestamp of the second delay measurement response message, determine the link transmission delay between the first communication device and the second communication device.

19. The method according to claim 18, characterized in that, After obtaining the second delay measurement response message for the PTP message, the method further includes: Obtain a delay measurement response follow-up message for the second delay measurement response message, where the delay measurement response follow-up message refers to a delay response follow-up message involved in the peer delay mechanism and includes the identifier, and the delay measurement response follow-up message includes the timestamp of the second delay measurement response message.

20. The method according to any one of claims 15-19, characterized in that The PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

21. The method according to any one of claims 15-19, characterized in that, The PTP message includes a message type field and multiple timestamp fields. The identifier is located in the message type field, and the multiple timestamp fields correspond to different delay measurement function messages, and each timestamp field is used to store the timestamp of the corresponding delay measurement function message.

22. The method according to any one of claims 15-19, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field. The identifier includes a first sub-identifier and a second sub-identifier, and the first sub-identifier and the second sub-identifier are located in different fields among the domain number field, the message type field, and the identifier field respectively; If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message; If the any one of the sub-identifiers is located in the message type field, the any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message; If the any one of the sub-identifiers is located in the identifier field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

23. The method according to any one of claims 15-19, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field. The identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier; The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message; The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message; The third sub-identifier is located in the identifier field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

24. The method according to any one of claims 15-19, characterized in that, The PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

25. The method according to claim 24, wherein The delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

26. The method according to any one of claims 20-25, characterized in that, The identifier is a reserved value of the field where it is located.

27. A communication system, characterized in that, The system includes a first communication device and a second communication device; The second communication device is configured to send a PTP message, and the PTP message includes an identifier, and the identifier indicates whether the PTP message is a delay measurement function message; The first communication device is configured to obtain the PTP message, and if the identifier indicates that the PTP message is a delay measurement function message, perform delay measurement based on the PTP message.

28. The system according to claim 27, wherein, The PTP message refers to a synchronization message involved in the delay request response mechanism and including the identifier; The first communication device is further configured to, in response to the PTP message, send a first delay measurement request message, and the first delay measurement request message refers to a delay request message involved in the delay request response mechanism and including the identifier; The second communication device is further configured to obtain the first delay measurement request message, and in response to the first delay measurement request message, send a first delay measurement response message, and the first delay measurement response message refers to a delay response message involved in the delay request response mechanism and including the identifier; The first communication device is further configured to obtain the second delay measurement response message, and determine the link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message and / or the timestamp of the first delay measurement response message.

29. The system according to claim 28, wherein The second communication device is further configured to send a delay measurement follow-up message of the PTP message, and the delay measurement follow-up message refers to a follow-up message involved in the delay request response mechanism and including the identifier, and the delay measurement follow-up message includes the timestamp of the PTP message.

30. The system according to claim 27, wherein, The PTP message is a delay request message involved in the peer delay mechanism and including the identifier; The first communication device is further configured to, in response to the PTP message, send a second delay measurement response message, and the second delay measurement response message refers to a delay response message involved in the peer delay mechanism and including the identifier; The second communication device is further configured to obtain the second delay measurement response message, and determine the link transmission delay between the first communication device and the second communication device based on the timestamp of the PTP message and / or the timestamp of the second delay measurement response message.

31. The system according to claim 30, wherein The first communication device is further configured to send a delay measurement response follow-up message of the second delay measurement response message, where the delay measurement response follow-up message refers to a delay response follow-up message involved in the peer delay mechanism and including the identifier, and the delay measurement response follow-up message includes a timestamp of the second delay measurement response message.

32. The system according to claim 27, wherein, The system further includes a third communication device; The first communication device is further configured to, if the identifier indicates that the PTP message is not a delay measurement function message, perform an end processing on the PTP message, and if the identifier indicates that the PTP message is a delay measurement function message, send the PTP message; The third communication device is configured to obtain the PTP message and perform the step of performing delay measurement based on the PTP message.

33. The system according to any one of claims 27-32, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field, and the identifier is located in any one of the domain number field, the message type field, or the identifier field.

34. The system according to any one of claims 27-32, characterized in that, The PTP message includes a message type field and multiple timestamp fields, the identifier is located in the message type field, the multiple timestamp fields correspond to different delay measurement function messages, and each timestamp field is used to store a timestamp of the corresponding delay measurement function message.

35. The system according to any one of claims 27 - 32, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field, the identifier includes a first sub-identifier and a second sub-identifier, and the first sub-identifier and the second sub-identifier are respectively located in different fields among the domain number field, the message type field, and the identifier field; If any one of the first sub-identifier and the second sub-identifier is located in the domain number field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message; If any one of the sub-identifiers is located in the message type field, the any one of the sub-identifiers indicates the message type of the PTP message and that the PTP message is a delay measurement function message; If any one of the sub-identifiers is located in the identifier field, the any one of the sub-identifiers indicates whether the PTP message is a delay measurement function message.

36. The system according to any one of claims 27 - 32, characterized in that, The PTP message includes a domain number field, a message type field, and an identifier field, and the identifier includes a first sub-identifier, a second sub-identifier, and a third sub-identifier; The first sub-identifier is located in the domain number field, and the first sub-identifier indicates whether the PTP message is a delay measurement function message; The second sub-identifier is located in the message type field, and the second sub-identifier indicates the message type of the PTP message and that the PTP message is a delay measurement function message; The third sub-identifier is located in the identifier field, and the third sub-identifier indicates whether the PTP message is a delay measurement function message.

37. The system according to any one of claims 27 - 32, characterized in that, The PTP message includes a delay measurement type length value TLV, and the identifier is located in the type field of the delay measurement TLV.

38. The system according to claim 37, wherein, The delay measurement TLV is a reserved TLV or a vendor TLV supported by the PTP message.

39. The system according to any one of claims 33-38, wherein The identifier is a reserved value of the field where it is located.

40. A processing device for Precision Time Protocol (PTP) messages of an accurate clock synchronization protocol, characterized in that, The device is configured to execute the method according to any one of claims 1 to 14.

41. A transmitting device for Precision Time Protocol (PTP) messages for precise clock synchronization, characterized in that, The device is used to perform the method described in any one of claims 15 to 26.

42. A communication device, characterized in that, The communication device includes a processor, and the processor is used to execute program code so that the communication device performs the method described in any one of claims 1 to 14, or the method described in any one of claims 15 to 26.

43. A computer-readable storage medium, characterized in that, At least one program code is stored in the storage medium, and the at least one program code is read by a processor to cause a communication device to perform the method described in any one of claims 1 to 14, or the method described in any one of claims 15 to 26.

Citation Information

Cited By

  • PTP message processing method, sending method, communication system, and apparatus

    WO2025152886A1