CN108768572B - A kind of timestamp generation system and method based on token - Google Patents

A kind of timestamp generation system and method based on token Download PDF

Info

Publication number
CN108768572B
CN108768572B CN201810331931.8A CN201810331931A CN108768572B CN 108768572 B CN108768572 B CN 108768572B CN 201810331931 A CN201810331931 A CN 201810331931A CN 108768572 B CN108768572 B CN 108768572B
Authority
CN
China
Prior art keywords
token
module
timestamp
serially
processing module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810331931.8A
Other languages
Chinese (zh)
Other versions
CN108768572A (en
Inventor
李�杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Binary Semiconductor 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
Priority to CN201810331931.8A priority Critical patent/CN108768572B/en
Priority to PCT/CN2018/103424 priority patent/WO2019196319A1/en
Publication of CN108768572A publication Critical patent/CN108768572A/en
Application granted granted Critical
Publication of CN108768572B publication Critical patent/CN108768572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

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

The invention discloses a kind of, and the timestamp based on token generates system and method, it is related to Ethernet communication technology field, present invention setting serially unstring module by the serial bit stream data amount sent and received in the form of the first token Real-time Feedback to timestamp processing module, setting timestamp processing module Real-time Feedback timestamp processing module in the form of the second token sent with received bit flow amount, the bit flow amount of delay serially to unstring between module and timestamp processing module is calculated according to the difference of the first token and the second token;The delay of the data transfer path serially to unstring between module and timestamp processing module is calculated according to the interface rate of the bit flow amount of delay and serial module of unstringing.This programme is accurately compensated by the delay for the data transfer path between module and timestamp processing module that serially unstrings, to improve timestamp precision.

Description

A kind of timestamp generation system and method based on token
Technical field
The present invention relates to Ethernet communication technology fields, and in particular to a kind of timestamp generation system and side based on token Method.
Background technique
Requirement of the network equipment to time synchronization performance at present is higher and higher, using 1588v2 agreement as the time synchronization of representative Scheme is all widely applied in many scenes, and the accuracy of generation time stamp directly determines the synchronousness of equipment Energy.Way generally used now is the function of PTP data packet addition time stamp to be placed on hardware view to do, and be placed on distance as far as possible Serial closer position interface (SerDes) of unstringing, so that " the timestamp reference point " that reduces in PTP data packet is passing through serially The total delay passed through when " reference planes " and " timestamp record point " in interface of unstringing, improves time stamp accuracy.Although can be with It is close, but can not infinite approach, therefore the problem of certainly exist compensation delay, and how effectively to calculate and compensate this section and prolong When, become the key for improving timestamp precision.
Shown in FIG. 1 is a kind of basic structure of the network equipment (Dev001) processing timestamp, it is unstringed by serial mode The basic units such as module (SerDes), physical layer coding module (Pcs) and timestamp processing module (Tpu) composition, specifically again can It sends (Tx is sent to by timestamp processing module and is serially unstringed module) and reception to be divided into (Rx, timestamp processing module connects Receive the data for module transmission of serially unstringing) two paths: where T1 and T2 respectively represents in PTP message " timestamp reference point " The actual time of (Timestamp Point) input and output SerDes pin (namely " reference planes " Reference Plane); " timestamp reference point " can be the SOP (the first bit of data packet first byte) in PTP data packet, and it is (leading to be also possible to SOF First bit after code), it can also be other reference positions;T1 ' and T2 ' respectively represents " timestamp on the direction Rx and Tx Reference point " passes through the precise time recorded when timestamp processing module by local high precision clock (Chronometer);Rx_ Latency and Tx_Latency respectively represents " timestamp reference point " input, exports the delay passed through to timestamp processing module; Rx_Timestamp and Tx_Timestamp respectively represents the timestamp that the direction Rx and the direction Tx ultimately generate, and has following relationship:
The direction Tx: Tx_Timestamp=T2 '+Tx_Latency ≈ T2
The direction Rx: Rx_Timestamp=T1 '-Rx_Latency ≈ T1
" timestamp reference point " input, output to the delay that timestamp processing module is passed through mainly include three kinds of situations:
1) path delay
It is shown in Fig. 2 be one kind after the comprehensive direction Tx and the direction Rx serially unstring module and timestamp processing module it Between path delay calculate structure, wherein Latency correspond to Fig. 1 in Rx_Latency and Tx_Latency, its practical packet Include constant time lag and Variable delay two parts.For example, FIFO buffer structure bring delay fluctuation and Gearbox (gearbox) etc. Bring delay fluctuation, they belong to Variable delay part.FIFO (First Input First Output) is a kind of advanced The data buffer first gone out, the data being introduced into first are read from FIFO buffer, do not have exterior read-write address compared with RAM Line, use is fairly simple, but can only be sequentially written in data, the reading data of sequence, cannot can be by as normal memory Address wire determines to read or be written some specified address.
2) timestamp reference point locations are delayed
Shown in Fig. 3 is a kind of typical multiplexing structure that can bring Variable delay, and the channel of M physical layer coding module is multiple Use N number of channel of module of serially unstringing, the value of M and N equal may may not also wait, and specific multiplexing relationship is with the mould that serially unstrings Block operating mode is related.Since the position of " timestamp reference point " in the channel for serially unstringing module is uncertain, so Variable multiplexing can be brought to be delayed.
Therefore, a kind of can accurately compensate by the data transmission between serial interface string module and timestamp processing module is needed The delay in path generates the technical solution of " timestamp reference point " input, the High Precision Time Stamps for exporting serial interface string module.
Summary of the invention
In view of the deficiencies in the prior art, the purpose of the present invention is to provide a kind of, and the timestamp based on token generates System and method can accurately compensate prolonging by the data transfer path between serial interface string module and timestamp processing module When, improve timestamp precision.
To achieve the above objectives, the technical solution adopted by the present invention is that: a kind of timestamp based on token generates system, should System includes serially unstring module, physical layer coding module and timestamp processing module, and module of serially unstringing and timestamp are handled Module is communicated by physical layer coding module:
The module of serially unstringing is used for: will have been sent real-time in the form of the first token with received bit flow amount Feed back to timestamp processing module;
The timestamp processing module is used for: in the form of the second token Real-time Feedback timestamp processing module sent and Received bit flow amount calculates serially unstring module and timestamp processing mould according to the difference of the first token and the second token The bit flow amount of delay between block;The interface rate for module of according to the bit flow amount of delay and serially unstringing calculates string The delay for the data transfer path that row unstrings between module and timestamp processing module.
Based on the above technical solution, according to the difference of the first token and the second token calculate serially unstring module with The detailed process of the bit flow amount of delay between timestamp processing module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket The second token is filled, the first token is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket The first token of middle filling, and the second token is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Bit flow amount.
Based on the above technical solution, the timestamp processing module further includes smothing filtering submodule, is used for Control the token uniform amount filled every time into the token bucket;Control the token quantity by taking out in the token bucket every time Uniformly.
Based on the above technical solution, the timestamp processing module detects that the timestamp in PTP message refers to When point, also according to the interface rate of module of serially unstringing, the position of the timestamp reference point detected, timestamp reference is calculated The offset of point.
Based on the above technical solution, the data transmission serially unstringed between module and timestamp processing module The calculation formula of the delay in path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
The timestamp generation method based on token that the invention also discloses a kind of, comprising the following steps:
Serially unstring module will send with received bit flow amount in the form of the first token Real-time Feedback to when Between stab processing module;
Timestamp processing module Real-time Feedback timestamp processing module in the form of the second token sent with it is received Bit flow amount is calculated according to the difference of the first token and the second token and is serially unstringed between module and timestamp processing module The bit flow amount of delay;
Unstring according to the bit flow amount of the delay and serially interface rate of module of timestamp processing module calculates serially The delay of data transfer path between module of unstringing and timestamp processing module.
Based on the above technical solution, according to the difference of the first token and the second token calculate serially unstring module with The detailed process of the bit flow amount of delay between timestamp processing module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket The second token is filled, the first token is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket The first token of middle filling, and the second token is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Bit flow amount.
Based on the above technical solution, the token that the timestamp processing module is filled into the token bucket every time Uniform amount;Token uniform amount by being taken out in the token bucket every time.
Based on the above technical solution, the timestamp processing module detects that the timestamp in PTP message refers to When point, also according to the interface rate of module of serially unstringing, the position of the timestamp reference point detected, timestamp reference is calculated The offset of point.
Based on the above technical solution, the data transmission serially unstringed between module and timestamp processing module The calculation formula of the delay in path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
Compared with the prior art, the advantages of the present invention are as follows:
Module of serially unstringing in the present invention is by the serial bit stream data amount sent and received in the form of the first token Real-time Feedback is to timestamp processing module, timestamp processing module Real-time Feedback timestamp processing module in the form of the second token Sent with received bit flow amount, calculated according to the difference of the first token and the second token and serially unstringed module and time Stab the bit flow amount of the delay between processing module;The interface rate for module of according to the bit flow amount of delay and serially unstringing Calculate the delay of the data transfer path serially to unstring between module and timestamp processing module.This programme is accurately compensated by going here and there Row connects the delay of the data transfer path between string module and timestamp processing module, to improve timestamp precision.
The present invention calculates the time according to the interface rate for module of serially unstringing, the position of the timestamp reference point detected The offset for stabbing reference point effectively overcomes uncertain bring in the position due to " timestamp reference point " in module of serially unstringing can The multiplexing of change is delayed.
Detailed description of the invention
Fig. 1 is the basic structure schematic diagram that the network equipment (Dev001) handles timestamp in background technique;
Fig. 2 is timestamp delay computing structure model in background technique;
Fig. 3 is channel multiplexing structural model in background technique;
Fig. 4 is the structural schematic diagram of timestamp processing system in the embodiment of the present invention;
Fig. 5 is token bucket filling and extraction schematic illustration in the embodiment of the present invention;
Fig. 6 is timestamp detection, compensation and the typical structure generated in the embodiment of the present invention;
Fig. 7 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point a;
Fig. 8 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point b;
Fig. 9 is the offset calculation method in the embodiment of the present invention under the conditions of timestamp reference point c;
Figure 10 is the schematic illustration of smothing filtering submodule in the embodiment of the present invention;
Figure 11 is the flow diagram of timestamp processing method in the embodiment of the present invention.
Specific embodiment
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Embodiment 1: the timestamp based on token generates system
Shown in Figure 4, the embodiment of the invention discloses a kind of, and the timestamp based on token generates system, which includes Serially unstring module (SerDes), physical layer coding module (Pcs) and timestamp processing module (Tpu), module of serially unstringing and Timestamp processing module is communicated by physical layer coding module:
The module of serially unstringing is used for: will have been sent real-time in the form of the first token with received bit flow amount Feed back to timestamp processing module;
The timestamp processing module is used for: in the form of the second token Real-time Feedback timestamp processing module sent and Received bit flow amount calculates serially unstring module and timestamp processing mould according to the difference of the first token and the second token The bit flow amount of delay between block;The interface rate for module of according to the bit flow amount of delay and serially unstringing calculates string The delay for the data transfer path that row unstrings between module and timestamp processing module.
When detecting the timestamp reference point in PTP message, this is recorded by local high precision clock (Chronometer) When time, base timestamp when module of serially unstringing as the timestamp reference point corresponding data input and output uses this Compensation of delay base timestamp, generate the input and output of timestamp reference point corresponding data serially unstring module when the final time Stamp.
It is shown in Figure 5, serially unstring module and timestamp processing are calculated according to the difference of the first token and the second token The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket The second token Tokens2 is filled, the first token Tokens1 is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket The first token Tokens1 of middle filling, and the second token Tokens2 is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Bit flow amount.
The interface rate for module of according to the bit flow amount of delay and serially unstringing, which calculates, serially to unstring module and time Stab the calculation formula of the delay of the data transfer path between processing module are as follows:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is described first The difference of token and the second token, Speed are the operating rate of module of serially unstringing.
The operating rate for module of serially unstringing determines the time that each token represents, such as: under 1Gbps rate, 1bit Token just represents the 1ns time;Under 10Gbps rate, 1bit token just represents 0.1ns.Therefore, knowing module work of serially unstringing Under conditions of making rate, the difference of the first token and the second token can be converted to specific delay time.
Embodiment 2: consider the offset of timestamp reference point
On the basis of embodiment 1, the offset for considering timestamp reference point, in the timestamp generation system based on token Timestamp processing module when detecting the timestamp reference point in PTP message, also according to module of serially unstringing interface rate, The position of the timestamp reference point detected calculates the offset of timestamp reference point.
Shown in fig. 6 is a kind of reality of the timestamp processing module in timestamp generation system in the present invention based on token Existing structure: where Timestamp Point Detect is " timestamp reference point " detection unit, is handled for detection time stamp Whether contain " timestamp reference point " in the Brick block of the interface of module.Here " timestamp reference point " can be PTP data SOP (the first bit of data packet first byte) in packet, is also possible to SOF (the first bit after lead code), can also be Other reference positions;Assuming that select SOF as " timestamp reference point ", then the subelement is after detecting SOF, it will Offset Offset is calculated according to operating mode.Mode in Fig. 6 is a register, it saves channel multiplexing rule etc. Information, offset Offset are calculated by migration algorithm combination configuration information by offset computation unit.Delay in Fig. 6 is mended Repay subelement Compensation) for computing and compensating final Delay Estima-tion value, Term is a register in Fig. 6, it Save the information such as the operating rate (Speed) for module of serially unstringing.
The calculation method of the offset of timestamp reference point shown in Fig. 7.Bricks represents physical layer coding module in figure (Pcs) data bus interface between timestamp processing module (Tpu), it is assumed that contain p Brick block, each Brick block Data bit width is w, and bx indicates the position where time stamp reference point;
PcsLane in Fig. 7 shares L, and the specific size of L is related to agreement, such as:
100G Ethernet requires to use 20 PcsLane,
40G Ethernet requires to use 4 PcsLane,
10G Ethernet requires to use 1 PcsLane,
The relationship of L and p can be summarized as follows three kinds:
A condition: L=n*p, (n >=1, L ≠ 1) is shown in Figure 7;
B condition: p=n*L, (n >=1, L=1) is shown in Figure 8;
C condition: p=n*L, (n >=1, L ≠ 1) is shown in Figure 9;
Fig. 7 is suitable for a condition, and coordinate system here has divided tetra- regions A/B/C/D, and Offset calculations of offset is as follows:
Offset=A-C=(A+D)-(C+D)=x*L-w*i;
As L=p, C=0, D=0, special circumstances in Offset=A=x*L, that is, Fig. 7 at this time.
The region interpretation of Fig. 7:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C: indicating in token bucket, but due to than exporting after bx, the data volume for needing therefrom to deduct;
Fig. 8 is suitable for b condition, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute The position bit, Offset calculate it is as follows:
Offset=x+C+D=x+w*i
Due to L=1, so all data before bx should all be added in token bucket, one as link delay Point.
The region interpretation of Fig. 8:
A: it is different with the region A meaning in condition a, because only the determination of some data is defeated before bx in A here Out, it is assumed that time stamp reference point bx is in the position of Bricks [i], then just there was only x bit number before bx in Bricks [i] It is counted according to needs;
C+D: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
Fig. 9 is suitable for c condition, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined The position bit where examination point, since p is the integral multiple of L, so p can be cut into multiple L blocks;Offset calculates as follows:
Offset=A+C+D,
Wherein the calculating of A can refer to Fig. 7;
C+D=w*i;
So Offset=x*L+w*i;
The region interpretation of Fig. 9:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C+D: it indicates that determination exports before bx, but is not yet added to the data volume of token bucket;
B, it E, F: indicates to determine the data exported after bx, cannot count in token bucket.
In the case where the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module According to the calculation formula of the delay of transmission path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
Embodiment 3: consider smothing filtering
On the basis of embodiment 1, consider smothing filtering, the timestamp processing in the timestamp generation system based on token Module further includes smothing filtering submodule (Smooth in Fig. 4), is used to control the token filled every time into the token bucket Uniform amount;Control the token uniform amount by taking out in the token bucket every time.
The specific method is as follows:
It is shown in Figure 10, using the thought of arithmetic average;Window is smothing filtering length of window, is counted for convenience It calculates, length L is usually 2 integral number power, such as 32;ACC is accumulator, save in window the statistics of L nodal value and, New and Old is the first order and afterbody node respectively;TokenIn is output, and TokenOut is output, and TokenOut is exactly L The mean value of a node:
TokenOut=[Acc+ (New-Old)]/L
In order to reduce loss of significance caused by computation complexity and displacement, output result can only exist temporarily not divided by L Take into account when final token bucket statistics relationship L is multiplied again, it may be assumed that
TokenOut=[Acc+ (New-Old)].
Embodiment 4: the timestamp generation method based on token
Shown in Figure 11, the timestamp generation method based on token that the embodiment of the invention discloses a kind of is used to go here and there When capable module of unstringing is communicated with timestamp processing module by physical layer coding module, the timestamp reference in PTP message is generated Point corresponding data input and output serially unstring module when timestamp, method includes the following steps:
Serially unstring module will send with received bit flow amount in the form of the first token Real-time Feedback to when Between stab processing module;
Timestamp processing module Real-time Feedback timestamp processing module in the form of the second token sent with it is received Bit flow amount is calculated according to the difference of the first token and the second token and is serially unstringed between module and timestamp processing module The bit flow amount of delay;
Unstring according to the bit flow amount of the delay and serially interface rate of module of timestamp processing module calculates serially The delay of data transfer path between module of unstringing and timestamp processing module.
When detecting the timestamp reference point in PTP message, this is recorded by local high precision clock (Chronometer) When time, base timestamp when module of serially unstringing as the timestamp reference point corresponding data input and output uses this Compensation of delay base timestamp, generate the input and output of timestamp reference point corresponding data serially unstring module when the final time Stamp.
It is shown in Figure 5, serially unstring module and timestamp processing are calculated according to the difference of the first token and the second token The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module send data when, timestamp processing module is filled out into the token bucket The second token Tokens2 is filled, the first token Tokens1 is taken out from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is to the token bucket The first token Tokens1 of middle filling, and the second token Tokens2 is taken out from the token bucket;
The delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Bit flow amount.
The interface rate for module of according to the bit flow amount of delay and serially unstringing, which calculates, serially to unstring module and time Stab the calculation formula of the delay of the data transfer path between processing module are as follows:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is described first The difference of token and the second token, Speed are the operating rate of module of serially unstringing.
Embodiment 5: consider the offset of timestamp reference point
On the basis of embodiment 4, the offset of timestamp reference point, the timestamp generation method based on token are considered In, when timestamp processing module detects the timestamp reference point in PTP message, also according to the interface speed for module of serially unstringing The position of rate, the timestamp reference point detected, calculates the offset of timestamp reference point.
The calculation method of the offset of timestamp reference point shown in Fig. 7.Bricks represents Bricks and represents physical layer in figure Data bus interface between coding module (Pcs) and timestamp processing module (Tpu), it is assumed that contain p Brick block, often A Brick block data bit width is w, and bx indicates the position where time stamp reference point;
PcsLane in Fig. 7 shares L, and the specific size of L is related to agreement, such as:
100G Ethernet requires to use 20 PcsLane,
40G Ethernet requires to use 4 PcsLane,
10G Ethernet requires to use 1 PcsLane,
The relationship of L and p can be summarized as follows:
A > L=n*p, (n >=1, L ≠ 1) is shown in Figure 7;
B > p=n*L, (n >=1, L=1) is shown in Figure 8;
C > p=n*L, (n >=1, L ≠ 1) is shown in Figure 9;
Fig. 7 is suitable for a condition, and coordinate system here has divided tetra- regions A/B/C/D, and Offset calculations of offset is as follows:
Offset=A-C=(A+D)-(C+D)=x*L-w*i;
As L=p, C=0, D=0, special circumstances in Offset=A=x*L, that is, Fig. 7 at this time.
The region interpretation of Fig. 7:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C: indicating in token bucket, but due to than exporting after bx, the data volume for needing therefrom to deduct;
Fig. 8 is suitable for b condition, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute The position bit, Offset calculate it is as follows:
Offset=x+C+D=x+w*i
Due to L=1, so all data before bx should all be added in token bucket, one as link delay Point.
The region interpretation of Fig. 8:
A: it is different with the region A meaning in condition a, because only the determination of some data is defeated before bx in A here Out, it is assumed that time stamp reference point bx is in the position of Bricks [i], then just there was only x bit number before bx in Bricks [i] It is counted according to needs;
C+D: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
Fig. 9 is suitable for c condition, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined The position bit where examination point, since p is the integral multiple of L, so p can be cut into multiple L blocks;Offset calculates as follows:
Offset=A+C+D,
Wherein the calculating of A can refer to Fig. 7;
C+D=w*i;
So Offset=x*L+w*i;
The region interpretation of Fig. 9:
A: it indicates that determination exports before bx, but is not yet added to total data volume in token bucket;
C+D: it indicates that determination exports before bx, but is not yet added to the data volume of token bucket;
B, it E, F: indicates that determination exports after bx, the data volume in token bucket cannot be counted on.
In the case where the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module According to the calculation formula of the delay of transmission path are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be the time Stamp processing module receives the direction that module of serially unstringing sends data;Latency is serially unstring module and timestamp processing mould Delay between block, Level are the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
Embodiment 6: consider smothing filtering
On the basis of embodiment 5, smothing filtering is considered, in the timestamp generation method based on token, timestamp processing The token uniform amount that module is filled into the token bucket every time;It is equal by the token quantity taken out in the token bucket every time It is even.
The specific method is as follows:
It is shown in Figure 10, using the thought of arithmetic average;Window is smothing filtering length of window, is counted for convenience It calculates, length L is usually 2 integral number power, such as 32;ACC is accumulator, save in window the statistics of L nodal value and, New and Old is the first order and afterbody node respectively;TokenIn is input, and TokenOut is output, and TokenOut is exactly L The mean value of a node:
TokenOut=[Acc+ (New-Old)]/L
In order to reduce loss of significance caused by computation complexity and displacement, output result can only exist temporarily not divided by L Take into account when final token bucket statistics relationship L is multiplied again, it may be assumed that
TokenOut=[Acc+ (New-Old)].
The present invention is not limited to the above-described embodiments, for those skilled in the art, is not departing from Under the premise of the principle of the invention, several improvements and modifications can also be made, these improvements and modifications are also considered as protection of the invention Within the scope of.The content being not described in detail in this specification belongs to the prior art well known to professional and technical personnel in the field.

Claims (10)

1. a kind of timestamp based on token generates system, the system include serially unstring module, physical layer coding module and when Between stab processing module, module of serially unstringing is communicated with timestamp processing module by physical layer coding module, it is characterised in that:
The serially module of unstringing is used for: will send with received bit flow amount the Real-time Feedback in the form of the first token To timestamp processing module;
The timestamp processing module is used for: Real-time Feedback timestamp processing module has sent and has connect in the form of the second token The bit flow amount of receipts, calculated according to the difference of the first token and the second token serially unstring module and timestamp processing module it Between delay bit flow amount;The interface rate for module of according to the bit flow amount of delay and serially unstringing calculates serial solution The delay for the data transfer path gone here and there between module and timestamp processing module.
2. a kind of timestamp based on token as described in claim 1 generates system, it is characterised in that: according to the first token and The difference of second token calculates the specific mistake of the bit flow amount for the delay serially unstringed between module and timestamp processing module Journey includes:
Create a token bucket;
Timestamp processing module serially unstrings module when sending data, and timestamp processing module fills the into the token bucket Two tokens take out the first token from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is filled out into the token bucket The first token is filled, and takes out the second token from the token bucket;
The ratio for the delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Special flow amount.
3. a kind of timestamp based on token as claimed in claim 2 generates system, it is characterised in that: the timestamp processing Module further includes smothing filtering submodule, is used to control the token uniform amount filled every time into the token bucket;Control Token uniform amount by being taken out in the token bucket every time.
4. a kind of timestamp based on token as described in claim 1 generates system, it is characterised in that: the timestamp processing Interface rate, time for detecting when module detects the timestamp reference point in PTP message, also according to module of serially unstringing The position for stabbing reference point, calculates the offset of timestamp reference point.
5. a kind of timestamp based on token as claimed in claim 4 generates system, it is characterised in that: the mould that serially unstrings The calculation formula of the delay of data transfer path between block and timestamp processing module are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be timestamp at Reason module receives the direction that module of serially unstringing sends data;Latency be serially unstring module and timestamp processing module it Between delay, Level is the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
6. a kind of timestamp generation method based on token, which comprises the following steps:
Module of serially unstringing will send with received bit flow amount in the form of the first token Real-time Feedback to timestamp Processing module;
Timestamp processing module Real-time Feedback timestamp processing module in the form of the second token has been sent and received bit Flow amount calculates the delay serially unstringed between module and timestamp processing module according to the difference of the first token and the second token Bit flow amount;
Unstring according to the bit flow amount of the delay and serially interface rate of module of timestamp processing module is calculated and is serially unstringed The delay of data transfer path between module and timestamp processing module.
7. a kind of timestamp generation method based on token as claimed in claim 6, it is characterised in that: according to the first token and The difference of second token calculates the specific mistake of the bit flow amount for the delay serially unstringed between module and timestamp processing module Journey includes:
Create a token bucket;
Timestamp processing module serially unstrings module when sending data, and timestamp processing module fills the into the token bucket Two tokens take out the first token from the token bucket;
When timestamp processing module receives the data for module transmission of serially unstringing, timestamp processing module is filled out into the token bucket The first token is filled, and takes out the second token from the token bucket;
The ratio for the delay that the difference of first token and the second token is as serially unstringed between module and timestamp processing module Special flow amount.
8. a kind of timestamp generation method based on token as claimed in claim 7, it is characterised in that: the timestamp processing The token uniform amount that module is filled into the token bucket every time;It is equal by the token quantity taken out in the token bucket every time It is even.
9. a kind of timestamp generation method based on token as claimed in claim 6, it is characterised in that: the timestamp processing Interface rate, time for detecting when module detects the timestamp reference point in PTP message, also according to module of serially unstringing The position for stabbing reference point, calculates the offset of timestamp reference point.
10. a kind of timestamp generation method based on token as claimed in claim 9, it is characterised in that: described serially to unstring The calculation formula of the delay of data transfer path between module and timestamp processing module are as follows:
The direction Tx: Tx_Latency=(Level+Offset)/Speed;
The direction Rx: Rx_Latency=(Level-Offset)/Speed;
Wherein, the direction Tx be timestamp processing module serially unstring module send data direction, the direction Rx be timestamp at Reason module receives the direction that module of serially unstringing sends data;Latency be serially unstring module and timestamp processing module it Between delay, Level is the difference of first token and the second token, and Speed is the operating rate of module of serially unstringing, Offset is the offset of timestamp reference point.
CN201810331931.8A 2018-04-13 2018-04-13 A kind of timestamp generation system and method based on token Active CN108768572B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810331931.8A CN108768572B (en) 2018-04-13 2018-04-13 A kind of timestamp generation system and method based on token
PCT/CN2018/103424 WO2019196319A1 (en) 2018-04-13 2018-08-31 Token-based timestamp generation system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810331931.8A CN108768572B (en) 2018-04-13 2018-04-13 A kind of timestamp generation system and method based on token

Publications (2)

Publication Number Publication Date
CN108768572A CN108768572A (en) 2018-11-06
CN108768572B true CN108768572B (en) 2019-11-08

Family

ID=64010712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810331931.8A Active CN108768572B (en) 2018-04-13 2018-04-13 A kind of timestamp generation system and method based on token

Country Status (2)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245542B (en) * 2018-11-28 2022-01-28 中兴通讯股份有限公司 Method for acquiring time stamp and time synchronization system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080095053A1 (en) * 2006-10-18 2008-04-24 Minghua Chen Method and apparatus for traffic shaping
CN102970238A (en) * 2012-11-22 2013-03-13 华为技术有限公司 Flow control method and flow control equipment
CN103326953A (en) * 2013-03-28 2013-09-25 华为技术有限公司 Flow limiting method and device based on token buckets

Family Cites Families (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
WO2014071636A1 (en) * 2012-11-12 2014-05-15 华为技术有限公司 Packet transmission method and device
CN107682279B (en) * 2017-11-03 2020-04-10 东软集团股份有限公司 Time delay control method, time delay control device, storage medium and program product

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080095053A1 (en) * 2006-10-18 2008-04-24 Minghua Chen Method and apparatus for traffic shaping
CN102970238A (en) * 2012-11-22 2013-03-13 华为技术有限公司 Flow control method and flow control equipment
CN103326953A (en) * 2013-03-28 2013-09-25 华为技术有限公司 Flow limiting method and device based on token buckets

Also Published As

Publication number Publication date
WO2019196319A1 (en) 2019-10-17
CN108768572A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
US5907566A (en) Continuous byte-stream encoder/decoder using frequency increase and cyclic redundancy check
CN101867452B (en) Communication method of serial real-time bus special in electricity
CN108880723B (en) Clock synchronization method and device
US7830924B2 (en) Stuffing and destuffing operations when mapping low-order client signals into high-order transmission frames
WO2019165965A1 (en) Method, apparatus, and device for determining time information
CN100479361C (en) Synchronous medium access controller
CN110858811B (en) Method for measuring time delay and network equipment
CN102195768A (en) Method for realizing precision time protocol (PTP) with nanosecond-level precision
CN103746966A (en) UDP-based upper-layer protocol and Ethernet MAC layer data transmission method
CN101499871B (en) Time delay detection method for SDH time delay, time clock synchronization method, master and slave time clock entity and SDH network element
CN111193567B (en) Time synchronization method, equipment and storage medium
CN108768572B (en) A kind of timestamp generation system and method based on token
CN104052588A (en) Methods to achieve accurate time stamp in ieee 1588 for system with fec encoder
CN102480415B (en) A kind of method and device being recovered optical transport network clock by reference clock
US9143420B2 (en) Data transport system, receiver and transmitter
US7428249B2 (en) Pointer processing and path BIP-8 computation for large concatenated payloads
GB2362777A (en) System for detection of asynchronous packet rates and maintenance of maximum theoretical packet rate
CN102957489B (en) Clock synchronization method and master-slave clock entity
CN1534906B (en) Frame aligning method and circuit
CN103888211B (en) A kind of method and device carried out data transmission between cross chips
Lu et al. Improving the real-time performance of Ethernet for plant automation (EPA) based industrial networks
CN100473031C (en) Ethernet and ATM tier joined data vonversion and correction device and method
CN102437991B (en) Method and device for synchronizing GFP (Generic Framing Procedure) bit streams
CN106549725A (en) A kind of multiplexing of TDM business and inverse multiplexing Implementation Technology
CN102799537B (en) Management method for dual-port RAM (Random Access Memory) buffer in spacecraft AOS (Advanced Orbiting System)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210727

Address after: 430074 second floor, optical communication building, Fenghuo Road, Guandong Industrial Park, Donghu Development Zone, Wuhan City, Hubei Province

Patentee after: WUHAN FISILINK MICROELECTRONICS TECHNOLOGY Co.,Ltd.

Address before: 430000 No. 6, High-tech Fourth Road, Donghu High-tech Development Zone, Wuhan City, Hubei Province

Patentee before: FIBERHOME TELECOMMUNICATION TECHNOLOGIES Co.,Ltd.

Patentee before: WUHAN FISILINK MICROELECTRONICS TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220602

Address after: 430000 Room 403, 4th floor, Optics Valley Science and technology building, No. 770, Gaoxin Avenue, Wuhan East Lake New Technology Development Zone, Wuhan City, Hubei Province kjdsa2022006 (Wuhan area of the free trade zone)

Patentee after: Wuhan binary semiconductor Co.,Ltd.

Address before: 430074 second floor, optical communication building, Fenghuo Road, Guandong Industrial Park, Donghu Development Zone, Wuhan City, Hubei Province

Patentee before: WUHAN FISILINK MICROELECTRONICS TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right