A kind of Transmitting Data Stream control method
Technical field
The invention patent relates to communication data transfer controls, and in particular to a kind of Transmitting Data Stream control method.
Background technique
Currently, network mainly provides two class service models: one kind is face in the building of end-to-end data transport service
To link, orderly, reliable data delivery service is provided, is typically represented as carrying out data based on TCP (transmission control protocol)
Transmission;Another kind of is to provide unordered, insecure data transmission delivery service towards connectionless, and Typical Representative is based on UDP
(User Datagram Protocol) carries out data transmission.
TCP transmission agreement can establish bi-directional chaining end to end by complicated design, provide orderly reliable streaming
Data transport service, and can load according to network and congestion situation, dynamically adjust the transmission rate of data.
And then value provides very original and simple data and sends and handover interface udp protocol, only provide as possible and
For data transmission capabilities.It is delivered if necessary to orderly, reliable Data Data, needs to be realized by application oneself.Simultaneously,
UDP agreement itself does not include congestion control mechanism yet.
With persistently enriching for network application, emerging application (such as Stream Media Application) mentions the service model of network transmission
New demand is gone out, these new transmission demands do not need completely reliable data and deliver, but are not intended to data transmission complete yet
It is unreliable.
Summary of the invention
The object of the present invention is to provide it is a kind of can by adjusting data transmission precision so that it is guaranteed that data transmission schedule
Transmitting Data Stream control method.
To achieve the goals above, the application is the technical solution adopted is that a kind of Transmitting Data Stream control method, including
It operates below:
1) data are divided into data segment, each data segment is divided into multiple grades, setting accuracy etc. by data significance level
Grade threshold value;
2) best transmission rate estimated value of the ratio of congestion window and round-trip delay as data is used, according to the value meter
Calculate and update the sending probability of each accuracy class data segment;
3) selected data segment is successively sent according to the data transmitting mechanisms of TCP;
4) congestion condition and available bandwidth that estimation network is fed back according to ACK, update congestion window with this, and make congestion window
Value≤data segment expectation transmission rate * round-trip delay of mouth;Wherein,
When data segment grade point < accuracy class threshold value, which is basic accuracy data;
When data segment grade point >=accuracy class threshold value, which is enhancing accuracy data;
When selected basic accuracy data ACK (Acknowledgement confirms character) time-out, then retransmitted, and
Update the sending probability of congestion window and each accuracy class data segment;
When selected enhancing accuracy data ACK time-out only updates congestion window and each accuracy class number without retransmitting
According to the sending probability of section;
When including that ECN is marked in the ACK received, then the sending probability of congestion window and each accuracy class data segment is updated.
It is divided into multiple data levels using the data transmitted as a stream, a portion needs reliable, orderly
Data are delivered, and another part can tolerate that non-reliable data are delivered;Using wish network provide it is a kind of between the two it
Between " half reliable " transmission control protocol.The party to the agreement face can guarantee that authentic data orderly, is reliably delivered, another aspect energy
Enough loading conditions according to link in transmission path, dynamically adjust the precision of non-reliable data transmission.
It is simpler that this transport protocol can provide the transmission service and TCP more more advanced than UDP, can be more fully sharp
With network bandwidth, preferably meet the data transfer demands of application.
Above-mentioned ECN (Explicit Congestion Notification) i.e. Explicit Congestion is noticed, and is certain versions
TCP be used to allow intermediate equipment advance notice sender's network the mechanism of congestion occur.An above-mentioned data segment corresponds to
Data segment (segment) in TCP message.
Further, utilizing the reservation in the TCP options of SYN message and ACK message in data segment transmission process
Maximal accuracy classification number, accuracy class threshold value and the expectation transmission rate of task are negotiated according to default process and confirmed to field.
SYN, that is, synchronizing sequence number (Synchronize Sequence Numbers), is synchronous mark, mark is only in three-way handshake
It establishes effective when TCP connection.It prompts the server-side of TCP connection to check that sequence number, the sequence number are that TCP connection is initial
Hold the initiation sequence number of (usually client).ACK confirms number (Acknowledgement Number).TCP header
The confirmation number for including in interior confirmation numbered bin is next expected sequence number, while far end system being prompted to succeed
All data before receiving the number.
Further, the default process includes following operation:
The negotiation of maximal accuracy classification number, accuracy class threshold value and expectation transmission rate occurs to establish rank in TCP link
Section;At this point, transmitting terminal carries P value in the TCP options field of SYN and RD_MAX value respectively indicates transmitting terminal and can support
Maximal accuracy classification number and greatest hope transmission rate;And PD_DEFAULT and RD_DEFAULT indicates that transmitting terminal pushes away
Recommend the maximal accuracy classification number and desired transmission rate used;
Wherein, P, RD_MAX, PD_DEFAULT, RD_DEFAULT value received is stored in local by receiving end;SYN is reported
During text carries out ACK, required accuracy class threshold value and required expectation transmission rate are passed through ACK message by receiving end
TCP options confirms to transmitting terminal;
Wherein, the maximal accuracy of the accuracy class threshold value < transmitting terminal notice of receiving end feedback is classified number, it is expected that sending
Rate≤transmitting terminal notice RD_MAX value;
If receiving end is not fed back, transmitting terminal default is corresponding as the receiving end using PD_DEFAULT and RD_DEFAULT
Transformation task accuracy class threshold value and desired transmission rate.(for P, RD_MAX, PD_DEFAULT, RD_DEFAULT, hair
Sending end will issue receiving end in access phase, at this point, receiving end can feed back oneself PD, RD, other when, receiving end can
To feed back new PD, RD again, achieve the purpose that update the value.)
Further, multiple continuous data segment composition data blocks are decoded by data block for unit by receiving end,
It can tolerate the missing of enhancing accuracy data section.Data segment is numbered by transmission sequence when carrying out data transmission, is sent
Data segment number value j, be numbered from 0, sent together with data segment;The receiving end can be counted when receiving data segment
Calculating the corresponding data block number value of the data segment is k=j div P, and operation is divided exactly in wherein div expression;Corresponding accuracy class
Information is i=j mod P, and wherein mod is complementation operation.
If all data segments have received in data block k, which is decoded;
If there are number values to be less than k for receiving end, the data segment of basic accuracy data has collected but not yet decoded data
Block is then decoded the data block.
Further, all data segments to be transmitted are numbered and are configured;The number is carried in each data segment
According to section number and show the data segment significance level accuracy class number;Grade numbers, data segment number deposit in TCP number
According in the TCP options reserved field of section, wherein the seq sequence number in data segment number and TCP message head is independent.
Further, congestion window and the ratio of network round-trip time delay is used to estimate as the best transmission rate of data
When value, the data segment transmitted is randomly selected using the first preset strategy and is transmitted;The first default plan
Slightly:
P is that maximal accuracy is classified number;
PD is accuracy class threshold value;
I is Grade numbers;
RD is desired transmission rate;
The each data segment for being i for accuracy class, it is selected with data segment sending probability Pr (i);
If the round-trip delay of current network is rtt, congestion control window size is cwnd, then, the value of Pr (i) are as follows:
For the accuracy class of i < PD, Pr (i)=1;
For PD≤i≤P-1 accuracy class, Pr (i)=1-max (0, min (1, i-cwnd/rtt*P/RD)).
Transmitting terminal it is expected that transmission rate transmits data in bandwidth abundance, and dynamic reduces transmission precision when bandwidth is inadequate
To maintain the same or similar transmission progress while avoid congestion.
Above-mentioned data precision or data precision grade is portrayed by data segment sending probability.Pr (i) is one
Number between 0-1 indicates that accuracy class is the data segment of i, with the selected transmission of great probability.If it is 1, the grade is indicated
Data segment absolutely transmit;If it is 0, indicate that all data segments of the grade do not transmit.
Further, transmitting terminal is according to whether the TCP data segment acknowledgement number that the ACK and ACK that receive feedback confirm, sentences
Whether there is packet loss during stealpass is defeated;
If the ACK time-out of basic accuracy data, retransmits the data segment, and adjusts according to the original strategy of TCP
The size of whole sliding window is and at the same time update the sending probability of each accuracy class data segment;
If time-out occurs in the ACK of enhanced accuracy data, without retransmitting, adjusts and slide according to the second preset strategy
The size of dynamic window is and at the same time update the sending probability of each accuracy class data segment;
If the ACK that transmitting terminal receives carries ECN label, according to the size of the original Developing Tactics sliding window of TCP, and
According to new sliding window value, the sending probability of each accuracy class data segment is updated.
The Transmission Control Protocol of some versions is when receiving the identical ACK of multiple confirmations number, also to think that packet loss has occurred in network,
It can active retransmission;Meanwhile the TCP of some versions also introduces the mechanism such as SACK.In these cases, transmitting terminal is according to correspondence
The size of the original Developing Tactics sliding window of version TCP, and update the sending probability of each accuracy class data segment.
Further, second preset strategy are as follows: the congestion before congestion control window size=adjustment adjusted
Control window size -1.
Further, basic accuracy data section has been collected for receiving end but not yet decoded data block, work as basis
The time that accuracy data collects is more than preset value time T, then is decoded immediately.
Further, setting the priority of support if network intermediary device supports stringent multipriority queue scheduling
Number is PS, and the data segment for basic accuracy data carries highest priority 0;Accuracy class value is PD, PD+1 ..., min (P-
1, PD+PS-1) data segment of enhancing accuracy data carries priority 1,2,3 respectively ..., PS-1, the number of remaining accuracy class
Priority value PS-1 is carried according to section.
The present invention include it is following at least one the utility model has the advantages that
The number of being transmitted can be controlled according to the link available bandwidth information of feedback, the transmission precision of active accommodation data
According to amount.If network bandwidth improves, increase the precision for sending data;No person reduces the precision for sending data, to reduce
The amount to be sent, it is ensured that the progress of transmission.
Data are divided into two classes for needing reliable transmission and not needing reliable transmission according to accuracy class.When in transmission go out
When existing packet loss, only the authentic data of loss is retransmitted, the decline of network goodput is avoided, makes transport protocol not non-
The packet loss of authentic data blocks.
The present invention is described further with reference to the accompanying drawings and detailed description.The additional aspect of the present invention and excellent
Point will be set forth in part in the description, and partially will become apparent from the description below.Or practice through the invention
It solves.
Detailed description of the invention
The attached drawing for constituting a part of the invention is used to assist the understanding of the present invention, content provided in attached drawing and its
Related explanation can be used for explaining the present invention in the present invention, but not constitute an undue limitation on the present invention.In the accompanying drawings:
Fig. 1 is for illustrating the Transmitting Data Stream control method schematic diagram in the embodiment in embodiment;
Fig. 2 is the schematic diagram for illustrating the data segment in embodiment, data block transmission and number order;
Specific embodiment
Clear, complete explanation is carried out to the present invention with reference to the accompanying drawing.Those of ordinary skill in the art are being based on these
The present invention will be realized in the case where explanation.Before in the attached Fig. 1 and 2 of combination, the present invention will be described, need to particularly point out
It is:
The technical solution provided in each section including following the description and technical characteristic in the present invention are not rushing
In the case where prominent, these technical solutions and technical characteristic be can be combined with each other.
In addition, the embodiment of the present invention being related in following the description is generally only the embodiment of a branch of the invention, and
The embodiment being not all of.Therefore, based on the embodiments of the present invention, those of ordinary skill in the art are not making creativeness
Every other embodiment obtained, should fall within the scope of the present invention under the premise of labour.
About term in the present invention and unit.Term in description and claims of this specification and related part
" comprising " and its any deformation, it is intended that cover and non-exclusive include.
Referring to Fig.1,2, present embodiment is using a kind of classification multiple precision number of bandwidth aware according to half reliable stream data
Transfer control method.The control method can be realized that (support is in different editions by extending existing TCP transmission agreement
It is extended on TCP).This method includes three classes participant on the implementation: data sending terminal, receiving end, and one or more
Network intermediate forwarding devices.Control program is transmitted to complete by the cooperation of transmitting terminal and receiving end.
The Network Service Model of use:
In the control method, the demand of each data transfer task is by triple<P, PD, RD>describe.P is maximum
Precision is classified number, the best transmission rate that PD is accuracy class threshold value, RD is data.It indicates to apply every part of data to be transmitted
It can be split as 0,1 ..., the total P accuracy class of P-1 (the lower grade point the more important);Wherein, accuracy class value is less than PD's
Data segment needs reliable orderly data to deliver, and is called basic accuracy data;And accuracy class value is greater than or equal to the number of PD
According to the data transport service that section need to only do one's best, it is called enhancing accuracy data;It is RD using desired data transmission rate,
It is called desired transmission rate.<P, PD, RD>value established by data sending terminal and receiving end in link or data are transmitted across
It is consensus in journey.
As shown in Fig. 2, wherein a line is exactly a data block, k, k+1 ... are data block number.Every row includes multiple numbers
According to section, j is data segment number.One data segment is just put into a TCP data section and is transmitted.
That is k is data block number, and j is data segment number.Each data block contains up to P data segment.When decoding, one
The data segment received in data block is more complete, and the data for decoding acquisition are more accurate.I and j can be carried and be transmitted in data segment.It is right
For receiving end, transmitting terminal informs the P of receiving end when by j and establishing the link, can inverse to go out the data segment corresponding
K value.
In this scenario, data to be transmitted are uniformly split as multiple data blocks, and each data block is encoded as P again
A accuracy class;The data of same precision grade are packaged into the same data segment in each data block, and layer-by-layer compile
Number and transmission.One data segment corresponds to a data packet in TCP transmission, and the size of data segment is according to TCP in network
Maximum segment size (MSS) is determined.Data segment of the number by the way of numbering cycle, with TCP in data segment
Sequence number value seq is independent.After receiving end receives data segment, decoding recovers the content of each data block.If in a data block
Part precision ranked data occur lack (i.e. data are not complete), receiving end be still able to carry out decoding restore, but, decoding
The result of acquisition can inaccuracy.For every part of data block, the data segment that receiving end receives is more complete, and the data for decoding acquisition are more smart
Really;Also, the lower data segment of grade point is bigger to the contribution of decoding precision.
The network transmission that a similar TCP is established in face of above-mentioned transmission demand, between transmitting terminal and receiving end links, streaming
Ground carries out data transmission;Break link after the end of transmission.
Link in establishment process, transmitting terminal and receiving end to the transformation task<P, PD, RD>parameter holds consultation and really
Recognize.In transmission process, receiving end can update the parameter.
If the congestion window size at currently transmitted end is cwnd, network round-trip length of delay is rtt.
Referring to Fig.1, the step of this method can be by following progress:
1. transmitting terminal uses best transmission rate estimated value of the ratio of cwnd and rtt as data, and determines choosing with this
The data segment for selecting which precision is transmitted, and concrete mode is to adjust the sending probability Pr (i) of each accuracy class data segment to take
It is worth, wherein i=0,1 ..., P-1;The data segment for being i for accuracy class, transmitting terminal are randomly chosen whether with probability P r (i)
It sends;
2. transmitting terminal successively sends selected data segment according to the data transmitting mechanisms of TCP, receiving end is to the number received
Confirmed according to section;
3. transmitting terminal feeds back the congestion condition and available bandwidth of estimation network according to ACK, congestion window cwnd is updated with this,
And the product for making the value of cwnd be no more than desired transmission rate RD and round-trip delay rtt;
If selected basic accuracy data ACK time-out, transmitting terminal if, is retransmitted, and updates cwnd and Pr (i);Such as
The selected enhancing accuracy data ACK time-out of fruit, transmitting terminal only update cwnd and Pr (i) without retransmitting;If received
It is marked in ACK comprising ECN, then updates cwnd and Pr (i).
In realization, this method can be modified extension based on the Transmission Control Protocol of existing various versions, realize corresponding control
Design, can also completely be redesigned.It can be set with existing network based on the implementation that existing TCP is extended
It is standby compatible, and be multiplexed existing TCP code and realize, therefore as the preferred embodiment of the present invention.
In the method, link is established during (or data transmission), transmitting terminal and receiving end using SYN message (or just
The link of regular data message, i.e. TCP sends data message when data after the completion of establishing, related in addition to establishing initial stage progress in link
The negotiation configuration of parameter is outer, can also renegotiate again in data transmission procedure.This when, TCP link have built up
Finish, by be data message rather than SYN message completes the transmitting of parameter.) and ACK message TCP options in
Reserved field, according to default process negotiate and confirm task<P, PD, RD>parameter.
Here default process is:
<P, PD, RD>negotiation occur TCP link foundation/handshake phase, at this point, TCP of the transmitting terminal in SYN
P value and RD_MAX value are carried in options field, respectively indicate the maximal accuracy classification number that transmitting terminal can be supported, and
Maximum transmission speed;And PD_DEFAULT and RD_DEFAULT indicates the PD value and RD value that transmitting terminal is recommended to use.Receiving end
P, RD_MAX, PD_DEFAULT, RD_DEFAULT value received is stored in local.
During carrying out ACK to SYN message, required PD value and RD value are passed through the TCP of ACK message by receiving end
Options confirms to transmitting terminal.The PD for receiving disconnected feedback is necessarily less than the P value of transmitting terminal notice, and RD value is logical not higher than transmitting terminal
The RD_MAX value of announcement.
If receiving end is not fed back, transmitting terminal default is corresponding as the receiving end using PD_DEFAULT and RD_DEFAULT
Transformation task PD and RD value.
In data segment transmission process, receiver section can also be updated PD, RD, but not guarantee centainly success.At this point,
Receiving end in the PD value and RD value incidentally new into the TCP options of the continuous N ACK message of transmitting terminal, the value of M according to
Network status setting, representative value 5.After transmitting terminal receives, the corresponding PD value of the receiving node and RD value are updated.
Utilize design such as the following table 1 of the reserved field related transmitting information in TCP options:
Table 1
Transmitting terminal is numbered and configures to all data segments to be transmitted.Data segment number j is carried in each data segment
(the seq serial number in the number and TCP message head is independent).J deposits in the TCP options reserved field of TCP data section
In.
Transmitting terminal can pass sequentially through the first strategy and randomly select and be transmitted according to the cwnd value of current link
Data segment, and transmitted;The target of first strategy is that agreement transmits data in bandwidth abundance with rate RD, and bandwidth is not filled
Dynamic reduces transmission precision to maintain the same or similar transmission progress while avoid congestion when sufficient.The method of use is to lose at random
Packet, each data segment for being i for accuracy class are selected with the probability of Pr (i).Assuming that the round-trip delay of current network is
Rtt, congestion control window size are cwnd, then, the value of Pr (i) is as follows:
For the accuracy class of i < PD, Pr (i)=1;
For PD≤i≤P-1 accuracy class, Pr (i)=1-max (0, min (1, i-cwnd/rtt*P/RD)).
Transmitting terminal judges to pass according to whether the TCP data segment acknowledgement number that the ACK and ACK that receive receiving end feedback confirm
Whether there is packet loss during defeated.If the ACK time-out of basic accuracy data section, retransmits the data segment, and press
According to the size of the original Developing Tactics sliding window of TCP;There is time-out if it is the ACK of enhanced precision, then without weight
It passes, according to the size of the second Developing Tactics sliding window;If carrying ECN label or other feelings for the ACK received
Condition, according to the size of the original Developing Tactics sliding window of TCP.Second strategy above-mentioned is cwnd=cwnd -1.
Receiving end is when receiving data segment j, the corresponding data block number value k=j div P of the data segment, wherein indicating whole
Division operation;Corresponding accuracy class information is i=j mod P, and wherein mod is complementation operation.
If all data segments have received in data block k, which is decoded;If there is number in receiving end
Value be less than k, the data segment of basic accuracy data collected ought not yet decoded data block, then the data block is decoded.
Basic accuracy data section has been collected for receiving end but not yet decoded data block, if basic accuracy data is received
The neat time is more than T (T can value be rtt), then is decoded immediately.
If network intermediary device supports stringent multipriority queue scheduling.Assuming that the priority number supported is PS, that
, for the data segment carrying highest priority 0 of basic accuracy data;Accuracy class value is PD, PD+1 ..., min (P-1, PD+
PS-1 the data segment of enhancing accuracy data) carries priority 1,2,3 respectively ..., PS-1, the data segment of remaining accuracy class
Carry priority value PS-1.
Using the Transmitting Data Stream control method of present embodiment, transmitting terminal can according to receiving end feed back link can
With bandwidth information, the transmission precision of active accommodation data controls the amount for the data transmitted.If network bandwidth improves, increase
Add the precision for sending data;No person reduces the precision for sending data, to reduce the amount to be sent, it is ensured that the progress of transmission.
Data are divided into two classes for needing reliable transmission and not needing reliable transmission according to accuracy class.When occurring packet loss in transmission
When, only the authentic data of loss is retransmitted, the decline of goodput is avoided, allows transport protocol not by non-authentic data
Packet loss obstruction.
Related content of the invention is illustrated above.Those of ordinary skill in the art are in the feelings illustrated based on these
The present invention will be realized under condition.Based on above content of the invention, those of ordinary skill in the art are not making creativeness
Every other embodiment obtained, should fall within the scope of the present invention under the premise of labour.