A data transmission method, comprising: receiving (S102, S402), by a first station device, a device group join request message that is sent by a second station device according to a multicast Media Access Control, MAC, address of a first device group, wherein the device group join request message is used to request to join the first device group, the first device group comprises the first station device, and each station device in the first device group supports a first service; and sending, by the first station device after receiving the device group join request message, a device group join response message to another station device in the first device group and the second station device according to the multicast MAC address of the first device group in a contention transmission manner, wherein the device group join response message is used to allow the second station device to join the first device group; and performing (S104, S403), by the first station device, data transmission of the first service with the second station device, wherein the data transmission of the first service with the second station device is performed in a service window of the first service, wherein the service window comprises a time and/or a channel of service transmission, the method being characterized by determining (S101, S401), by the first station device, that the second station device supports the first service, wherein the device group join request message is received after determining that the second station device supports the first service; and receiving (S102, S402), by the first station device after the device group join response message is sent and before the data transmission is performed, a device identifier notification message according to the MAC address of the first device group, wherein the device identifier notification message comprises a first device identifier, the first device identifier is a device identifier of the second station device in the first device group, wherein the second station device generates a first IP address according to an IP address prefix of the first device group and a host address of the second station device, and wherein the second station device further generates the first device ID according to the first IP address. receiving (S102, S402), by a first station device, a device group join request message that is sent by a second station device according to a multicast Media Access Control, MAC, address of a first device group, wherein the device group join request message is used to request to join the first device group, the first device group comprises the first station device, and each station device in the first device group supports a first service; and sending, by the first station device after receiving the device group join request message, a device group join response message to another station device in the first device group and the second station device according to the multicast MAC address of the first device group in a contention transmission manner, wherein the device group join response message is used to allow the second station device to join the first device group; and performing (S104, S403), by the first station device, data transmission of the first service with the second station device, wherein the data transmission of the first service with the second station device is performed in a service window of the first service, wherein the service window comprises a time and/or a channel of service transmission, the method being characterized by determining (S101, S401), by the first station device, that the second station device supports the first service, wherein the device group join request message is received after determining that the second station device supports the first service; and receiving (S102, S402), by the first station device after the device group join response message is sent and before the data transmission is performed, a device identifier notification message according to the MAC address of the first device group, wherein the device identifier notification message comprises a first device identifier, the first device identifier is a device identifier of the second station device in the first device group, wherein the second station device generates a first IP address according to an IP address prefix of the first device group and a host address of the second station device, and wherein the second station device further generates the first device ID according to the first IP address.