A method for implementing a Mux machine, wherein the method is applied to a network running a link aggregation control protocol, LACP, the network comprises a first network device and a second network device, a first aggregation port of the first network device is connected to a second aggregation port of the second network device over an aggregated link, and the method being characterized by: setting, by the first network device, a Mux machine on the first aggregation port to be in a PROTECT_WAITING state, wherein the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collecting and distributing state, but notify another network device that a status of the first aggregation port is the collecting and distributing state, wherein the another network device includes a network device that communicates with the first network device over the aggregated link; when the Mux machine is in the PROTECT_WAITING state, determining, by the first network device, that the first aggregation port is not in the collecting and distributing state, and sending a first link aggregation control protocol data unit, LACPDU, packet to the second network device, wherein the first LACPDU packet is used to notify the second network device that the first aggregation port is in the collecting and distributing state, and trigger the second network device to set the second aggregation port to be in the collecting and distributing state; determining, by the first network device, whether a second LACPDU packet from the second network device is received, wherein the second LACPDU packet is used to indicate that the second aggregation port is in the collecting and distributing state; when the first network device determines that the second LACPDU packet is not received, setting the aggregated link as Single-port_UP, where Single-port_UP is used to indicate that an aggregation port on one end of the aggregated link is in the collecting and distributing state, and an aggregation port on the other end is not in the collecting and distributing state; and when the first network device determines that the second LACPDU packet is received, switching, by the first network device, a status of the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state, and setting the first aggregation port to be in the collecting and distributing state, wherein the COLLECTING_DISTRIBUTING state is used to indicate that the first aggregation port is allowed to receive and send data packets. setting, by the first network device, a Mux machine on the first aggregation port to be in a PROTECT_WAITING state, wherein the PROTECT_WAITING state is used to identify that the first aggregation port is not in a collecting and distributing state, but notify another network device that a status of the first aggregation port is the collecting and distributing state, wherein the another network device includes a network device that communicates with the first network device over the aggregated link; when the Mux machine is in the PROTECT_WAITING state, determining, by the first network device, that the first aggregation port is not in the collecting and distributing state, and sending a first link aggregation control protocol data unit, LACPDU, packet to the second network device, wherein the first LACPDU packet is used to notify the second network device that the first aggregation port is in the collecting and distributing state, and trigger the second network device to set the second aggregation port to be in the collecting and distributing state; determining, by the first network device, whether a second LACPDU packet from the second network device is received, wherein the second LACPDU packet is used to indicate that the second aggregation port is in the collecting and distributing state; when the first network device determines that the second LACPDU packet is not received, setting the aggregated link as Single-port_UP, where Single-port_UP is used to indicate that an aggregation port on one end of the aggregated link is in the collecting and distributing state, and an aggregation port on the other end is not in the collecting and distributing state; and when the first network device determines that the second LACPDU packet is received, switching, by the first network device, a status of the Mux machine from the PROTECT_WAITING state to a COLLECTING_DISTRIBUTING state, and setting the first aggregation port to be in the collecting and distributing state, wherein the COLLECTING_DISTRIBUTING state is used to indicate that the first aggregation port is allowed to receive and send data packets.