CN108768572A - 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
CN108768572A
CN108768572A CN201810331931.8A CN201810331931A CN108768572A CN 108768572 A CN108768572 A CN 108768572A CN 201810331931 A CN201810331931 A CN 201810331931A CN 108768572 A CN108768572 A CN 108768572A
Authority
CN
China
Prior art keywords
token
module
timestamp
processing module
serially
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.)
Granted
Application number
CN201810331931.8A
Other languages
Chinese (zh)
Other versions
CN108768572B (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, the bit flow amount that timestamp processing module Real-time Feedback timestamp processing module in the form of the second token has sent and received is set, the bit flow amount of the serial delay unstringed between module and timestamp processing module is calculated according to the difference of the first token and the second token;The delay of the serial data transfer path 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 accurately compensates the delay by 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 technology
Requirement of the network equipment to time net synchronization capability at present is higher and higher, using 1588v2 agreements as the time synchronization of representative Scheme is obtained for extensive use 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 packets addition time stamp to be placed on hardware view to do, and be placed on distance as far as possible The serial closer position of interface (SerDes) of unstringing, to reduce " timestamp reference point " in PTP data packets across serial The total delay passed through when unstringing " reference planes " and " timestamp record point " in interface 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 time stamp, it is unstringed by serial mode The basic units such as module (SerDes), physical layer coding module (Pcs) and timestamp processing module (Tpu) form, specifically again can It sends (Tx is sent to serial module of unstringing by timestamp processing module) and reception to be divided into (Rx, timestamp processing module connects Receive the data for module transmission of serially unstringing) two paths:Wherein, T1 and T2 is respectively represented in PTP messages " timestamp reference point " The actual time of (Timestamp Point) input and output SerDes pins (namely " reference planes " Reference Plane); " timestamp reference point " can be the SOP (the first bit of data packet first byte) in PTP data packets, can also be SOF (leading First bit after code), it can also be other reference positions;T1 ' and T2 ' respectively represents " timestamp on the directions Rx and Tx Reference point " by when timestamp processing module by local high precision clock (Chronometer) record precise time;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 directions Rx and the directions Tx ultimately generate, and has following relationship:
The directions Tx:Tx_Timestamp=T2 '+Tx_Latency ≈ T2
The directions Rx:Rx_Timestamp=T1 '-Rx_Latency ≈ T1
The delay that " timestamp reference point " input, output to timestamp processing module are passed through includes mainly three kinds of situations:
1) path delay
It is shown in Fig. 2 be one kind after the comprehensive directions Tx and the directions 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, delay fluctuation that FIFO buffer structures are brought and Gearbox (gearbox) etc. The delay fluctuation brought, they belong to Variable delay part.A kind of FIFO (First Input FirstOutput) advanced elder generation The data buffer gone out, the data being introduced into first are read from FIFO buffers, do not have exterior read-write address wire compared with RAM, Using fairly simple, but data can only be sequentially written in, the reading data of sequence cannot can be by address as normal memory Line 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 the channel of N number of serial module of 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, it can accurately be compensated by the data transmission between serial interface string module and timestamp processing module there is an urgent need for a kind of The delay in path generates the technical solution that " timestamp reference point " inputted, exported the High Precision Time Stamps of serial interface string module.
Invention content
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 generation system based on token, should System includes serial unstring module, physical layer coding module and timestamp processing module, and module of serially unstringing is handled with timestamp Module is communicated by physical layer coding module:
The serial module of unstringing is used for:The bit flow amount for having sent He having received is real-time in the form of the first token 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 The bit flow amount received calculates serial module of unstringing according to the difference of the first token and the second token and handles mould with timestamp The bit flow amount of delay between block;String is calculated according to the interface rate of the bit flow amount of delay and module of serially unstringing 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 it is serial 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 transmission 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 bit for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module 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 being taken out in the token bucket every time Uniformly.
Based on the above technical solution, the timestamp processing module detects that the timestamp in PTP messages 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 serial data transmission unstringed between module and timestamp processing module The calculation formula of the delay in path is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are the time Stamp processing module receives the direction for module transmission data of serially unstringing;Latency is that serial module of unstringing handles mould with timestamp Delay between block, Level are the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, Offset For the offset of timestamp reference point.
The timestamp generation method based on token that the invention also discloses a kind of, includes the following steps:
It is serial unstring module by the bit flow amount for having sent and having received in the form of the first token Real-time Feedback to when Between stab processing module;
What timestamp processing module Real-time Feedback timestamp processing module in the form of the second token had sent and had 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;
Timestamp processing module calculates serially according to the bit flow amount of delay and the interface rate for module of serially unstringing 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 it is serial 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 transmission 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 bit for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module 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 messages 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 serial data transmission unstringed between module and timestamp processing module The calculation formula of the delay in path is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are the time Stamp processing module receives the direction for module transmission data of serially unstringing;Latency is that serial module of unstringing handles mould with timestamp Delay between block, Level are the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, Offset For the offset of timestamp reference point.
Compared with the prior art, the advantages of the present invention are as follows:
Serial module of 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 The bit flow amount for having sent and having received is calculated according to the difference of the first token and the second token and is serially unstringed module and time Stab the bit flow amount of the delay between processing module;According to the interface rate of the bit flow amount of delay and module of serially unstringing Calculate the delay of the serial data transfer path 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 since " timestamp reference point " can in serial uncertain bring in mould position in the block of unstringing The multiplexing of change is delayed.
Description of the drawings
Fig. 1 is the basic structure schematic diagram that the network equipment (Dev001) processing time stabs in background technology;
Fig. 2 is timestamp delay computing structure model in background technology;
Fig. 3 is channel multiplexing structural model in background technology;
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 principle schematic 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 computational methods under the conditions of timestamp reference point a in the embodiment of the present invention;
Fig. 8 is the offset computational methods under the conditions of timestamp reference point b in the embodiment of the present invention;
Fig. 9 is the offset computational methods under the conditions of timestamp reference point c in the embodiment of the present invention;
Figure 10 is the principle schematic 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 implementation mode
Invention is further described in detail with reference to the accompanying drawings and embodiments.
Embodiment 1: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 Serial 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 serial module of unstringing is used for:The bit flow amount for having sent He having received is real-time in the form of the first token 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 The bit flow amount received calculates serial module of unstringing according to the difference of the first token and the second token and handles mould with timestamp The bit flow amount of delay between block;String is calculated according to the interface rate of the bit flow amount of delay and module of serially unstringing The delay for the data transfer path that row unstrings between module and timestamp processing module.
When detecting the timestamp reference point in PTP messages, 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, generated time stamp the input and output of reference point corresponding data serially unstring module when the final time Stamp.
It is shown in Figure 5, serial module of unstringing is calculated according to the difference of the first token and the second token and is handled with timestamp The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module transmission 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 bit for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module Flow amount.
It is calculated according to the interface rate of the bit flow amount of delay and module of serially unstringing and is serially unstringed module and time The calculation formula of delay of data transfer path between stamp processing module is:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is the token Token number in bucket, Speed are the operating rate of module of serially unstringing.
The operating rate of serial module of unstringing determines the time that each token represents, such as:Under 1Gbps rates, 1bit Token just represents the 1ns times;Under 10Gbps rates, 1bit tokens just represent 0.1ns.Therefore, knowing serial module work of unstringing Under conditions of making rate, the token number in token bucket can be converted to specific delay time.
Embodiment 2:Consider the offset of timestamp reference point
On the basis of embodiment 1, the offset of timestamp reference point is considered, in the timestamp generation system based on token Timestamp processing module when detecting the timestamp reference point in PTP messages, 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 the present invention in the timestamp generation system based on token Existing structure:Wherein, Timestamp Point Detect are " timestamp reference point " detection units, are handled for detection time stamp Whether contain " timestamp reference point " in the Brick blocks of the interface of module.Here " timestamp reference point " can be PTP data SOP (the first bit of data packet first byte) in packet, can also be 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 for final Delay Estima-tion value, Term is a register in Fig. 6, it Save the information such as the operating rate (Speed) of serial module of unstringing.
The computational methods 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 blocks 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 require to use 20 PcsLane,
40G Ethernet require to use 4 PcsLane,
10G Ethernet require to use 1 PcsLane,
The relationship of L and p can be summarized as follows three kinds:
A conditions:L=n*p, (n >=1, L ≠ 1) is shown in Figure 7;
B conditions:P=n*L, (n >=1, L=1) is shown in Figure 8;
C conditions:P=n*L, (n >=1, L ≠ 1) is shown in Figure 9;
Fig. 7 is suitable for a conditions, 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:It indicates in token bucket, but due to than being exported after bx, needing the data volume therefrom deducted;
Fig. 8 is suitable for b conditions, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute The positions 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 meanings in condition a because in A here only some data determine it is defeated before bx Go 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 conditions, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined The positions 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 be with reference chart 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,E,F:It indicates to determine the data exported after bx, cannot count in token bucket.
In the case of the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module Calculation formula according to the delay of transmission path is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are the time Stamp processing module receives the direction for module transmission data of serially unstringing;Latency is that serial module of unstringing handles mould with timestamp Delay between block, Level are the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, Offset For the offset of timestamp reference point.
Embodiment 3:Consider smothing filtering
On the basis of embodiment 1, smothing filtering is considered, 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 being taken 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 typically 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
Loss of significance caused by order to reduce computation complexity and displacement, output result can only not exist temporarily divided by L Take into account relationship L is multiplied again when final token bucket statistics, i.e.,:
TokenOut=[Acc+ (New-Old)].
Embodiment 4: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 messages is generated Point corresponding data input and output serially unstring module when timestamp, this approach includes the following steps:
It is serial unstring module by the bit flow amount for having sent and having received in the form of the first token Real-time Feedback to when Between stab processing module;
What timestamp processing module Real-time Feedback timestamp processing module in the form of the second token had sent and had 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;
Timestamp processing module calculates serially according to the bit flow amount of delay and the interface rate for module of serially unstringing The delay of data transfer path between module of unstringing and timestamp processing module.
When detecting the timestamp reference point in PTP messages, 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, generated time stamp the input and output of reference point corresponding data serially unstring module when the final time Stamp.
It is shown in Figure 5, serial module of unstringing is calculated according to the difference of the first token and the second token and is handled with timestamp The detailed process of the bit flow amount of delay between module includes:
Create a token bucket;
Timestamp processing module serially unstring module transmission 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 bit for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module Flow amount.
It is calculated according to the interface rate of the bit flow amount of delay and module of serially unstringing and is serially unstringed module and time The calculation formula of delay of data transfer path between stamp processing module is:
Latency=Level/Speed;
Wherein, Latency is the delay serially unstringed between module and timestamp processing module, and Level is the token Token number in bucket, 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 messages, 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 computational methods 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 blocks 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 require to use 20 PcsLane,
40G Ethernet require to use 4 PcsLane,
10G Ethernet require 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 conditions, 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:It indicates in token bucket, but due to than being exported after bx, needing the data volume therefrom deducted;
Fig. 8 is suitable for b conditions, and coordinate system here has also divided tetra- regions A/B/C/D, and bx indicates time stamp reference point institute The positions 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 meanings in condition a because in A here only some data determine it is defeated before bx Go 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 conditions, and coordinate system here has divided six regions A/B/C/D/E/F, and bx still indicates that time stamp is joined The positions 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 be with reference chart 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,E,F:It indicates that determination exports after bx, the data volume in token bucket cannot be counted on.
In the case of the offset for considering timestamp reference point, the number between module of serially unstringing and timestamp processing module Calculation formula according to the delay of transmission path is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are the time Stamp processing module receives the direction for module transmission data of serially unstringing;Latency is that serial module of unstringing handles mould with timestamp Delay between block, Level are the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, Offset For 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 typically 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
Loss of significance caused by order to reduce computation complexity and displacement, output result can only not exist temporarily divided by L Take into account relationship L is multiplied again when final token bucket statistics, i.e.,:
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 the protection of the present invention Within the scope of.The content not being 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 serial module of unstringing, 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 serial module of unstringing is used for:It will send and the bit flow amount that the has received 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, according to the difference of the first token and the second token calculate it is serial unstring module and timestamp processing module it Between delay bit flow amount;Serial solution is calculated according to the interface rate of the bit flow amount of delay and module of serially unstringing 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 of the serial delay unstringed between module and timestamp processing module Journey includes:
Create a token bucket;
Timestamp processing module serially unstring module transmission data when, timestamp processing module fills 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 bit fluxion for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module Mesh.
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 When module detects the timestamp reference point in PTP messages, interface rate, time for detecting 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 serial mould that unstrings The calculation formula of the delay of data transfer path between block and timestamp processing module is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are at timestamp Reason module receives the direction for module transmission data of serially unstringing;Latency be it is serial unstring module and timestamp processing module it Between delay, Level is the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, when Offset is Between stab reference point offset.
6. a kind of timestamp generation method based on token, which is characterized in that include the following steps:
It is serial unstring module by the bit flow amount for having sent and having received in the form of the first token Real-time Feedback to timestamp Processing module;
The bit that timestamp processing module Real-time Feedback timestamp processing module in the form of the second token has sent and received Flow amount calculates the serial delay unstringed between module and timestamp processing module according to the difference of the first token and the second token Bit flow amount;
Timestamp processing module is calculated and is serially unstringed according to the bit flow amount of delay and the interface rate for module of serially unstringing 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 of the serial delay unstringed between module and timestamp processing module Journey includes:
Create a token bucket;
Timestamp processing module serially unstring module transmission data when, timestamp processing module fills 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 bit fluxion for the delay that token number in the token bucket as serially unstrings between module and timestamp processing module Mesh.
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 When module detects the timestamp reference point in PTP messages, interface rate, time for detecting 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:It is described serially to unstring The calculation formula of the delay of data transfer path between module and timestamp processing module is:
The directions Tx:Tx_Latency=(Level+Offset)/Speed;
The directions Rx:Rx_Latency=(Level-Offset)/Speed;
Wherein, the directions Tx are that timestamp processing module is serially unstringed the direction of module transmission data, and the directions Rx are at timestamp Reason module receives the direction for module transmission data of serially unstringing;Latency be it is serial unstring module and timestamp processing module it Between delay, Level is the token number in the token bucket, and Speed is the operating rate of module of serially unstringing, when Offset is Between stab reference point offset.
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 true CN108768572A (en) 2018-11-06
CN108768572B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245542A (en) * 2018-11-28 2020-06-05 中兴通讯股份有限公司 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
AU2003282653A1 (en) * 2002-12-20 2004-07-14 Operax Ab Method, resource manager and computer program for using reserved resources for data traffic in an ip-network
CN103229465A (en) * 2012-11-12 2013-07-31 华为技术有限公司 Message sending 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

Cited By (2)

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

Also Published As

Publication number Publication date
WO2019196319A1 (en) 2019-10-17
CN108768572B (en) 2019-11-08

Similar Documents

Publication Publication Date Title
KR102466081B1 (en) Time information confirmation method, device and equipment
US5142529A (en) Method and means for transferring a data payload from a first SONET signal to a SONET signal of different frequency
US5907566A (en) Continuous byte-stream encoder/decoder using frequency increase and cyclic redundancy check
JP4991270B2 (en) Transmitter and receiver
CN108880723B (en) Clock synchronization method and device
CN102833063B (en) The implementation method of client traffic Clock Extraction in a kind of OTN network
CN1812317A (en) Synchronous medium access controller
CN110858811B (en) Method for measuring time delay and network equipment
CN111193567B (en) Time synchronization method, equipment and storage medium
CN105119775A (en) Method for improving accuracy of Ethernet message transmission delay measurement
CN102377678B (en) Data transmission and processing method and device
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
CN1534906B (en) Frame aligning method and circuit
EP0308450B1 (en) Jitter control in digital communications links
CN100558075C (en) Logic-based is realized the method and apparatus of dynamic speed adjustment for data packets
CN103888211B (en) A kind of method and device carried out data transmission between cross chips
CN102437991B (en) Method and device for synchronizing GFP (Generic Framing Procedure) bit streams
CN106209691A (en) A kind of network port mirror method possessing independent mac source address
CN102208973B (en) Data stream transmitting method and device
CN105897631A (en) Guest room night getup guidance 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
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.