Disclosure of Invention
The application provides a data transmission method, a communication device and a system, which can solve the problem that the average rate of data transmission from a first device to a second device is lower, and the technical scheme is as follows:
A data transmission method is provided in the first aspect and used for transfer equipment, the transfer equipment is provided with a target transmission queue corresponding to second equipment, the target transmission queue corresponds to the second equipment, the method comprises the steps that the transfer equipment receives target data which are transmitted by first equipment and used for being transmitted to the second equipment, and then, when the length of the target transmission queue in the transfer equipment is determined to be smaller than a length threshold value, the transfer equipment adds the target data into the target transmission queue and transmits the data in the target transmission queue to the second equipment, so that the target data are transmitted to the second equipment.
In the data transmission method provided by the embodiment of the application, the first device sends the data to the second device through the transfer device, and the first device does not adjust the data sending rate in a mode of avoiding network congestion in the related technology, so that the data sending rate of the first device does not have larger fluctuation. And the transfer device adds data to the target transmission queue when the length of the target transmission queue is smaller than the length threshold, and stops adding data to the target transmission queue when the length of the target transmission queue is larger than or equal to the length threshold, so that fluctuation of the rate of the transfer device for transmitting the data in the target transmission queue can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the relay device transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
And, transfer equipment adds data or prohibits adding data to the target transmission queue according to the length threshold, and the target transmission queue in the transfer equipment has more data, and the target transmission queue has smaller probability of being empty, and the utilization rate of the transfer equipment is higher.
In addition, in the embodiment of the application, the target data is transmitted between the first device and the second device through the transfer device, the transfer device serves as a proxy device, the transfer device can be regarded as a data receiving end of the first device and a data transmitting end of the second device, and the data transmission channel between the first device and the second device is divided into a section of data transmission channel between the first device and the transfer device and a section of data transmission channel between the transfer device and the second device. Since the original data transmission channel is divided into two segments, the round-trip time (RTT) of each segment of data transmission channel is smaller. And, since RTT is inversely related to throughput, the throughput of each segment of data transmission channel is large.
Optionally, the method further comprises the step that the transfer equipment prohibits adding the target data to the target sending queue when determining that the length of the target sending queue is greater than or equal to the length threshold.
When the length of the target sending queue is greater than the length threshold, it indicates that more data needs to be sent to the second device by the transfer device at this time, and network congestion may be caused if data in the target cache is further added into the target sending queue, so that the transfer device at this time may prohibit the data in the target cache from being added into the target sending queue, so as to avoid network congestion caused by the data in the target cache being added into the target sending queue at this time.
Optionally, the first device and the second device transmit the target data through a transmission control protocol (Transmission Control Protocol, TCP) connection, and the method further includes determining, by a relay device, a target cache corresponding to the TCP connection before receiving the target data. And after receiving the target data, the transfer equipment caches the target data in the target cache.
The target cache is different from the sending cache, and is used for caching data sent by the first device and used for being sent to the second device, and the sending cache is used for caching data in a sending queue in the transfer device. The target buffer is divided in the transfer device, so that data sent by the first device are temporarily stored in the target storage, and whether the target data need to be added into the target sending queue from the target buffer is conveniently determined according to the length of the target sending queue.
Optionally, after the buffering the target data in the target buffer, the method further comprises determining, by a relay device, whether a length of the target transmit queue is less than the length threshold. After the target data is cached in the target cache, the transfer device may perform an action of determining whether the length of the target transmit queue is less than a length threshold, so as to determine whether the target data needs to be added to the target transmit queue.
Optionally, the method further comprises the steps that the transfer device receives a packet loss indication sent by the second device and used for being sent to the first device, wherein the packet loss indication is used for indicating that the second device does not receive the target data, and after receiving the packet loss indication, the transfer device can add the target data into the target sending queue according to the packet loss indication and send the data in the target sending queue to the second device so as to retransmit the target data.
Optionally, the target sending queue comprises a plurality of sub-queues, the plurality of sub-queues have priorities, the data in the plurality of sub-queues are sequentially sent from high to low according to the priorities of the sub-queues, and the transfer device can add the target data into the sub-queue with the highest priority in the plurality of sub-queues when adding the target data into the target sending queue according to the packet loss indication. Because the data in the plurality of sub-queues are sequentially sent from high to low according to the priority of the sub-queues, the transfer device adds the target data into the sub-queue with the highest priority, so that the transfer device can quickly retransmit the target data to the second device.
In a second aspect, a data transmission method is provided, where the optical line terminal OLT is connected to an optical network terminal ONT, and the ONT has a target transmit queue corresponding to a second device, where the target transmit queue corresponds to the second device. The method comprises the steps that an OLT receives target data sent by a first device and used for being sent to a second device, and then when the OLT determines that the length of a target sending queue in an ONT is smaller than a length threshold value, the target data is sent to the ONT, so that the ONT can be convenient to add the target data into the target sending queue, and the data in the target sending queue is sent to the second device, so that the target data is sent to the second device.
In the data transmission method provided by the embodiment of the application, the first device sends the data to the second device through the OLT and the ONT, and the first device does not adjust the data sending rate in a mode of avoiding network congestion in the related art, so that the data sending rate of the first device does not have larger fluctuation. And when the length of the target transmission queue is smaller than the length threshold, the OLT controls the ONT to add data into the target transmission queue, and when the length of the target transmission queue is larger than or equal to the length threshold, the OLT stops controlling the ONT to add data into the target transmission queue, so that fluctuation of the data rate in the target transmission queue of the ONT can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the ONT transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
And the OLT controls the ONT to add data into the target transmission queue or prohibit adding data according to the length threshold, so that the target transmission queue in the ONT has more data, the probability of the target transmission queue being empty is smaller, and the utilization rate of the ONT is higher.
In addition, in the embodiment of the application, the target data is transmitted between the first device and the second device through the whole formed by the OLT and the ONT, the whole formed by the OLT and the ONT is taken as a proxy device, the whole formed by the OLT and the ONT can be regarded as a data receiving end of the first device, and a data transmitting end of the second device, and a data transmission channel between the first device and the second device is divided into a section of data transmission channel between the first device and the whole formed by the OLT and the ONT, and a section of data transmission channel between the whole formed by the OLT and the ONT and the second device. The original data transmission channel is divided into two sections of data transmission channels, so that RTT of each section of data transmission channel is smaller. And, since RTT is inversely related to throughput, the throughput of each segment of data transmission channel is large.
Optionally, the method further comprises the step that the OLT receives the information of the length of the target transmission queue sent by the ONT before sending the target data to the ONT, and then the OLT can determine that the length of the target transmission queue is smaller than the length threshold according to the information of the length of the target transmission queue.
Optionally, the information of the length of the target transmission queue comprises a size relation between the length of the target transmission queue and the length threshold. For example, the length of the target transmit queue is less than a length threshold, or the length of the target transmit queue is greater than or equal to the length threshold. Also by way of example, the information of the length of the target transmit queue may include the length of the target transmit queue.
Optionally, the method further comprises the OLT prohibiting the sending of the target data to the ONT when determining that the length of the target send queue is greater than or equal to the length threshold.
Optionally, the first device and the second device transmit the target data through a TCP connection, and the method further comprises the steps that the OLT determines a target cache corresponding to the TCP connection, and after receiving the target data, the OLT caches the target data in the target cache.
Optionally, after the buffering the target data in the target buffer, the method further comprises the OLT determining whether the length of the target transmit queue is less than the length threshold.
The method comprises the steps that an OLT receives a packet loss indication sent by a second device and used for being sent to a first device, wherein the packet loss indication is used for indicating that the second device does not receive target data, and then the OLT sends a retransmission instruction to an ONT according to the packet loss indication, the retransmission instruction is used for indicating the ONT to add the target data to a target sending queue according to the retransmission instruction, and sends the data in the target sending queue to the second device.
In a third aspect, a data transmission method is provided, where the optical network terminal ONT, the ONT has a target transmission queue corresponding to a second device, and the target transmission queue corresponds to the second device. The method comprises the steps that the ONT sends information of the length of a target sending queue in the ONT to the optical line terminal OLT, then the ONT receives target data sent by the OLT and used for being sent to the second device, the target data are added into the target sending queue, and finally the ONT sends the data in the target sending queue to the second device so as to send the target data to the second device.
Optionally, the information of the length of the target transmission queue comprises the size relation between the length of the target transmission queue and a length threshold value.
Optionally, the method further comprises the steps that after the ONT receives a retransmission instruction sent by the OLT, the target data is added into the target sending queue according to the retransmission instruction, and the data in the target sending queue is sent to the second device so as to retransmit the target data to the second device.
Optionally, the target sending queue includes a plurality of sub-queues, the plurality of sub-queues have priorities, the data in the plurality of sub-queues are sequentially sent according to the order from high to low of the priorities of the sub-queues, and the ONT can add the target data to the sub-queue with the highest priority among the plurality of sub-queues when adding the target data to the target sending queue according to the retransmission instruction.
In a fourth aspect, a communication device is provided for a relay device, the communication device comprising respective modules for performing any one of the data transmission methods provided in the first aspect.
In a fifth aspect, a communication device is provided for an optical line terminal OLT, the communication device comprising respective modules for performing any of the data transmission methods provided in the second aspect.
In a sixth aspect, a communication device is provided for an optical network terminal ONT, the communication device comprising respective modules for performing any one of the data transmission methods provided in the third aspect.
In a seventh aspect, a communication device is provided for a relay device, where the communication device includes a processor and a memory, and the processor is configured to execute a program stored in the memory, to implement any one of the data transmission methods provided in the first aspect.
In an eighth aspect, a communication device is provided for an optical line terminal OLT, where the communication device includes a processor and a memory, and the processor is configured to execute a program stored in the memory, so as to implement any one of the data transmission methods provided in the second aspect.
In a ninth aspect, a communication device is provided for an optical network terminal ONT, the communication device comprising a processor and a memory, the processor being configured to execute a program stored in the memory, to implement any one of the data transmission methods provided in the third aspect.
In a tenth aspect, there is provided a communication system comprising a first device, a second device and a relay device, the relay device being any one of the communication devices provided in the fourth or seventh aspects.
An eleventh aspect provides a communication system comprising a first device, a second device, an optical line terminal OLT and an optical network terminal ONT;
the OLT is any one of the communication devices provided in the fifth aspect, the ONT is any one of the communication devices provided in the sixth aspect, or the OLT is any one of the communication devices provided in the eighth aspect, and the ONT is any one of the communication devices provided in the ninth aspect.
In a twelfth aspect, there is provided a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform any one of the data transmission methods as provided in the first, second or third aspects.
In a thirteenth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the data transmission methods as provided in the first, second or third aspects.
Effects of the foregoing corresponding arrangements in the first aspect to the thirteenth aspect may be referred to each other, and the disclosure is not repeated herein.
Detailed Description
In order to make the principles and technical solutions of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic structural diagram of a communication system according to an embodiment of the present application, and as shown in fig. 1, the communication system includes a plurality of communication devices, such as a first device 01 and a second device 02 in fig. 1. The communication device may be any device capable of communication, such as a router, gateway, server or terminal. The embodiment of the application does not limit the number of communication devices in the communication system, and only two communication devices are taken as an example in fig. 1.
By way of example, a communication device may include a processor coupled to a memory and configured to execute a method performed by the communication device as described in embodiments of the present application in accordance with the instructions after the processor is coupled to the memory and reads the instructions in the memory. The number of the processors may be multiple, and the memory coupled to the processors may be independent of the processors or independent of the communication device, or may be within the processors or the communication device. The memory may be a physically independent unit, or may be a storage space on a cloud server, a network hard disk, or the like. Alternatively, the memory may be one or more. When the number of the memories is plural, the memories may be located at the same or different positions and may be used independently or in combination. For example, when the memory is located inside the communication device, please refer to fig. 2, fig. 2 is a schematic structural diagram of the communication device according to an embodiment of the present application. The communication device 200 comprises a processor 202 and a memory 201, wherein the memory 201 is adapted to store a program, and the processor 202 is adapted to invoke the program stored in the memory 201 to cause the communication device to perform a corresponding method or function. Optionally, as shown in fig. 2, the communication device 200 may further comprise at least one communication interface 203 and at least one communication bus 204. The memory 201, the processor 202, and the communication interface 203 are communicatively coupled via a communication bus 204. The communication interface 203 is used to communicate with other devices under the control of the processor 202, and the processor 202 may call a program stored in the memory 201 through the communication bus 204.
Communication devices in a communication system may establish communication connections between themselves and may communicate (e.g., transfer data) based on the established communication connections. The communication devices may be connected through a wired network or a wireless network, where the wired network may include, but is not limited to, a universal serial bus (english: universal Serial Bus; abbreviated as USB), and the wireless network may include, but is not limited to, wireless fidelity (english: WIRELESS FIDELITY; abbreviated as WIFI), bluetooth, infrared, zigbee (english: zigbee), data, and the like.
Communication devices in a communication system may communicate based on any communication protocol, such as TCP, or user datagram protocol (User Datagram Protocol, UDP), etc., when communicating.
For example, fig. 3 is a schematic diagram of a first device transmitting data to a second device according to an embodiment of the present application, and as shown in fig. 3, the first device may perform a three-way handshake with the second device based on TCP before transmitting data to the second device. Wherein upon a first handshake, the second device sends a first handshake signal to the first device, the first handshake signal may include a first synchronization sequence number (Synchronize Sequence Numbers, SYN), wherein the first syn=x, x is any value. In a second handshake, the first device sends a second handshake signal to the second device based on the first handshake signal, where the second handshake signal may include a second synchronization sequence number (Synchronize Sequence Numbers, SYN) and a first acknowledgement character (Acknowledge character, ACK), where the second syn=y, y is any value, and the first ack=x+1. In a third handshake, the second device sends a third handshake signal to the first device, the third handshake signal comprising a second ACK, the second ACK = y +1. After the three handshakes, the first device and the second device establish a TCP connection, and then the first device can transmit data to the second device. With continued reference to fig. 3, assuming that the first device needs to sequentially transmit 3 data, i.e., M1, M2, and M3, to the second device, after receiving each data sent by the first device, will send an acknowledgement response of the data to the first device, for example, the second device sends an ACK of the data to the first device. For example, the second device may send an ACK M1 to the first device after receiving the M1 sent by the first device, and the second device may send an ACK M2 to the first device after receiving the M2 sent by the first device.
After each time of receiving the data transmitted by the first device, the second device determines whether the next data is received within a time duration threshold after receiving the data. For example, referring to fig. 3, after receiving M2, the second device determines whether M3 is received within a duration threshold after receiving M2. If the second device does not receive the next data within the duration threshold, the second device repeatedly sends a packet loss indication of the next data to the first device until the next data is received. For example, the packet loss indication of the next data may be the same as the acknowledgement response of the latest received data, e.g., please continue with reference to fig. 3, if the second device does not receive M3 within the duration threshold after receiving M2, the second device may repeatedly send an ACK M2 to the first device. After receiving the three packet loss indications, the first device retransmits the next data to the second device. For example, referring to fig. 3, after receiving the first ACK M2, the first device receives three further ACKs M2 and then retransmits M3 to the second device. After receiving M3, the second device sends an acknowledgement response of M3 to the first device, ACK M3.
It should be noted that, in the process of transmitting data between communication devices, network congestion is relatively easy to occur, so that the transmitted data has a packet loss phenomenon, thereby affecting the reliability and efficiency of data transmission. Therefore, in the process of transmitting data between communication devices, a mechanism for avoiding congestion is often adopted to reduce the occurrence probability of network congestion as much as possible.
For example, in the embodiment shown in fig. 3, the rate at which the first device transmits data, that is, the second rate, that is, the amount of data transmitted by the first device per second, may be in bits per second, megabits per second, or the like, is continuously adjusted during the process of transmitting data by the first device. The process of adjusting the second rate by the first device may refer to fig. 4, and it should be noted that, in fig. 4, the abscissa indicates time, and units may be seconds, milliseconds, and the like, and the ordinate indicates the second rate, and units may be bits per second, megabits per second, and the like, and as shown in fig. 4, the initial value of the second rate of the first device is 1. Each time the first device receives an acknowledgement response for one data, the second rate is doubled. For example, at each transmission round, the first device may send a data to the second device and receive an acknowledgement response of the data sent by the second device, where the first device increases the second rate by a factor of two. When the second rate reaches the second rate threshold (16 in fig. 4 for example), the first device increases the second rate by 1 each time it receives an acknowledgement response of one data, but the increased second rate is less than twice the original second rate. When the first device continuously receives three packet loss indications of certain data, the first device may determine that network congestion is about to occur, and at this time, the first device updates the original second rate threshold to be half of the current second rate (e.g., the current second rate is 24, and the updated second rate threshold is 12). The first device will also reduce the value of the second rate to an initial value of 1 and repeat the above process. When the value of the second rate is reduced to the initial value 1, the rate at which the first device transmits data is reduced to the initial value, so that the occurrence probability of network congestion can be reduced as much as possible.
For another example, as shown in fig. 5, when the first device determines that network congestion is about to occur, the first device may reduce the second rate to half the original second rate (for example, the original second rate is 24 and the updated second rate is 12) instead of reducing the second rate to 1, and then, the first device increases the second rate by 1 each time it receives an acknowledgement response of one data, but the increased second rate is less than twice the original second rate. When the second rate is reduced to half of the original rate, the occurrence probability of network congestion can be reduced as much as possible.
But the first device reducing the second rate to half the current second rate (or less, such as reducing the second rate to an initial value) will cause the network rate to fluctuate more, resulting in a lower average rate at which the first device transmits data. For example, as shown in fig. 6, the rate at which the first device transmits data is shown, and it can be seen that, in the process that the first device adopts the above manner of avoiding network congestion, the rate at which the first device transmits data (second rate) is reduced to half or less of the current rate repeatedly, which results in a larger fluctuation in the rate at which the first device transmits data. In this way, the queue depth of the transmission queue (including the data to be transmitted by the first device) in the first device is read for a plurality of times, and the read queue depth is found to be 0 when about 10% -20% of the probability is found, which means that the first device has 10% -20% of the time in the idle state in the process of transmitting the data. It can be seen that the rate at which the first device transmits data fluctuates greatly, the average rate at which the first device transmits data to the second device is low, and the utilization rate of the first device is low.
The embodiment of the application provides a data transmission method, in which the fluctuation of the data transmission rate is small, the average data transmission rate is high, and the utilization rate of communication equipment is high. The plurality of communication devices in the communication system shown in fig. 1 not only includes the first device 01 and the second device 02, but also includes the relay device 03, and the data transmission method provided by the embodiment of the present application may be used for the relay device 03. The first device 01 and the second device 02 are connected through the relay device 03, and the first device 01 and the second device 02 can transmit data through the relay device 03. The relay device 03 may be geographically located between the first device 01 and the second device 02, or of course, the relay device 03 may not be geographically located between the first device 01 and the second device 02, which is not limited by the embodiment of the present application. Alternatively, when the first device 01 is a server and the second device 02 is a terminal, the relay device may be a router, a gateway, or the like.
For example, based on the communication system shown in fig. 1, a flowchart of a data transmission method provided in an embodiment of the present application is shown in fig. 7, where the data transmission method includes:
in step 701, the first device and the second device establish a TCP connection through the transit device.
In the process of establishing TCP connection between the first device and the second device, the first device and the second device can carry out three-way handshake, and the first handshake signal, the second handshake signal and the third handshake signal can be transmitted between the first device and the second device through the transfer device.
Step 702, the relay device determines a target cache corresponding to the TCP connection established by the first device and the second device.
In the process that the first device and the second device establish TCP connection, the transfer device forwards the handshake signals between the first device and the second device, and after forwarding the first handshake signals, the second handshake signals and the third handshake signals, the transfer device can determine that the first device and the second device establish TCP connection.
After determining that the first device and the second device establish the TCP connection, the transit device may determine a target cache corresponding to the TCP connection from the local caches. The target cache is different from the sending cache, and is used for caching data sent by the first device and used for being sent to the second device, and the sending cache is used for caching data in a sending queue in the transfer device.
Optionally, the relay device may further feed back the size of the empty storage area in the target cache to the first device, so that the first device adjusts the rate at which the first device sends data to the relay device according to the size of the empty storage area. For example, the first device may decrease the rate of sending data to the relay device when the free storage area is small, and the first device may increase the rate of sending data to the relay device when the free storage area is large.
In step 703, the first device sends target data for sending to the second device to the relay device.
After the first device and the second device establish a TCP connection, the first device may send data (e.g., target data) to the second device over the TCP connection. Since the TCP connection is established by the first device and the second device through the relay device, the target data sent by the first device through the TCP connection is transmitted to the relay device. After receiving the target data, the transfer device may adopt a scheme in a subsequent step to send the target data to the first device.
In step 704, the relay device caches the target data in the target cache.
After determining that the first device and the second device establish the TCP connection, the relay device detects whether target data sent by the first device through the TCP connection and used for being sent to the second device is received, and after receiving the target data, the relay device caches the target data in a target cache.
Step 705, the relay device determines whether the length of the target transmit queue corresponding to the second device is less than a length threshold. Step 706 is performed when the length of the target transmit queue is less than the length threshold, and step 708 is performed when the length of the target transmit queue is greater than or equal to the length threshold.
The transfer device is connected with at least one device, and the transfer device is provided with at least one transmission queue corresponding to the at least one device one by one. The second device is a device connected with the transfer device, and a transmission queue corresponding to the second device in the at least one transmission queue is a target transmission queue. When the transfer device transmits data to the second device, the transfer device may add the data to the target transmission queue, and then transmit the data in the target transmission queue to the second device.
When the length of the target transmit queue is less than the length threshold, which indicates that the transfer device needs to transmit less data to the second device at this time, the transfer device may execute step 706 to continue adding data in the target cache to the target transmit queue. For example, assuming that the length threshold is 100 and the current length of the target transmit queue is 80, the transfer device may continue to add data in the target cache to the target transmit queue.
When the length of the target transmission queue is greater than the length threshold, it indicates that more data needs to be transmitted to the second device by the transfer device at this time, and network congestion may be caused if the data in the target buffer is further added to the target transmission queue, so the transfer device may execute step 708 to prohibit the data in the target buffer from being added to the target transmission queue, so as to avoid network congestion caused by the data in the target buffer being added to the target transmission queue at this time. For example, assuming that the length threshold is 100 and the current length of the target transmit queue is 100 or 110, the transit device needs to prohibit adding data in the target cache to the target transmit queue.
It can be seen that, in the embodiment of the present application, the first device sends data through the transfer device and the second device does not adjust the rate of sending data in a manner of avoiding network congestion in the related art, so that the rate of sending data by the first device does not have a larger fluctuation.
In the embodiment of the application, the transfer device adds data into the target sending queue when the length of the target sending queue is smaller than the length threshold value, and stops adding data into the target sending queue when the length of the target sending queue is larger than or equal to the length threshold value. As can be seen, there are many cases where there is data in the target transmission queue in the relay device, and the probability that the target transmission queue is empty is small, and the utilization rate of the relay device is high. In addition, the transfer device adds data to the target transmission queue or prohibits adding data according to the length threshold, so that fluctuation of the rate of the transfer device transmitting the data in the target transmission queue can be reduced. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the relay device transmits data to the second device is high.
In step 706, the relay device adds the target data in the target buffer to the target sending queue.
In one aspect, the target sending queue may only include one sub-queue, and in this case, the relay device may directly add the target data to the sub-queue.
Alternatively, the target transmit queue may include a plurality of sub-queues, each having a priority, the priorities of the plurality of sub-queues being different. The data in the plurality of sub-queues are sequentially sent according to the order of the priority of the sub-queues from high to low. At this time, the transfer device may add the target data to a sub-queue of a certain priority according to a certain mechanism.
For example, the relay device may add the target data to a sub-queue of the plurality of sub-queues that contains the least amount of data.
For another example, the target data may carry the priority of the target data, and when the relay device adds the target data to the target sending queue, the relay device may find a sub-queue with the same priority as the priority of the target data in multiple sub-queues of the target sending queue, and add the target data to the sub-queue.
Step 707, the relay device transmits the data in the target transmission queue to the second device.
Since the relay device adds the target data to the target transmission queue in step 706, the relay device transmits the data in the target transmission queue to the second device in step 707, enabling the relay device to transmit the target data to the second device.
Step 708, the relay device prohibits adding the target data to the target transmit queue.
Further, when the second device does not receive the target data, the second device may send, to the first device, a packet loss indication of the target data in the foregoing embodiment, where the packet loss indication is used to indicate that the second device does not receive the target data. Since the first device and the second device establish a TCP connection through the relay device, the relay device can receive the packet loss indication. It should be noted that, after receiving the packet loss indication, the relay device does not need to send the packet loss indication to the first device.
After receiving the packet loss indication, the relay device may determine that the second device does not receive the target data, where the relay device needs to retransmit the target data. At this time, the transfer device may add the target data to the target transmission queue according to the packet loss indication, and further retransmit the data in the target transmission queue to the second device, so as to retransmit the target data to the second device.
For example, when the target transmission queue includes a plurality of sub-queues having different priorities, the relay device may add the target data to a sub-queue having the highest priority among the plurality of sub-queues to retransmit the target data to the second device. Because the data in the plurality of sub-queues are sequentially sent from high to low according to the priority of the sub-queues, the transfer device adds the target data into the sub-queue with the highest priority, so that the transfer device can quickly retransmit the target data to the second device.
In summary, in the data transmission method provided by the embodiment of the present application, the first device sends the data to the second device through the transfer device, and the first device does not adjust the data sending rate in a manner of avoiding network congestion in the related art, so that the data sending rate of the first device does not have larger fluctuation. And the transfer device adds data to the target transmission queue when the length of the target transmission queue is smaller than the length threshold, and stops adding data to the target transmission queue when the length of the target transmission queue is larger than or equal to the length threshold, so that fluctuation of the rate of the transfer device for transmitting the data in the target transmission queue can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the relay device transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
As an example, in the embodiment of the present application, the rate of sending data in the target sending queue by the transfer device is shown in fig. 8, it can be seen that the transfer device adds data to the target sending queue when the length of the target sending queue is less than the length threshold, and stops adding data to the target sending queue when the length of the target sending queue is greater than or equal to the length threshold, so that the fluctuation degree of the rate of sending data in the target sending queue by the transfer device is smaller than the fluctuation degree shown in fig. 6.
And, transfer equipment adds data or prohibits adding data to the target transmission queue according to the length threshold, and the target transmission queue in the transfer equipment has more data, and the target transmission queue has smaller probability of being empty, and the utilization rate of the transfer equipment is higher. For example, in the data transmission manner shown in fig. 4 or fig. 5, the first device has 10% -20% of the time in the idle state in the data transmission process, and the utilization rate of the first device is low. In the data transmission method shown in fig. 7, since the target transmission queue always has data, the relay device is continuously in a non-idle state, and the utilization rate of the relay device is higher, and compared with the data transmission methods shown in fig. 4 and 5, the utilization rate of the relay device can be improved by 10% -20%.
In addition, in the embodiment of the application, the target data is transmitted between the first device and the second device through the transfer device, the transfer device is used as a proxy device, the transfer device can be regarded as a data receiving end of the first device and a data transmitting end of the second device, and the data transmission channel between the first device and the second device is divided into a section of data transmission channel between the first device and the transfer device and a section of data transmission channel between the transfer device and the second device. The original data transmission channel is divided into two sections of data transmission channels, so that RTT of each section of data transmission channel is smaller. And, since RTT is inversely related to throughput, the throughput of each segment of data transmission channel is large.
The communication system provided by the embodiment of the application can be a mobile communication system or a fixed network communication system, and correspondingly, the communication equipment (such as the first equipment, the second equipment and the transit equipment) in the communication system can be mobile communication equipment or fixed network communication equipment.
Alternatively, when the transit device is a fixed network communication device, if the transit device is an optical line terminal (optical LINE TERMINAL, OLT), as shown in fig. 9, the communication system includes a first device 01, an OLT 03, an optical network terminal (Optical Network Terminal, ONT) 04, and a second device 02, which are sequentially connected.
Based on the communication system shown in fig. 9, the data transmission method provided in the embodiment of the present application may be as shown in fig. 10, and the data transmission method may include:
in step 1001, the first device and the second device establish a TCP connection through the OLT and the ONT.
Step 1001 may refer to step 701, and the embodiment of the present application is not described herein.
Step 1002, the OLT determines a target buffer corresponding to the TCP connection in the OLT and a target transmit queue corresponding to the TCP connection in the ONT.
Step 1002 may refer to step 702, and embodiments of the present application are not described herein.
Step 1003, the ONT sends information of the length of the target transmit queue in the ONT to the OLT.
The ONT is connected to at least one device, and has at least one transmission queue corresponding to the at least one device one by one. The second device is an ONT connected device, and the transmission queue corresponding to the second device in the at least one transmission queue is a target transmission queue. When the ONT transmits data to the second device, the ONT may add the data to the target transmission queue, and then transmit the data in the target transmission queue to the ONT.
In step 1003, the ONT may send information of the lengths of all the transmission queues in the ONT to the OLT to send information of a target transmission queue in the all transmission queues to the OLT. The ONT may periodically send information of the length of the target transmit queue in the ONT to the OLT.
The information of the length of the target transmit queue may include a size relationship of the length of the target transmit queue to a length threshold. For example, the length of the target transmit queue is less than a length threshold, or the length of the target transmit queue is greater than or equal to the length threshold. Also by way of example, the information of the length of the target transmit queue may include the length of the target transmit queue.
Step 1004, the first device sends target data to the OLT for transmission to the second device.
Step 1004 may refer to step 703, which is not described herein in detail.
In step 1005, the OLT caches the target data in a target cache.
Step 1005 may refer to step 704, and the embodiment of the present application is not described herein.
In step 1006, the OLT determines whether the length of the target transmit queue is less than a length threshold according to the information of the length of the target transmit queue in the ONT. Step 1007 is performed when the length of the target transmit queue is less than the length threshold, and step 1010 is performed when the length of the target transmit queue is greater than or equal to the length threshold.
Step 1006 may refer to step 705, and embodiments of the present application are not described herein.
When the information of the length of the target transmission queue transmitted by the ONT in step 1001 includes the length of the target transmission queue, the OLT needs to compare the length of the target transmission queue with a length threshold to determine whether the length of the target transmission queue is smaller than the length threshold. When the information of the length of the target transmission queue sent by the ONT in step 1001 includes the size relation between the length of the target transmission queue and the length threshold, the OLT may directly determine the size relation between the target transmission queue and the length threshold according to the information of the target transmission queue.
In addition, when the ONT transmits the information of the length of the target transmission queue to the OLT by transmitting the information of the length of all the transmission queues in the ONT in step 1001, in step 1006, the OLT needs to search for the information of the length of the target transmission queue corresponding to the second device from the information of the length of all the transmission queues, and then determine whether the length of the target transmission queue is smaller than the length threshold according to the information of the length of the target transmission queue.
Step 1007, the OLT sends the target data to the ONT.
Upon determining that the length of the target transmit queue is less than the length threshold, the OLT may transmit target data to the ONT so that the ONT adds the target data to the target transmit queue to transmit the target data to the second device.
Step 1008, the ONT adds the target data to the target transmit queue.
The process of adding the target data to the target sending queue by the ONT may refer to the process of adding the target data in the target cache to the target sending queue by the transfer device in step 706, which is not described herein in detail in the embodiment of the present application.
Step 1009, the ONT sends the data in the target transmit queue to the second device.
The process of the ONT transmitting the data in the target transmission queue to the second device may refer to the process of the relay device transmitting the data in the target transmission queue to the second device in step 707, which is not described herein in detail in the embodiment of the present application.
In step 1010, the OLT prohibits sending the target data to the ONT.
When the OLT determines that the length of the target transmission queue is greater than or equal to the length threshold, the OLT does not transmit target data to the ONT, so that the ONT does not add the target data to the target transmission queue, and further the ONT does not transmit the target data to the second device.
Further, when the second device does not receive the target data, the second device may send, to the first device, a packet loss indication of the target data in the foregoing embodiment, where the packet loss indication is used to indicate that the second device does not receive the target data. Since the first device and the second device establish a TCP connection through the OLT and the ONT, the OLT can receive the packet loss indication. It should be noted that, after receiving the packet loss indication, the OLT does not need to send the packet loss indication to the first device.
After receiving the packet loss indication, the OLT may determine that the second device does not receive the target data, and at this time, the OLT needs to control the ONT to retransmit the target data. At this time, the OLT may send a retransmission instruction to the ONT according to the packet loss instruction, where the retransmission instruction is used to instruct the ONT to retransmit the target data, so that the ONT adds the target data to the target transmission queue again according to the retransmission instruction, and further retransmits the target data in the process of sending the data in the target transmission queue to the second device.
The process of adding the target data into the target transmission queue by the ONT according to the retransmission instruction may refer to the process of adding the target data into the target transmission queue by the relay device according to the packet loss instruction in the foregoing embodiment, and the embodiments of the present application are not described herein.
In summary, in the data transmission method provided by the embodiment of the present application, the first device sends data to the second device through the OLT and the ONT, and the first device does not adjust the rate of sending the data in a manner of avoiding network congestion in the related art, so that the rate of sending the data by the first device does not have larger fluctuation. And when the length of the target transmission queue is smaller than the length threshold, the OLT controls the ONT to add data into the target transmission queue, and when the length of the target transmission queue is larger than or equal to the length threshold, the OLT stops controlling the ONT to add data into the target transmission queue, so that fluctuation of the data rate in the target transmission queue of the ONT can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the ONT transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
For example, in the embodiment of the present application, the rate of data in the ONT sending target sending queue is shown in fig. 8, it can be seen that when the length of the target sending queue is smaller than the length threshold, the OLT controls the ONT to add data to the target sending queue, and when the length of the target sending queue is greater than or equal to the length threshold, the OLT stops controlling the ONT to add data to the target sending queue, so that the fluctuation degree of the rate of data in the ONT sending target sending queue is smaller than the fluctuation degree shown in fig. 6.
And the OLT controls the ONT to add data into the target transmission queue or prohibit adding data according to the length threshold, so that the target transmission queue in the ONT has more data, the probability of the target transmission queue being empty is smaller, and the utilization rate of the ONT is higher. In the data transmission manner shown in fig. 4 or fig. 5, the first device is in an idle state 10% -20% of the time in the data transmission process, and the utilization rate of the first device is low. In the data transmission method shown in fig. 10, since the target transmission queue always has data, the ONT is continuously in a non-idle state, and the utilization rate of the ONT is high, and compared with the data transmission methods shown in fig. 4 and 5, the utilization rate of the ONT can be improved by 10% -20%.
In addition, in the embodiment of the application, the target data is transmitted between the first device and the second device through the whole formed by the OLT and the ONT, the whole formed by the OLT and the ONT is taken as a proxy device, the whole formed by the OLT and the ONT can be regarded as a data receiving end of the first device, and a data transmitting end of the second device, and a data transmission channel between the first device and the second device is divided into a section of data transmission channel between the first device and the whole formed by the OLT and the ONT, and a section of data transmission channel between the whole formed by the OLT and the ONT and the second device. The original data transmission channel is divided into two sections of data transmission channels, so that RTT of each section of data transmission channel is smaller. And, since RTT is inversely related to throughput, the throughput of each segment of data transmission channel is large.
The data transmission method provided by the embodiment of the present application is described above in conjunction with fig. 1 to 10, and each communication device provided by the embodiment of the present application will be described below in conjunction with fig. 11 to 13.
Fig. 11 is a schematic structural diagram of another communication device according to an embodiment of the present application, which may be used as a relay device in the communication system shown in fig. 1. As shown in fig. 11, the communication device includes:
the first receiving module 1101 is configured to receive target data sent by the first device and used for being sent to the second device. The function of the first receiving module 1101 may refer to the function related to the relay device in step 703 in fig. 7, which is not described herein.
And a first joining module 1102, configured to join the target data into a target sending queue when the length of the target sending queue in the transit device is less than a length threshold, where the target sending queue corresponds to a second device. The function of the first joining module 1102 may refer to the function related to the relay device in step 707 in fig. 7, which is not described herein in detail.
A first sending module 1103 is configured to send the data in the target sending queue to the second device. The function of the first sending module 1103 may refer to the function related to the relay device in step 708 in fig. 7, which is not described herein.
Optionally, the communication device further includes:
A prohibiting module (not shown in fig. 11) for prohibiting the target data from being added to the target transmission queue when the length of the target transmission queue is greater than or equal to the length threshold. The function of the prohibiting module may refer to the function related to the transferring device in step 709 of fig. 7, and the embodiment of the present application will not be described herein.
Optionally, the first device and the second device transmit the target data through a transmission control protocol TCP connection, and the communication device further includes:
The function of the first determining module may refer to the function related to the transit device in step 702 in fig. 7, and the embodiment of the present application is not described herein.
A caching module (not shown in fig. 11) for caching the target data in the target cache after receiving the target data. The function of the buffer module may refer to the function related to the relay device in step 704 in fig. 7, and the embodiment of the present application is not described herein.
Optionally, the communication device further includes:
A second determining module (not shown in fig. 11) is configured to determine, after the target data is cached in the target cache, whether a length of the target transmit queue is less than the length threshold. The function of the second determining module may refer to the function related to the relay device in step 705 in fig. 7, which is not described herein in detail.
Optionally, the communication device further includes:
A second receiving module (not shown in fig. 11), configured to receive a packet loss indication sent by the second device and used for sending the packet loss indication to the first device, where the packet loss indication is used for indicating that the second device does not receive the target data;
A second joining module (not shown in fig. 11) for joining the target data to the target transmit queue according to the packet loss indication;
A second transmitting module (not shown in fig. 11) for transmitting the data in the target transmission queue to the second device.
Optionally, the target sending queue includes a plurality of sub-queues, and the plurality of sub-queues have priorities, and the data in the plurality of sub-queues are sent sequentially from high to low according to the priorities of the sub-queues;
The second adding module (not shown in fig. 11) is configured to add the target data to a sub-queue with the highest priority among the plurality of sub-queues according to the packet loss indication.
In summary, the embodiment of the present application provides a communication device, through which a first device sends data to a second device, and the first device does not adjust the rate of sending the data in a manner of avoiding network congestion in the related art, so that the rate of sending the data by the first device does not have a larger fluctuation. And the communication device adds data to the target transmission queue when the length of the target transmission queue is smaller than the length threshold, and stops adding data to the target transmission queue when the length of the target transmission queue is greater than or equal to the length threshold, so that fluctuation of the rate of the data in the target transmission queue sent by the communication device can be made smaller. Because the fluctuation degree of the sending rate is inversely related to the average sending rate, the average sending rate of the data sent by the communication device to the second device is higher, and the average sending rate of the data sent by the first device to the second device is higher.
Fig. 12 is a schematic structural diagram of another communication device according to an embodiment of the present application, where the communication device may be used in an OLT in a communication system shown in fig. 9, and as shown in fig. 12, the communication device includes:
the function of the first receiving module 1201 may refer to the function related to the OLT in step 1004 in fig. 10, and the embodiment of the present application is not described herein.
A first sending module 1202, configured to send the target data to an ONT when a length of a target sending queue in the ONT is less than a length threshold, so that the ONT adds the target data to the target sending queue, and send the data in the target sending queue to the second device, where the target sending queue corresponds to the second device. The function of the first transmitting module 1202 may refer to the function related to the OLT in step 1008 in fig. 10, and the embodiment of the present application is not described herein.
Optionally, the communication device further includes:
A second receiving module (not shown in fig. 12) is configured to receive the information of the length of the target transmit queue sent by the ONT before sending the target data to the ONT, and the function of the second receiving module may refer to the function related to the OLT in step 1003 in fig. 10, which is not described herein in detail.
A first determining module (not shown in fig. 12) is configured to determine, according to the information about the length of the target transmit queue, that the length of the target transmit queue is less than the length threshold.
Optionally, the information of the length of the target transmission queue comprises a size relation between the length of the target transmission queue and the length threshold.
Optionally, the communication device further includes:
a disabling module (not shown in fig. 12) configured to disable sending of the target data to the ONT when the length of the target send queue is greater than or equal to the length threshold. The function of the prohibiting module may refer to the function related to the OLT in step 1011 of fig. 10, and the embodiment of the present application will not be described herein.
Optionally, the first device and the second device transmit the target data through a transmission control protocol TCP connection, and the communication device further includes:
The function of the fourth determining module may refer to the function related to the OLT in step 1002 in fig. 10, and the embodiment of the present application is not described herein.
A caching module (not shown in fig. 12) for caching the target data in the target cache after receiving the target data. The function of the buffer module may refer to the function related to the OLT in step 1005 in fig. 10, and the embodiment of the present application is not described herein.
Optionally, the communication device further includes:
a third determining module (not shown in fig. 12) is configured to determine, after the target data is cached in the target cache, whether a length of the target transmit queue is less than the length threshold. The function of the fifth determining module may refer to the function related to the OLT in step 1006 in fig. 10, and the embodiment of the present application is not described herein.
Optionally, the communication device further includes:
A third receiving module (not shown in fig. 12), configured to receive a packet loss indication sent by the second device and used for sending the packet loss indication to the first device, where the packet loss indication is used for indicating that the second device does not receive the target data;
A second sending module (not shown in fig. 12) configured to send a retransmission instruction to the ONT according to the packet loss indication, where the retransmission instruction is configured to instruct the ONT to add the target data to the target sending queue according to the retransmission instruction, and send the data in the target sending queue to the second device.
In summary, the embodiment of the present application provides a communication device, which is an OLT, and because a first device sends data to a second device through the OLT and an ONT, and the first device does not adjust a rate of sending the data in a manner of avoiding network congestion in the related art, a rate of sending the data by the first device does not have a larger fluctuation. And when the length of the target transmission queue is smaller than the length threshold, the OLT controls the ONT to add data into the target transmission queue, and when the length of the target transmission queue is larger than or equal to the length threshold, the OLT stops controlling the ONT to add data into the target transmission queue, so that fluctuation of the data rate in the target transmission queue of the ONT can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the ONT transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
Fig. 13 is a schematic structural diagram of another communication device according to an embodiment of the present application, which may be used for an ONT in the communication system shown in fig. 9, and as shown in fig. 13, the communication device includes:
The first transmitting module 1301 is configured to transmit, to the OLT, information about a length of a target transmit queue in the ONT, where the target transmit queue corresponds to the second device, and the function of the first transmitting module 1301 may refer to a function related to the ONT in step 1003 in fig. 10, which is not described herein in detail.
The first receiving module 1302 is configured to receive the target data sent by the OLT and used for sending the target data to the second device, and the function of the first receiving module 1302 may refer to the function related to ONT in step 1008 in fig. 10, which is not described herein in detail.
The function of the first joining module 1303 may refer to the function related to ONT in step 1009 in fig. 10, and the embodiment of the present application will not be described herein.
A second sending module 1304 is configured to send data in the target sending queue to the second device. The function of the second transmitting module 1304 may refer to the function related to ONT in step 1010 in fig. 10, and the embodiment of the present application is not described herein.
Optionally, the information of the length of the target transmission queue comprises the size relation between the length of the target transmission queue and a length threshold value.
Optionally, the communication device further includes:
And a second receiving module (not shown in fig. 13) configured to receive a retransmission instruction sent by the OLT.
A second joining module (not shown in fig. 13) for joining the target data to the target transmit queue according to the retransmission instruction;
A second transmitting module (not shown in fig. 13) for transmitting the data in the target transmission queue to the second device.
Optionally, the target sending queue includes a plurality of sub-queues, and the plurality of sub-queues have priorities, and the data in the plurality of sub-queues are sent sequentially from high to low according to the priorities of the sub-queues;
and the second joining module is used for joining the target data into the sub-queue with the highest priority in the plurality of sub-queues according to the retransmission instruction.
In summary, the embodiment of the present application provides a communication device, where the communication device is an ONT, and since the first device sends data to the second device through the OLT and the ONT, and the first device does not adjust the rate of sending the data in a manner of avoiding network congestion in the related art, the rate of sending the data by the first device does not have a larger fluctuation. And when the length of the target transmission queue is smaller than the length threshold, the OLT controls the ONT to add data into the target transmission queue, and when the length of the target transmission queue is larger than or equal to the length threshold, the OLT stops controlling the ONT to add data into the target transmission queue, so that fluctuation of the data rate in the target transmission queue of the ONT can be smaller. Since the fluctuation degree of the transmission rate is inversely related to the average transmission rate, the average rate at which the ONT transmits data to the second device is higher, and the average rate at which the first device transmits data to the second device is higher.
The embodiment of the application provides a computer readable storage medium, wherein instructions are stored in the computer readable storage medium, and when the instructions run on a computer, the computer is caused to execute any data transmission method for transit equipment, an OLT or an ONT.
The embodiments of the present application provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the data transmission methods for a transit device, OLT or ONT as provided by the embodiments of the present application.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be embodied in whole or in part in the form of a computer program product comprising one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a network of computers, or other programmable devices. The computer instructions may be stored in or transmitted from one computer readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means from one website, computer, server, or data center. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium, or a semiconductor medium (e.g., solid state disk), etc.
In the present application, the terms "first" and "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "at least one" means one or more, "a plurality" means two or more, unless expressly defined otherwise.
Different types of embodiments, such as a method embodiment and a device embodiment, provided by the embodiment of the present application may be referred to each other, and the embodiment of the present application is not limited to this. The sequence of the operations of the method embodiment provided by the embodiment of the application can be properly adjusted, the operations can be correspondingly increased or decreased according to the situation, and any method which is easily conceivable to be changed by a person skilled in the art within the technical scope of the disclosure of the application is covered in the protection scope of the application, so that the description is omitted.
In the corresponding embodiments provided by the present application, it should be understood that the disclosed system, apparatus, device, etc. may be implemented by other means of construction. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, or may be in electrical or other forms.
The elements illustrated as separate elements may or may not be physically separate, and elements described as elements may or may not be physically located in one place or distributed over a plurality of devices. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.