To meet a requirement for data transmission between devices, it is necessary to ensure by means of clock synchronization that clock errors from different devices are within an acceptable range. When clock synchronization is applied to a ring network, there is a given probability of clock loops, and therefore communication performance of the network deteriorates.
At present, in a ring network, a clock loop may be prevented by using a path tracking method. For example, a clock identity of a boundary clock (BC) device is added to every clock packet passing through the boundary clock device. The clock identity of the boundary clock device is an identity of a clock source used by the boundary clock device. If a clock packet passes through a first BC device and a second BC device, a clock identity of the first BC device and a clock identity of the second BC device are carried in the clock packet. If a third BC device receives the clock packet, the third BC device parses the clock packet. When a quantity of devices in the ring network is relatively large, a packet transmitted by using this method is relatively long, and a large quantity of resources need to be consumed for parsing the packet. This affects communication performance of the network.