A method for data transmission comprising: sending, by a first network device, at least one first data packet to UE, wherein the first data packet is obtained by encoding an original data packet with a fountain code, the original data packet is data that needs to be sent to the UE, and a quantity of first data packets is greater than a quantity of original data packets (step 101); determining, by the first network device, that the user equipment UE needs to be handed over from the first network device to a second network device (step 102); sending a feedback control message to the UE, wherein the feedback control message is used to instruct the UE to send indication information of a remaining sending quantity k, and the remaining sending quantity k is at least greater than or equal to a difference between a quantity of first data packets needed by the UE to correctly restore all the original data packets and a quantity of first data packets correctly received by the UE (step 103); receiving a feedback message sent by the UE, wherein the feedback message comprises the indication information of the remaining sending quantity (step 104); and sending an original data packet message to the second network device, to instruct the second network device to continue to send a first data packet to the UE according to the original data packet message, wherein the original data packet message comprises the indication information of the remaining sending quantity k, a second data packet, and a location identifier of the second data packet, the second data packet is m data packets selected from the original data packets, m≥k, and the location identifier of the second data packet is identifiers of locations of the selected data packets in the original data packets (step 105). sending, by a first network device, at least one first data packet to UE, wherein the first data packet is obtained by encoding an original data packet with a fountain code, the original data packet is data that needs to be sent to the UE, and a quantity of first data packets is greater than a quantity of original data packets (step 101); determining, by the first network device, that the user equipment UE needs to be handed over from the first network device to a second network device (step 102); sending a feedback control message to the UE, wherein the feedback control message is used to instruct the UE to send indication information of a remaining sending quantity k, and the remaining sending quantity k is at least greater than or equal to a difference between a quantity of first data packets needed by the UE to correctly restore all the original data packets and a quantity of first data packets correctly received by the UE (step 103); receiving a feedback message sent by the UE, wherein the feedback message comprises the indication information of the remaining sending quantity (step 104); and sending an original data packet message to the second network device, to instruct the second network device to continue to send a first data packet to the UE according to the original data packet message, wherein the original data packet message comprises the indication information of the remaining sending quantity k, a second data packet, and a location identifier of the second data packet, the second data packet is m data packets selected from the original data packets, m≥k, and the location identifier of the second data packet is identifiers of locations of the selected data packets in the original data packets (step 105).