WO2018120549A1 - Method and device for processing time stamp in ethernet passive optical network, and storage medium - Google Patents
Method and device for processing time stamp in ethernet passive optical network, and storage medium Download PDFInfo
- Publication number
- WO2018120549A1 WO2018120549A1 PCT/CN2017/082284 CN2017082284W WO2018120549A1 WO 2018120549 A1 WO2018120549 A1 WO 2018120549A1 CN 2017082284 W CN2017082284 W CN 2017082284W WO 2018120549 A1 WO2018120549 A1 WO 2018120549A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- timestamp
- frame
- mpcp
- delay
- olt
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0658—Clock or time synchronisation among packet nodes
- H04J3/0661—Clock or time synchronisation among packet nodes using timestamps
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J14/00—Optical multiplex systems
- H04J14/08—Time-division multiplex systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/16—Time-division multiplex systems in which the time allocation to individual channels within a transmission cycle is variable, e.g. to accommodate varying complexity of signals, to vary number of channels transmitted
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/16—Time-division multiplex systems in which the time allocation to individual channels within a transmission cycle is variable, e.g. to accommodate varying complexity of signals, to vary number of channels transmitted
- H04J3/1605—Fixed allocated frame structures
- H04J3/1652—Optical Transport Network [OTN]
- H04J3/167—Optical Transport Network [OTN] interaction with SDH/SONET, e.g. carrying SDH/SONET frames, interfacing with SDH/SONET
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/28—Flow control; Congestion control in relation to timing considerations
- H04L47/283—Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L7/00—Arrangements for synchronising receiver with transmitter
Definitions
- the present invention relates to a time synchronization technology in the field of network communication, and in particular, to a timestamp processing method and apparatus, and a storage medium in an Ethernet Passive Optical Network (EPON).
- EPON Ethernet Passive Optical Network
- EPON technology is an Ethernet-based Passive Optical Network (PON) technology that combines the technical advantages of Ethernet and PON to provide a high-speed platform for accessing data, voice and video services.
- the EPON system is composed of an optical line terminal (OLT), an optical network unit (ONU, an optical network unit), and an optical distribution network (ODN), and the EPON system adopts a point-to-multipoint topology. And the transmission mode of passive optical fiber, providing multiple services based on Ethernet.
- MPCP is the core protocol for solving the key technologies of EPON.
- MPCP is a protocol of the media access control (MAC) control sublayer in the EPON system. The protocol specifies the control mechanism between the OLT and the ONU, and coordinates the effective transmission and reception of data by providing ONU control management information, ONU bandwidth management information, and service monitoring information control.
- MAC media access control
- the multi-point MAC control function is the core of the MPCP; the multi-point MAC controls the sending and receiving of the MAC client, so that multiple MAC clients work in the point-to-multipoint optical network, and multiple MAC clients The ends are connected by a shared fiber.
- the multi-point MAC control needs to comply with certain delay requirements, that is, based on a strict timestamp (Timestamp), or called a timestamp mechanism, according to system requirements. Strict calculation of timing.
- the actual delay of the ONU processing In order to maintain the correctness of the timestamp, in addition to the timestamp carried in the MPCP frame received by the ONU, the actual delay of the ONU processing must be added to obtain the correct new timestamp in order to reset the internal counter of the ONU.
- the conventional method of processing the actual delay of the ONU is to set the processing delay of the data stream through the physical layer (PHY, Physical Layer), MAC layer and MPCP layer sub-modules to be fixed. The value of this fixed delay is based on the longest delay of each submodule in the actual situation.
- IPs are also included in the middle, such as Advanced Encryption Standard (AES), triple disturbance, etc., and the delay when the data flows through these IP processing is fixed. This brings a lot of implementation difficulty to some algorithms IP and module processing. Even if the delay is fixed, the required delay will be large.
- AES Advanced Encryption Standard
- the embodiments of the present invention are directed to providing a timestamp processing method and apparatus, and a storage medium in an EPON, aiming at solving the problem that a delay caused by a fixed delay processing is large in the existing timestamp calculation method.
- An embodiment of the present invention provides a method for processing a timestamp in an EPON, where the method includes:
- the Report frame is sent to the OLT.
- the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time.
- the first timestamp is a timestamp carried by the Gate frame delivered by the OLT.
- the method further includes:
- the detecting the delay of the data flow of each MPCP packet through the PCS and the delay of the MAC coding layer include:
- the method further includes:
- the counter of the ONU is updated by the second timestamp by a control character.
- the method further includes:
- the embodiment of the present invention further provides a timestamp processing device in an EPON, where the device includes: a first processor and a second processor; wherein
- the first processor is configured to detect a delay of the MPC packet data flow through the PCS and a delay of the MAC coding layer, and obtain a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes Report frame
- the second processor is configured to add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and After the Report frame is filled in the second timestamp, the Report frame is sent to the OLT.
- the device further includes: a third processor, configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame that matches the ONU, and intercept the Transmitting the length of the MPCP packet in the Gate frame and starting the transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
- a third processor configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame that matches the ONU, and intercept the Transmitting the length of the MPCP packet in the Gate frame and starting the transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
- the first processor is configured to: calculate, according to the delay information carried by the MPCP packet, and the current local timing of the ONU, the MPCP packet to pass through each processing module in the PCS and the MAC coding layer. And the time difference of the local timing, the delay information of the MPCP packet passing through the processing module in the PCS and the MAC coding layer is obtained; and the second timestamp is updated by the control symbol to update the counter of the ONU.
- the device further includes: a fourth processor, configured to calculate, after the second processor sends the Report frame to the OLT, according to the second timestamp, between the OLT and the ONU RTT, and adjust the authorization time of each ONU according to the RTT.
- a fourth processor configured to calculate, after the second processor sends the Report frame to the OLT, according to the second timestamp, between the OLT and the ONU RTT, and adjust the authorization time of each ONU according to the RTT.
- An embodiment of the present invention further provides a timestamp processing apparatus in an EPON, including:
- a memory for storing an executable program
- a processor for implementing the following steps by executing an executable program stored in the memory:
- the embodiment of the invention further provides a readable storage medium, which stores an executable program, and when the executable program is executed by the processor, the following steps are implemented:
- the timestamp processing method and device in the EPON provided by the embodiment of the present invention, and the storage medium, detecting the delay of each MPCP packet passing through the PCS and the delay of the MAC coding layer; acquiring the first time carried in the MPCP frame delivered by the OLT
- the MPCP frame includes a Report frame, and the first timestamp, the delay of the respective MPCP packets passing through the PCS, and the delay of the MAC encoding layer are added to obtain a second timestamp, and the After the report frame is filled in the second timestamp, Sending the Report frame to the OLT.
- Embodiments can also make the method of calculating the timestamp more accurate to better achieve synchronization between the ONU and the OLT.
- FIG. 1 is a schematic flowchart of a method for processing a timestamp in an EPON according to an embodiment of the present invention
- FIG. 2 is a schematic diagram of a format of an MPCP frame according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a format of a time synchronization mechanism between an OLT and an ONU according to an embodiment of the present invention
- FIG. 4 is a schematic diagram of data flow of a PCS and a MAC coding layer according to an embodiment of the present invention
- FIG. 5 is a schematic structural diagram of a structure of a timestamp processing apparatus in an EPON according to an embodiment of the present invention.
- the implementation process of the timestamp processing method in the EPON in the embodiment of the present invention includes the following steps:
- Step 101 Detect a delay of each MPCP packet data stream passing through the PCS and a delay of passing through the MAC encoding layer;
- the step specifically includes: calculating, according to the delay information carried by the current MPCP packet data stream and the local timing of the current ONU, the difference between the local timing of each MPCP packet data stream passing through each processing module in the PCS and the MAC coding layer, and obtaining the PCS through the PCS
- the final delay information of the processing module is processed in the MAC coding layer, and the final delay information of the processing module in the PCS and MAC coding layers is carried in the counter by the control character.
- the delay of each MPCP packet data stream passing through the MAC coding layer is mainly the MPCP packet.
- the data stream passes through the delay of the decryption module in the MAC coding layer.
- the local timing of the current ONU can be directly measured and obtained by the counter, which belongs to the prior art and will not be further described herein.
- the MPCP packet is included in the MPCP frame, and only one MPCP packet is encapsulated in one MPCP frame, that is, one MPCP packet corresponds to one MPCP frame.
- the MPCP packet operates on the network layer and the transport layer in the Open System Interconnection (OSI), and the MPCP frame operates on the data link layer in the OSI.
- OSI Open System Interconnection
- timestamps has been clearly defined in the IEEE802.3 standard protocol: within the OLT and ONU.
- the timestamp identifies the count value of the OLT when the MAC control frame is uploaded to the MAC layer, and the timestamp is mapped to the corresponding area of the MPCP frame sent by the OLT or ONU (see MPCP frame format).
- FIG. 2 shows the MPCP frame format.
- the MPCP frame format mainly includes: destination address (DA, Destination Address), source address (SA, Source Address), length or type (Length/Type), operation. Code (Opcode), Timestamp, Date/Reserved/Pad, and Frame Check Sequence (FCS).
- the DA occupies 6 bytes in the MPCP frame
- the SA occupies 6 bytes in the MPCP frame
- the Length/Type occupies 2 bytes in the MPCP frame
- the Opcode occupies 2 bytes in the MPCP frame
- the Timestamp occupies 4 bytes in the MPCP frame
- Date/Reserved/Pad occupies 40 bytes in the MPCP frame
- the FCS occupies 4 bytes in the MPCP frame.
- the 8 bits (b0-b7) in each byte are transmitted in order from left to right, that is, from low to high; at the same time, the bytes in each frame are sent in order from top to bottom. .
- Figure 3 shows the format of the OLT and ONU time synchronization mechanism, which can be seen from Figure 3.
- Out After the ONU receives the Gate frame, it does not delay until the time frame T3 is filled in before the Report frame is sent to the Report frame. To ensure the accuracy of the timestamp T3, Tn and Tn' must be guaranteed. The correct processing of this delay between.
- serializer/deserializer Serializer/Deserializer
- the delay during this time will be composed of the processing time of the PCS and MAC coding layers.
- the PCS can usually be divided into five modules: a bit-width conversion module (denoted as a gearbox module), a 66-bit sync header lock module (denoted as a SYNC module), and forward error correction (FEC). , Forward Error Correction) module, 66bit data descrambling module (denoted as DESCRAM module), 66b64b decoding module (denoted as 66b64b_DECODE module).
- Figure 4 shows the data flow direction of the PCS and MAC coding layers. As shown in Figure 4, after the data flows through the SerDes IP output, it passes through the gearbox module and then delimits through the SYNC module. After error correction by the FEC module, Then perform data descrambling operation, and finally enter the 66b64b decoding module. Since the data of the first four modules only has the concept of data stream and codeword, and there is no fixed format of the MPCP packet to conveniently carry the delay information of each module, the actual start of the recording delay should be after the 66b64b decoding module.
- the data format outputted by the 66b64b is a standardized 10Gb media independent interface (XGMII interface, 10Gigabit Media Independent Interface), where X corresponds to the Roman numeral 10.
- X corresponds to the Roman numeral 10.
- the delay of the data stream passing through the MAC coding layer is mainly delayed by the decryption module.
- the decryption module generally calls IP, and the processing of the data is complicated, and different IP types or different MPCP packet lengths will affect the processing of the delay. Therefore, the delay between the lengths of the MPCP packets is very different.
- Step 102 Acquire a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a Report frame.
- the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time;
- the first timestamp is a timestamp carried by the Gate frame in the MPCP frame delivered by the OLT.
- the method further includes:
- the OLT sends an MPCP frame to the specified ONU, where the MPCP frame contains the transmission information and the start time of the transmission.
- the Gate information in the transmission process is added with a local timestamp, that is, the transmission time is started.
- the first timestamp is mapped to the corresponding area in the MPCP frame format (corresponding to the Timestamp field).
- the ONU intercepts the transmission length and the start transmission time, and uses the timestamp (first timestamp) carried in the received Gate frame to update the local timing of the ONU, thereby eliminating the possibility.
- the clock drifts to ensure synchronization between the ONU and the OLT.
- the ONUs in the EPON system use the broadcast mode in the downlink direction and the time division multiple access (TDMA) in the uplink direction.
- TDMA time division multiple access
- the clock of the OLT and the clock of the ONU must be communicated.
- Initial stage one It needs to be synchronized until the end of the communication.
- the EPON needs to keep the synchronization of the entire network by using a timestamp, that is, the timestamp is first generated by the OLT, and the timestamp is sent to each ONU through the MPCP frame, and each ONU adjusts the timestamp by receiving the timestamp.
- the deviation between the local clock and the OLT clock so as to achieve the effect that each ONU synchronizes with the OLT.
- the OLT and the ONU need to complete the automatic registration process through the interaction of the other three types of MPCP control frames - REGISTER_REQ frame, REGISTER frame, and REGISTER_ACK frame.
- the registration process is as follows: the Gate frame is sent by the OLT, and the ONU that receives the Gate frame is allowed to send data immediately or within a specified time period; the ONU reports its state to the OLT through the Report frame, including where the ONU is synchronized. A timestamp, and whether there is data to be sent, etc.; the ONU sends a REGISTER_REQ frame to the OLT, that is, requests registration during the registration procedure; the OLT sends a REGISTER frame to notify the ONU that the registration request has been identified during the registration procedure; the ONU passes Sending a REGISTER_ACK frame indicates the registration confirmation during the registration procedure processing.
- Step 103 Add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and fill in the report frame. After the second timestamp is described, the Report frame is sent to the OLT.
- the method further includes:
- FIG. 3 shows the calculation process of the RTT: 1.
- the OLT sends a Gate frame from the MPCP layer to the ONU at time T1, and fills in the timestamp T1, and in actuality, the time when the Gate frame is officially sent from the SERDES link is T1', there is a time difference between T1 and T1'; 2.
- ONU receives the Gate frame from the SERDES link at time T2', and the data arrives at MPCP at time T2. Layer, reset the local counter, and set the timestamp at this time to T2; 3.
- ONU sends a Report frame at time T3, and fills the report frame with timestamp T3. The time when the Report frame is officially sent from the SERDES link is T3. '; 4.
- the ONU and the OLT will rely on the timestamp to implement unique clock synchronization.
- the OLT inserts the value of its local counter into the timestamp field, and the ONU inserts its own local count value into the timestamp field; the ONU is based on the received OLT.
- the timestamp, updating its own counter, the OLT calculates the RTT according to the timestamp of the received ONU, and then the OLT adjusts the authorization time of each ONU according to the RTT.
- the method for calculating the timestamp according to the embodiment of the present invention obtains the actual used delay according to the count of the internal counters recorded when each MPCP packet passes each module, without setting the maximum delay in advance. Fixed delay.
- the calculation method of the embodiment of the present invention greatly reduces the processing delay, optimizes the internal processing time, and is flexible and simple to implement, and also reduces some algorithm IP and module. The difficulty of implementation.
- an embodiment of the present invention further provides a timestamp processing apparatus in an EPON.
- the apparatus includes a first processor and a second processor.
- the first processor is configured to detect a delay of the MPC packet data flow through the PCS and a delay of the MAC coding layer, and obtain a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes Report frame
- the second processor is configured to add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and After the second timestamp is filled in the Report frame, the Report frame is sent to the OLT.
- the first processor is configured to calculate, according to the delay information carried in the current MPCP packet data stream and the local timing of the current ONU, each MPCP packet data stream is locally processed through each processing module in the PCS and MAC coding layers. The time difference is obtained, and the final delay information of the processing module in the PCS and MAC coding layers is obtained, and the final delay information of the processing module in the PCS and MAC coding layers is carried in the counter by the control character.
- the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time;
- the first timestamp is a timestamp carried by the Gate frame in the MPCP frame delivered by the OLT.
- the apparatus further includes: a third processor, configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame matching the ONU, and intercept the Gate The transmission length of the MPCP packet in the frame and the start transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
- a third processor configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame matching the ONU, and intercept the Gate The transmission length of the MPCP packet in the frame and the start transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
- the device further includes: a fourth processor, configured to: after the second processor sends the Report frame to the OLT, calculate an RTT between the OLT and the ONU according to the second timestamp, and according to The RTT adjusts the authorization time of each ONU.
- a fourth processor configured to: after the second processor sends the Report frame to the OLT, calculate an RTT between the OLT and the ONU according to the second timestamp, and according to The RTT adjusts the authorization time of each ONU.
- the first processor, the second processor, the third processor, and the fourth processor may be implemented on the OLT device or on the ONU device.
- the embodiment of the present invention detects a delay of the data flow of each MPCP packet through the PCS and a delay of the MAC coding layer; and obtains a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes a Report frame; The first timestamp, the delay of the respective MPCP packet data streams passing through the PCS, and the delay of the MAC encoding layer are added to obtain a second timestamp, and after the second timestamp is filled in the Report frame Sending the Report frame to the OLT. So, you can The processing time delay of the ONU is flexibly processed to avoid the problem that the delay is large due to the fixed delay processing in the existing timestamp calculation method, and the processing delay is optimized, and the internal processing time is optimized. The method of calculating the timestamp can be made more precise to better achieve synchronization between the ONU and the OLT.
- the embodiment of the present invention provides a timestamp processing device in an EPON, which can be applied to an ONU, and is applicable to a time synchronization scenario between an ONU and an OLT:
- the OLT sends an MPCP frame to the designated ONU.
- the MPCP frame contains the transmission length and the start transmission time, carries the local timestamp of the OLT, and is mapped to the corresponding area of the MPCP frame.
- the ONU intercepts the transmission length and starts the transmission time, and updates the ONU local timing. This is mainly done by the timestamp in the received Gate frame, thereby eliminating possible clock drift. Synchronization with the OLT is guaranteed.
- each ONU uplink is accessed by TDMA, and the clock of the OLT and the clock of the ONU are kept synchronized at the time when the communication does not start until the end of the communication to avoid data collision.
- the MPCP packet will come from the SerDes link and will pass through the physical layer PCS and the coding layer MAC.
- the physical layer PCS can be divided into five modules as shown in FIG. 5 according to the function.
- the Start control character start of a packet
- the flag S0 or S4 the counter of the MPCP packet processing module is recorded at this time.
- Count1 the MPCP packet obtained by the parsing is transmitted to the subsequent module in FIG. 5, and when the MPCP packet reaches the MPCP packet processing module of the encoding layer MAC, the counter count2 of the MPCP packet processing module is subtracted from the count1.
- the delay of the MPCP packet from the decoding module to the MPCP packet processing module can be obtained.
- Timestamp complete a time synchronization, repeat the above steps to continue the synchronization.
- This timestamp processing method is based on the time when each recorded MPCP packet arrives at each module.
- the counter is counted to get the actual delay, without the need to calculate the maximum delay as a fixed delay. Relatively speaking, this solution is flexible and convenient, and the delay is greatly reduced.
- the internal processing delay is based on the time when each recorded MPCP packet arrives at each module.
- the hardware structure of the time stamp processing device may include:
- a memory for storing an executable program
- the processor is configured to implement the timestamp processing method provided by the embodiment of the present invention by executing the executable program stored in the memory, for example, including at least the following steps:
- Embodiments of the present invention provide a storage medium storing an executable program, and the executable program is executed by a processor, for example, a time stamp processing method as shown in FIG. 1 .
- the storage medium of the embodiment of the present invention may be a storage medium such as an optical disk, a hard disk, or a magnetic disk, and may be a non-transitory storage medium.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Disclosed is a method for processing a time stamp in an EPON, the method comprising: detecting a delay in an MPCP packet passing through a PCS and a delay in same passing through an MAC coding layer; acquiring a first time stamp carried in an MPCP frame delivered by an OLT, wherein the MPCP frame comprises a Report frame; and adding the first time stamp, the delay in a data flow of each MPCP packet passing through the PCS and the delay in same passing through the MAC coding layer to obtain a second time stamp, and after the second time stamp is filled into the Report frame, sending the Report frame to the OLT. Further disclosed are a device for processing a time stamp in an EPON, and a storage medium.
Description
相关申请的交叉引用Cross-reference to related applications
本申请基于申请号为201611266568.3、申请日为2016年12月29日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的内容在此引入本申请作为参考。The present application is based on a Chinese patent application filed on Jan. 29, 2016, the entire disclosure of which is hereby incorporated by reference.
本发明涉及网络通信领域中的时间同步技术,尤其涉及一种以太网无源光网络(EPON,Ethernet Passive Optical Network)中的时间戳处理方法和装置、存储介质。The present invention relates to a time synchronization technology in the field of network communication, and in particular, to a timestamp processing method and apparatus, and a storage medium in an Ethernet Passive Optical Network (EPON).
随着因特网的不断发展,用户对高速接入网的需求与日俱增,EPON技术正是在这种形势下应运而生。EPON技术,是基于以太网的无源光网络(PON,Passive Optical Network)技术,融合了以太网和PON的技术优势,为实现数据、语音和视频业务的接入提供一个高速平台。其中,EPON系统由光线路终端(OLT,Optical Line Terminal)、光网络单元(ONU,Optical Network Unit)以及光分配网(ODN,Optical Distribution Network)组成,且EPON系统采用点到多点的拓扑结构,以及无源光纤的传输方式,在以太网的基础上提供多种业务。With the continuous development of the Internet, the demand for high-speed access networks is increasing, and EPON technology emerges in this situation. EPON technology is an Ethernet-based Passive Optical Network (PON) technology that combines the technical advantages of Ethernet and PON to provide a high-speed platform for accessing data, voice and video services. The EPON system is composed of an optical line terminal (OLT), an optical network unit (ONU, an optical network unit), and an optical distribution network (ODN), and the EPON system adopts a point-to-multipoint topology. And the transmission mode of passive optical fiber, providing multiple services based on Ethernet.
为实现各ONU上行带宽资源的合理分配,EPON系统需通过多点控制协议(MPCP,Multi-Point Control Protocol)来完成EPON设备间的带宽管理功能,因此,MPCP是解决EPON关键技术的核心协议。MPCP是EPON系统中介质访问控制(MAC,Media Access Control)控制子层的协议,该
协议规定了OLT和ONU之间的控制机制,通过提供ONU控制管理信息、ONU带宽管理信息,以及业务监控信息控制,来协调数据的有效发送和接收。In order to achieve reasonable allocation of uplink bandwidth resources of each ONU, the EPON system needs to implement the bandwidth management function between EPON devices through the Multi-Point Control Protocol (MPCP). Therefore, MPCP is the core protocol for solving the key technologies of EPON. MPCP is a protocol of the media access control (MAC) control sublayer in the EPON system.
The protocol specifies the control mechanism between the OLT and the ONU, and coordinates the effective transmission and reception of data by providing ONU control management information, ONU bandwidth management information, and service monitoring information control.
在EPON系统运行过程中,多点MAC控制功能是MPCP的核心;多点MAC通过控制MAC客户端的发送和接收,使多个MAC客户端工作在点到多点光网络中,且多个MAC客户端通过一条共享光纤连接起来。其中,上行方向上,在任意给定时刻每次仅允许一个MAC在网络中发送上行帧,使得多个MAC可以在共享介质上操作。因此,为避免数据发生冲突,以及考虑到数据兼容性,多点MAC控制需遵从一定的时延要求,即建立在严格的时间戳(Timestamp),或称为在时间戳机制上,根据系统要求对时序进行严格的计算。During the operation of the EPON system, the multi-point MAC control function is the core of the MPCP; the multi-point MAC controls the sending and receiving of the MAC client, so that multiple MAC clients work in the point-to-multipoint optical network, and multiple MAC clients The ends are connected by a shared fiber. Wherein, in the uplink direction, only one MAC is allowed to send an uplink frame in the network at any given moment, so that multiple MACs can operate on the shared medium. Therefore, in order to avoid data conflicts and to consider data compatibility, multi-point MAC control needs to comply with certain delay requirements, that is, based on a strict timestamp (Timestamp), or called a timestamp mechanism, according to system requirements. Strict calculation of timing.
为了维护时间戳的正确性,除了ONU所收到的MPCP帧携带的时间戳,还需加上ONU处理的实际延时,才能得到正确的新时间戳,以便重新设置ONU的内部计数器。然而,在传统的时间戳计算方法中,处理ONU实际延时的常规做法是:将数据流经过物理层(PHY,Physical Layer)、MAC层和MPCP层的各个子模块的处理延时设置为固定值;而这个固定的延时值是根据实际情况中各个子模块的最长延时得到的。由于各模块中对数据流的处理比较复杂,中间还包括多个IP,比如高级加密标准(AES,Advanced Encryption Standard)、三重扰动等,若想达到数据流经这些IP处理时的延时是固定的,这给一些算法IP和模块处理带来了很大的实现难度,即使实现了延时固定,所需要的延时也会很大。In order to maintain the correctness of the timestamp, in addition to the timestamp carried in the MPCP frame received by the ONU, the actual delay of the ONU processing must be added to obtain the correct new timestamp in order to reset the internal counter of the ONU. However, in the traditional timestamp calculation method, the conventional method of processing the actual delay of the ONU is to set the processing delay of the data stream through the physical layer (PHY, Physical Layer), MAC layer and MPCP layer sub-modules to be fixed. The value of this fixed delay is based on the longest delay of each submodule in the actual situation. Since the processing of the data stream in each module is complicated, a plurality of IPs are also included in the middle, such as Advanced Encryption Standard (AES), triple disturbance, etc., and the delay when the data flows through these IP processing is fixed. This brings a lot of implementation difficulty to some algorithms IP and module processing. Even if the delay is fixed, the required delay will be large.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种EPON中的时间戳处理方法和装置、存储介质,旨在解决现有时间戳计算方法中存在的因固定延时处理导致延时较大的问题。
In view of this, the embodiments of the present invention are directed to providing a timestamp processing method and apparatus, and a storage medium in an EPON, aiming at solving the problem that a delay caused by a fixed delay processing is large in the existing timestamp calculation method.
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供一种EPON中的时间戳处理方法,所述方法包括:An embodiment of the present invention provides a method for processing a timestamp in an EPON, where the method includes:
检测各个MPCP包数据流经过物理编码子层(PCS,Physical Coding Sublayer)的延时和经过MAC编码层的延时;Detecting a delay of each MPCP packet data stream passing through a physical coding sublayer (PCS, Physical Coding Sublayer) and a delay of passing through the MAC coding layer;
获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告(Report)帧;Obtaining a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a report frame;
将所述第一时间戳、所述各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the respective MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and filling the second frame with the second timestamp After the timestamp, the Report frame is sent to the OLT.
上述方案中,所述MPCP帧还包括选通(Gate)帧,所述Gate帧中包括MPCP包的传输长度和开始传输时间的信息;In the foregoing solution, the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time.
所述第一时间戳为所述OLT下发的所述Gate帧携带的时间戳。The first timestamp is a timestamp carried by the Gate frame delivered by the OLT.
上述方案中,在所述获取OLT下发的MPCP帧中携带的第一时间戳之后,所述方法还包括:In the foregoing solution, after the acquiring the first timestamp carried in the MPCP frame sent by the OLT, the method further includes:
接收与ONU匹配的Gate帧,截取所述Gate帧中MPCP包的传输长度和开始传输时间,并根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。Receiving a Gate frame that matches the ONU, intercepting a transmission length and a start transmission time of the MPCP packet in the Gate frame, and updating a local timing of the ONU according to the first timestamp carried in the Gate frame.
上述方案中,所述检测各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时,包括:In the foregoing solution, the detecting the delay of the data flow of each MPCP packet through the PCS and the delay of the MAC coding layer include:
根据所述MPCP包携带的延时信息、以及所述ONU当前的本地计时,计算所述MPCP包经过PCS和MAC编码层中各处理模块时所述本地计时的差值,得到所述MPCP包经过PCS和MAC编码层中处理模块的延时信息;Calculating, according to the delay information carried by the MPCP packet, and the current local timing of the ONU, the difference of the local timing when the MPCP packet passes through each processing module in the PCS and the MAC coding layer, to obtain the MPCP packet Delay information of the processing module in the PCS and MAC coding layers;
所述方法还包括:The method further includes:
通过控制符将所述第二时间戳更新所述ONU的计数器。
The counter of the ONU is updated by the second timestamp by a control character.
上述方案中,在所述将所述Report帧发送给所述OLT之后,所述方法还包括:In the above solution, after the sending the report frame to the OLT, the method further includes:
根据所述第二时间戳计算OLT与ONU之间的往返时延(RTT,Round Trip Time),并根据所述RTT调整每个ONU的授权时间。Calculating a round trip delay (RTT) between the OLT and the ONU according to the second timestamp, and adjusting an authorization time of each ONU according to the RTT.
本发明实施例还提供一种EPON中的时间戳处理装置,所述装置包括:第一处理器、第二处理器;其中,The embodiment of the present invention further provides a timestamp processing device in an EPON, where the device includes: a first processor and a second processor; wherein
所述第一处理器,配置为检测各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时,以及获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;The first processor is configured to detect a delay of the MPC packet data flow through the PCS and a delay of the MAC coding layer, and obtain a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes Report frame
所述第二处理器,配置为将所述第一时间戳、所述各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。The second processor is configured to add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and After the Report frame is filled in the second timestamp, the Report frame is sent to the OLT.
上述方案中,所述装置还包括:第三处理器,配置为在所述第一处理器获取OLT下发的MPCP帧中携带的第一时间戳之后,接收与ONU匹配的Gate帧,截取所述Gate帧中MPCP包的传输长度和开始传输时间,并根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。In the above solution, the device further includes: a third processor, configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame that matches the ONU, and intercept the Transmitting the length of the MPCP packet in the Gate frame and starting the transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
上述方案中,所述第一处理器,具体配置为:根据所述MPCP包携带的延时信息、以及所述ONU当前的本地计时,计算所述MPCP包经过PCS和MAC编码层中各处理模块时所述本地计时的差值,得到所述MPCP包经过PCS和MAC编码层中处理模块的延时信息;通过控制符将所述第二时间戳更新所述ONU的计数器。In the foregoing solution, the first processor is configured to: calculate, according to the delay information carried by the MPCP packet, and the current local timing of the ONU, the MPCP packet to pass through each processing module in the PCS and the MAC coding layer. And the time difference of the local timing, the delay information of the MPCP packet passing through the processing module in the PCS and the MAC coding layer is obtained; and the second timestamp is updated by the control symbol to update the counter of the ONU.
上述方案中,所述装置还包括:第四处理器,配置为在所述第二处理器将所述Report帧发送给所述OLT之后,根据所述第二时间戳计算OLT与ONU之间的RTT,并根据所述RTT调整每个ONU的授权时间。
In the above solution, the device further includes: a fourth processor, configured to calculate, after the second processor sends the Report frame to the OLT, according to the second timestamp, between the OLT and the ONU RTT, and adjust the authorization time of each ONU according to the RTT.
本发明实施例还提供一种以EPON中的时间戳处理装置,包括:An embodiment of the present invention further provides a timestamp processing apparatus in an EPON, including:
存储器,用于存储可执行程序;a memory for storing an executable program;
处理器,用于通过执行所述存储器中存储的可执行程序时实现以下步骤:a processor for implementing the following steps by executing an executable program stored in the memory:
检测MPCP包经过PCS的延时和经过介质访问控制MAC编码层的延时;Detecting the delay of the MPCP packet passing through the PCS and the delay of the MAC encoding layer after the medium access control;
获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a Report frame;
将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and after filling the second timestamp into the Report frame Sending the Report frame to the OLT.
本发明实施例还提供一种可读存储介质,存储有可执行程序,所述可执行程序被处理器执行时实现以下步骤:The embodiment of the invention further provides a readable storage medium, which stores an executable program, and when the executable program is executed by the processor, the following steps are implemented:
检测MPCP包经过PCS的延时和经过介质访问控制MAC编码层的延时;Detecting the delay of the MPCP packet passing through the PCS and the delay of the MAC encoding layer after the medium access control;
获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a report Report frame;
将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and after filling the second timestamp into the Report frame Sending the Report frame to the OLT.
本发明实施例提供的EPON中的时间戳处理方法和装置、存储介质,检测各个MPCP包经过PCS的延时和经过MAC编码层的延时;获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;将所述第一时间戳、所述各个MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,
将所述Report帧发送给所述OLT。如此,可以灵活处理ONU的实际处理延时,避免现有时间戳计算方法中存在的因固定延时处理导致延时较大的问题,不仅能够有效降低处理延时,优化内部处理时间;本发明实施例还可以使计算时间戳的方法更加精确,以更好地达到ONU与OLT的同步。The timestamp processing method and device in the EPON provided by the embodiment of the present invention, and the storage medium, detecting the delay of each MPCP packet passing through the PCS and the delay of the MAC coding layer; acquiring the first time carried in the MPCP frame delivered by the OLT The MPCP frame includes a Report frame, and the first timestamp, the delay of the respective MPCP packets passing through the PCS, and the delay of the MAC encoding layer are added to obtain a second timestamp, and the After the report frame is filled in the second timestamp,
Sending the Report frame to the OLT. In this way, the actual processing delay of the ONU can be flexibly processed to avoid the problem that the delay caused by the fixed delay processing in the existing timestamp calculation method is large, and the processing delay can be effectively reduced, and the internal processing time is optimized. Embodiments can also make the method of calculating the timestamp more accurate to better achieve synchronization between the ONU and the OLT.
图1为本发明实施例EPON中的时间戳处理方法的流程示意图;1 is a schematic flowchart of a method for processing a timestamp in an EPON according to an embodiment of the present invention;
图2为本发明实施例MPCP帧格式示意图;2 is a schematic diagram of a format of an MPCP frame according to an embodiment of the present invention;
图3为本发明实施例OLT和ONU时间同步机制格式示意图;3 is a schematic diagram of a format of a time synchronization mechanism between an OLT and an ONU according to an embodiment of the present invention;
图4为本发明实施例PCS和MAC编码层的数据流向示意图;4 is a schematic diagram of data flow of a PCS and a MAC coding layer according to an embodiment of the present invention;
图5为本发明实施例EPON中的时间戳处理装置的组成结构示意图。FIG. 5 is a schematic structural diagram of a structure of a timestamp processing apparatus in an EPON according to an embodiment of the present invention.
为了能够更加详尽地了解本发明实施例的特点与技术内容,下面结合附图对本发明实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本发明。The embodiments of the present invention are described in detail with reference to the accompanying drawings.
如图1所示,本发明实施例中EPON中的时间戳处理方法的实现流程,包括以下步骤:As shown in FIG. 1, the implementation process of the timestamp processing method in the EPON in the embodiment of the present invention includes the following steps:
步骤101:检测各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时;Step 101: Detect a delay of each MPCP packet data stream passing through the PCS and a delay of passing through the MAC encoding layer;
本步骤具体包括:根据当前MPCP包数据流携带的延时信息、以及当前ONU的本地计时,计算各个MPCP包数据流经过PCS和MAC编码层中各处理模块时本地计时的差值,得到经过PCS和MAC编码层中处理模块的最终延时信息,并通过控制符将所述PCS和MAC编码层中处理模块的最终延时信息携带在计数器中。The step specifically includes: calculating, according to the delay information carried by the current MPCP packet data stream and the local timing of the current ONU, the difference between the local timing of each MPCP packet data stream passing through each processing module in the PCS and the MAC coding layer, and obtaining the PCS through the PCS The final delay information of the processing module is processed in the MAC coding layer, and the final delay information of the processing module in the PCS and MAC coding layers is carried in the counter by the control character.
这里,各个MPCP包数据流经过MAC编码层的延时主要是MPCP包
数据流经过MAC编码层中解密模块的延时。Here, the delay of each MPCP packet data stream passing through the MAC coding layer is mainly the MPCP packet.
The data stream passes through the delay of the decryption module in the MAC coding layer.
这里,可以通过计数器直接测量并得到当前ONU的本地计时,属于现有技术,在此不再一一赘述。Here, the local timing of the current ONU can be directly measured and obtained by the counter, which belongs to the prior art and will not be further described herein.
其中,MPCP包包含在MPCP帧中,且一个MPCP帧中只封装有一个MPCP包,也就是说,一个MPCP包就对应一个MPCP帧。一般来说,MPCP包在开放式通信系统互联参考模型(OSI,Open System Interconnection)中的网络层和传输层上工作,MPCP帧在OSI中的数据链路层上工作。The MPCP packet is included in the MPCP frame, and only one MPCP packet is encapsulated in one MPCP frame, that is, one MPCP packet corresponds to one MPCP frame. In general, the MPCP packet operates on the network layer and the transport layer in the Open System Interconnection (OSI), and the MPCP frame operates on the data link layer in the OSI.
需要说明的是,在EPON系统、甚至在10G以太网无源光网络(XEPON,10Gigabit-EPON)系统中,时间戳的概念已经在IEEE802.3标准协议中有了明确定义:在OLT和ONU内部分别设置一个32位的计数器,并每隔16ns计数一次;也就是说,由计数器提供时间戳,来唯一标识OLT或ONU在某一时刻的时间。时间戳标识在MAC控制帧上传到MAC层时OLT的计数值,且时间戳会映射到OLT或ONU发送的MPCP帧的相应区域(参见MPCP帧格式)。It should be noted that in EPON systems and even in 10G Ethernet passive optical networks (XEPON, 10Gigabit-EPON) systems, the concept of timestamps has been clearly defined in the IEEE802.3 standard protocol: within the OLT and ONU. Set a 32-bit counter and count it every 16 ns; that is, the counter provides a timestamp to uniquely identify the time of the OLT or ONU at a certain time. The timestamp identifies the count value of the OLT when the MAC control frame is uploaded to the MAC layer, and the timestamp is mapped to the corresponding area of the MPCP frame sent by the OLT or ONU (see MPCP frame format).
图2给出了MPCP帧格式示意图,如图2所示,MPCP帧格式主要包括:目的地址(DA,Destination Address)、源地址(SA,Source Address)、长度或类型(Length/Type)、操作码(Opcode)、Timestamp、日期/保留/填充(Date/Reserved/Pad)、以及帧校验序列(FCS,Frame Check Sequence)。其中,DA占用MPCP帧中的6个字节,SA占用MPCP帧中的6个字节,Length/Type占用MPCP帧中的2个字节,Opcode占用MPCP帧中的2个字节,Timestamp占用MPCP帧中的4个字节,Date/Reserved/Pad占用MPCP帧中的40个字节,FCS占用MPCP帧中的4个字节。需要特别指出的是,每个字节中的8位(b0-b7)按照从左到右,即从低位到高位的顺序发送;同时,每帧内的字节按照从上到下的顺序发送。Figure 2 shows the MPCP frame format. As shown in Figure 2, the MPCP frame format mainly includes: destination address (DA, Destination Address), source address (SA, Source Address), length or type (Length/Type), operation. Code (Opcode), Timestamp, Date/Reserved/Pad, and Frame Check Sequence (FCS). The DA occupies 6 bytes in the MPCP frame, the SA occupies 6 bytes in the MPCP frame, the Length/Type occupies 2 bytes in the MPCP frame, and the Opcode occupies 2 bytes in the MPCP frame, and the Timestamp occupies 4 bytes in the MPCP frame, Date/Reserved/Pad occupies 40 bytes in the MPCP frame, and the FCS occupies 4 bytes in the MPCP frame. In particular, the 8 bits (b0-b7) in each byte are transmitted in order from left to right, that is, from low to high; at the same time, the bytes in each frame are sent in order from top to bottom. .
图3给出了OLT和ONU时间同步机制格式示意图,从图3中可以看
出:ONU接收到Gate帧后,直到发送Report帧,并向Report帧填入时间戳T3之前,中间有一段时间的延时,为了保证计算时间戳T3的准确性,必须保证Tn和Tn’之间这段延时的正确处理。Figure 3 shows the format of the OLT and ONU time synchronization mechanism, which can be seen from Figure 3.
Out: After the ONU receives the Gate frame, it does not delay until the time frame T3 is filled in before the Report frame is sent to the Report frame. To ensure the accuracy of the timestamp T3, Tn and Tn' must be guaranteed. The correct processing of this delay between.
根据EPON/XEPON协议可知,数据从串行器/解串器(SerDes,Serializer/Deserializer)链路发送过来,在这段时间内的延时,将由PCS和MAC编码层两部分的处理时间组成。According to the EPON/XEPON protocol, data is sent from the serializer/deserializer (SerDes, Serializer/Deserializer) link. The delay during this time will be composed of the processing time of the PCS and MAC coding layers.
根据各模块的功能不同,通常可以将PCS划分为五个模块:位宽转换模块(记为gearbox模块)、66比特(bit)同步头锁定模块(记为SYNC模块)、前向纠错(FEC,Forward Error Correction)模块、66bit数据解扰模块(记为DESCRAM模块)、66b64b解码模块(记为66b64b_DECODE模块)。当数据流经过PCS中的上述各个模块时,记录下各个模块的延时,并且和数据流一起向后传递,这样,在后面的模块记录当前延时时,可以参考数据流所携带记录的之前模块的延时。Depending on the function of each module, the PCS can usually be divided into five modules: a bit-width conversion module (denoted as a gearbox module), a 66-bit sync header lock module (denoted as a SYNC module), and forward error correction (FEC). , Forward Error Correction) module, 66bit data descrambling module (denoted as DESCRAM module), 66b64b decoding module (denoted as 66b64b_DECODE module). When the data flows through the above modules in the PCS, the delay of each module is recorded and transmitted backwards together with the data stream, so that when the current module records the current delay, it can refer to the data stream before the record is carried. Module delay.
图4给出了PCS和MAC编码层的数据流向示意图,如图4所示,数据流经SerDes IP输出后,首先经过gearbox模块,然后经过SYNC模块的定界,经过FEC模块的纠错后,再进行数据解扰操作,最后进入66b64b解码模块。由于经前四个模块的数据中只有数据流和codeword的概念,并没有MPCP包的固定格式来方便携带各模块的延时信息,因此,真正开始记录延时应该是在66b64b解码模块之后。这样,经过66b64b解码之后,可以得到Start控制符(一个包的开始)携带各模块的延时,将其标记为S0或S4,此时,就可以记录下MPCP包处理模块的当前延时,并跟随解析得到的包数据一起向后面的模块传递。Figure 4 shows the data flow direction of the PCS and MAC coding layers. As shown in Figure 4, after the data flows through the SerDes IP output, it passes through the gearbox module and then delimits through the SYNC module. After error correction by the FEC module, Then perform data descrambling operation, and finally enter the 66b64b decoding module. Since the data of the first four modules only has the concept of data stream and codeword, and there is no fixed format of the MPCP packet to conveniently carry the delay information of each module, the actual start of the recording delay should be after the 66b64b decoding module. In this way, after 66b64b decoding, you can get the delay of the Start control character (the beginning of a packet) carrying each module, mark it as S0 or S4, at this time, you can record the current delay of the MPCP packet processing module, and The packet data that follows the parsing is passed along to the subsequent modules.
这里,66b64b解码后输出的数据格式为标准化的10Gb独立于媒体的接口(XGMII接口,10Gigabit Media Independent Interface),其中,X对应罗马数字10。此时,数据流经过MAC编码层的延时主要是经过解密模块的延
时,即根据数据流解析得到的加密情况,判断数据流是进入AES解密模块、三重扰动模块,还是非解密模块。解密模块一般调用的都是IP,对数据的处理比较复杂,且不同的IP类型或不同的MPCP包长度都会影响延时的处理,因此,各MPCP包长之间延时的差异很大。Here, the data format outputted by the 66b64b is a standardized 10Gb media independent interface (XGMII interface, 10Gigabit Media Independent Interface), where X corresponds to the Roman numeral 10. At this time, the delay of the data stream passing through the MAC coding layer is mainly delayed by the decryption module.
When the data stream is parsed according to the data stream, it is determined whether the data stream enters the AES decryption module, the triple disturbance module, or the non-decryption module. The decryption module generally calls IP, and the processing of the data is complicated, and different IP types or different MPCP packet lengths will affect the processing of the delay. Therefore, the delay between the lengths of the MPCP packets is very different.
步骤102:获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;Step 102: Acquire a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a Report frame.
这里,所述MPCP帧还包括Gate帧,所述Gate帧中包括MPCP包的传输长度和开始传输时间的信息;Here, the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time;
所述第一时间戳为所述OLT下发的所述MPCP帧中Gate帧携带的时间戳。The first timestamp is a timestamp carried by the Gate frame in the MPCP frame delivered by the OLT.
这里,在本步骤中获取OLT下发的MPCP帧中携带的第一时间戳之后,所述方法还包括:Here, after obtaining the first timestamp carried in the MPCP frame delivered by the OLT in this step, the method further includes:
接收与ONU匹配的Gate帧,截取所述Gate帧中MPCP包的传输长度和开始传输时间,并根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。Receiving a Gate frame that matches the ONU, intercepting a transmission length and a start transmission time of the MPCP packet in the Gate frame, and updating a local timing of the ONU according to the first timestamp carried in the Gate frame.
具体来说,OLT发送MPCP帧给指定的ONU,该MPCP帧中含有传输长度和开始传输时间的Gate信息,其中,该传输过程中的Gate信息会被加上本地时间戳,即表示开始传输时间的第一时间戳,并将所述第一时间戳映射到MPCP帧格式中的相应区域(对应Timestamp域)。ONU在接收到与自身匹配的Gate帧后,就会截取传输长度和开始传输时间,同时使用接收到的Gate帧中携带的时间戳(第一时间戳)来更新ONU的本地计时,从而消除可能的时钟漂移,使ONU与OLT之间的同步得到保障。Specifically, the OLT sends an MPCP frame to the specified ONU, where the MPCP frame contains the transmission information and the start time of the transmission. The Gate information in the transmission process is added with a local timestamp, that is, the transmission time is started. The first timestamp is mapped to the corresponding area in the MPCP frame format (corresponding to the Timestamp field). After receiving the Gate frame matching with itself, the ONU intercepts the transmission length and the start transmission time, and uses the timestamp (first timestamp) carried in the received Gate frame to update the local timing of the ONU, thereby eliminating the possibility. The clock drifts to ensure synchronization between the ONU and the OLT.
由于EPON系统中各ONU在下行方向采用广播方式、在上行方向采用时分复用(TDMA,Time Division Multiple Access)方式接入,为了避免数据发生冲突,必须要求OLT的时钟和ONU的时钟在通信未开始阶段,一
直到通信结束这段时间内都需保持同步。换句话来说就是,EPON需通过时间戳来保持整个网络的同步,即首先由OLT产生时间戳,并通过MPCP帧将该时间戳发送给各ONU,各ONU通过接收该时间戳来调整其本地时钟与OLT时钟的偏差,从而实现各ONU同步于OLT的效果。The ONUs in the EPON system use the broadcast mode in the downlink direction and the time division multiple access (TDMA) in the uplink direction. To avoid data collision, the clock of the OLT and the clock of the ONU must be communicated. Initial stage, one
It needs to be synchronized until the end of the communication. In other words, the EPON needs to keep the synchronization of the entire network by using a timestamp, that is, the timestamp is first generated by the OLT, and the timestamp is sent to each ONU through the MPCP frame, and each ONU adjusts the timestamp by receiving the timestamp. The deviation between the local clock and the OLT clock, so as to achieve the effect that each ONU synchronizes with the OLT.
除了上面涉及到的Report帧和Gate帧,OLT和ONU之间还需通过另外三种类型的MPCP控制帧-REGISTER_REQ帧、REGISTER帧、以及REGISTER_ACK帧的交互来完成自动注册过程。In addition to the Report frame and the Gate frame mentioned above, the OLT and the ONU need to complete the automatic registration process through the interaction of the other three types of MPCP control frames - REGISTER_REQ frame, REGISTER frame, and REGISTER_ACK frame.
具体来说,注册过程大致如下:由OLT发送Gate帧,允许接收到Gate帧的ONU立即或者在指定的时间段内发送数据;ONU通过Report帧向OLT报告自身的状态,包括该ONU同步于哪一个时间戳、以及是否有数据需要发送等;ONU向OLT发送REGISTER_REQ帧,即在注册规程处理过程中请求注册;OLT发送REGISTER帧来通知ONU在注册规程处理过程中已经识别了注册请求;ONU通过发送REGISTER_ACK帧表明在注册规程处理过程中的注册确认。Specifically, the registration process is as follows: the Gate frame is sent by the OLT, and the ONU that receives the Gate frame is allowed to send data immediately or within a specified time period; the ONU reports its state to the OLT through the Report frame, including where the ONU is synchronized. A timestamp, and whether there is data to be sent, etc.; the ONU sends a REGISTER_REQ frame to the OLT, that is, requests registration during the registration procedure; the OLT sends a REGISTER frame to notify the ONU that the registration request has been identified during the registration procedure; the ONU passes Sending a REGISTER_ACK frame indicates the registration confirmation during the registration procedure processing.
步骤103:将所述第一时间戳、所述各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Step 103: Add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and fill in the report frame. After the second timestamp is described, the Report frame is sent to the OLT.
这里,在本步骤中将所述Report帧发送给所述OLT之后,所述方法还包括:Here, after the report frame is sent to the OLT in this step, the method further includes:
根据所述第二时间戳计算OLT与ONU之间的RTT,并根据所述RTT调整每个ONU的授权时间。Calculating an RTT between the OLT and the ONU according to the second timestamp, and adjusting an authorization time of each ONU according to the RTT.
具体地,图3表示了RTT的计算过程:1.OLT在T1时刻从MPCP层向ONU发送Gate帧,并填入时间戳T1,而实际情况中Gate帧从SERDES链路上正式发送的时刻为T1’,可见T1到T1’之间还有一段时间差;2.ONU在T2’时刻从SERDES链路上接收到Gate帧,在T2时刻数据到达MPCP
层,复位本地计数器,并将此时的时间戳置为T2;3.ONU在T3时刻发送Report帧,并向Report帧填入时间戳T3,Report帧从SERDES链路上正式发送的时刻为T3’;4.OLT在T4’时刻从SERDES链路上接收到Report帧,而实际情况中数据到达MPCP层的时刻为T4;由此可以得到RTT的计算公式为:RTT=T2’-T1’+T4’-T3’。其中,实际情况中都是在MPCP层计算RTT,从图3可以看出,记录的时间戳到在SERDES链路上正式发送数据时,会存在一段延时。Specifically, FIG. 3 shows the calculation process of the RTT: 1. The OLT sends a Gate frame from the MPCP layer to the ONU at time T1, and fills in the timestamp T1, and in actuality, the time when the Gate frame is officially sent from the SERDES link is T1', there is a time difference between T1 and T1'; 2. ONU receives the Gate frame from the SERDES link at time T2', and the data arrives at MPCP at time T2.
Layer, reset the local counter, and set the timestamp at this time to T2; 3. ONU sends a Report frame at time T3, and fills the report frame with timestamp T3. The time when the Report frame is officially sent from the SERDES link is T3. '; 4. The OLT receives the Report frame from the SERDES link at time T4', and the time when the data reaches the MPCP layer in the actual situation is T4; thus the formula for calculating the RTT is: RTT=T2'-T1'+ T4'-T3'. In the actual situation, the RTT is calculated at the MPCP layer. As can be seen from Figure 3, there is a delay when the recorded timestamp is officially transmitted on the SERDES link.
这里,ONU与OLT之间将依靠时间戳来实现唯一的时钟同步,OLT将自己本地计数器的值插入时间戳域中,且ONU将自己本地计数值插入时间戳域中;ONU根据收到的OLT的时间戳,更新自身的计数器,OLT根据收到的ONU的时间戳计算RTT,接着OLT根据RTT来调整每个ONU的授权时间。Here, the ONU and the OLT will rely on the timestamp to implement unique clock synchronization. The OLT inserts the value of its local counter into the timestamp field, and the ONU inserts its own local count value into the timestamp field; the ONU is based on the received OLT. The timestamp, updating its own counter, the OLT calculates the RTT according to the timestamp of the received ONU, and then the OLT adjusts the authorization time of each ONU according to the RTT.
综上可见,本发明实施例提出的这种时间戳的计算方法,根据所记录的各个MPCP包经过各模块时内部计数器的计数,得到实际所用的延时,而不需要事先设置最大延时作为固定延时。相比较于传统的时间戳计算方法,本发明实施例的这种计算方法在很大程度上降低了处理延时,优化了内部处理时间,且实现方式灵活简便,还降低了一些算法IP和模块处理的实现难度。In summary, the method for calculating the timestamp according to the embodiment of the present invention obtains the actual used delay according to the count of the internal counters recorded when each MPCP packet passes each module, without setting the maximum delay in advance. Fixed delay. Compared with the traditional timestamp calculation method, the calculation method of the embodiment of the present invention greatly reduces the processing delay, optimizes the internal processing time, and is flexible and simple to implement, and also reduces some algorithm IP and module. The difficulty of implementation.
为实现上述方法,本发明实施例还提供了一种EPON中的时间戳处理装置,如图5所示,该装置包括第一处理器、第二处理器;其中,To implement the above method, an embodiment of the present invention further provides a timestamp processing apparatus in an EPON. As shown in FIG. 5, the apparatus includes a first processor and a second processor.
所述第一处理器,配置为检测各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时,以及获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;The first processor is configured to detect a delay of the MPC packet data flow through the PCS and a delay of the MAC coding layer, and obtain a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes Report frame
所述第二处理器,配置为将所述第一时间戳、所述各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并
在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。The second processor is configured to add the first timestamp, the delay of each MPCP packet data stream to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and
After the second timestamp is filled in the Report frame, the Report frame is sent to the OLT.
其中,所述第一处理器,具体配置为:根据当前MPCP包数据流携带的延时信息、以及当前ONU的本地计时,计算各个MPCP包数据流经过PCS和MAC编码层中各处理模块时本地计时的差值,得到经过PCS和MAC编码层中处理模块的最终延时信息,并通过控制符将所述PCS和MAC编码层中处理模块的最终延时信息携带在计数器中。The first processor is configured to calculate, according to the delay information carried in the current MPCP packet data stream and the local timing of the current ONU, each MPCP packet data stream is locally processed through each processing module in the PCS and MAC coding layers. The time difference is obtained, and the final delay information of the processing module in the PCS and MAC coding layers is obtained, and the final delay information of the processing module in the PCS and MAC coding layers is carried in the counter by the control character.
这里,所述MPCP帧还包括Gate帧,所述Gate帧中包括MPCP包的传输长度和开始传输时间的信息;Here, the MPCP frame further includes a Gate frame, where the Gate frame includes information about a transmission length of the MPCP packet and a start transmission time;
所述第一时间戳为所述OLT下发的所述MPCP帧中Gate帧携带的时间戳。The first timestamp is a timestamp carried by the Gate frame in the MPCP frame delivered by the OLT.
这里,所述装置还包括:第三处理器,配置为在所述第一处理器获取OLT下发的MPCP帧中携带的第一时间戳之后,接收与ONU匹配的Gate帧,截取所述Gate帧中MPCP包的传输长度和开始传输时间,并根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。Here, the apparatus further includes: a third processor, configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame matching the ONU, and intercept the Gate The transmission length of the MPCP packet in the frame and the start transmission time, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
所述装置还包括:第四处理器,配置为在所述第二处理器将所述Report帧发送给所述OLT之后,根据所述第二时间戳计算OLT与ONU之间的RTT,并根据所述RTT调整每个ONU的授权时间。The device further includes: a fourth processor, configured to: after the second processor sends the Report frame to the OLT, calculate an RTT between the OLT and the ONU according to the second timestamp, and according to The RTT adjusts the authorization time of each ONU.
在实际应用中,所述第一处理器、第二处理器、第三处理器、第四处理器既可以位于OLT设备上实现,也可以位于ONU设备上实现。In an actual application, the first processor, the second processor, the third processor, and the fourth processor may be implemented on the OLT device or on the ONU device.
本发明实施例检测各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时;获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;将所述第一时间戳、所述各个MPCP包数据流经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。如此,可以
灵活处理ONU的实际处理延时,避免现有时间戳计算方法中存在的因固定延时处理导致延时较大的问题,不仅能够有效降低处理延时,优化内部处理时间;本发明实施例还可以使计算时间戳的方法更加精确,以更好地达到ONU与OLT的同步。The embodiment of the present invention detects a delay of the data flow of each MPCP packet through the PCS and a delay of the MAC coding layer; and obtains a first timestamp carried in the MPCP frame sent by the OLT, where the MPCP frame includes a Report frame; The first timestamp, the delay of the respective MPCP packet data streams passing through the PCS, and the delay of the MAC encoding layer are added to obtain a second timestamp, and after the second timestamp is filled in the Report frame Sending the Report frame to the OLT. So, you can
The processing time delay of the ONU is flexibly processed to avoid the problem that the delay is large due to the fixed delay processing in the existing timestamp calculation method, and the processing delay is optimized, and the internal processing time is optimized. The method of calculating the timestamp can be made more precise to better achieve synchronization between the ONU and the OLT.
本发明实施例提供EPON中的时间戳处理装置,可以应用于ONU中,适用于ONU与OLT的时间同步的场景:The embodiment of the present invention provides a timestamp processing device in an EPON, which can be applied to an ONU, and is applicable to a time synchronization scenario between an ONU and an OLT:
OLT发送MPCP帧给指定的ONU,该MPCP帧含有传输长度和开始传输时间,携带OLT的本地时间戳,并映射到MPCP帧的相应区域。ONU接收到与自己匹配的Gate帧后,就会截取传输长度和开始传输时间,同时更新ONU本地计时,这主要通过接收到的Gate帧中的时间戳来完成,从而消除可能的时钟漂移,使得与OLT的同步得到保障。EPON系统中各ONU上行采用TDMA方式接入,OLT的时钟和ONU的时钟在通信未开始到通信结束的时间保持同步以避免数据发生冲突。The OLT sends an MPCP frame to the designated ONU. The MPCP frame contains the transmission length and the start transmission time, carries the local timestamp of the OLT, and is mapped to the corresponding area of the MPCP frame. After receiving the Gate frame matching with itself, the ONU intercepts the transmission length and starts the transmission time, and updates the ONU local timing. This is mainly done by the timestamp in the received Gate frame, thereby eliminating possible clock drift. Synchronization with the OLT is guaranteed. In the EPON system, each ONU uplink is accessed by TDMA, and the clock of the OLT and the clock of the ONU are kept synchronized at the time when the communication does not start until the end of the communication to avoid data collision.
举例来说,对于设置时间戳处理装置的ONU,MPCP包从SerDes链路而来,将经过物理层PCS和编码层MAC。For example, for an ONU that sets up a timestamp processing device, the MPCP packet will come from the SerDes link and will pass through the physical layer PCS and the coding layer MAC.
物理层PCS根据功能可划分为如图5所示的5个模块,经过66b64b解码模块之后可以得到Start控制符(一个包的开始)标记S0或S4,此时记录下MPCP包处理模块的计数器计数count1,跟随解析得到的MPCP包一起向图5中的后续模块传递,等到MPCP包到达编码层MAC的MPCP包处理模块的时候,将此时MPCP包处理模块的计数器的计数count2与count1相减,就可以得到MPCP包从解码模块到MPCP包处理模块的延时。将这部分的延时加上FEC解码的延时,再加上接收到的OLT下发的Gate帧中的时间戳,就可以得到新的时间戳,将ONU内部的本地计数器更新为此新得到的时间戳,完成一次时间的同步,重复上述步骤以继续同步。The physical layer PCS can be divided into five modules as shown in FIG. 5 according to the function. After the 66b64b decoding module, the Start control character (start of a packet) can be obtained with the flag S0 or S4, and the counter of the MPCP packet processing module is recorded at this time. Count1, the MPCP packet obtained by the parsing is transmitted to the subsequent module in FIG. 5, and when the MPCP packet reaches the MPCP packet processing module of the encoding layer MAC, the counter count2 of the MPCP packet processing module is subtracted from the count1. The delay of the MPCP packet from the decoding module to the MPCP packet processing module can be obtained. Adding the delay of this part to the delay of FEC decoding, and adding the timestamp in the Gate frame sent by the OLT, you can get a new timestamp and update the local counter inside the ONU to this new one. Timestamp, complete a time synchronization, repeat the above steps to continue the synchronization.
这种时间戳的处理方法,根据所记录的各个MPCP包到达各模块时内
部计数器的计数来得到实际所用的延时,而不需要事先算好最大延时来作为固定延时,相对来说,这种解决方案灵活方便,还很大程度上减小了延时,优化了内部处理延时。This timestamp processing method is based on the time when each recorded MPCP packet arrives at each module.
The counter is counted to get the actual delay, without the need to calculate the maximum delay as a fixed delay. Relatively speaking, this solution is flexible and convenient, and the delay is greatly reduced. The internal processing delay.
就时间戳处理装置的硬件结构举例来说,可以包括:For example, the hardware structure of the time stamp processing device may include:
存储器,用于存储可执行程序;a memory for storing an executable program;
处理器,用于通过执行所述存储器中存储的可执行程序时实现本发明实施例提供的时间戳处理方法,例如,至少包括以下步骤:The processor is configured to implement the timestamp processing method provided by the embodiment of the present invention by executing the executable program stored in the memory, for example, including at least the following steps:
检测MPCP包经过CS的延时和经过MAC编码层的延时;Detecting the delay of the MPCP packet passing through the CS and the delay of passing through the MAC coding layer;
获取OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the OLT, where the MPCP frame includes a Report frame;
将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and after filling the second timestamp into the Report frame Sending the Report frame to the OLT.
本发明实施例提供一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时间戳的处理方法,例如,如图1所示的时间戳处理方法。本发明实施例的存储介质可为光盘、硬盘或磁盘等存储介质,可选为非瞬间存储介质。Embodiments of the present invention provide a storage medium storing an executable program, and the executable program is executed by a processor, for example, a time stamp processing method as shown in FIG. 1 . The storage medium of the embodiment of the present invention may be a storage medium such as an optical disk, a hard disk, or a magnetic disk, and may be a non-transitory storage medium.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和
/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each of the processes and/or blocks in the flowcharts and/or block diagrams, and in the flowcharts and/or block diagrams, can be implemented by computer program instructions.
/ or a combination of boxes. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。
The above is only the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in Within the scope of protection of the present invention.
Claims (12)
- 一种以太网无源光网络EPON中的时间戳处理方法,所述方法包括:A timestamp processing method in an Ethernet passive optical network EPON, the method comprising:检测多点控制协议MPCP包经过物理编码子层PCS的延时和经过介质访问控制MAC编码层的延时;Detecting the delay of the multi-point control protocol MPCP packet passing through the physical coding sub-layer PCS and the delay of the medium access control MAC coding layer;获取光线路终端OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the optical line terminal OLT, where the MPCP frame includes a report Report frame;将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and after filling the second timestamp into the Report frame Sending the Report frame to the OLT.
- 根据权利要求1所述的方法,其中,The method of claim 1 wherein所述MPCP帧还包括选通Gate帧,所述Gate帧中包括MPCP包的传输长度和开始传输时间;The MPCP frame further includes a strobe Gate frame, where the Gate frame includes a transmission length of the MPCP packet and a start transmission time;所述第一时间戳为所述OLT下发所述Gate帧中携带的时间戳。The first timestamp is a timestamp carried in the Gate frame by the OLT.
- 根据权利要求2所述的方法,其中,在所述获取OLT下发的MPCP帧中携带的第一时间戳之后,所述方法还包括:The method according to claim 2, wherein after the acquiring the first timestamp carried in the MPCP frame delivered by the OLT, the method further includes:接收与光网络单元ONU匹配的Gate帧,截取所述Gate帧中所述MPCP包的传输长度和开始传输时间、根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。Receiving a Gate frame that matches the optical network unit ONU, intercepting the transmission length and the start transmission time of the MPCP packet in the Gate frame, and updating the local timing of the ONU according to the first timestamp carried in the Gate frame.
- 根据权利要求1所述的方法,其中,所述检测MPCP包经过PCS的延时和经过MAC编码层的延时,包括:The method according to claim 1, wherein the detecting the delay of the MPCP packet passing through the PCS and the delay of the MAC encoding layer include:根据所述MPCP包携带的延时信息、以及所述ONU当前的本地计时,计算所述MPCP包经过PCS和MAC编码层中各处理模块时所述本地计时的差值,得到所述MPCP包经过PCS和MAC编码层中处理模块的延时信息;Calculating, according to the delay information carried by the MPCP packet, and the current local timing of the ONU, the difference of the local timing when the MPCP packet passes through each processing module in the PCS and the MAC coding layer, to obtain the MPCP packet Delay information of the processing module in the PCS and MAC coding layers;所述方法还包括: The method further includes:通过控制符将所述第二时间戳更新所述ONU的计数器。The counter of the ONU is updated by the second timestamp by a control character.
- 根据权利要求1所述的方法,其中,在所述将所述帧发送给所述OLT之后,所述方法还包括:The method of claim 1, wherein after the transmitting the frame to the OLT, the method further comprises:根据所述第二时间戳计算所述OLT与所述ONU之间的往返时延RTT,并根据所述RTT调整所述ONU的授权时间。Calculating a round-trip delay RTT between the OLT and the ONU according to the second timestamp, and adjusting an authorization time of the ONU according to the RTT.
- 一种以太网无源光网络EPON中的时间戳处理装置,所述装置包括:第一处理器和第二处理器;其中,A timestamp processing device in an Ethernet passive optical network EPON, the device comprising: a first processor and a second processor; wherein所述第一处理器,配置为检测所述多点控制协议MPCP包经过物理编码子层PCS的延时和经过介质访问控制MAC编码层的延时,以及获取光线路终端OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告Report帧;The first processor is configured to detect a delay of the multi-point control protocol MPCP packet passing through the physical coding sub-layer PCS and a delay of the medium access control MAC coding layer, and obtain an MPCP frame sent by the optical line terminal OLT a first timestamp carried in the MPCP frame, including a report report frame;所述第二处理器,配置为将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。The second processor is configured to add the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and in the report frame After filling in the second timestamp, the Report frame is sent to the OLT.
- 根据权利要求6所述的装置,其中,所述MPCP帧还包括选通Gate帧,所述Gate帧中包括所述MPCP包的传输长度和开始传输时间;The apparatus according to claim 6, wherein the MPCP frame further comprises a gated Gate frame, wherein the Gate frame includes a transmission length and a start transmission time of the MPCP packet;所述第一时间戳为所述OLT下发的所述Gate帧携带的时间戳。The first timestamp is a timestamp carried by the Gate frame delivered by the OLT.
- 根据权利要求7所述的装置,其中,所述装置还包括:The apparatus of claim 7 wherein said apparatus further comprises:第三处理器,配置为在所述第一处理器获取OLT下发的MPCP帧中携带的第一时间戳之后,接收与所述ONU匹配的Gate帧,截取所述Gate帧中所述MPCP包的传输长度和开始传输时间,根据所述Gate帧中携带的第一时间戳,更新所述ONU的本地计时。The third processor is configured to: after the first processor acquires the first timestamp carried in the MPCP frame sent by the OLT, receive a Gate frame that matches the ONU, and intercept the MPCP packet in the Gate frame. The transmission length and the start transmission time are updated according to the first timestamp carried in the Gate frame, and the local timing of the ONU is updated.
- 根据权利要求6所述的装置,其中,The apparatus according to claim 6, wherein所述第一处理器,具体配置为:根据所述MPCP包携带的延时信息、以及所述ONU当前的本地计时,计算所述MPCP包经过PCS和MAC编码 层中各处理模块时所述本地计时的差值,得到所述MPCP包经过PCS和MAC编码层中处理模块的延时信息;The first processor is configured to: calculate, according to the delay information carried by the MPCP packet, and the current local timing of the ONU, the MPCP packet is subjected to PCS and MAC coding. The difference between the local timings of each processing module in the layer, and the delay information of the processing module of the MPCP packet passing through the PCS and the MAC encoding layer is obtained;通过控制符将所述第二时间戳更新所述ONU的计数器。The counter of the ONU is updated by the second timestamp by a control character.
- 根据权利要求6所述的装置,其中,所述装置还包括:第四处理器,配置为在所述第二处理器将所述Report帧发送给所述OLT之后,根据所述第二时间戳计算OLT与ONU之间的往返时延RTT,并根据所述RTT调整所述ONU的授权时间。The apparatus of claim 6, wherein the apparatus further comprises: a fourth processor configured to, after the second processor sends the Report frame to the OLT, according to the second timestamp Calculating a round trip delay RTT between the OLT and the ONU, and adjusting an authorization time of the ONU according to the RTT.
- 一种以太网无源光网络EPON中的时间戳处理装置,包括:A timestamp processing device in an Ethernet passive optical network EPON, comprising:存储器,用于存储可执行程序;a memory for storing an executable program;处理器,用于通过执行所述存储器中存储的可执行程序时实现以下步骤:a processor for implementing the following steps by executing an executable program stored in the memory:检测多点控制协议MPCP包经过物理编码子层PCS的延时和经过介质访问控制MAC编码层的延时;Detecting the delay of the multi-point control protocol MPCP packet passing through the physical coding sub-layer PCS and the delay of the medium access control MAC coding layer;获取光线路终端OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the optical line terminal OLT, where the MPCP frame includes a report Report frame;将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。Adding the first timestamp, the delay of the MPCP packet to the PCS, and the delay of the MAC encoding layer to obtain a second timestamp, and after filling the second timestamp into the Report frame Sending the Report frame to the OLT.
- 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时实现以下步骤:A storage medium storing an executable program, the executable program being executed by a processor to implement the following steps:检测多点控制协议MPCP包经过物理编码子层PCS的延时和经过介质访问控制MAC编码层的延时;Detecting the delay of the multi-point control protocol MPCP packet passing through the physical coding sub-layer PCS and the delay of the medium access control MAC coding layer;获取光线路终端OLT下发的MPCP帧中携带的第一时间戳,所述MPCP帧包括报告Report帧;Obtaining a first timestamp carried in an MPCP frame sent by the optical line terminal OLT, where the MPCP frame includes a report Report frame;将所述第一时间戳、所述MPCP包经过PCS的延时和经过MAC编码 层的延时相加,得到第二时间戳,并在向所述Report帧填入所述第二时间戳后,将所述Report帧发送给所述OLT。 The first timestamp, the delay of the MPCP packet passing through the PCS, and the MAC encoding The delays of the layers are added to obtain a second timestamp, and after the second timestamp is filled in the Report frame, the Report frame is sent to the OLT.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611266568.3 | 2016-12-29 | ||
CN201611266568.3A CN108259106A (en) | 2016-12-29 | 2016-12-29 | A kind of time stamp treating method and apparatus in Ethernet passive optical network |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018120549A1 true WO2018120549A1 (en) | 2018-07-05 |
Family
ID=62706734
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/082284 WO2018120549A1 (en) | 2016-12-29 | 2017-04-27 | Method and device for processing time stamp in ethernet passive optical network, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108259106A (en) |
WO (1) | WO2018120549A1 (en) |
Families Citing this family (4)
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 |
CN112583509B (en) * | 2019-09-30 | 2024-07-19 | 深圳市中兴微电子技术有限公司 | Method and device for acquiring time stamp of data stream, storage medium and electronic device |
CN115250243A (en) * | 2022-07-22 | 2022-10-28 | 中国电信股份有限公司 | Time delay data measuring method, device, system, electronic equipment and storage medium |
CN115396333B (en) * | 2022-08-24 | 2024-01-16 | 北京智芯微电子科技有限公司 | Visual chip, method and switch for communication network delay test |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011124759A (en) * | 2009-12-10 | 2011-06-23 | Mitsubishi Electric Corp | Communication system, station-side communication device, and slave clock correction device |
CN102938676A (en) * | 2011-08-16 | 2013-02-20 | 中兴通讯股份有限公司 | Method, device and system for processing time synchronization |
CN105281860A (en) * | 2015-06-16 | 2016-01-27 | 南京智汇电力技术有限公司 | Data synchronous acquisition method based on Ethernet passive optical network |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101218792A (en) * | 2005-07-15 | 2008-07-09 | 泰克诺沃斯公司 | Method and apparatus for facilitating asymmetric line rates in an Ethernet passive optical network |
CN102377556B (en) * | 2010-08-19 | 2016-04-13 | 中兴通讯股份有限公司 | A kind ofly realize the synchronous method and system of active and standby optical line terminal timestamp |
-
2016
- 2016-12-29 CN CN201611266568.3A patent/CN108259106A/en active Pending
-
2017
- 2017-04-27 WO PCT/CN2017/082284 patent/WO2018120549A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011124759A (en) * | 2009-12-10 | 2011-06-23 | Mitsubishi Electric Corp | Communication system, station-side communication device, and slave clock correction device |
CN102938676A (en) * | 2011-08-16 | 2013-02-20 | 中兴通讯股份有限公司 | Method, device and system for processing time synchronization |
CN105281860A (en) * | 2015-06-16 | 2016-01-27 | 南京智汇电力技术有限公司 | Data synchronous acquisition method based on Ethernet passive optical network |
Also Published As
Publication number | Publication date |
---|---|
CN108259106A (en) | 2018-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11824636B2 (en) | Method and apparatus for sending and receiving clock synchronization packet | |
CN109787703B (en) | Timestamp correction method, clock synchronization method and system | |
US9882666B2 (en) | Time synchronization for network testing equipment | |
US8718482B1 (en) | Transparent clock for precision timing distribution | |
US7289439B2 (en) | Method for implementing various functions in gigabit ethernet-passive optical network system and structure of ethernet frame employed in the same | |
WO2019165965A1 (en) | Method, apparatus, and device for determining time information | |
US8982912B2 (en) | Inter-packet gap network clock synchronization | |
WO2018120549A1 (en) | Method and device for processing time stamp in ethernet passive optical network, and storage medium | |
US8660152B2 (en) | Multi-frame network clock synchronization | |
US11108485B2 (en) | Clock synchronization method and apparatus | |
CN109699199B (en) | Message processing method and network equipment | |
WO2010097035A1 (en) | Clock message tunnel transmission method, network node and communication system thereof | |
WO2010017762A1 (en) | Time synchronization method and device for passive optical network and passive optical network | |
CN102013931A (en) | Time synchronization method and system, salve timing device and main timing device | |
WO2015117501A1 (en) | Time synchronization method, programmable logic device, single board and network element | |
WO2011017867A1 (en) | Method and system for bearing time synchronization protocol in optical transport network | |
JP2013157983A (en) | Method for performing switching operation, program product, optical line terminal, optical network units and passive optical network | |
WO2013082901A1 (en) | 1588 event message processing method and system | |
US8948586B2 (en) | Method and apparatus for laser overlap detection | |
WO2017177751A1 (en) | Time synchronization method and apparatus | |
Christodoulopoulos et al. | Demonstration of industrial-grade passive optical network | |
JP2011040870A (en) | Optical transmission system, and synchronization method using time reference pulse | |
JP5922047B2 (en) | Delay measurement method and delay measurement system | |
WO2024045815A1 (en) | Registration method, related device and optical communication system | |
WO2018165893A1 (en) | Method for sending optical signal by optical network unit, and optical network unit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17889244 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17889244 Country of ref document: EP Kind code of ref document: A1 |