Abstract:
The present invention relates to method for synchronizing time, apparatus and system. The method discloses an OLT generates a Passive Optical Network (PON) downstream frame from to an Optical Network Unit (ONU), wherein the PON downstream frame comprises a time synchronization message based on Ethernet protocol, wherein the time synchronization message comprises a time value that is referenced to a PON Media Access Control (MAC) control layer and that indicates the ONU to adjust a time of a clock coupled to the ONU; and send the PON downstream frame.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of U.S. patent application Ser. No. 12/942,196, filed on Nov. 9, 2010 which is a continuation of International Application No. PCT/CN2009/071598, filed on Apr. 30, 2009. The International Application claims priority to Chinese Patent Application No. 200810096171.3, filed on May 9, 2008. The aforementioned patent applications are hereby incorporated by reference in their entireties. 
     
    
     TECHNICAL FIELD 
       [0002]    The present invention relates to the field of optical communications, and in particular, to an optical network device, a point-to-multipoint optical communications system, and a method for synchronizing time of a passive optical network. 
       BACKGROUND 
       [0003]    A Passive Optical Network (PON) includes an Optical Distribution Network (ODN), which contains no electronic device or electronic power source and is entirely composed of passive devices such as optical splitters. A PON includes an Optical Line Terminal (OLT) installed in a central office and a batch of Optical Network Units (ONUs) installed at the customer premise. Three PON technologies are provided, Asynchronous Transfer Mode Passive Optical Network (APON), Ethernet Passive Optical Network (EPON) and Gigabit Passive Optical Network (GPON). EPON and GPON also evolve to the next generation PON (xPON). 
         [0004]    Taking GPON as an example, the GPON protocol stack is illustrated in  FIG. 1 . The GPON protocol stack includes three layers, and they are briefly introduced in a down to top sequence. 
         [0005]    One is the GPON Physical Medium Dependent (GPM) layer, which is responsible for the transmission of GPON Transmission Convergence (GTC) layer frames on optical fibers. It transmits optical signals from the optical fibers to the PON Media Access Control (MAC) layer for data processing and converts data signals received from the PON MAC layer into optical signals. 
         [0006]    A second layer is the MAC layer. For GPON, the MAC layer is a GTC layer, which includes two sub-layers: 
         [0007]    (a) TC Adapter Sublayer 
         [0008]    The TC adapter sub-layer is responsible for fragmenting service data received from an Asynchronous Transfer Mode (ATM) client into ATM cells and fragmenting service data received from a GPON Encapsulation Method (GEM) client into GEM data blocks; the TC adapter sub-layer is also responsible for assembling ATM cells or GEM data blocks in a GTC frame to appropriate service data. 
         [0009]    (b). GTC Framing Sub-Layer 
         [0010]    The GTC framing sub-layer is responsible for assembling GTC TC frames. Specifically, the GTC framing sub-layer adds a GTC TC frame header before an ATM cell or a GEM data block according to control information of Physical Layer Operation, Administration and Maintenance (PLOAM) to create a complete GTC TC frame and send the frame to the GPM layer; the GTC framing sub-layer is also responsible for removing frame header information from a GTC TC frame received from the GPM layer and sending the frame with the frame header information removed to the TC adapter sub-layer for processing. 
         [0011]    The GPON also has a third layer, which includes the ATM client, GEM client and the following units: 
         [0012]    (1) PLOAM: responsible for functions like operation, administration and maintenance at the PON physical layer; and 
         [0013]    (2) ONU Management and Control Interface (OMCI): the OLT controls an Optical Network Terminal (ONT) via the OMCI; like common service data, OMCI data can be encapsulated to ATM cells or GEM data blocks for transmission. 
         [0014]    IEEE 1588 is the Precision Time Protocol (PTP) of a system for network measurement and control, and implements synchronization of the slave clock of an ONT (client device) with the master clock of the main control device by sending/receiving clock packets. The principle of the IEEE 1588 PTP protocol is described as follows: Based on the most precise time when the synchronization packets are sent and received, each slave clock exchanges synchronization packets with the master clock to achieve synchronization with the master clock. 
         [0015]    The synchronization process includes two stages: offset measurement stage and delay measurement stage. 
         [0016]      FIG. 2A  illustrates the offset measurement stage where the master clock broadcasts two messages to all nodes on the network: 
         [0017]    1. sync message: denoting desired time for sending the message 
         [0018]    2. follow-up message: denoting actual time for sending the message 
         [0019]    The sync messages are sent automatically at given intervals. The follow-up messages are employed to calculate the transmission delay caused by the local protocol when packets are sent. The master clock sends determined sync messages at regular intervals (generally once two seconds). The sync message contains a time stamp, which describes precisely the desired time the packet is sent. Assume that the time of the master clock before synchronization is Tm=128s and that the slave clock time is Ts=111s. The master clock measures that the precise sending time is Tm1 and the slave clock measures that the precise receiving time is Ts1. Because the sync message contains the desired sending time instead of the actual sending time, the master clock sends a follow-up message which contains a time stamp that records precisely the actual sending time Tm1 of the sync message. Thus, the slave clock can calculate the offset between the slave clock and the master clock according to the actual sending time in the follow-up message and the actual receiving time of the receiver: 
         [0000]      Offset= Ts 1− Tm 1−Delay=111.75−128.5−0=16.75 s  
 
         [0020]    The “delay” above means the transmission delay between the master clock and the slave clock and will be measured in the following measurement stage. At the current stage, the delay is unknown and assumed to be 0. 
         [0021]    At the offset measurement stage, Adjust Time can be obtained and the slave clock is adjusted to: 
         [0000]      Adjust Time= Ts −Offset
 
         [0022]    The second stage is the delay measurement stage as shown in  FIG. 2B . 
         [0023]    The delay measurement stage measures the delay caused by network transmission. The measurement is achieved through exchange of the following messages between the master clock and the slave clock: 
         [0024]    1. The slave clock sends a Delay Request message, informing the master clock, “I send the Delay Request message at this moment.” 
         [0025]    2. The master clock sends a Delay Response message, informing the slave clock, “I receive your Delay Request message at this moment.” 
         [0026]    The slave clock sends the Delay Request at Ts3 130.75s after receiving the sync message. The master clock sends the Delay Response to the slave clock after receiving the Delay Request and marks the precise receiving time Tm3 131.25s in the Delay Response. Thus, the slave clock can calculate the accurate network delay. 
         [0000]      Delay=( Tm 3− Ts 3)/2=(131.25−130.75)/2=0.25
 
         [0027]    IEEE 802.3 defines the basic structure of an Ethernet frame, including: preamble, Start Frame Delimiter (SFD), destination address, source address, length field, data field, and frame check sequence. 
         [0028]    As shown in  FIG. 3 , the preamble consists of 8 bits of alternated 1s and 0s. The SFD includes 8 bits where the first 6 bits are alternated 1s and 0s and the last 2 bits are “1, 1” indicating the start of the frame to the receiver. Following the two bits are the actual fields of the frame. 
         [0029]    In an Ethernet, all clock packets defined by IEEE 1588/1588v2 are transmitted in the form of IP multicast packets. The packet time stamp generating point for determining the time a clock packet is transmitted or received is located at the last bit of the SFD. 
         [0030]    During the implementation of the present invention, the inventor finds at least the following weaknesses in the prior art: 
         [0031]    When Ethernet data is encapsulated to GEM (that is, when the “Ethernet over GEM” mode is employed), each Ethernet frame is mapped into a GEM frame. As shown in  FIG. 4 , the GEM frame does not include the preamble and SFD, and the destination address, source address, length field, data field, and frame check sequence field of the Ethernet frame are directly mapped into the GEM payload for transmission. The GEM frame is automatically encapsulated with the GEM frame header which includes four parts: Payload Length Indicator (PLI, 12 bits), Port ID (12 bits), Payload Type Indicator (PTI, 3 bits), and Header Error Control (HEC, 13 bits). 
         [0032]    In case of Ethernet over GEM mode, the Ethernet time stamp generating point required for sending IEEE 1588/1588v2 clock packets is lost. As a result, the time synchronization method defined by IEEE 1588/1588v2 is not supported in “Ethernet over GEM” mode. 
       SUMMARY 
       [0033]    On the one hand, embodiments of the present invention provide an optical network device and a method for synchronizing time of a PON master clock, and this achieves time synchronization in the network. 
         [0034]    For the above purpose, the following technical solution is provided: 
         [0035]    A method for synchronizing time of a PON master clock, where a match rule for matching packet time stamp generating points is predefined on the master clock side, includes: 
         [0036]    sending a first clock packet carried in a first downstream frame; 
         [0037]    acquiring time at a packet time stamp generating point according to frame data of the first downstream frame at the PON MAC layer, and regarding the acquired time as the time the first clock packet is sent; and 
         [0038]    sending a second clock packet carried in a second downstream frame, where the second clock packet carries the time the first clock packet is sent. 
         [0039]    An optical network device includes: 
         [0040]    a sending unit, configured to send a first clock packet carried in a first downstream frame and a second clock packet carried in a second downstream frame, where the second clock packet carries the time the first clock packet is sent; 
         [0041]    a first monitoring unit, configured to determine a packet time stamp generating point according to frame data of the first downstream frame at the PON MAC layer; and 
         [0042]    a first acquiring unit, configured to acquire time at the packet time stamp generating point, and regard the acquired time as the time the first clock packet is sent. 
         [0043]    On the other hand, embodiments of the present invention provide an optical network device and a method for synchronizing time of a PON slave clock, and this achieves time synchronization in the network. 
         [0044]    For the above purpose, the following technical solution is provided: 
         [0045]    A method for synchronizing time of a PON slave clock, where a match rule for matching packet time stamp generating points is predefined on the slave clock side, and the method includes: 
         [0046]    receiving a first clock packet carried in a first downstream frame; 
         [0047]    acquiring time at a packet time stamp generating point according to frame data of the first downstream frame at the PON MAC layer, and regarding the acquired time as the time the first clock packet is received; 
         [0048]    receiving a second clock packet carried in a second downstream frame, where the second clock packet carries the time the first clock packet is sent; and 
         [0049]    adjusting the local time according to a difference between the time the first clock packet is sent and the time the first clock packet is received. 
         [0050]    An optical network device includes: 
         [0051]    a receiving unit, configured to receive a first clock packet carried in a first downstream frame and a second clock packet carried in a second downstream frame, where the second clock packet carries the time the first clock packet is sent; 
         [0052]    a first monitoring unit, configured to determine a packet time stamp generating point according to frame data of the first downstream frame at the PON MAC layer; 
         [0053]    a first acquiring unit, configured to acquire time at the packet time stamp generating point, and regard the acquired time as the time the optical network device receives the first clock packet; and 
         [0054]    an adjusting unit, configured to adjust the local time according to a difference between the time the first clock packet is sent and the time the first clock packet is received. 
         [0055]    In addition, embodiments of the present invention provide a point-to-multipoint optical communications system, which is able to determine the time a clock message is sent and/or received on the master/slave clock side, and this achieves time synchronization in the network. 
         [0056]    For the above purpose, the following technical solution is provided: 
         [0057]    A point-to-multipoint optical communications system includes an OLT and at least one ONU. 
         [0058]    The OLT includes: 
         [0059]    an OLT clock synchronization processing module, configured to send a first clock packet carried in a first downstream frame and a second clock packet carried in a second downstream frame to the ONU, where the second clock packet carries the time the first clock packet is sent; and 
         [0060]    an OLT clock packet time stamp generating module, configured to acquire time according to frame data of the first clock packet at the PON MAC layer, and regard the acquired time as the time the first clock packet is sent. 
         [0061]    The ONU includes: 
         [0062]    an ONU clock packet time stamp generating module, configured to acquire time according to frame data of the first clock packet at the PON MAC layer, and regard the acquired time as the time the first clock packet is received; and 
         [0063]    an ONU clock synchronization processing module, configured to receive the first downstream frame and the second downstream frame, and adjust the time of the ONU according to a difference between the time the first clock packet is sent and the time the first clock packet is received. 
         [0064]    With the optical network device, point-to-multipoint optical communications system, and method for synchronizing time of a PON according to the embodiments of the present invention, the time a clock packet is sent and/or received on the master/slave clock side is acquired based on the packet time stamp generating point of the lower layer transmission frame, and therefore, the present invention enables multiple modes of clock packet encapsulation based on the PON transmission frame, for example, the application of IEEE 1588 in “Ethernet over GEM” mode. Thus, time is synchronized in the network. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0065]      FIG. 1  is a schematic diagram illustrating a GPON protocol layered model in the prior art; 
           [0066]      FIG. 2A  is a schematic diagram illustrating the principle at the first-stage of the IEEE 1588 PTP protocol in the prior art; 
           [0067]      FIG. 2B  is a schematic diagram illustrating the principle at the second-stage of the IEEE 1588 PTP protocol in the prior art; 
           [0068]      FIG. 3  is a schematic diagram illustrating a packet time stamp generating point in an Ethernet in the prior art; 
           [0069]      FIG. 4  is a schematic diagram illustrating “Ethernet over GEM” in the prior art; 
           [0070]      FIG. 5  is a flowchart of a method for synchronizing time of a master clock according to a first embodiment of the present invention; 
           [0071]      FIG. 6  is a schematic diagram illustrating a first time stamp generating point in a method for synchronizing time of a master clock of the present invention; 
           [0072]      FIG. 7  is a schematic diagram illustrating a second time stamp generating point a method for synchronizing time of a master clock of the present invention; 
           [0073]      FIG. 8  is a schematic diagram illustrating a third time stamp generating point in a method for synchronizing time of a master clock of the present invention, where the ONU is in the Working state; 
           [0074]      FIG. 9  is a schematic diagram illustrating a fourth time stamp generating point in a method for synchronizing time of a master clock of the present invention, where the ONU is in the Ranging state; 
           [0075]      FIG. 10  is a flowchart of a method for synchronizing time of a master clock according to a second embodiment of the present invention; 
           [0076]      FIG. 11  is a schematic diagram illustrating a fifth time stamp generating point in a method for synchronizing time of a master clock of the present invention; 
           [0077]      FIG. 12  is a schematic diagram illustrating a sixth time stamp generating point in a method for synchronizing time of a master clock of the present invention; 
           [0078]      FIG. 13  is a schematic diagram illustrating a GEM frame structure in a method for synchronizing time of a master clock of the present invention; 
           [0079]      FIG. 14  is a flowchart of a method for synchronizing time of a slave clock according to a first embodiment of the present invention; 
           [0080]      FIG. 15  is a flowchart of a method for synchronizing time of a slave clock according to a second embodiment of the present invention; 
           [0081]      FIG. 16  illustrates a structure of an optical network device on the master clock side according to a first embodiment of the present invention; 
           [0082]      FIG. 17  illustrates a structure of an optical network device on the master clock side according to a second embodiment of the present invention; 
           [0083]      FIG. 18  illustrates a structure of an optical network device on the slave clock side according to a first embodiment of the present invention; 
           [0084]      FIG. 19  illustrates a structure of an optical network device on the slave clock side according to a second embodiment of the present invention; 
           [0085]      FIG. 20  is a structure of an optical communications system according to an embodiment of the present invention; 
           [0086]      FIG. 21  illustrates a first application of an optical communications system according to an embodiment of the present invention; 
           [0087]      FIG. 22  illustrates a second application of an optical communications system according to an embodiment of the present invention; 
           [0088]      FIG. 23  illustrates a third application of an optical communications system according to an embodiment of the present invention; 
           [0089]      FIG. 24  illustrates a fourth application of an optical communications system according to an embodiment of the present invention; 
           [0090]      FIG. 25  illustrates a fifth application of an optical communications system according to an embodiment of the present invention; 
           [0091]      FIG. 26  illustrates a sixth application of an optical communications system according to an embodiment of the present invention; 
           [0092]      FIG. 27  illustrates a seventh application of an optical communications system according to an embodiment of the present invention; and 
           [0093]      FIG. 28  illustrates an eighth application of an optical communications system according to an embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION 
       [0094]    To better explain the technical solution of the present invention, the embodiments of the present invention are described hereinafter in detail with reference to the accompanying drawings. On the one hand, an embodiment of the present invention provides a method for synchronizing time at a master clock side. 
         [0095]    As shown in  FIG. 5 , a method for synchronizing time at a master clock side according to an embodiment of the present invention includes the following steps: 
         [0096]      501 . A match rule is predefined for matching packet time stamp generating points. 
         [0097]      502 . An OLT sends a first clock packet carried in a first downstream frame. 
         [0098]    The first clock packet may be a sync message or a Delay Response message. 
         [0099]      503 . The OLT measures or acquires time at the packet time stamp generating point that matches the frame data of the first downstream frame at the PON MAC layer, where the acquired time is regarded as the time the first clock packet is sent. 
         [0100]      504 . The OLT sends a second clock packet carried in a second downstream frame, where the second clock packet contains the time the first clock packet is sent. 
         [0101]    The second clock packet is a follow-up message. 
         [0102]    In the method for synchronizing time at a master clock side according to the embodiment of the present invention, the time a clock packet is sent is first acquired at the packet time stamp generating point, which is determined according to the lower layer transmission frame. Therefore, the method enables multiple modes of clock packet encapsulation based on the PON transmission frame, for example, the application of IEEE 1588 in case of Ethernet over GEM. Thus, time is synchronized in the network. 
         [0103]    In the method, the step of acquiring the time at the packet time stamp generating point that matches the frame data of the first downstream frame at the PON MAC layer, regarding the acquired time as the time the first clock packet is sent includes: regarding the last bit of the physical synchronization (Psync) field in the frame header of the GTC TC frame of the first downstream frame at the GTC framing sub-layer as the packet time stamp generating point. As shown in  FIG. 6 , the downstream frame structure of the GTC TC frame includes a frame header and a payload. Physical Control Block downstream (PCBd) is the downstream frame header of the GTC TC frame. The packet time stamp generating point is located at the last bit of the Psync field in the GTC TC frame header. 
         [0104]    Optionally, the step of acquiring the time at the packet time stamp generating point that matches the frame data of the first downstream frame at the PON MAC layer and regarding the acquired time as the time the first clock packet is sent includes: regarding the last bit of the HEC field in the frame header of the GEM frame of the first downstream frame at the TC adapter sub-layer as the packet time stamp generating point. As shown in  FIG. 7 , the GEM frame includes a frame header and a payload. The packet time stamp generating point is determined according to the GEM frame header. For example, the packet time stamp generating point is located at the last bit of the HEC field in the GEM frame header. 
         [0105]    Optionally, the step of acquiring the time at the packet time stamp generating point that matches the frame data of the first downstream frame at the PON MAC layer and regarding the acquired time as the time the first clock packet is sent includes: determining the packet time stamp generating point according to the sum of the start time received by the ONU, the response time of the ONU, and the Equal Delay (EqD) of the ONU. The above basis for determining the packet time stamp generating point may be included in the first downstream frame or needs be added to the first downstream frame. For example, the OLT sends a bandwidth map (BWmap) message to the ONU. The BWmap message is used to allocate for each ONU a transmission interval that indicates the ONU to transmit upstream data therein. The StartTime (Sstart) field in the BWmap message includes a time indicator. As shown in  FIG. 8  and  FIG. 9 , the packet time stamp generating point is determined according to the sum of the start time indicated by the Sstart field in the BWmap message received by the ONU, the response time of the ONU, and the EqD. The response time of the ONU is a performance index of the ONU and is dependent on the hardware configuration of the ONU. The EqD is dependent on the network delay. 
         [0106]    As shown in  FIG. 10 , a method for synchronizing time at a master clock side provided in an embodiment of the present invention includes the following steps: 
         [0107]      1001 . A match rule is predefined for matching packet time stamp generating points. 
         [0108]      1002 . The OLT sends a first clock packet carried in a first downstream frame. 
         [0109]    The first clock packet may be a sync message or a Delay Response message. 
         [0110]      1003 . The OLT acquires time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer, where the acquired time is regarded as the time the first clock packet is sent. 
         [0111]      1004 . The OLT sends a second clock packet which carries the time the first clock packet is sent. The second clock packet is a follow-up message and is carried in a second downstream frame. 
         [0112]      1005 . The OLT receives a third clock packet carried in a third upstream frame. 
         [0113]    The third clock packet may be a Delay Request message. 
         [0114]      1006 . The OLT acquires time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer, and the acquired time is regarded as the time the OLT receives the third clock packet. 
         [0115]      1007 . The OLT sends a fourth clock packet, where the fourth clock packet carries the time the third clock packet is received and the fourth clock packet is carried in a fourth downstream frame. 
         [0116]    The fourth clock packet is a Delay Response message. 
         [0117]    In the method, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is received includes: regarding the last bit of the Delimiter field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point. As shown in  FIG. 11 , the GTC TC frame includes a frame header and a payload. In the upstream direction, that is, when the synchronization clock packet is sent from the ONU to the OLT, the packet time stamp generating point is located at the last bit of the Delimiter field in the GTC TC frame. 
         [0118]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is received includes: regarding the last bit of the HEC field in the frame header of the GEM frame of the third upstream frame at the TC adapter sub-layer as the packet time stamp generating point, as shown in  FIG. 7 . 
         [0119]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is received includes: regarding the last bit of the HEC field in the frame header of the GEM frame of the third upstream frame at the TC adapter sub-layer as the packet time stamp generating point. As shown in  FIG. 11 , the GTC TC frame includes a frame header and a payload. The Physical Layer Overhead upstream (PLOu) is the upstream frame header of the GTC TC frame. The payload is the upstream frame payload of the GTC TC frame. The last bit of the PLOu in the GTC TC frame header is regarded as the packet time stamp generating point. 
         [0120]    The first, second, third, and fourth clock packets are carried over Ethernet protocols such as ETH, Internet Protocol (IP), and User Datagram Protocol (UDP). Or, the first, second, third, and fourth clock packets are carried in IEEE 1588/1588v2 over GEM mode; or the first, second, third, and fourth clock packets are carried in PLOAM messages; or the first, second, third, and fourth clock packets are carried in OMCI messages. 
         [0121]    In case of IEEE 1588/1588v2 over GEM mode, the PTI in the GEM frame header may indicate that the frame includes an internal extended field, and the PTI in the extended field indicates that the service type of the payload is IEEE 1588/1588v2 clock packet. For example, as shown in the following table, when the PTI code is 110, it indicates that an internal GEM frame extended field is carried.  FIG. 12  illustrates the structure of a GEM frame when the PTI code is 110. 
         [0000]    
       
         
               
               
               
             
           
               
                   
                   
               
               
                   
                 PTI Code 
                 Function 
               
               
                   
                   
               
             
             
               
                   
                 000-101 
                 Same as in the prior art, indicates whether the 
               
               
                   
                   
                 GEM frame is the last section in case of 
               
               
                   
                   
                 sectional processing or whether congestion 
               
               
                   
                   
                 occurs. 
               
               
                   
                 110 
                 Indicates that an internal GEM frame extended 
               
               
                   
                   
                 field is carried. 
               
               
                   
                   
               
             
          
         
       
     
         [0122]    Those skilled in the art can understand that the mode of transmitting and/or receiving clock packets here is also applicable to other embodiments of the present invention. 
         [0123]    On the other hand, an embodiment of the present invention provides a method for synchronizing time of a slave clock. 
         [0124]    As shown in  FIG. 14 , the method for synchronizing time at a slave clock side includes: 
         [0125]      1401 . A match rule is predefined for matching packet time stamp generating points. 
         [0126]      1402 . The ONU receives a first clock packet from the OLT. The first clock packet is carried in a first downstream frame. 
         [0127]    The first clock packet may be a sync message or a Delay Response message. 
         [0128]      1403 . The ONU acquires time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer and regards the acquired time as the time the ONU receives the first clock packet. 
         [0129]      1404 . The ONU receives a second clock packet, where the second clock packet carries the time the first clock packet is sent and the second clock packet is carried in a second downstream frame. 
         [0130]    The second clock packet is a follow-up message. 
         [0131]      1405 . The ONU adjusts the local time according to a difference between the time the OLT sends the first clock packet and the time the ONU receives the first clock packet. 
         [0132]    In the slave clock time synchronization method according to the embodiment of the present invention, a packet time stamp generating point is first determined based on the lower layer and then the time a clock packet is sent and/or received on the slave clock side is determined according to the packet time stamp generating point. Therefore, the method enables multiple modes of clock packet encapsulation based on the PON transmission frame, for example, the application of IEEE 1588 in case of Ethernet over GEM mode. Thus, time is synchronized in the network. 
         [0133]    In the method, the step of acquiring the time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer and regarding the acquired time as the time the ONU receives the first clock packet includes: regarding the last bit of the Psync field in the frame header of the GTC TC frame of the first downstream frame at the GTC framing sub-layer as the packet time stamp generating point, as shown in  FIG. 6 . 
         [0134]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer and regarding the acquired time as the time the ONU receives the first clock packet includes: regarding the last bit of the HEC field in the frame header of the GEM frame of the first downstream frame at the TC adapter sub-layer as the packet time stamp generating point, as shown in  FIG. 7 . 
         [0135]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer and regarding the acquired time as the time the ONU receives the first clock packet includes: determining the packet time stamp generating point according to the sum of the start time received by the ONU, the response time of the ONU, and the EqD of the ONU, as shown in  FIG. 8  and  FIG. 9 . 
         [0136]    As shown in  FIG. 15 , a method for synchronizing time at a slave clock side in an embodiment of the present invention includes: 
         [0137]      1501 . A match rule is predefined for matching packet time stamp generating points. 
         [0138]      1502 . The ONU receives a first clock packet from the OLT. The first clock packet is carried in a first downstream frame. 
         [0139]      1503 . The ONU acquires time at the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer and regards the acquired time as the time the ONU receives the first clock packet. 
         [0140]      1504 . The ONU receives a second clock packet from the OLT. The second clock packet carries the time the OLT sends the first clock packet. 
         [0141]      1505 . The ONU adjusts the local time according to a difference between the time the OLT sends the first clock packet and the time the ONU receives the first clock packet. 
         [0142]      1506 . The ONU sends a third clock packet to the OLT. 
         [0143]      1507 . The ONU acquires time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regards the acquired time as the time the ONU sends the third clock packet. 
         [0144]      1508 . The ONU receives a fourth clock packet from the OLT. The fourth clock packet carries the time the OLT receives the third clock packet. 
         [0145]      1509 . The ONU corrects the local time according to a difference between the time the ONU sends the third clock packet and the time the OLT receives the third clock packet. 
         [0146]    In the method, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is sent includes: regarding the last bit of the Delimiter field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point, as shown in  FIG. 11 . 
         [0147]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is sent includes: regarding the last bit of the HEC field in the frame header of the GEM frame of the third upstream frame at the TC adapter sub-layer as the packet time stamp generating point, as shown in  FIG. 7 . 
         [0148]    Optionally, the step of acquiring the time at the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer and regarding the acquired time as the time the third clock packet is sent includes: regarding the last bit of the PLOu field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point, as shown in  FIG. 12 . 
         [0149]    In the embodiment of the present invention, the packet time stamp generating point is determined at the lower layer (GTC framing sub-layer or TC adapter sub-layer) of the PON and thus the precision and accuracy of the generated time stamp are improved. 
         [0150]    The first, second, third, and fourth clock packets are carried over an Ethernet protocol; or in IEEE 1588/1588v2 over GEM mode; or in PLOAM messages; or in OMCI messages. 
         [0151]    The first, second, third, and fourth clock packets are received when the ONU is in the Working state or Ranging state. The third clock packet is sent when the ONU is in the Working state or Ranging state. As shown in  FIG. 8 , the clock packets are sent and/or received when the ONU is in the Working state; or as shown in  FIG. 9 , the clock packets are sent and/or received when the ONU is in the Ranging state. The clock packets are not sent when the ONU is in the Serial Number state to avoid a great error in time synchronization caused by the random delay. 
         [0152]    Those skilled in the art understand that all or part of the steps in the methods according to the above embodiments of the present invention can be completed by hardware under software instructions. The software according to the embodiments of the present invention can be stored in a computer-readable medium. 
         [0153]    Another embodiment of the present invention provides an optical network device on the master clock side, namely, an OLT. 
         [0154]    As shown in  FIG. 16 , the optical network device on the master clock side includes: 
         [0155]    a sending unit, configured to send a first clock packet carried in a first downstream frame and a second clock packet carried in a second downstream frame, where the second clock packet carries the time stamp when the OLT sends the first clock packet; 
         [0156]    a first monitoring unit, configured to determine the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer; and 
         [0157]    a first acquiring unit, configured to acquire time at the packet time stamp generating point and regard the acquired time as the time the OLT sends the first clock packet. 
         [0158]    The optical network device on the master clock side according to the embodiment of the present invention monitors the packet time stamp generating point based on the lower layer and acquires the time the clock packet is sent on the master clock side at the packet time stamp generating point. Therefore, the optical network device on the master clock side is able to support IEEE 1588/188v2 time synchronization in Ethernet over GEM mode and thus realizes time synchronization in the network. 
         [0159]    The first monitoring unit is also configured to: 
         [0160]    regard the last bit of the Psync field in the frame header of the GTC TC frame of the first downstream frame at the GTC framing sub-layer as being the packet time stamp generating point; or 
         [0161]    regard the last bit of the HEC field in the frame header of the GEM frame of the first downstream frame at the TC adapter sub-layer as being the packet time stamp generating point; or 
         [0162]    determine the packet time stamp generating point according to the sum of the start time received by the ONU, the response time of the ONU, and the EqD of the ONU. 
         [0163]    As shown in  FIG. 17 , the optical network device on the master clock side according to the embodiment of the present invention further includes: 
         [0164]    a receiving unit, configured to receive a third clock packet carried in a third upstream frame; 
         [0165]    a second monitoring unit, configured to determine the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer; and 
         [0166]    a second acquiring unit, configured to acquire time at the packet time stamp generating point and regard the acquired time as the time the OLT receives the third clock packet. 
         [0167]    The sending unit is further configured to send a fourth clock packet of the OLT, where the fourth clock packet carries the time stamp when the OLT receives the third clock packet. 
         [0168]    The second monitoring unit is also configured to: 
         [0169]    regard the last bit of the Delimiter field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point; or 
         [0170]    regard the last bit of the HEC field in the frame header of the GEM frame of the third upstream frame at the TC adapter sub-layer as the packet time stamp generating point; or 
         [0171]    regard the last bit of the PLOu field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point. 
         [0172]    In the embodiment of the present invention, the optical network device on the master clock side determines the time stamp generating point based on the lower layer (GTC framing sub-layer or TC adapter layer) of the PON, and thus the precision and accuracy of the generated time stamp are improved. 
         [0173]    On the other hand, an embodiment of the present invention provides an optical network device on the slave clock side, namely, an ONU. 
         [0174]    As shown in  FIG. 18 , the optical network device on the slave clock side includes: 
         [0175]    a receiving unit, configured to receive a first clock packet and a second clock packet from the OLT, where the second clock packet carries the time stamp when the OLT sends the first clock packet; 
         [0176]    a first monitoring unit, configured to determine the packet time stamp generating point according to the frame data of the first downstream frame at the PON MAC layer; 
         [0177]    a first acquiring unit, configured to acquire time at the packet time stamp generating point, where the acquired time is regarded as the time the ONU receives the first clock packet; and 
         [0178]    an adjusting unit, configured to adjust the local time of the ONU according to a difference between the time the OLT sends the first clock packet and the time the ONU receives the first clock packet. 
         [0179]    The first monitoring unit is also configured to: 
         [0180]    regard the last bit of the Psync field in the frame header of the GTC TC frame of the first downstream frame at the GTC framing sub-layer as the packet time stamp generating point; or 
         [0181]    regard the last bit of the HEC field in the frame header of the GEM frame of the first downstream frame at the TC adapter sub-layer as the packet time stamp generating point; or 
         [0182]    determine the packet time stamp generating point according to the sum of the start time received by the ONU which is contained in the first downstream frame or needs to be added in the first downstream frame, the response time of the ONU, and the EqD of the ONU. 
         [0183]    As shown in  FIG. 19 , the optical network device on the slave clock side further includes: 
         [0184]    a sending unit, configured to send a third clock packet carried in a third upstream frame; 
         [0185]    a second monitoring unit, configured to determine the packet time stamp generating point according to the frame data of the third upstream frame at the PON MAC layer; 
         [0186]    a second acquiring unit, configured to acquire time at the packet time stamp generating point and regard the acquired time as the time the ONU sends the third clock packet; and 
         [0187]    a correcting unit, configured to correct the local time of the ONU according to a difference between the time the ONU sends the third clock packet and the time the OLT receives the third clock packet. 
         [0188]    The receiving unit is further configured to receive from the OLT a fourth clock packet carried in a fourth downstream frame, where the fourth clock packet carries the time stamp when the OLT receives the third clock packet. 
         [0189]    The second monitoring unit is further configured to: 
         [0190]    regard the last bit of the Delimiter field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point; or 
         [0191]    regard the last bit of the HEC field in the frame header of the GEM frame of the third upstream frame at the TC adapter sub-layer as the packet time stamp generating point; or 
         [0192]    regard the last bit of the PLOu field in the frame header of the GTC TC frame of the third upstream frame at the GTC framing sub-layer as the packet time stamp generating point. 
         [0193]    The optical network device on the slave clock side according to the embodiment of the present invention monitors the packet time stamp generating point based on the lower layer and acquires the time a clock packet is received on the slave clock side at the packet time stamp generating point. Therefore, the optical network device on the slave clock side supports multiple modes of clock packet encapsulation over the PON transmission frame, for example, the application of IEEE 1588 in case of Ethernet over GEM. Thus, time is synchronized in the network. In addition, the packet time stamp generating point is determined at the lower layer (GTC framing sub-layer or TC adapter sub-layer) of the PON and thus the precision and accuracy of the generated time stamp are improved. 
         [0194]    An embodiment of the present invention provides a point-to-multipoint optical communications system. 
         [0195]    As shown in  FIG. 20 , the point-to-multipoint optical communications system according to the embodiment of the present invention includes an OLT and at least one ONU coupled to the OLT. 
         [0196]    The OLT includes: 
         [0197]    a master clock synchronization processing module, configured to send a first clock packet carried in a first downstream frame and a second clock packet carried in a second downstream frame to the ONU, where the second clock packet carries the time stamp when the OLT sends the first clock packet; and 
         [0198]    a master clock packet time stamp generating module, configured to acquire the time the OLT sends the first clock packet according to the frame data of the first clock packet at the PON MAC layer. 
         [0199]    The ONU includes: 
         [0200]    a slave clock synchronization processing module, configured to receive the first clock packet and the second clock packet, where the second clock packet carries the time stamp when the OLT sends the first clock packet, and adjust the time of the ONU according to the difference between the time the OLT sends the first clock packet and the time the ONU receives the first clock packet; and 
         [0201]    a slave clock packet time stamp generating module, configured to acquire the time the ONU receives the first clock packet according to the frame data of the first clock packet at the PON MAC layer. 
         [0202]    Optionally, the master clock synchronization processing module is further configured to receive a third clock packet and send a fourth clock packet, where the fourth clock packet carries the time stamp when the OLT receives the third clock packet. 
         [0203]    The master clock packet time stamp generating module is further configured to acquire the time the OLT receives the third clock packet according to the frame data of the third clock packet at the PON MAC layer. 
         [0204]    The slave clock synchronization processing module is further configured to send the third clock packet; receive from the OLT the fourth clock packet which carries the time stamp when the OLT receives the third clock packet; and correct the time of the ONU according to the difference between the time the ONU sends the third clock packet and the time the OLT receives the third clock packet. 
         [0205]    The slave clock packet time stamp generating module is further configured to acquire the time the ONU sends the third clock packet according to the frame data of the third clock packet at the PON MAC layer. 
         [0206]    The optical communications system according to the embodiment of the present invention monitors the packet time stamp generating point based on the lower layer and then determines the time a clock packet is sent and received on the master clock side according to the packet time stamp generating point. Therefore, the optical communications system supports multiple modes of clock packet encapsulation based on the PON transmission frame, for example, the application of IEEE 1588 in case of Ethernet over GEM. Thus, time is synchronized in the network. In addition, the packet time stamp generating point is determined at the lower layer (GTC framing sub-layer or TC adapter sub-layer) of the PON and thus the precision and accuracy of the generated time stamp are improved. 
         [0207]    The application of the optical communications system in the embodiment of the present invention is described hereinafter. 
         [0208]      FIG. 21  illustrates a first application of the optical communications system according to the embodiment of the present invention, where the first, second, third, and fourth clock packets are carried over an Ethernet protocol. On the master clock side, the OLT includes a master clock packet time stamp generating module, a master clock synchronization processing module, an OLT GPM sub-layer processing module, an OLT GTC framing sub-layer processing module, an OLT TC adapter sub-layer processing module, and an OLT network protocol stack processing module. The master clock packet time stamp generating module is configured to determine the position of the master clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. The master clock synchronization processing module is configured to complete IEEE 1588 protocol processing and exchange clock packets with the OLT to determine the time a clock packet is sent or received according to the time stamp. The network protocol stack processing module is configured to process the protocol stack carrying the clock packets. The protocol stack may be ETH, IP or UDP. On the slave clock side, the ONU includes a slave clock packet time stamp generating module, a slave clock synchronization processing module, an ONU GPM sub-layer processing module, an ONU GTC framing sub-layer processing module, an ONU TC adapter sub-layer processing module, and an ONU network protocol stack processing module. The slave clock packet time stamp generating module is configured to determine the position of the slave clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. The slave clock synchronization processing module is configured to complete IEEE 1588 protocol processing and exchange clock packets with the OLT to determine the time a clock packet is sent and received according to the time stamp. The ONU network protocol stack processing module is configured to process the protocol stack carrying the clock packets. The protocol stack may be ETH, IP or UDP. 
         [0209]      FIG. 22  illustrates a second application of the optical communications system according to the embodiment of the present invention, where the first, second, third, and fourth clock packets are carried over an Ethernet protocol.  FIG. 22  differs from  FIG. 21  in that: on the master clock side, the master clock packet time stamp generating module is configured to determine the master clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer; on the slave clock side, the slave clock packet time stamp generating module is configured to determine the slave clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer. 
         [0210]      FIG. 23  illustrates a third application of the optical communications system according to the embodiment of the present invention. The first, second, third, and fourth clock packet are carried in IEEE 1588/1588v2 over GEM mode. On the master clock side, the OLT includes a master clock packet time stamp generating module, a master clock synchronization processing module, an OLT GPM sub-layer processing module, an OLT GTC framing sub-layer processing module, and an OLT TC adapter sub-layer processing module. The master clock packet time stamp generating module is configured to determine the position of the master clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. The ONU includes a slave clock packet time stamp generating module, a slave clock synchronization processing module, an ONU GPM sub-layer processing module, an ONU GTC framing sub-layer processing module, and an ONU TC adapter sub-layer processing module. The slave clock packet time stamp generating module is configured to determine the position of the slave clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. 
         [0211]      FIG. 24  illustrates a fourth application of the optical communications system according to the embodiment of the present invention, where the first, second, third, and fourth clock packets are carried in IEEE 1588/1588v2 over GEM mode.  FIG. 24  differs from  FIG. 23  in that: on the master clock side, the master clock packet time stamp generating module is configured to determine the master clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer; on the slave clock side, the slave clock packet time stamp generating module is configured to determine the slave clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer. 
         [0212]      FIG. 25  illustrates a fifth application of the optical communications system according to the embodiment of the present invention, where the clock packets are carried in PLOAM messages. On the master clock side, the OLT includes a master clock packet time stamp generating module, a master clock synchronization processing module, an OLT PLOAM processing module, an OLT GPM sub-layer processing module, and an OLT GTC framing sub-layer processing module. The master clock packet time stamp generating module is configured to determine the position of the master clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. On the slave clock side, the ONU includes a slave clock packet time stamp generating module, a slave clock synchronization processing module, an ONU PLOAM processing module, an ONU GPM sub-layer processing module, and an ONU GTC framing sub-layer processing module. The slave clock packet time stamp generating module is configured to determine the position of the slave clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. 
         [0213]      FIG. 26  illustrates a sixth application of the optical communications system according to the embodiment of the present invention, where the clock packets are carried in PLOAM messages.  FIG. 26  is different from  FIG. 25  in that: On the master clock side, the master clock packet time stamp generating module is configured to determine the master clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer; on the slave clock side, the slave clock packet time stamp generating module is configured to determine the slave clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer. 
         [0214]      FIG. 27  illustrates a seventh application of the optical communications system according to the embodiment of the present invention, where the clock packets are carried in OMCI messages. On the master clock side, the OLT includes a master clock packet time stamp generating module, a master clock synchronization processing module, an OLT GPM sub-layer processing module, an OLT GTC framing sub-layer processing module, an OLT TC adapter sub-layer processing module, and an OLT OMCI adapter sub-layer processing module. The master clock packet time stamp generating module is configured to determine the position of the master clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. On the slave clock side, the ONU includes a slave clock packet time stamp generating module, a slave clock synchronization processing module, an ONU GPM sub-layer processing module, an ONU GTC framing sub-layer processing module, an ONU TC adapter sub-layer processing module, and an ONU OMCI adapter sub-layer processing module. The slave clock packet time stamp generating module is configured to determine the position of the slave clock packet time stamp generating point and generate time stamp information according to the GTC TC frame header at the GTC framing sub-layer. 
         [0215]      FIG. 28  illustrates an eighth application of the optical communications system according to the embodiment of the present invention, where the clock packets are carried in OMCI messages.  FIG. 28  differs from  FIG. 27  in that: At the master clock side, the master clock packet time stamp generating module is configured to determine the master clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer; on the slave clock side, the slave clock packet time stamp generating module is configured to determine the slave clock packet time stamp generating point according to the GEM frame header at the TC adapter sub-layer. 
         [0216]    Those skilled in the art understand that the synchronization method, optical network device, and optical communications system according to the embodiments of the present invention are applicable not only to GPON systems but also to other xPON systems. 
         [0217]    Through the descriptions of the preceding embodiments, those skilled in the art may understand that the present invention may be implemented by hardware only or by software and necessary universal hardware. However, in most cases, software and necessary universal hardware are preferred. Based on such understandings, all or part of the technical solution under the present invention that makes contributions to the prior art may be essentially embodied in the form of a software product. The software product may be stored in a storage medium. The software product includes a number of instructions that enable a computer device (mobile phone, personal computer, server, or network device) to execute the methods provided in the embodiments of the present invention. 
         [0218]    The above descriptions are merely some exemplary embodiments of the present invention, but not desired to limit the scope of the present invention. Any modification, replacement, or improvement made without departing from the spirit and principle of the present invention should fall within the scope of the present invention.