WAN interface based 1588V2 packet transmission method and apparatus
09985737 ยท 2018-05-29
Assignee
Inventors
Cpc classification
H04L2101/622
ELECTRICITY
H04J3/0667
ELECTRICITY
H04L2012/5652
ELECTRICITY
International classification
Abstract
Embodiments of the present invention disclose a WAN interface based 1588V2 packet transmission method and apparatus, which relate to the field of communications technologies and can reduce complexity of 1588V2 packet transmission. The method includes: first, inserting, by a sending end, a 1588V2 packet into a payload area of a data frame, and sending, to a receiving end, the data frame carrying the 1588V2 packet; then, receiving, by the receiving end, the data frame that is sent by the sending end and carries the 1588V2 packet, and acquiring a receiving time at which the data frame is received; and finally, performing, by the receiving end, time synchronization adjustment on the receiving time. The embodiments of the present invention are applicable to 1588V2 packet transmission between networks.
Claims
1. A wide area network (WAN) interface based 1588V2 packet transmission method, comprising: receiving, by a receiving end, a data frame that is sent by a sending end and carries a 1588V2 packet; acquiring, by the receiving end, a receiving time at which the data frame is received; performing, by the receiving end, time synchronization adjustment on the receiving time; wherein before performing, by the receiving end, time synchronization adjustment on the receiving time, the method further comprises: configuring, by the receiving end, a synchronous counter separately for a wide area network interface sublayer (WIS) and a media access control (MAC) sublayer; when the data frame carrying the 1588V2 packet is transmitted to the WIS, acquiring, by the receiving end, a first count value corresponding to the WIS; and when the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer, acquiring, by the receiving end, a second count value corresponding to the MAC sublayer; and performing, by the receiving end, time synchronization adjustment on the receiving time comprises: performing, by the receiving end, the time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value, wherein the receiving time is a corresponding time at which the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer.
2. The method according to claim 1, wherein: before performing, by the receiving end, the time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value, the method further comprises: acquiring, by the receiving end, the count difference between the first count value and the second count value; and performing, by the receiving end, the time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value comprises: acquiring, by the receiving end, a time difference corresponding to the count difference, and performing, by the receiving end, the time synchronization adjustment on the receiving time according to the time difference.
3. A wide area network (WAN) interface based 1588V2 packet transmission apparatus, comprising: a processor; and a non-transitory storage memory storing instructions that, when executed by the processor, cause the apparatus to: receive a data frame that is sent by a sending end and carries a 1588V2 packet, acquire a receiving time when the data frame is received, configure a synchronous counter separately for a wide area network interface sublayer (WIS) and a media access control (MAC) sublayer, when the data frame carrying the 1588V2 packet is transmitted to the WIS, acquire a first count value that is corresponding to the WIS, when the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer, acquire a second count value that is corresponding to the MAC sublayer, and perform time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value, wherein the receiving time is a corresponding time at which the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer.
4. The apparatus according to claim 3, wherein the instructions, when executed by the processor, further cause the apparatus to: acquire the count difference between the first count value and the second count value; acquire a time difference corresponding to the count difference, and perform the time synchronization adjustment on the receiving time according to the time difference.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) To describe the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings required for describing the embodiments. Apparently, the accompanying drawings in the following description show merely some embodiments of the present invention, and a person of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
DETAILED DESCRIPTION
(10) The following clearly describes the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are merely a part rather than all of the embodiments of the present invention. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
(11) To make the advantages of the technical solutions of the present invention clearer, the following describes the present invention in detail with reference to the accompanying drawings and embodiments.
Embodiment 1
(12) This embodiment of the present invention provides a WAN interface based 1588V2 packet transmission method, and as shown in
(13) 101: A sending end encapsulates a 1588V2 packet.
(14) 1588V2 is a precision time synchronization protocol standard issued by the IEEE (Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers) standard organization. In this embodiment of the present invention, the 1588V2 packet may be a packet of 44 bytes to 64 bytes, including a packet header of 34 bytes, time information of 10 bytes, and other packet information. The time information may be time information, at the sending end, of the 1588V2 packet.
(15) For this embodiment of the present invention, the sending end may encapsulate the 1588V2 packet to make the 1588V2 packet carry one packet header, where the packet header includes an SMAC (Source Media Access Control, source address), a DMAC (Destination Media Access Control, destination address), and an Etype (Ethernet type, Ethernet type). The Etype is used to specify an Ethernet type of the 1588V2 packet. Specifically, if the Etype is 88F7, the Ethernet type of the 1588V2 packet is specified as a layer 2 Ethernet type; if the Etype is 0800, the Ethernet type of the 1588V2 packet is specified as a layer 3 Ethernet IPv4 (Internet Protocol version 4, Internet Protocol version 4) type; and if the Etype is 86DD, the Ethernet type of the 1588V2 packet is specified as a layer 3 Ethernet IPv6 (Internet Protocol version 6, Internet Protocol version 6) type.
(16) For this embodiment of the present invention, the 1588V2 may be encapsulated at the sending end, and therefore the 1588V2 packet may carry a corresponding packet header, so that the 1588V2 packet may be successfully transmitted.
(17) 102: The sending end inserts an encapsulated 1588V2 packet into a payload area of a data frame.
(18) The payload area of the data frame is an area, except a frame header and a frame trailer, in the data frame and used to transmit data, and the area is sufficient to store one encapsulated 1588V2 packet.
(19) For this embodiment of the present invention, the sending end inserts the 1588V2 packet into the payload area of the data frame, so that slicing and reassembling performed on the 1588V2 packet by using an assisting module can be avoided, thereby reducing complexity of 1588V2 packet transmission.
(20) 103. The sending end sends, to a receiving end, the data frame carrying the 1588V2 packet.
(21) Further, the receiving end performs time synchronization adjustment on a receiving time at which the data frame is received.
(22) The 1588V2 packet may be transmitted between an IP network and an SDH network by using a WAN interface, or may be transmitted between IP networks by using a WAN interface, which is not limited in this embodiment of the present invention.
(23) Further, as a specific implementation of the method shown in
(24) The inserting unit 21 is configured to insert a 1588V2 packet into a payload area of a data frame.
(25) The sending unit 22 is configured to send, to a receiving end, the data frame carrying the 1588V2 packet inserted by the inserting unit 21.
(26) Optionally, the apparatus may further include: an encapsulating unit 23.
(27) The encapsulating unit 23 is configured to encapsulate the 1588V2 packet.
(28) The inserting unit 21 is further configured to insert the 1588V2 packet, encapsulated by the encapsulating unit 23, into the payload area of the data frame.
(29) Further, an entity of the WAN interface based 1588V2 packet transmission apparatus may be a sending end. As shown in
(30) The processor 31 is configured to insert a 1588V2 packet into a payload area of a data frame.
(31) The processor 31 is further configured to send, to a receiving end, the data frame carrying the 1588V2 packet.
(32) The processor 31 is further configured to encapsulate the 1588V2 packet.
(33) The processor 31 is further configured to insert an encapsulated 1588V2 packet into the payload area of the data frame.
(34) It should be noted that, for other corresponding descriptions corresponding to the functional units in the WAN interface based 1588V2 packet transmission apparatus provided by this embodiment of the present invention, reference may be made to corresponding descriptions in
(35) According to the WAN interface based 1588V2 packet transmission method and apparatus that are provided by this embodiment of the present invention: first, a sending end inserts a 1588V2 packet into a payload area of a data frame, and sends, to a receiving end, the data frame carrying the 1588V2 packet; then the receiving end receives the data frame that is sent by the sending end and carries the 1588V2 packet, and acquires a receiving time at which the data frame is received; and finally, the receiving end performs time synchronization adjustment on the receiving time. Compared with that currently, a 1588V2 packet is sliced and inserted into an OH overhead segment for transmission, in this embodiment of the present invention, the 1588V2 packet is inserted into the payload area of the data frame for transmission, so that slicing and reassembling performed on the 1588V2 packet by using an assisting module can be avoided, thereby reducing complexity of 1588V2 packet transmission.
Embodiment 2
(36) This embodiment of the present invention provides a WAN interface based 1588V2 packet transmission method, and as shown in
(37) 401: A receiving end receives a data frame that is sent by a sending end and carries a 1588V2 packet.
(38) The 1588V2 packet may be a packet of 44 bytes to 64 bytes, including a packet header of 34 bytes and time information of 10 bytes to 30 bytes. The time information in the 1588V2 packet may be time information, at the sending end, of the 1588V2 packet. The packet header includes an SMAC, a DMAC, and an Etype. The Etype is used to specify an Ethernet type of the 1588V2 packet. Specifically, if the Etype is 88F7, the Ethernet type of the 1588V2 packet is specified as a layer 2 Ethernet type; if the Etype is 0800, the Ethernet type of the 1588V2 packet is specified as a layer 3 Ethernet IPv4 type; and if the Etype is 86DD, the Ethernet type of the 1588V2 packet is specified as a layer 3 Ethernet IPv6 type.
(39) For this embodiment of the present invention, the 1588V2 packet may be transmitted between an IP network and an SDH network by using a WAN interface, or may be transmitted between IP networks by using a WAN interface, which is not limited in this embodiment of the present invention.
(40) 402: The receiving end acquires a receiving time at which the data frame is received.
(41) The receiving time is a corresponding time at which the data frame carrying the 1588V2 packet is transmitted to a MAC (Media Access Control, media access control) sublayer of the receiving end.
(42) For this embodiment of the present invention, between an IP network and an SDH network or between IP networks, packet transmission is performed based on a WAN interface. Specifically, as shown in
(43) 403: The receiving end configures a synchronous counter separately for a wide area network interface WIS sublayer and a media access control MAC sublayer.
(44) For this embodiment of the present invention, the synchronous counter is separately configured for the WIS sublayer and the MAC sublayer, so that count values based on a same standard may be acquired separately at the WIS sublayer and the MAC sublayer.
(45) 404: When the data frame carrying the 1588V2 packet is transmitted to the WIS sublayer, the receiving end acquires a first count value corresponding to the WIS sublayer.
(46) The first count value corresponding to the WIS sublayer is a time identifier corresponding to the WIS sublayer.
(47) 405: When the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer, the receiving end acquires a second count value corresponding to the MAC sublayer.
(48) The second count value corresponding to the MAC sublayer is a time identifier corresponding to the MAC sublayer. In this embodiment of the present invention, at a same time, the first count value corresponding to the WIS sublayer and the second count value corresponding to the MAC sublayer are the same.
(49) 406: The receiving end acquires a count difference between the first count value and the second count value.
(50) The count difference is the second count value minus the first count value. For example, if the first count value is 202 and the second count value is 208, the count difference between the first count value and the second count value is 6.
(51) 407: The receiving end acquires a time difference corresponding to the count difference.
(52) For this embodiment of the present invention, a correspondence between the count difference and the time difference may be pre-configured by the receiving end, which is not limited in this embodiment of the present invention. For example, every period of the count difference may equal 0.5 milliseconds. If the count difference acquired by the receiving end is 6, the time difference corresponding to the count difference is 3 milliseconds; and if the count difference acquired by the receiving end is 20, the time difference corresponding to the count difference is 10 milliseconds.
(53) 408: The receiving end performs time synchronization adjustment on the receiving time according to the time difference.
(54) Specifically, the receiving end performs the time synchronization adjustment on the receiving time by subtracting the time difference from the receiving time. For example, if the receiving time acquired by the receiving end is 11:32:20:038, and the corresponding time difference is 8 milliseconds, a receiving time after the time synchronization adjustment is performed on the receiving time by the receiving end is 11:32:20:030.
(55) For this embodiment of the present invention, the receiving end performs the time synchronization adjustment on the receiving time, so that time synchronization is achieved between the sending end and the receiving end, and therefore time synchronization for packet transmission is performed between an IP network and an SDH network or between an IP network and an IP network. Optionally, the time information carried in the 1588V2 packet sent by the sending end may be time information that is after the time synchronization adjustment is performed by using a time synchronization adjustment method provided by this embodiment of the present invention, and the receiving end records, in the time information of the 1588V2 packet, a receiving time that is after the time synchronization adjustment is performed by using the time synchronization adjustment method provided by this embodiment of the present invention. In this embodiment of the present invention, by using a sending time that is carried in the 1588V2 packet and is after the time synchronization adjustment is performed and the receiving time that is carried in the 1588V2 packet and is after the time synchronization adjustment is performed, a path delay (Delay) and a time offset (Offset) that are between different networks may be obtained through calculation, so that time synchronization adjustment may be performed, according to the path delay and the time offset, on network devices that are separately corresponding to the different networks.
(56) Specifically, as shown in
Delay=[(T4T1)(T3T2)]/2
Offset=[(T2T1)+(T3T4)]/2
(57) corresponding path delay and time offset are calculated, so that time synchronization adjustment is performed on the first network device and the second network device.
(58) Further, as a specific implementation of the method shown in
(59) The receiving unit 51 is configured to receive a data frame that is sent by a sending end and carries a 1588V2 packet.
(60) The acquiring unit 52 is configured to acquire a receiving time at which the receiving unit 51 receives the data frame.
(61) The adjusting unit 53 is configured to perform time synchronization adjustment on the receiving time acquired by the acquiring unit 52.
(62) Optionally, the apparatus further includes: a configuring unit 54.
(63) The configuring unit 54 is configured to configure a synchronous counter separately for a wide area network interface WIS sublayer and a media access control MAC sublayer.
(64) The acquiring unit 52 is further configured to acquire, when the data frame carrying the 1588V2 packet is transmitted to the WIS sublayer, a first count value that is corresponding to the WIS sublayer and configured by the configuring unit 54.
(65) The acquiring unit 52 is further configured to acquire, when the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer, a second count value that is corresponding to the MAC sublayer and configured by the configuring unit 54.
(66) The adjusting unit 53 is further configured to perform the time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value.
(67) The receiving time is a corresponding time at which the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer.
(68) The acquiring unit 52 is further configured to acquire the count difference between the first count value and the second count value.
(69) The adjusting unit 53 includes: an acquiring module 5301 and an adjusting module 5302.
(70) The acquiring module 5301 is configured to acquire a time difference corresponding to the count difference.
(71) The adjusting module 5302 is configured to perform the time synchronization adjustment on the receiving time according to the time difference acquired by the acquiring module 5301.
(72) Further, an entity of the WAN interface based 1588V2 packet transmission apparatus may be a receiving end. As shown in
(73) The processor 61 is configured to receive a data frame that is sent by a sending end and carries a 1588V2 packet.
(74) The processor 61 is further configured to acquire a receiving time at which the data frame is received.
(75) The processor 61 is further configured to perform time synchronization adjustment on the receiving time.
(76) The processor 61 is further configured to configure a synchronous counter separately for a wide area network interface WIS sublayer and a media access control MAC sublayer.
(77) The processor 61 is further configured to acquire, when the data frame carrying the 1588V2 packet is transmitted to the WIS sublayer, a first count value corresponding to the WIS sublayer.
(78) The processor 61 is further configured to acquire, when the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer, a second count value corresponding to the MAC sublayer.
(79) The processor 61 is further configured to perform the time synchronization adjustment on the receiving time according to a count difference between the first count value and the second count value.
(80) The receiving time is a corresponding time at which the data frame carrying the 1588V2 packet is transmitted to the MAC sublayer.
(81) The processor 61 is further configured to acquire the count difference between the first count value and the second count value.
(82) The processor 61 is further configured to acquire a time difference corresponding to the count difference.
(83) The processor 61 is further configured to perform the time synchronization adjustment on the receiving time according to the time difference.
(84) It should be noted that, for other corresponding descriptions corresponding to the functional units in the WAN interface based 1588V2 packet transmission apparatus provided by this embodiment of the present invention, reference may be made to corresponding descriptions in
(85) According to the WAN interface based 1588V2 packet transmission method and apparatus that are provided by this embodiment of the present invention: first, a sending end inserts a 1588V2 packet into a payload area of a data frame, and sends, to a receiving end, the data frame carrying the 1588V2 packet; then the receiving end receives the data frame that is sent by the sending end and carries the 1588V2 packet, and acquires a receiving time at which the data frame is received; and finally, the receiving end performs time synchronization adjustment on the receiving time. Compared with that currently, a 1588V2 packet is sliced and inserted into an OH overhead segment for transmission, in this embodiment of the present invention, the 1588V2 packet is inserted into the payload area of the data frame for transmission, so that slicing and reassembling performed on the 1588V2 packet by using an assisting module can be avoided, thereby reducing complexity of 1588V2 packet transmission.
(86) The WAN interface based 1588V2 packet transmission apparatus provided by the embodiments of the present invention can implement the foregoing method embodiment. For specific implementation of functions, reference may be made to descriptions in the method embodiment, and no details are repeatedly described herein again. The WAN interface based 1588V2 packet transmission method and apparatus that are provided by this embodiment of the present invention are applicable to 1588V2 packet transmission between networks, but are not limited thereto.
(87) A person of ordinary skill in the art may understand that all or a part of the processes of the methods in the embodiments may be implemented by a computer program instructing relevant hardware. The program may be stored in a computer readable storage medium. When the program runs, the processes of the methods in the embodiments are performed. The foregoing storage medium may include: a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM).
(88) The foregoing descriptions are merely specific embodiments of the present invention, but are not intended to limit the protection scope of the present invention. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in the present invention shall fall within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.