WO2019196319A1 - 一种基于令牌的时间戳生成系统及方法 - Google Patents

一种基于令牌的时间戳生成系统及方法 Download PDF

Info

Publication number
WO2019196319A1
WO2019196319A1 PCT/CN2018/103424 CN2018103424W WO2019196319A1 WO 2019196319 A1 WO2019196319 A1 WO 2019196319A1 CN 2018103424 W CN2018103424 W CN 2018103424W WO 2019196319 A1 WO2019196319 A1 WO 2019196319A1
Authority
WO
WIPO (PCT)
Prior art keywords
timestamp
token
module
processing module
serial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/103424
Other languages
English (en)
French (fr)
Inventor
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fisilink Microelectronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fiberhome Telecommunication Technologies Co Ltd, Wuhan Fisilink Microelectronics Technology Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Publication of WO2019196319A1 publication Critical patent/WO2019196319A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0685Clock or time synchronisation in a node; Intranode synchronisation
    • H04J3/0697Synchronisation in a packet node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Definitions

  • the present invention relates to the field of Ethernet communication technologies, and in particular, to a token-based timestamp generation system and method.
  • the time synchronization scheme represented by the 1588v2 protocol has been widely used in many scenarios.
  • the accuracy of generating timestamps directly determines the time synchronization performance of the device.
  • the common practice now is to put the PTP packet time stamping function on the hardware level and place it as close as possible to the serial deserialization interface (SerDes), thus reducing the "timestamp” in the PTP packet.
  • the reference point “improves the timestamp accuracy by the total delay that traverses the "reference plane” and "timestamp record points” in the serial deserialization interface. Although it can be close, but it can't be infinitely close, there is bound to be a problem of compensating delay. How to effectively calculate and compensate this delay becomes the key to improve the accuracy of time stamp.
  • FIG 1 shows the basic structure of a network device (Dev001) processing timestamp, which consists of a basic unit such as a data serial deserialization module (SerDes), a physical layer coding module (Pcs), and a timestamp processing module (Tpu).
  • SerDes data serial deserialization module
  • Pcs physical layer coding module
  • Tpu timestamp processing module
  • the composition may be further divided into two paths: sending (Tx, sent by the timestamp processing module to the serial deserialization module) and receiving (Rx, the timestamp processing module receiving the data sent by the serial deserialization module): where T1 And T2 respectively represent the real time of the "Timestamp Point” input and output SerDes pin (that is, the "Reference Plane” Reference Plane) in the PTP message; the "Timestamp Reference Point” may be in the PTP packet.
  • SOP the first bit of the first byte of the data packet
  • SOF the first bit after the preamble
  • T1' and T2' represent the "timestamp” in the Rx and Tx directions, respectively.
  • Rx_Latency and Tx_Latency represent the delay of the "timestamp reference point" input and output to the time stamp processing module, respectively;
  • Rx_Timest The amp and Tx_Timestamp represent the timestamps finally generated in the Rx direction and the Tx direction, respectively, and have the following relationship:
  • Tx_Timestamp T2’+Tx_Latency ⁇ T2
  • Rx_Timestamp T1'-Rx_Latency ⁇ T1
  • the delays of the "timestamp reference point" input and output to the timestamp processing module mainly include three cases:
  • Figure 2 shows the path delay calculation structure between a serial deserialization module and a timestamp processing module after integrating the Tx direction and the Rx direction, where Latency corresponds to Rx_Latency and Tx_Latency in Figure 1, which actually includes Fixed delay and variable delay. For example, delay fluctuations caused by the FIFO buffer structure and delay fluctuations caused by Gearbox, etc., are all part of the variable delay.
  • FIFO First Input First Output
  • there is no external read/write address line It is simple to use but can only be written sequentially. Incoming data, sequential read data, can not be read or written to a specified address by the address line as in normal memory.
  • Figure 3 shows a typical multiplexing structure that introduces variable delay.
  • the channels of the M physical layer coding modules are multiplexed into the channels of the N serial deserialization modules.
  • the values of M and N may be equal. It may not be equal, and the specific reuse relationship is related to the working mode of the serial deserialization module. Since the position of the "timestamp reference point" in the channel of the serial deserialization module is indeterminate, it introduces a variable multiplexing delay.
  • the object of the present invention is to provide a token-based timestamp generation system and method, which can accurately compensate the delay of the data transmission path between the serial concatenation module and the timestamp processing module. When you increase the timestamp precision.
  • a token-based timestamp generation system which includes a serial deserialization module, a physical layer coding module, and a timestamp processing module, and a serial deserialization module and time.
  • the stamp processing module communicates through the physical layer encoding module:
  • the serial deserialization module is configured to: feed back the number of sent and received bitstreams in real time to the timestamp processing module in the form of a first token;
  • the timestamp processing module is configured to: in real time feedback, in the form of a second token, the number of bitstreams sent and received by the timestamp processing module, and calculate the serial deserialization according to the difference between the first token and the second token.
  • the number of delayed bitstreams between the module and the timestamp processing module; the data transmission path between the serial deserialization module and the timestamp processing module is calculated according to the number of delayed bitstreams and the interface rate of the serial deserialization module Delay.
  • the specific process of calculating the number of delayed bitstreams between the serial deserialization module and the timestamp processing module according to the difference between the first token and the second token includes:
  • the timestamp processing module When the timestamp processing module sends data to the serial deserialization module, the timestamp processing module fills the token bucket with a second token, and takes out the first token from the token bucket;
  • the timestamp processing module When the timestamp processing module receives the data sent by the serial deserialization module, the timestamp processing module fills the token bucket with the first token, and takes out the second token from the token bucket;
  • the number of tokens in the token bucket is the number of delayed bitstreams between the serial deserialization module and the timestamp processing module.
  • the timestamp processing module further includes a smoothing filtering submodule, configured to control the number of tokens filled into the token bucket each time uniformly; control each time by the token bucket The number of tokens taken out is even.
  • the timestamp processing module when the timestamp processing module detects the timestamp reference point in the PTP message, calculates the time according to the interface rate of the serial deserialization module and the detected timestamp reference point. The offset of the timestamp reference point.
  • the calculation formula of the delay of the data transmission path between the serial deserialization module and the timestamp processing module is:
  • Tx_Latency (Level+Offset)/Speed
  • Rx_Latency (Level-Offset)/Speed
  • the Tx direction is a direction in which the timestamp processing module sends data to the serial deserialization module
  • the Rx direction is a direction in which the timestamp processing module receives the data sent by the serial deserialization module
  • the Latency is a serial deserialization module and a timestamp processing module.
  • the delay between the levels is the number of tokens in the token bucket
  • Speed is the working rate of the serial deserialization module
  • Offset is the offset of the timestamp reference point.
  • the invention also discloses a token-based timestamp generation method, comprising the following steps:
  • the serial deserialization module feeds back the number of transmitted and received bitstreams in real time to the timestamp processing module in the form of a first token
  • the timestamp processing module returns the number of bitstreams sent and received by the timestamp processing module in real time in the form of a second token, and calculates a serial deserialization module and timestamp processing according to the difference between the first token and the second token.
  • the timestamp processing module calculates the delay of the data transmission path between the serial deserialization module and the timestamp processing module according to the number of delayed bitstreams and the interface rate of the serial deserialization module.
  • the specific process of calculating the number of delayed bitstreams between the serial deserialization module and the timestamp processing module according to the difference between the first token and the second token includes:
  • the timestamp processing module When the timestamp processing module sends data to the serial deserialization module, the timestamp processing module fills the token bucket with a second token, and takes out the first token from the token bucket;
  • the timestamp processing module When the timestamp processing module receives the data sent by the serial deserialization module, the timestamp processing module fills the token bucket with the first token, and takes out the second token from the token bucket;
  • the number of tokens in the token bucket is the number of delayed bitstreams between the serial deserialization module and the timestamp processing module.
  • the number of tokens filled in the token bucket by the time stamp processing module is uniform each time; the number of tokens taken out by the token bucket is uniform each time.
  • the timestamp processing module when the timestamp processing module detects the timestamp reference point in the PTP message, calculates the time according to the interface rate of the serial deserialization module and the detected timestamp reference point. The offset of the timestamp reference point.
  • the calculation formula of the delay of the data transmission path between the serial deserialization module and the timestamp processing module is:
  • Tx_Latency (Level+Offset)/Speed
  • Rx_Latency (Level-Offset)/Speed
  • the Tx direction is a direction in which the timestamp processing module sends data to the serial deserialization module
  • the Rx direction is a direction in which the timestamp processing module receives the data sent by the serial deserialization module
  • the Latency is a serial deserialization module and a timestamp processing module.
  • the delay between the levels is the number of tokens in the token bucket
  • Speed is the working rate of the serial deserialization module
  • Offset is the offset of the timestamp reference point.
  • the serial deserialization module of the present invention feeds the transmitted and received serial bit stream data amount in real time to the time stamp processing module in the form of a first token, and the time stamp processing module returns the time stamp in real time in the form of a second token.
  • the number of bitstreams and the interface rate of the serial deserialization module calculate the delay of the data transmission path between the serial deserialization module and the timestamp processing module.
  • the solution accurately compensates for the delay of the data transmission path between the serial serial module and the time stamp processing module to improve the time stamp accuracy.
  • the invention calculates the offset of the timestamp reference point according to the interface rate of the serial deserialization module and the detected position of the timestamp reference point, and effectively overcomes the position of the "timestamp reference point" in the serial deserialization module. Uncertainty introduces variable multiplexing delays.
  • FIG. 1 is a schematic diagram of a basic structure of a timestamp processed by a network device (Dev001) in the background art;
  • FIG. 4 is a schematic structural diagram of a timestamp processing system according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a principle of filling and extracting a token bucket according to an embodiment of the present invention
  • FIG. 9 is a schematic diagram of an offset calculation method under the condition of a timestamp reference point c according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a principle of a smoothing filter submodule according to an embodiment of the present invention.
  • FIG. 11 is a schematic flowchart diagram of a method for processing a timestamp according to an embodiment of the present invention.
  • Embodiment 1 Token-based timestamp generation system
  • an embodiment of the present invention discloses a token-based timestamp generation system, which includes a serial deserialization module (SerDes), a physical layer coding module (Pcs), and a timestamp processing module (Tpu).
  • SerDes serial deserialization module
  • Pcs physical layer coding module
  • Tpu timestamp processing module
  • the serial deserialization module is configured to: feed back the number of sent and received bitstreams in real time to the timestamp processing module in the form of a first token;
  • the timestamp processing module is configured to: in real time feedback, in the form of a second token, the number of bitstreams sent and received by the timestamp processing module, and calculate the serial deserialization according to the difference between the first token and the second token.
  • the number of delayed bitstreams between the module and the timestamp processing module; the data transmission path between the serial deserialization module and the timestamp processing module is calculated according to the number of delayed bitstreams and the interface rate of the serial deserialization module Delay.
  • the time at this time is recorded by the local high-precision clock (Chronometer), and the basic time stamp is used as the timestamp of the data input and output serial deserialization module corresponding to the timestamp reference point.
  • the delay compensates the base timestamp, and generates the final timestamp when the timestamp reference point corresponds to the data input and output serial deserialization module.
  • the specific process of calculating the number of delayed bitstreams between the serial deserialization module and the timestamp processing module according to the difference between the first token and the second token includes:
  • the timestamp processing module When the timestamp processing module sends the data to the serial deserialization module, the timestamp processing module fills the token bucket with the second token Tokens2, and takes out the first token Tokens1 from the token bucket;
  • the timestamp processing module When the timestamp processing module receives the data sent by the serial deserialization module, the timestamp processing module fills the token bucket with the first token Tokens1, and extracts the second token Tokens2 from the token bucket;
  • the number of tokens in the token bucket is the number of delayed bitstreams between the serial deserialization module and the timestamp processing module.
  • Latency Level/Speed
  • Latency is the delay between the serial deserialization module and the timestamp processing module.
  • Level is the number of tokens in the token bucket, and Speed is the working rate of the serial deserialization module.
  • the working speed of the serial deserialization module determines the time represented by each token. For example, at 1 Gbps, a 1-bit token represents 1 ns; at 10 Gbps, a 1-bit token represents 0.1 ns. Therefore, under the condition that the serial deserialization module works, the number of tokens in the token bucket can be converted into a specific delay time.
  • Embodiment 2 Considering the offset of the timestamp reference point
  • Embodiment 1 considering the offset of the timestamp reference point, when the timestamp processing module in the token-based timestamp generation system detects the timestamp reference point in the PTP message, it is also based on the serial solution. The interface rate of the string module, the position of the detected timestamp reference point, and the offset of the timestamp reference point are calculated.
  • Timestamp Point Detect is a "timestamp reference point" detecting unit for detecting timestamp processing Whether the "timestamp reference point" is included in the Brick block of the module's interface.
  • the "timestamp reference point” may be the SOP in the PTP packet (the first bit of the first byte of the data packet), or the SOF (the first bit after the preamble), or other reference positions; Assuming that SOF is selected as the "timestamp reference point", then after detecting the SOF, the subunit calculates the offset Offset according to the working mode.
  • Term is a register that holds information such as the serial deserialization module's speed (Speed).
  • Bricks represents the data bus interface between the physical layer coding module (Pcs) and the time stamp processing module (Tpu). It is assumed that p brick blocks are included. Each Brick block has a data bit width of w and bx represents a time stamp reference point.
  • L PcsLane There are a total of L PcsLane in Figure 7, and the specific size of L is related to the protocol, such as:
  • A indicates the total amount of data that is output before bx but has not been added to the token bucket
  • Figure 8 applies to the b condition.
  • the coordinate system here also divides the four regions A/B/C/D.
  • bx represents the bit position where the timestamp reference point is located.
  • the Offset is calculated as follows:
  • A The meaning of area A in condition a is different, because only part of the data in A here is determined to be output before bx, assuming that the timestamp reference point bx is in the position of Bricks[i], then there is only bx in Bricks[i].
  • the x bit data is required to be counted;
  • C+D indicates the total amount of data that is output before bx but has not been added to the token bucket
  • Figure 9 applies to the condition c.
  • the coordinate system here divides the six regions A/B/C/D/E/F, and bx still indicates the bit position where the timestamp reference point is located. Since p is an integer multiple of L, it can Split p into multiple L blocks; Offset is calculated as follows:
  • A indicates the total amount of data that is output before bx but has not been added to the token bucket
  • C+D indicates the amount of data that is output before bx but has not been added to the token bucket
  • B, E, F indicates that the data output after bx is determined and cannot be counted in the token bucket.
  • Tx_Latency (Level+Offset)/Speed
  • Rx_Latency (Level-Offset)/Speed
  • the Tx direction is a direction in which the timestamp processing module sends data to the serial deserialization module
  • the Rx direction is a direction in which the timestamp processing module receives the data sent by the serial deserialization module
  • the Latency is a serial deserialization module and a timestamp processing module.
  • the delay between the levels is the number of tokens in the token bucket
  • Speed is the working rate of the serial deserialization module
  • Offset is the offset of the timestamp reference point.
  • Embodiment 3 Consider smoothing filtering
  • the time stamp processing module in the token-based timestamp generating system further includes a smoothing filtering sub-module (Smooth in FIG. 4) for controlling each time to the token.
  • the number of tokens filled in the bucket is even; the number of tokens taken out by the token bucket is controlled each time.
  • Window is the smoothing filter window length.
  • L is usually an integer power of 2, such as 32
  • ACC is an accumulator, which stores L node values in the window.
  • New and Old are the first and last level nodes respectively
  • TokenIn is the output
  • TokenOut is the output
  • TokenOut is the mean of the L nodes:
  • the output result can be temporarily not divided by L, and the multiplication relation L is taken into account only when the final token bucket is counted, namely:
  • Embodiment 4 Token-based timestamp generation method
  • an embodiment of the present invention discloses a token-based timestamp generation method, which is used in a PTP packet when a serial deserialization module and a timestamp processing module communicate through a physical layer coding module.
  • the timestamp reference point corresponds to the timestamp when the data is input and output serial deserialization module, and the method includes the following steps:
  • the serial deserialization module feeds back the number of transmitted and received bitstreams in real time to the timestamp processing module in the form of a first token
  • the timestamp processing module returns the number of bitstreams sent and received by the timestamp processing module in real time in the form of a second token, and calculates a serial deserialization module and timestamp processing according to the difference between the first token and the second token.
  • the timestamp processing module calculates the delay of the data transmission path between the serial deserialization module and the timestamp processing module according to the number of delayed bitstreams and the interface rate of the serial deserialization module.
  • the time at this time is recorded by the local high-precision clock (Chronometer), and the basic time stamp is used as the timestamp of the data input and output serial deserialization module corresponding to the timestamp reference point.
  • the delay compensates the base timestamp, and generates the final timestamp when the timestamp reference point corresponds to the data input and output serial deserialization module.
  • the specific process of calculating the number of delayed bitstreams between the serial deserialization module and the timestamp processing module according to the difference between the first token and the second token includes:
  • the timestamp processing module When the timestamp processing module sends the data to the serial deserialization module, the timestamp processing module fills the token bucket with the second token Tokens2, and takes out the first token Tokens1 from the token bucket;
  • the timestamp processing module When the timestamp processing module receives the data sent by the serial deserialization module, the timestamp processing module fills the token bucket with the first token Tokens1, and extracts the second token Tokens2 from the token bucket;
  • the number of tokens in the token bucket is the number of delayed bitstreams between the serial deserialization module and the timestamp processing module.
  • Latency Level/Speed
  • Latency is the delay between the serial deserialization module and the timestamp processing module.
  • Level is the number of tokens in the token bucket, and Speed is the working rate of the serial deserialization module.
  • Embodiment 5 Considering the offset of the timestamp reference point
  • the timestamp processing module detects the timestamp reference point in the PTP message, it is also based on the serial solution.
  • the interface rate of the string module, the position of the detected timestamp reference point, and the offset of the timestamp reference point are calculated.
  • Bricks represents Bricks on behalf of the data bus interface between the physical layer coding module (Pcs) and the time stamp processing module (Tpu). It is assumed that p blocks are included. Each block has a data bit width of w and bx represents a time stamp. The location of the reference point;
  • L PcsLane There are a total of L PcsLane in Figure 7, and the specific size of L is related to the protocol, such as:
  • A indicates the total amount of data that is output before bx but has not been added to the token bucket
  • Figure 8 applies to the b condition.
  • the coordinate system here also divides the four regions A/B/C/D.
  • bx represents the bit position where the timestamp reference point is located.
  • the Offset is calculated as follows:
  • A The meaning of area A in condition a is different, because only part of the data in A here is determined to be output before bx, assuming that the timestamp reference point bx is in the position of Bricks[i], then there is only bx in Bricks[i].
  • the x bit data is required to be counted;
  • C+D indicates the total amount of data that is output before bx but has not been added to the token bucket
  • Figure 9 applies to the condition c.
  • the coordinate system here divides the six regions A/B/C/D/E/F, and bx still indicates the bit position where the timestamp reference point is located. Since p is an integer multiple of L, it can Split p into multiple L blocks; Offset is calculated as follows:
  • A indicates the total amount of data that is output before bx but has not been added to the token bucket
  • C+D indicates the amount of data that is output before bx but has not been added to the token bucket
  • B, E, F indicates that the output is determined after bx, and the amount of data in the token bucket cannot be counted.
  • Tx_Latency (Level+Offset)/Speed
  • Rx_Latency (Level-Offset)/Speed
  • the Tx direction is a direction in which the timestamp processing module sends data to the serial deserialization module
  • the Rx direction is a direction in which the timestamp processing module receives the data sent by the serial deserialization module
  • the Latency is a serial deserialization module and a timestamp processing module.
  • the delay between the levels is the number of tokens in the token bucket
  • Speed is the working rate of the serial deserialization module
  • Offset is the offset of the timestamp reference point.
  • Embodiment 6 Consider smoothing filtering
  • the number of tokens filled by the timestamp processing module into the token bucket is uniform each time; each time by the token bucket The number of tokens taken out is even.
  • Window is the smoothing filter window length.
  • L is usually an integer power of 2, such as 32
  • ACC is an accumulator, which stores L node values in the window.
  • New and Old are the first and last level nodes respectively
  • TokenIn is the input
  • TokenOut is the output
  • TokenOut is the mean of the L nodes:
  • the output result can be temporarily not divided by L, and the multiplication relation L is taken into account only when the final token bucket is counted, namely:

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

本发明公开了一种基于令牌的时间戳生成系统及方法,涉及以太网通信技术领域,本发明设置串行解串模块将发送和接收的串行比特流数据量以第一令牌的形式实时反馈至时间戳处理模块,设置时间戳处理模块以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。本方案精确补偿由串行解串模块与时间戳处理模块之间的数据传输路径的延时,以提高时间戳精度。

Description

一种基于令牌的时间戳生成系统及方法 技术领域
本发明涉及以太网通信技术领域,具体涉及一种基于令牌的时间戳生成系统及方法。
背景技术
目前网络设备对时间同步性能的要求越来越高,以1588v2协议为代表的时间同步方案在诸多场景中都得到了广泛应用,产生时间戳的精确度直接决定了设备的时间同步性能。现在通用的做法是将PTP数据包添加时戳的功能放在硬件层面做,并且尽可能放在距离串行解串接口(SerDes)较近的位置,从而减小PTP数据包中的“时间戳参考点”在穿过串行解串接口中的“参考平面”和“时间戳记录点”时经过的总延时,提高时戳精确度。虽然可以靠近,但也不能无限接近,因此必然存在补偿延时的问题,而如何有效计算并且补偿这段延时,成为提高时间戳精度的关键。
图1所示的是一种网络设备(Dev001)处理时间戳的基本结构,它由数据串行解串模块(SerDes)、物理层编码模块(Pcs)和时间戳处理模块(Tpu)等基本单元组成,具体又可以划分为发送(Tx,由时间戳处理模块发送至串行解串模块)和接收(Rx,时间戳处理模块接收串行解串模块发送的数据)两条路径:其中,T1和T2分别代表PTP报文中“时间戳参考点”(Timestamp Point)输入输出SerDes引脚(也即“参考平面”Reference Plane)的真实时间;“时间戳参考点”可以是PTP数据包中的SOP(数据包首字节的首个比特),也可 以是SOF(前导码之后的首个比特),还可以是其他的参考位置;T1’和T2’分别代表Rx和Tx方向上“时间戳参考点”通过时间戳处理模块时被本地高精度时钟(Chronometer)记录的精确时间;Rx_Latency和Tx_Latency分别代表“时间戳参考点”输入、输出至时间戳处理模块经过的延时;Rx_Timestamp和Tx_Timestamp分别代表Rx方向和Tx方向最终生成的时间戳,有如下关系:
Tx方向:Tx_Timestamp=T2’+Tx_Latency≈T2
Rx方向:Rx_Timestamp=T1’-Rx_Latency≈T1
“时间戳参考点”输入、输出至时间戳处理模块经过的延时主要包括三种情形:
1)路径延时
图2所示的是综合Tx方向和Rx方向之后的一种串行解串模块和时间戳处理模块之间的路径延时计算结构,其中Latency对应于图1中的Rx_Latency和Tx_Latency,它实际包括固定延时和可变延时两部分。例如,FIFO缓存结构带来的延时波动和Gearbox(变速箱)等带来的延时波动,它们都属于可变延时部分。FIFO(First Input First Output)一种先进先出的数据缓存器,先进入的数据先从FIFO缓存器中读出,与RAM相比没有外部读写地址线,使用比较简单,但只能顺序写入数据,顺序的读出数据,不能像普通存储器那样可以由地址线决定读取或写入某个指定的地址。
2)时间戳参考点位置延时
图3所示的是一种会带来可变延时的典型复用结构,M个物理层编码模块的通道复用到N个串行解串模块的通道,M和N的值可能相等也可能不等,具体复用关系跟串行解串模块工作模式有关。由于“时间戳参考点”在串行解串模块的通道中的位置是不确定的,所以 会带来可变的复用延时。
因此,亟需一种能够精确补偿由串行接串模块与时间戳处理模块之间的数据传输路径的延时,生成“时间戳参考点”输入、输出串行接串模块的高精度时间戳的技术方案。
发明内容
针对现有技术中存在的缺陷,本发明的目的在于提供一种基于令牌的时间戳生成系统及方法,能够精确补偿由串行接串模块与时间戳处理模块之间的数据传输路径的延时,提高时间戳精度。
为达到以上目的,本发明采取的技术方案是:一种基于令牌的时间戳生成系统,该系统包括串行解串模块、物理层编码模块和时间戳处理模块,串行解串模块与时间戳处理模块通过物理层编码模块来通信:
所述串行解串模块用于:将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
所述时间戳处理模块用于:以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
在上述技术方案的基础上,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
创建一个令牌桶;
时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌,从所述令牌桶中取出第一令牌;
时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌,并从所述令牌桶中取出第二令牌;
所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
在上述技术方案的基础上,所述时间戳处理模块还包括平滑滤波子模块,其用于控制每次向所述令牌桶中填充的令牌数量均匀;控制每次由所述令牌桶中取出的令牌数量均匀。
在上述技术方案的基础上,所述时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算出时间戳参考点的偏移量。
在上述技术方案的基础上,所述串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Tx方向:Tx_Latency=(Level+Offset)/Speed;
Rx方向:Rx_Latency=(Level-Offset)/Speed;
其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时间戳参考点的偏移量。
本发明还公开了一种基于令牌的时间戳生成方法,包括以下步骤:
串行解串模块将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
时间戳处理模块以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串 行解串模块与时间戳处理模块之间的延时的比特流数目;
时间戳处理模块根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
在上述技术方案的基础上,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
创建一个令牌桶;
时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌,从所述令牌桶中取出第一令牌;
时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌,并从所述令牌桶中取出第二令牌;
所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
在上述技术方案的基础上,所述时间戳处理模块每次向所述令牌桶中填充的令牌数量均匀;每次由所述令牌桶中取出的令牌数量均匀。
在上述技术方案的基础上,所述时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算出时间戳参考点的偏移量。
在上述技术方案的基础上,所述串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Tx方向:Tx_Latency=(Level+Offset)/Speed;
Rx方向:Rx_Latency=(Level-Offset)/Speed;
其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方 向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时间戳参考点的偏移量。
与现有技术相比,本发明的优点在于:
本发明中的串行解串模块将发送和接收的串行比特流数据量以第一令牌的形式实时反馈至时间戳处理模块,时间戳处理模块以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。本方案精确补偿由串行接串模块与时间戳处理模块之间的数据传输路径的延时,以提高时间戳精度。
本发明根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算时间戳参考点的偏移量,有效克服由于“时间戳参考点”在串行解串模块中的位置不确定带来可变的复用延时。
附图说明
图1为背景技术中网络设备(Dev001)处理时间戳的基本结构示意图;
图2为背景技术中时间戳延时计算结构模型;
图3为背景技术中通道复用结构模型;
图4为本发明实施例中时间戳处理系统的结构示意图;
图5为本发明实施例中令牌桶填充和抽取原理示意图;
图6为本发明实施例中时间戳检测、补偿和产生的典型结构;
图7为本发明实施例中时间戳参考点a条件下的偏移量计算方 法;
图8为本发明实施例中时间戳参考点b条件下的偏移量计算方法;
图9为本发明实施例中时间戳参考点c条件下的偏移量计算方法;
图10为本发明实施例中平滑滤波子模块的原理示意图;
图11为本发明实施例中时间戳处理方法的流程示意图。
具体实施方式
以下结合附图及实施例对本发明作进一步详细说明。
实施例1:基于令牌的时间戳生成系统
参见图4所示,本发明实施例公开了一种基于令牌的时间戳生成系统,该系统包括串行解串模块(SerDes)、物理层编码模块(Pcs)和时间戳处理模块(Tpu),串行解串模块与时间戳处理模块通过物理层编码模块来通信:
所述串行解串模块用于:将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
所述时间戳处理模块用于:以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
检测到PTP报文中的时间戳参考点时,通过本地高精度时钟(Chronometer)记录此时的时间,作为该时间戳参考点对应数据输入输出串行解串模块时的基础时间戳,使用该延时补偿基础时间戳,生成时间戳参考点对应数据输入输出串行解串模块时的最终时间戳。
参见图5所示,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
创建一个令牌桶;
时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌Tokens2,从所述令牌桶中取出第一令牌Tokens1;
时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌Tokens1,并从所述令牌桶中取出第二令牌Tokens2;
所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Latency=Level/Speed;
其中,Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率。
串行解串模块的工作速率决定了每个令牌代表的时间,比如:1Gbps速率下,1bit令牌就代表1ns时间;10Gbps速率下,1bit令牌就代表0.1ns。因此,在知道串行解串模块工作速率的条件下,令牌桶中的令牌数就可以转换为具体的延时时间。
实施例2:考虑时间戳参考点的偏移量
在实施例1的基础上,考虑时间戳参考点的偏移量,基于令牌的时间戳生成系统中的时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的 位置,计算出时间戳参考点的偏移量。
图6所示的是本发明中基于令牌的时间戳生成系统中的时间戳处理模块的一种实现结构:其中,Timestamp Point Detect是“时间戳参考点”检测单元,用于检测时间戳处理模块的接口的Brick块中是否含有“时间戳参考点”。这里的“时间戳参考点”可以是PTP数据包中的SOP(数据包首字节的首个比特),也可以是SOF(前导码之后的首个比特),还可以是其他的参考位置;假设选择SOF作为“时间戳参考点”,那么该子单元在检测到SOF之后,就会根据工作模式计算出偏移量Offset。图6中的Mode是一个寄存器,它保存了通道复用规则等信息,偏移量Offset由偏移算法结合配置信息由偏移量计算单元计算得到。图6中的延时补偿子单元Compensation)用于计算和补偿最终的延时估计值,图6中Term是一个寄存器,它保存了串行解串模块的工作速率(Speed)等信息。
图7所示时间戳参考点的偏移量的计算方法。图中Bricks代表物理层编码模块(Pcs)和时间戳处理模块(Tpu)之间的数据总线接口,假设包含了p个Brick块,每个Brick块数据位宽为w,bx表示时戳参考点所在的位置;
图7中的PcsLane共有L个,L的具体大小和协议相关,比如:
100G Ethernet要求使用20个PcsLane,
40G Ethernet要求使用4个PcsLane,
10G Ethernet要求使用1个PcsLane,
L和p的关系,可以总结如下三种:
a条件:L=n*p,(n≥1,L≠1),参见图7所示;
b条件:p=n*L,(n≥1,L=1),参见图8所示;
c条件:p=n*L,(n≥1,L≠1),参见图9所示;
图7适用于a条件,这里的坐标系划分了A/B/C/D四个区域,Offset偏移计算如下:
Offset=A-C=(A+D)-(C+D)=x*L–w*i;
当L=p时,C=0,D=0,此时Offset=A=x*L,也就是图7中的特殊情况。
图7的区域解释:
A:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
C:表示已经在令牌桶中,但由于比bx后输出,需要从中扣除的数据量;
图8适用于b条件,这里的坐标系也划分了A/B/C/D四个区域,bx表示时戳参考点所在的bit位置,Offset计算如下:
Offset=x+C+D=x+w*i
由于L=1,所以bx之前的所有数据都应该添加到令牌桶中,作为链路延时的一部分。
图8的区域解释:
A:和条件a中的区域A含义不同,因为这里的A中只有一部分数据确定在bx之前输出,假设时戳参考点bx处于Bricks[i]的位置,那么Bricks[i]中就只有bx之前的x个bit数据是需要统计的;
C+D:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
图9适用于c条件,这里的坐标系划分了A/B/C/D/E/F六个区域,bx仍然表示时戳参考点所在的bit位置,由于p是L的整数倍,所以能够把p切分成多个L块;Offset计算如下:
Offset=A+C+D,
其中A的计算可以参考图7;
C+D=w*i;
所以Offset=x*L+w*i;
图9的区域解释:
A:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
C+D:表示确定在bx之前输出,但是尚未添加到令牌桶的数据量;
B、E、F:表示确定在bx之后输出的数据,不能统计到令牌桶中。
考虑时间戳参考点的偏移量的情况下,串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Tx方向:Tx_Latency=(Level+Offset)/Speed;
Rx方向:Rx_Latency=(Level-Offset)/Speed;
其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时间戳参考点的偏移量。
实施例3:考虑平滑滤波
在实施例1的基础上,考虑平滑滤波,基于令牌的时间戳生成系统中的时间戳处理模块还包括平滑滤波子模块(图4中Smooth),其用于控制每次向所述令牌桶中填充的令牌数量均匀;控制每次由所述令牌桶中取出的令牌数量均匀。
具体方法如下:
参见图10所示,采用算术平均的思想;Window是平滑滤波窗口 长度,为了方便计算,长度L通常是2的整数次幂,比如32;ACC是累加器,保存了窗口内L个节点值的统计和,New和Old分别是第一级和最后一级节点;TokenIn是输出,TokenOut是输出,TokenOut就是L个节点的均值:
TokenOut=[Acc+(New–Old)]/L
为了减少计算复杂度以及移位造成的精度损失,输出结果可以暂时不除以L,只在最终令牌桶统计的时候把倍乘关系L考虑进去,即:
TokenOut=[Acc+(New–Old)]。
实施例4:基于令牌的时间戳生成方法
参见图11所示,本发明实施例公开了一种基于令牌的时间戳生成方法,其用于串行解串模块与时间戳处理模块通过物理层编码模块通信时,生成PTP报文中的时间戳参考点对应数据输入输出串行解串模块时的时间戳,该方法包括以下步骤:
串行解串模块将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
时间戳处理模块以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;
时间戳处理模块根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
检测到PTP报文中的时间戳参考点时,通过本地高精度时钟(Chronometer)记录此时的时间,作为该时间戳参考点对应数据输入输出串行解串模块时的基础时间戳,使用该延时补偿基础时间戳,生成时间戳参考点对应数据输入输出串行解串模块时的最终时间戳。
参见图5所示,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
创建一个令牌桶;
时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌Tokens2,从所述令牌桶中取出第一令牌Tokens1;
时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌Tokens1,并从所述令牌桶中取出第二令牌Tokens2;
所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Latency=Level/Speed;
其中,Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率。
实施例5:考虑时间戳参考点的偏移量
在实施例4的基础上,考虑时间戳参考点的偏移量,基于令牌的时间戳生成方法中,时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算出时间戳参考点的偏移量。
图7所示时间戳参考点的偏移量的计算方法。图中Bricks代表Bricks代表物理层编码模块(Pcs)和时间戳处理模块(Tpu)之间的数据总线接口,假设包含了p个Brick块,每个Brick块数据位宽为 w,bx表示时戳参考点所在的位置;
图7中的PcsLane共有L个,L的具体大小和协议相关,比如:
100G Ethernet要求使用20个PcsLane,
40G Ethernet要求使用4个PcsLane,
10G Ethernet要求使用1个PcsLane,
L和p的关系,可以总结如下:
a>L=n*p,(n≥1,L≠1),参见图7所示;
b>p=n*L,(n≥1,L=1),参见图8所示;
c>p=n*L,(n≥1,L≠1),参见图9所示;
图7适用于a条件,这里的坐标系划分了A/B/C/D四个区域,Offset偏移计算如下:
Offset=A-C=(A+D)-(C+D)=x*L–w*i;
当L=p时,C=0,D=0,此时Offset=A=x*L,也就是图7中的特殊情况。
图7的区域解释:
A:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
C:表示已经在令牌桶中,但由于比bx后输出,需要从中扣除的数据量;
图8适用于b条件,这里的坐标系也划分了A/B/C/D四个区域,bx表示时戳参考点所在的bit位置,Offset计算如下:
Offset=x+C+D=x+w*i
由于L=1,所以bx之前的所有数据都应该添加到令牌桶中,作为链路延时的一部分。
图8的区域解释:
A:和条件a中的区域A含义不同,因为这里的A中只有一部分 数据确定在bx之前输出,假设时戳参考点bx处于Bricks[i]的位置,那么Bricks[i]中就只有bx之前的x个bit数据是需要统计的;
C+D:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
图9适用于c条件,这里的坐标系划分了A/B/C/D/E/F六个区域,bx仍然表示时戳参考点所在的bit位置,由于p是L的整数倍,所以能够把p切分成多个L块;Offset计算如下:
Offset=A+C+D,
其中A的计算可以参考图7;
C+D=w*i;
所以Offset=x*L+w*i;
图9的区域解释:
A:表示确定在bx之前输出,但是尚未添加到令牌桶中的总的数据量;
C+D:表示确定在bx之前输出,但是尚未添加到令牌桶的数据量;
B、E、F:表示确定在bx之后输出,不能统计到令牌桶中的数据量。
考虑时间戳参考点的偏移量的情况下,串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
Tx方向:Tx_Latency=(Level+Offset)/Speed;
Rx方向:Rx_Latency=(Level-Offset)/Speed;
其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述 令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时间戳参考点的偏移量。
实施例6:考虑平滑滤波
在实施例5的基础上,考虑平滑滤波,基于令牌的时间戳生成方法中,时间戳处理模块每次向所述令牌桶中填充的令牌数量均匀;每次由所述令牌桶中取出的令牌数量均匀。
具体方法如下:
参见图10所示,采用算术平均的思想;Window是平滑滤波窗口长度,为了方便计算,长度L通常是2的整数次幂,比如32;ACC是累加器,保存了窗口内L个节点值的统计和,New和Old分别是第一级和最后一级节点;TokenIn是输入,TokenOut是输出,TokenOut就是L个节点的均值:
TokenOut=[Acc+(New–Old)]/L
为了减少计算复杂度以及移位造成的精度损失,输出结果可以暂时不除以L,只在最终令牌桶统计的时候把倍乘关系L考虑进去,即:
TokenOut=[Acc+(New–Old)]。
本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种基于令牌的时间戳生成系统,该系统包括串行解串模块、物理层编码模块和时间戳处理模块,串行解串模块与时间戳处理模块通过物理层编码模块来通信,其特征在于:
    所述串行解串模块用于:将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
    所述时间戳处理模块用于:以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
  2. 如权利要求1所述的一种基于令牌的时间戳生成系统,其特征在于:根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
    创建一个令牌桶;
    时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌,从所述令牌桶中取出第一令牌;
    时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌,并从所述令牌桶中取出第二令牌;
    所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
  3. 如权利要求2所述的一种基于令牌的时间戳生成系统,其特征在于:所述时间戳处理模块还包括平滑滤波子模块,其用于控制每次向所述令牌桶中填充的令牌数量均匀;控制每次由所述令牌桶中取出的令牌数量均匀。
  4. 如权利要求1所述的一种基于令牌的时间戳生成系统,其特征在于:所述时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算出时间戳参考点的偏移量。
  5. 如权利要求4所述的一种基于令牌的时间戳生成系统,其特征在于:所述串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
    Tx方向:Tx_Latency=(Level+Offset)/Speed;
    Rx方向:Rx_Latency=(Level-Offset)/Speed;
    其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时间戳参考点的偏移量。
  6. 一种基于令牌的时间戳生成方法,其特征在于,包括以下步骤:
    串行解串模块将已发送和已接收的比特流数目以第一令牌的形式实时反馈至时间戳处理模块;
    时间戳处理模块以第二令牌的形式实时反馈时间戳处理模块已发送和已接收的比特流数目,根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目;
    时间戳处理模块根据延时的比特流数目和串行解串模块的接口速率计算出串行解串模块与时间戳处理模块之间的数据传输路径的延时。
  7. 如权利要求6所述的一种基于令牌的时间戳生成方法,其特 征在于:根据第一令牌和第二令牌之差计算出串行解串模块与时间戳处理模块之间的延时的比特流数目的具体过程包括:
    创建一个令牌桶;
    时间戳处理模块向串行解串模块发送数据时,时间戳处理模块向所述令牌桶中填充第二令牌,从所述令牌桶中取出第一令牌;
    时间戳处理模块接收串行解串模块发送的数据时,时间戳处理模块向所述令牌桶中填充第一令牌,并从所述令牌桶中取出第二令牌;
    所述令牌桶中的令牌数即为串行解串模块与时间戳处理模块之间的延时的比特流数目。
  8. 如权利要求7所述的一种基于令牌的时间戳生成方法,其特征在于:所述时间戳处理模块每次向所述令牌桶中填充的令牌数量均匀;每次由所述令牌桶中取出的令牌数量均匀。
  9. 如权利要求6所述的一种基于令牌的时间戳生成方法,其特征在于:所述时间戳处理模块检测到PTP报文中的时间戳参考点时,还根据串行解串模块的接口速率、检测出的时间戳参考点的位置,计算出时间戳参考点的偏移量。
  10. 如权利要求9所述的一种基于令牌的时间戳生成方法,其特征在于:所述串行解串模块与时间戳处理模块之间的数据传输路径的延时的计算公式为:
    Tx方向:Tx_Latency=(Level+Offset)/Speed;
    Rx方向:Rx_Latency=(Level-Offset)/Speed;
    其中,Tx方向为时间戳处理模块向串行解串模块发送数据的方向,Rx方向为时间戳处理模块接收串行解串模块发送数据的方向;Latency为串行解串模块与时间戳处理模块之间的延时,Level为所述令牌桶内的令牌数,Speed为串行解串模块的工作速率,Offset为时 间戳参考点的偏移量。
PCT/CN2018/103424 2018-04-13 2018-08-31 一种基于令牌的时间戳生成系统及方法 Ceased WO2019196319A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810331931.8A CN108768572B (zh) 2018-04-13 2018-04-13 一种基于令牌的时间戳生成系统及方法
CN201810331931.8 2018-04-13

Publications (1)

Publication Number Publication Date
WO2019196319A1 true WO2019196319A1 (zh) 2019-10-17

Family

ID=64010712

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/103424 Ceased WO2019196319A1 (zh) 2018-04-13 2018-08-31 一种基于令牌的时间戳生成系统及方法

Country Status (2)

Country Link
CN (1) CN108768572B (zh)
WO (1) WO2019196319A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245542B (zh) * 2018-11-28 2022-01-28 中兴通讯股份有限公司 获取时间戳的方法、时间的同步系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004057814A1 (en) * 2002-12-20 2004-07-08 Operax Ab Method, resource manager and computer program for using reserved resources for data traffic in an ip-network
CN103229465A (zh) * 2012-11-12 2013-07-31 华为技术有限公司 一种发送报文的方法和设备
CN107682279A (zh) * 2017-11-03 2018-02-09 东软集团股份有限公司 一种时延控制方法、装置及存储介质、程序产品

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7830796B2 (en) * 2006-10-18 2010-11-09 Ericsson Ab Method and apparatus for traffic shaping
CN102970238B (zh) * 2012-11-22 2015-09-30 华为技术有限公司 一种流量控制的方法和设备
CN103326953B (zh) * 2013-03-28 2016-06-29 华为技术有限公司 一种基于令牌桶的流量限制方法和装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004057814A1 (en) * 2002-12-20 2004-07-08 Operax Ab Method, resource manager and computer program for using reserved resources for data traffic in an ip-network
CN103229465A (zh) * 2012-11-12 2013-07-31 华为技术有限公司 一种发送报文的方法和设备
CN107682279A (zh) * 2017-11-03 2018-02-09 东软集团股份有限公司 一种时延控制方法、装置及存储介质、程序产品

Also Published As

Publication number Publication date
CN108768572B (zh) 2019-11-08
CN108768572A (zh) 2018-11-06

Similar Documents

Publication Publication Date Title
JP5548305B2 (ja) パケット交換通信ネットワークにおけるパケットの累積滞留時間の更新
US8571062B1 (en) Multichannel data conversion into packets
US8018968B2 (en) System and method for high precision clock recovery over packet networks
WO2020135857A1 (zh) 时间同步方法、系统、设备及存储介质
CN108155982B (zh) 一种时间戳处理方法及设备
US7830924B2 (en) Stuffing and destuffing operations when mapping low-order client signals into high-order transmission frames
CN104113517A (zh) 时间戳生成方法、装置及系统
WO2008125025A1 (en) Inter-packet gap network clock synchronization
CN101977104A (zh) 基于ieee1588精确时钟同步协议系统及其同步方法
JP2002374231A (ja) ネットワーク同期方法、lsi、バスブリッジ、ネットワーク機器、およびプログラム
CN1069374A (zh) 同步数字分层数据传输时序
CN115225187A (zh) 时钟同步方法、光头端及光终端
JP3694534B2 (ja) 伝送システムおよび伝送装置
US7305013B2 (en) Handling traffic in a synchronous communication network
WO2021213225A1 (zh) 一种信号帧的处理方法及相关设备
WO2019196319A1 (zh) 一种基于令牌的时间戳生成系统及方法
WO2023115403A1 (en) Methods and network devices for ptp clock synchronization
CN102340365B (zh) 一种基于时戳的时钟恢复方法及装置
CN113228564B (zh) 一种打戳处理方法及装置
US7016344B1 (en) Time slot interchanging of time slots from multiple SONET signals without first passing the signals through pointer processors to synchronize them to a common clock
US20040037182A1 (en) Phase adjusting apparatus, phase adjusting method for use therein, and program for phase adjusting method
US7542484B2 (en) Managing payload specific latencies in a cross-connect system
US6738395B1 (en) Pointer processing and path BIP-8 computation for large concatenated payloads
US20060233165A1 (en) Managing data in a subtended switch
CN101471740A (zh) 测量sdh网元传输时延及时钟同步的方法、装置和系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18914518

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18914518

Country of ref document: EP

Kind code of ref document: A1