A data transmission method, applied to software-defined networking, SDN, wherein a controller in an SDN network is connected to a switching device through a southbound interface of the controller and is connected to an application server through a northbound interface of the controller, at least one application runs on the application server, and when the application server determines that currently data needs to be transmitted from a sending device to a receiving device by using the Transmission Control Protocol, TCP, the method comprises: receiving, by the controller, a TCP transmission resource allocation request from the application server, wherein the TCP transmission resource allocation request carries an address of the sending device and an address of the receiving device; determining, by the controller, a first transmission path and a second transmission path according to the TCP transmission resource allocation request, wherein the first transmission path is used by the sending device to transmit the data to the receiving device, and the second transmission path is used by the receiving device to transmit a TCP acknowledgment to the sending device; and sending, by the controller, a TCP transmission resource allocation response message to the application server, wherein the TCP transmission resource allocation response message comprises bandwidth information of the first transmission path and a TCP round-trip transmission delay, the TCP round-trip transmission delay indicates a pre-estimated time difference between a time T1 at which the sending device sends each data packet through the first transmission path and a time T2 at which the sending device receives a TCP acknowledgment of each data packet through the second transmission path, and the bandwidth information of the first transmission path and the TCP round-trip transmission delay are used to determine an initial value of a transmit window for TCP data transmission between the sending device and the receiving device. receiving, by the controller, a TCP transmission resource allocation request from the application server, wherein the TCP transmission resource allocation request carries an address of the sending device and an address of the receiving device; determining, by the controller, a first transmission path and a second transmission path according to the TCP transmission resource allocation request, wherein the first transmission path is used by the sending device to transmit the data to the receiving device, and the second transmission path is used by the receiving device to transmit a TCP acknowledgment to the sending device; and sending, by the controller, a TCP transmission resource allocation response message to the application server, wherein the TCP transmission resource allocation response message comprises bandwidth information of the first transmission path and a TCP round-trip transmission delay, the TCP round-trip transmission delay indicates a pre-estimated time difference between a time T1 at which the sending device sends each data packet through the first transmission path and a time T2 at which the sending device receives a TCP acknowledgment of each data packet through the second transmission path, and the bandwidth information of the first transmission path and the TCP round-trip transmission delay are used to determine an initial value of a transmit window for TCP data transmission between the sending device and the receiving device.