A packet forwarding method, wherein the method comprises: receiving, by a first network device, a first message sent by a second network device via a second egress port of the second network device, wherein the first message is used to measure a phase difference, and the phase difference is a phase difference between a switching time of one of a plurality of first buffers of a first egress port of the first network device and a switching time of one of a plurality of second buffers of the second egress port of the second network device with a link delay taken into consideration, wherein the link delay is a link delay of a communications link from the second network device to the first network device, and wherein the second egress port of the second network device and the first egress port of the first network device are connected via the communications link; determining, by the first network device, the phase difference based on the first message, wherein a switching cycle for the plurality of first buffers is the same as a switching cycle for the plurality of second buffers, the plurality of first buffers are cyclically scheduled by the first network device, and the plurality of second buffers are cyclically scheduled by the second network device such that in a cycle, in which one of the plurality of first buffers of the first network device is scheduled, all data packets of the first message from a previous cycle, in which another one of the plurality of second buffers of the second network device is scheduled, are sent; and scheduling, by the first network device based on the phase difference, a second data packet sent via the first egress port, wherein the second data packet is a data packet obtained by the first network device by processing a first data packet, and the first data packet is a data packet received by the first network device from the second egress port of the second network device. receiving, by a first network device, a first message sent by a second network device via a second egress port of the second network device, wherein the first message is used to measure a phase difference, and the phase difference is a phase difference between a switching time of one of a plurality of first buffers of a first egress port of the first network device and a switching time of one of a plurality of second buffers of the second egress port of the second network device with a link delay taken into consideration, wherein the link delay is a link delay of a communications link from the second network device to the first network device, and wherein the second egress port of the second network device and the first egress port of the first network device are connected via the communications link; determining, by the first network device, the phase difference based on the first message, wherein a switching cycle for the plurality of first buffers is the same as a switching cycle for the plurality of second buffers, the plurality of first buffers are cyclically scheduled by the first network device, and the plurality of second buffers are cyclically scheduled by the second network device such that in a cycle, in which one of the plurality of first buffers of the first network device is scheduled, all data packets of the first message from a previous cycle, in which another one of the plurality of second buffers of the second network device is scheduled, are sent; and scheduling, by the first network device based on the phase difference, a second data packet sent via the first egress port, wherein the second data packet is a data packet obtained by the first network device by processing a first data packet, and the first data packet is a data packet received by the first network device from the second egress port of the second network device.