Streaming data transmission control method
Technical Field
The invention relates to communication data transmission control, in particular to a streaming data transmission control method.
Background
At present, in the construction of an end-to-end data transmission service, a network mainly provides two types of service models: one is link-oriented, providing ordered and reliable data delivery services, typically represented by data transmission based on TCP (transmission control protocol); the other is directed to connectionless, and provides an out-of-order, unreliable data transfer delivery service, typically represented by UDP (user datagram protocol) based data transfer.
The TCP transmission protocol can establish an end-to-end bidirectional link through a complex design, provide an ordered and reliable streaming data transmission service, and dynamically adjust the sending rate of data according to the load and congestion conditions of the network.
The UDP protocol provides a very primitive and simple data transmission and listening interface, providing only best effort data transmission capabilities. If ordered and reliable data delivery is required, it needs to be implemented by the application itself. At the same time, the UDP protocol itself does not include a congestion control mechanism.
As networking applications continue to enrich, emerging applications (e.g., streaming media applications) place new demands on the service model for network transport that do not require completely reliable data delivery, but do not want data transport to be completely unreliable.
Disclosure of Invention
The invention aims to provide a streaming data transmission control method which can ensure the progress of data transmission by adjusting the sending precision of data.
In order to achieve the above object, the present application adopts a technical solution that is a streaming data transmission control method, including the following operations:
1) Dividing data into data segments, dividing each data segment into a plurality of levels according to the importance degree of the data, and setting a precision level threshold;
2) Using the ratio of the congestion window to the round trip delay as the optimal sending rate estimation value of the data, and calculating and updating the sending probability of the data segment of each precision grade according to the value;
3) Sequentially sending the selected data segments according to a data sending mechanism of the TCP;
4) Estimating the congestion state and available bandwidth of the network according to the ACK feedback, updating a congestion window according to the congestion state and the available bandwidth, and enabling the value of the congestion window to be less than or equal to the expected sending rate of the data segment and the round trip delay; wherein,
when the grade value of the data segment is less than the precision grade threshold value, the data is basic precision data;
when the grade value of the data segment is larger than or equal to the precision grade threshold value, the data is enhanced precision data;
when the selected basic precision data ACK (Acknowledgement character) is overtime, carrying out retransmission and updating the sending probability of the congestion window and the data segments of each precision grade;
when the selected enhanced precision data ACK is overtime, retransmission is not carried out, and only the congestion window and the sending probability of the data segments of each precision grade are updated;
and when the received ACK comprises the ECN mark, updating the congestion window and the sending probability of the data segment with each precision level.
The data that the application needs to stream is divided into a plurality of data levels, wherein one part needs reliable and ordered data delivery, and the other part can tolerate unreliable data delivery; applications expect the network to provide a "semi-reliable" transmission control protocol between the two. The protocol can ensure ordered and reliable delivery of reliable data on one hand, and can dynamically adjust the accuracy of unreliable data transmission according to the load condition of a link in a transmission path on the other hand.
The transmission protocol can provide higher-level transmission service than UDP, is simpler than TCP, can more fully utilize network bandwidth, and can better meet the data transmission requirement of application.
The ECN (Explicit Congestion Notification) is a mechanism for some versions of TCP to let the intermediate device inform the sender of Congestion in advance. The above-mentioned one data segment corresponds to the data segment (segment) in the TCP message.
Furthermore, in the data segment sending process, the maximum precision grading number, the precision grade threshold value and the expected sending rate of the tasks are negotiated and confirmed according to the preset flow by using the reserved fields in the TCP options of the SYN message and the ACK message. SYN, synchronization Sequence Numbers (syncronize Sequence Numbers), is a synchronization flag that is only valid when a TCP connection is established by a three-way handshake. It prompts the server of the TCP connection to check the sequence number, which is the initial sequence number of the initial end (typically the client) of the TCP connection. ACK is an Acknowledgement Number (Acknowledgement Number). The acknowledgement number contained in the acknowledgement number field in the TCP header is the next expected sequence number, and also indicates to the remote system that all data prior to that number has been successfully received.
Further, the preset process includes the following operations:
the negotiation of the maximum precision grading number, the precision grade threshold value and the expected sending rate occurs in a TCP link establishing stage; at this time, the sending end carries a P value and an RD _ MAX value in a TCP options field of the SYN, which respectively represent the maximum precision grading number and the maximum expected sending rate that the sending end can support; and PD _ DEFAULT and RD _ DEFAULT represent the maximum number of precision steps recommended by the transmitting end and the desired transmission rate;
the receiving end stores the received P, RD _ MAX, PD _ DEFAULT and RD _ DEFAULT values in the local; in the process of carrying out ACK on the SYN message, the receiving end confirms the required precision grade threshold value and the required expected sending rate to the sending end through TCP options of the ACK message;
wherein, the precision grade threshold value fed back by the receiving end is less than the maximum precision grading number announced by the transmitting end, and the expected transmitting speed is less than or equal to the RD _ MAX value announced by the transmitting end;
if the receiving end does not feed back, the transmitting end adopts PD _ DEFAULT and RD _ DEFAULT as the accuracy level threshold value and the expected transmission rate of the transmission task corresponding to the receiving end by DEFAULT. (for P, RD _ MAX, PD _ DEFAULT, RD _ DEFAULT, the sending end will send to the receiving end in the connection phase, at this time, the receiving end can feed back its PD, RD, and at other times, the receiving end can feed back new PD, RD again to achieve the purpose of updating the value.)
Furthermore, the receiving end makes up a plurality of consecutive data segments into data blocks, and decodes the data blocks as units, so that the loss of the enhanced precision data segments can be tolerated. Numbering the data segments according to a sending sequence when data are sent, and sending a value j of the sent data segment number from 0 to the data segments; when the receiving end receives the data segment, the number value of the data block corresponding to the data segment can be calculated to be k = j div P, wherein div represents integer division operation; the corresponding precision class information is i = j mod P, where mod is the modulo operation.
If all data segments in the data block k have been received, decoding the data block;
and if the number value of the receiving end is smaller than k, decoding the data block which is completely received but not decoded in the data segment of the basic precision data.
Further, numbering and configuring all data segments to be transmitted; each data segment carries the number of the data segment and the precision grade number indicating the importance degree of the data segment; and the grade number and the data segment number are stored in a TCP options reserved field of the TCP data segment, wherein the data segment number is independent from the seq sequence number in the TCP message header.
Further, when the ratio of the congestion window to the network round trip delay is used as the optimal sending rate estimation value of the data, a first preset strategy is adopted to randomly select the data segment to be transmitted and transmit the data segment; the first preset strategy is as follows:
p is the maximum precision grading number;
PD is a precision grade threshold;
i is a grade number;
RD is the desired transmission rate;
for each data segment with the accuracy grade i, selecting the data segment transmission probability Pr (i);
if the round-trip delay of the current network is rtt and the size of the congestion control window is cwnd, the value of Pr (i) is as follows:
for a precision class of i < PD, pr (i) =1;
for a precision rating of PD ≦ i ≦ P-1, pr (i) =1-max (0,min (1,i-cwnd/rtt P/RD)).
The sender transmits data at a desired sending rate when bandwidth is sufficient, and dynamically reduces transmission accuracy when bandwidth is insufficient to maintain the same or similar transmission schedule while avoiding congestion.
The data accuracy or data accuracy level is characterized by the probability of data segment transmission. Pr (i) is a number between 0 and 1, indicating the probability with which a data segment with a level of accuracy i is selected for transmission. If the transmission rate is 1, the data segment representing the grade is transmitted by one hundred percent; if it is 0, all data segments indicating the level are not transmitted.
Further, the sending end judges whether packet loss occurs in the transmission process according to whether the feedback ACK is received or not and the TCP data segment confirmation number confirmed by the ACK;
if the ACK of the basic precision data is overtime, retransmitting the data segment, adjusting the size of a sliding window according to the original strategy of the TCP and updating the sending probability of the data segment of each precision grade;
if the ACK of the enhanced precision data is overtime, retransmission is not carried out, the size of the sliding window is adjusted according to a second preset strategy, and the sending probability of each precision grade data segment is updated at the same time;
and if the ACK received by the sending end carries the ECN mark, adjusting the size of the sliding window according to the original strategy of the TCP, and updating the sending probability of the data segments of each precision grade according to the new value of the sliding window.
When some versions of TCP protocols receive a plurality of ACKs with the same acknowledgement number, the TCP protocols also consider that packet loss occurs in the network and can actively retransmit the packet; meanwhile, some versions of TCP also introduce SACK and other mechanisms. Under the conditions, the sending end adjusts the size of the sliding window according to the original strategy of the corresponding version TCP and updates the sending probability of the data segment with each precision level.
Further, the second preset strategy is as follows: the adjusted congestion control window size = congestion control window size-1 before adjustment.
Further, for the data block which is already received and not yet decoded by the basic precision data segment, when the time for receiving the basic precision data segment exceeds the preset value time T, the data block is immediately decoded.
Further, if the network intermediate device supports strict multi-priority queue scheduling, the number of supported priorities is set to be PS, and the data segment of the basic precision data carries the highest priority 0; the data segments of the enhanced precision data with precision grade values of PD, PD +1, …, min (P-1, PD + PS-1) respectively carry priority 1,2,3, … and PS-1, and the data segments of the other precision grades carry priority values of PS-1.
The invention comprises at least one of the following beneficial effects:
the sending precision of the data can be actively adjusted according to the fed back link available bandwidth information, and the quantity of the data to be transmitted is controlled. If the network bandwidth becomes better, the accuracy of data transmission is increased; otherwise, the accuracy of the data transmission is reduced, so that the amount of data to be transmitted is reduced, and the transmission progress is ensured.
Data is divided into two types requiring reliable transmission and not requiring reliable transmission according to the precision level. When packet loss occurs in transmission, retransmission is only performed on the lost reliable data, so that the reduction of the effective throughput rate of the network is avoided, and the transmission protocol is not blocked by the packet loss of the unreliable data.
The invention is further described with reference to the following figures and detailed description. Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description. Or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to assist in understanding the invention, and are included to explain the invention and their equivalents and not limit it unduly. In the drawings:
fig. 1 is a schematic diagram for explaining a streaming data transmission control method in an embodiment;
FIG. 2 is a diagram illustrating data segment, data block transmission, and numbering order in an embodiment;
Detailed Description
The present invention will now be described more fully hereinafter with reference to the accompanying drawings. Those skilled in the art will be able to practice the invention based on these descriptions. Before describing the present invention in conjunction with fig. 1 and 2, it should be particularly noted that:
the technical solutions and features provided in the present invention in the respective sections including the following description may be combined with each other without conflict.
Moreover, the embodiments of the present invention described in the following description are generally only examples of a part of the present invention, and not all examples. Therefore, all other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without any creative effort shall fall within the protection scope of the present invention.
With respect to terms and units in the present invention. The term "comprises" and any variations thereof in the description and claims of this invention and the relevant portions thereof are intended to cover non-exclusive inclusions.
Referring to fig. 1 and 2, the present embodiment employs a bandwidth-aware hierarchical multi-precision data semi-reliable streaming data transmission control method. The control method can be realized by expanding the existing TCP transmission protocol (supporting the expansion on different versions of TCP). The method comprises three types of participants in implementation: the system comprises a data sending end, a data receiving end and one or more network intermediate forwarding devices. The transmission control scheme is completed through cooperation of the transmitting end and the receiving end.
The network service model adopted is as follows:
in this control method, the requirements of each data transfer task are described by the triplet < P, PD, RD >. P is the maximum number of precision stages, PD is the precision level threshold, and RD is the optimal sending rate of data. Representing that each part of data to be transmitted by the application can be split into 0,1, …, P-1 with P precision levels (the lower the grade value is, the more important the lower the grade value is); the data segment with the precision grade value smaller than the PD needs reliable and ordered data delivery, and is called as basic precision data; the data segment with the precision grade value larger than or equal to the PD only needs best-effort data transmission service, which is called enhanced precision data; the desired data transmission rate of the application is referred to as RD, which is the desired transmission rate. The values of < P, PD, RD > are negotiated by the data sending end and the receiving end in the process of establishing the link or sending the data.
As shown in fig. 2, one row is a data block, and k, k +1, … is the data block number. Each row contains a plurality of data segments, and j is a data segment number. A data segment is placed into exactly one TCP data segment for transmission.
I.e., k is the data block number and j is the data segment number. Each data block contains at most P data segments. When decoding, the more complete the data segment received in a data block, the more accurate the data obtained by decoding. i and j will be carried in the data segment for transmission. For the receiving end, the k value corresponding to the data segment can be back-calculated by j and P which is notified to the receiving end by the transmitting end when the link is established.
In the scheme, data to be transmitted is uniformly split into a plurality of data blocks, and each data block is encoded into P precision levels; and packing the data with the same precision grade in each data block into the same data segment, and numbering and transmitting layer by layer. One data segment corresponds to one packet in a TCP transmission, and the size of the data segment is determined according to the Maximum Segment Size (MSS) of the TCP in the network. The number in the data segment adopts a circular number mode and is independent of the data segment sequence number value seq of the TCP. And after receiving the data segments, the receiving end decodes and recovers the content of each data block. If some precision hierarchical data in a data block are missing (i.e. data is incomplete), the receiving end can still perform decoding recovery, however, the result obtained by decoding may be inaccurate. For each data block, the more complete the data segment received by the receiving end, the more accurate the data obtained by decoding; and, the data segment having the lower rank value contributes more to the decoding accuracy.
In the face of the transmission requirement, a network transmission link similar to TCP is established between the sending end and the receiving end, and data transmission is carried out in a streaming way; and disconnecting the link after the transmission is finished.
In the link establishment process, the sending end and the receiving end negotiate and confirm the < P, PD, RD > parameters of the transmission task. During the transmission process, the receiving end can update the parameter.
And setting the congestion window size of the current sending end as cwnd and the network round-trip delay value as rtt.
Referring to fig. 1, the steps of the method may be performed as follows:
1. the sending end uses the ratio of cwnd to rtt as the optimal sending rate estimation value of data, and determines which precision data segments are selected for transmission according to the optimal sending rate estimation value, and the specific method is to adjust the value of the sending probability Pr (i) of each precision grade data segment, wherein i =0,1, … and P-1; for a data segment with the accuracy level of i, a sending end randomly selects whether to send the data segment with the probability Pr (i);
2. the sending end sends the selected data segments in sequence according to the data sending mechanism of the TCP, and the receiving end confirms the received data segments;
3. the sending end estimates the congestion state and the available bandwidth of the network according to the ACK feedback, so as to update the congestion window cwnd and ensure that the value of cwnd does not exceed the product of the expected sending rate RD and the round-trip delay rtt;
if the selected basic precision data ACK is overtime, the transmitting end retransmits and updates cwnd and Pr (i); if the selected enhanced precision data ACK is overtime, the transmitting end does not retransmit and only updates cwnd and Pr (i); cwnd and Pr (i) are updated if ECN flags are included in the received ACK.
In implementation, the method can be modified and expanded based on the existing TCP protocols of various versions, so that corresponding control design is realized, and complete redesign can also be performed. The implementation scheme based on the existing TCP for extension can be compatible with the existing network equipment and can be realized by multiplexing the existing TCP codes, thereby being taken as a preferred embodiment of the invention.
In the method, in the process of link establishment (or data transmission), a sending end and a receiving end negotiate and confirm < P, PD, RD > parameters of a task according to a preset flow by using a SYN message (or a normal data message, namely a data message when data is sent after TCP link establishment is finished, except that negotiation configuration of related parameters is carried out in the initial stage of link establishment, the negotiation can be carried out again in the process of data transmission.
The preset flow here is:
the negotiation of < P, PD, RD > occurs in the TCP link establishment/handshake phase, at this time, the sending end carries a P value and an RD _ MAX value in the TCP options field of SYN, which respectively represent the maximum precision grading number and the maximum sending speed that the sending end can support; and PD _ DEFAULT and RD _ DEFAULT indicate a PD value and RD value recommended to be used by the transmitting end. The receiving end stores the received P, RD _ MAX, PD _ defiault, RD _ defiault values locally.
And in the process of carrying out ACK on the SYN message, the receiving end confirms the needed PD value and RD value to the sending end through the TCP options of the ACK message. The PD receiving the feedback must be smaller than the P value advertised by the sender, and the RD value is not higher than the RD _ MAX value advertised by the sender.
If the receiving end does not feed back, the sending end adopts PD _ DEFAULT and RD _ DEFAULT as the PD and RD values of the transmission task corresponding to the receiving end by DEFAULT.
In the data segment sending process, the receiving segment can also update the PD and RD, but does not guarantee certain success. At this time, the receiving end piggybacks new PD values and RD values in TCP options of M consecutive ACK packets to the transmitting end, and the value of M is set according to the network condition, with a typical value of 5. And after receiving the data, the sending end updates the PD value and the RD value corresponding to the receiving node.
The design of using reserved fields in TCP options to transmit relevant information is as follows:
TABLE 1
And the sending end numbers and configures all the data segments to be transmitted. Each data segment carries a data segment number j (which is independent of the seq sequence number in the TCP header). j is stored in the TCP options reserved field of the TCP data segment.
The sending end randomly selects the data segments to be transmitted sequentially through a first strategy according to the cwnd value of the current link and transmits the data segments; the goal of the first strategy is that the protocol transmits data at rate RD when bandwidth is sufficient, and dynamically reduces transmission accuracy when bandwidth is insufficient to maintain the same or similar transmission schedule while avoiding congestion. The adopted method is random packet loss, and each data segment with the accuracy grade of i is selected according to the probability of Pr (i). Assuming that the round trip delay of the current network is rtt and the congestion control window size is cwnd, then the value of Pr (i) is as follows:
for a precision class of i < PD, pr (i) =1;
for a precision rating of PD ≦ i ≦ P-1, pr (i) =1-max (0,min (1,i-cwnd/rtt P/RD)).
And the sending end judges whether packet loss occurs in the transmission process according to whether the ACK fed back by the receiving end is received or not and the TCP data segment confirmation number confirmed by the ACK. If the ACK of the basic precision data segment is overtime, retransmitting the data segment, and adjusting the size of a sliding window according to the original strategy of the TCP; if the enhanced accuracy ACK is overtime, retransmission is not carried out, and the size of the sliding window is adjusted according to a second strategy; and if the received ACK carries the ECN mark or in other cases, adjusting the size of the sliding window according to the original strategy of the TCP. The aforementioned second strategy is cwnd = cwnd-1.
When a receiving end receives a data segment j, the number value k = j div P of a data block corresponding to the data segment, wherein integer division operation is represented; the corresponding precision class information is i = j mod P, where mod is the remainder operation.
If all data segments in the data block k have been received, decoding the data block; and if the serial number value of the receiving end is smaller than k, and the data segments of the basic precision data are all received as the data blocks which are not decoded, decoding the data blocks.
And for the data block which is completely received by the basic precision data segment but is not decoded, if the time for completely receiving the basic precision data exceeds T (T can be regarded as rtt), immediately decoding.
If the network intermediary supports strict multi-priority queue scheduling. Assuming that the number of supported priorities is PS, then the data segment of the basic precision data carries the highest priority 0; data segments of enhanced precision data with precision grade values of PD, PD +1, …, min (P-1, PD + PS-1) respectively carry priority levels of 1,2,3, … and PS-1, and data segments of the rest precision grades carry priority values of PS-1.
By adopting the streaming data transmission control method of the embodiment, the sending end can actively adjust the sending precision of the data according to the link available bandwidth information fed back by the receiving end, and control the amount of the data to be transmitted. If the network bandwidth becomes better, the accuracy of data transmission is increased; otherwise, the accuracy of the transmitted data is reduced, thereby reducing the amount to be transmitted and ensuring the progress of transmission. Data is divided into two types requiring reliable transmission and not requiring reliable transmission according to the precision level. When packet loss occurs in transmission, only the lost reliable data is retransmitted, so that the reduction of the effective throughput rate is avoided, and the transmission protocol is not blocked by the packet loss of the unreliable data.
The contents of the present invention have been explained above. Those skilled in the art will be able to implement the invention based on these teachings. Based on the above description of the present invention, all other embodiments obtained by a person of ordinary skill in the art without any creative effort shall fall within the protection scope of the present invention.