Background technology
Along with development of computer, internet (Internet) becomes people gradually and obtains one of important platform of information, interchange mutually.The internet in the world rapid expansion and the internet in the fast development of new business such as real time business and multimedia service, caused the internet network performance decrease.At present, the main cause that influences network performance has factors such as the design of link bandwidth, link bottleneck, application and agreement and host computer system, wherein, link bandwidth is most important Internet resources, it also is one of main determining factor of transmission path performance, and closely related with network bottleneck, overall performance analysis, capacity planning etc., therefore, accurately measuring bandwidth just becomes a major issue in the internet research.
In network bandwidth fields of measurement, by different estimating, the network bandwidth is measured the measurement that can be divided into different aspects such as link bandwidth, path bandwidth and available bandwidth.Available bandwidth is a key parameter in network route, traffic engineering, the QoS control in engineering, has more practical significance than bottleneck bandwidth.
Link bandwidth refers to the maximum bandwidth of a link, the i.e. maximum data transfer rate of this link, by the physical property decision of link; The link available bandwidth refers to a current bandwidth that is not used of link; Path bandwidth is the minimum value of all link bandwidths on the current path, and path bandwidth is also referred to as the end-to-end path bandwidth; The path available bandwidth is the minimum value of all the link available bandwidths on the current path, and the path available bandwidth is also referred to as available bandwidth of end-to-end route.In all links on current path, the link of link available bandwidth minimum is called as the urgent link in this path, and the link of link bandwidth minimum is called as the bottleneck link in this path.
Figure 1 shows that the end-to-end bandwidth schematic diagram, the path between transmitting terminal and the receiving terminal is by three link L
1, L
2And L
3Form, wherein, C
1, C
2, C
3Be respectively link L
1, L
2, L
3Link bandwidth; Dash area is represented the already used bandwidth of current link, then A
1, A
2, A
3Be respectively link L
1, L
2, L
3The bandwidth that is not used, be the link available bandwidth.As can be seen from the figure C
1<C
2<C
3, be link L
1The link bandwidth minimum, determined the path bandwidth of transmitting terminal, then link L to receiving terminal
1It is the bottleneck link between transmitting terminal and the receiving terminal; In addition, A
3<A
1<A
2, be link L
3Link available bandwidth minimum has determined the path available bandwidth of transmitting terminal to receiving terminal, then link L
3Urgent link for this path.
Existing bandwidth measurement method is based on the bag formation algorithm of timestamp more, and main measurement model has probe interval model (PGM, Packet Gap Model) and detection rate model (PRM, Packet Rate Model).Wherein, mainly be that the inter-packet gap of analyzing the detection packet formation changes based on the algorithm of PGM model, determine the estimated value of bandwidth to be also referred to as bandwidth measurement method according to variation tendency based on timestamp; Algorithm based on the PRM model mainly is to send the detection packet formation at transmitting terminal with certain speed, receive the speed of detection packet formation according to receiving terminal, dynamically adjust the transmission rate of detection packet formation, thereby the critical speed of determining a coupling is estimated bandwidth to be measured.
But mainly there is following shortcoming in existing bandwidth measurement method based on PGM and PRM:
1. above-mentioned two kinds of method of measurement generally need the cooperating of passive measurement end, that is to say, the passive measurement end need carry out corresponding calculated according to some information of detection packet formation, and these computing informations are returned to initiatively measuring junction, two measuring junctions need cooperating aptitude test outgoing link bandwidth.In this case, need the passive measurement end to take to install ancillary methods such as corresponding process of measurement, reduced the practicality and the flexibility of method of measurement like this.
2. above-mentioned two kinds of method of measurement calculation process complexity, particularly based on the bandwidth measurement method of PGM, relatively stricter for requirements such as timing accuracies, the complexity of calculating is higher.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of the utilization to mix the method and apparatus that message is measured available bandwidth, can reduce the complexity of bandwidth measurement.
For achieving the above object, technical scheme of the present invention is achieved in that
The invention provides a kind of the utilization and mix the method that message is measured available bandwidth, this method comprises:
Initiatively measuring junction sends the Internet Control Message Protocol icmp packet to the passive measurement end, the normal icmp packet packet loss of the network that described active measuring junction counts on the passive measurement end;
Initiatively measuring junction sends and mixes message to described passive measurement end, and initiatively measuring junction counts on the icmp packet average packet loss ratio of the described mixing message of passive measurement end;
When initiatively the measuring junction difference of judging described icmp packet average packet loss ratio and the normal icmp packet packet loss of network is greater than the packet loss threshold value preset, add up described passive measurement termination and receive the Mean Speed of mixing message, as the available bandwidth of active measuring junction to the passive measurement end.
This method further comprises: described active measuring junction sends icmp packet to the passive measurement end with default initialization speed, after described passive measurement termination is received described icmp packet, described icmp packet is returned to described active measuring junction, described active measuring junction is added up the normal icmp packet packet loss of described network according to the icmp packet that icmp packet that self sends and passive measurement end return.
Wherein, described active measuring junction sends and mixes message to before the described passive measurement end, and this method also comprises: described active measuring junction is determined the transmission rate of described mixing message;
Accordingly, determine the transmission rate of described mixing message, be specially:
When described active measuring junction for the first time when described passive measurement end sends described mixing message, the transmission rate first time of described mixing message is described default initialization speed or is the link bandwidth of described active measuring junction to bottleneck link between the passive measurement end.
The mixing message that described active measuring junction sends is that the n group is mixed message, and described mixing message comprises described icmp packet and user datagram protocol UDP message, and wherein n is the integer more than or equal to 1.
This method also comprises: the destination interface of the described UDP message of described active measuring junction is set to wrong destination interface; Accordingly, after described passive measurement termination is received described mixing message, with described UDP packet loss, and the icmp packet in the described mixing message returned to described active measuring junction according to the destination interface of described mistake.
Described active measuring junction is added up described icmp packet average packet loss ratio, be specially: the icmp packet that described active measuring junction returns according to n group mixing message that self sends and passive measurement end, add up every group of icmp packet packet loss that mixes message in the described n group, and the icmp packet packet loss that described n group is mixed message averaged, obtain described icmp packet average packet loss ratio.
The difference that described active measuring junction is judged described icmp packet average packet loss ratio and the normal icmp packet packet loss of described network is during smaller or equal to default packet loss threshold value, this method also comprises: described active measuring junction redefines the transmission rate of described mixing message, be specially: based on the transmission rate first time of described mixing message, the mode that adopts linear raising or index doubly to improve increases described transmission rate.
Described active measuring junction is added up the Mean Speed that described passive measurement termination is received described mixing message, be specially: the icmp packet that described active measuring junction returns according to n group mixing message that self sends and passive measurement end, add up described passive measurement termination and receive every group of speed of mixing message in the described n group, and described passive measurement termination is received described n group mix the speed of message and average, obtain the Mean Speed that described passive measurement termination is received described mixing message.
The present invention also provides a kind of the utilization to mix the device that message is measured available bandwidth, and this device comprises: active measuring junction and passive measurement end, wherein,
Described active measuring junction is used to send icmp packet to described passive measurement end, and counts on the normal icmp packet packet loss of network of described passive measurement end; Also be used for sending and mix message to described passive measurement end, and count on the described icmp packet average packet loss ratio of described passive measurement end, and during greater than the packet loss threshold value preset, add up the Mean Speed that described passive measurement termination is received described mixing message in the difference of judging described icmp packet average packet loss ratio and the normal icmp packet packet loss of described network;
Described passive measurement end is used to receive described icmp packet and described mixing message.
Wherein, described passive measurement end also is used for, and when receiving the icmp packet of described active measuring junction transmission, returns described icmp packet and gives initiatively measuring junction; When receiving the mixing message of described active measuring junction transmission, with the UDP packet loss in the described mixing message, and the icmp packet that will mix in the message returns to initiatively measuring junction.
Bandwidth measurement scheme of the present invention sends icmp packet to the passive measurement end by the active measuring junction, and counts on the normal icmp packet packet loss of network of passive measurement end; Send the mixing message to the passive measurement end by the active measuring junction, and count on the icmp packet average packet loss ratio of passive measurement end; The difference of judging icmp packet average packet loss ratio and the normal icmp packet packet loss of network when the active measuring junction is during greater than default packet loss threshold value, and statistics passive measurement termination is received the Mean Speed of mixing message; This Mean Speed is the path available bandwidth of measurement.In addition, in this scheme, initiatively the destination interface of UDP message is set to wrongly in the mixing message that sends of measuring junction, and so, the passive measurement end can only return icmp packet to the active measuring junction directly with the UDP packet loss.This shows that the bandwidth measurement among the present invention does not need the cooperating of passive measurement end, reduced the complexity of surveying work, the practicality of method of measurement of the present invention and flexibility are also than higher simultaneously.
Embodiment
The technical solution of the present invention is further elaborated below in conjunction with the drawings and specific embodiments.
Bandwidth measurement among the present invention mainly is to the measurement of path available bandwidth end to end, and wherein an end is the active measuring junction, and a then other end is the passive measurement end; Initiatively measuring junction is measured the path available bandwidth at two ends by sending the mode of mixing message to the passive measurement end.
Mix message among the present invention and refer to user datagram protocol (UDP, User Datagram Protocol) message and Internet Control Message Protocol (ICMP, Internet Control Message Protocol) message.
The present invention utilizes and mixes flow process that message measures available bandwidth as shown in Figure 2, comprising:
Step 201, initiatively measuring junction sends icmp packet to the passive measurement end, and initiatively measuring junction counts on the normal icmp packet packet loss of network of passive measurement end;
Step 202, initiatively measuring junction sends and mixes message to the passive measurement end, and initiatively measuring junction counts on the icmp packet average packet loss ratio in the mixing message of passive measurement end;
Step 203, when initiatively the measuring junction difference of judging icmp packet average packet loss ratio and the normal icmp packet packet loss of network is greater than the packet loss threshold value preset, statistics passive measurement termination is received the Mean Speed of mixing message, as the available bandwidth of active measuring junction to the passive measurement end.
Below in conjunction with illustrating in the concrete enforcement that the present invention measures the method for bandwidth, as shown in Figure 3, comprising:
Step 301, the initiatively normal icmp packet packet loss of measuring junction Measurement Network.
Initiatively measuring junction sends icmp packet to the passive measurement end with default initialization speed, after the passive measurement termination is received icmp packet, icmp packet is returned to initiatively measuring junction, the icmp packet that the active measuring junction returns according to icmp packet that self sends and passive measurement end, statistics initiatively measuring junction is specially to the normal icmp packet packet loss of network of passive measurement end: initiatively measuring junction is with default initialization speed V
0Send icmp packet, wherein V to the passive measurement end
0Be a lower transmission rate, when with V
0During for the transmission rate of icmp packet, need guarantee can not cause the congested of network, under this prerequisite, initiatively measuring junction can carry out V according to self needs
0The selection of value.
Suppose that initiatively measuring junction has once sent the individual icmp packet of z (z is a positive integer) to the passive measurement end, and the passive measurement end returned the individual icmp packet of z ' (z ' be positive integer), then the normal icmp packet packet loss of network is on the current path
Step 302, initiatively measuring junction is determined the transmission rate of current mixing message.
When sending to the passive measurement end for the first time, the active measuring junction mixes message, and at known current path, when promptly initiatively measuring junction is to the link bandwidth of the bottleneck link of passive measurement end, this transmission rate first time of mixing message can be the link bandwidth of this bottleneck link; Otherwise, can be default initialization speed V
0
If the transmission rate first time of mixing message can not satisfy the measurement of path available bandwidth, then need to improve the transmission rate of mixing message, concrete, can adopt linear raising and index doubly to improve two kinds of means as required.Wherein, when linearity improved transmission rate, the growth rate of transmission rate was slower, cause the testing time longer relatively, but test result is more accurate; When index doubly improved transmission rate, the growth rate of transmission rate was very fast, and the test convergence is fast, but the error of the linear relatively raising transmission rate of test result is bigger.
Step 303, initiatively measuring junction sends to the passive measurement end with current definite transmission rate and mixes message; The passive measurement end returns icmp packet to the active measuring junction.
In the mixing message of the present invention, the quantity of UDP message is more, preferably, can be provided with and send an icmp packet behind the individual UDP message of continuous transmission k (k is a positive integer), is illustrated in figure 4 as one group of structural representation that mixes message, and initiatively transmitting terminal is with ICMP
1Message mixes the initial of message as this group, sends ICMP of transmission behind k the UDP message then continuously
2Message; Send an ICMP after sending k UDP message more continuously
3Message, by that analogy, to send an ICMP behind k UDP message of continuous transmission
sMessage can be called k UDP message+1 icmp packet one group of of mixing message and send at interval as the end of this group mixing message.The transmission that this shows two continuous icmp packets is at interval very big, and it is also very big that then the passive measurement end returns the interval of icmp packet.
The total individual icmp packet of s (s is a positive integer) in this mixing message, and the numbering of icmp packet is continuous, wherein, and ICMP
1Be first icmp packet, ICMP
sBe last icmp packet; The quantity of UDP message is (s-1) * k.
It is to be noted, the active measuring junction is when sending the UDP message among the present invention, the destination interface of UDP message is set to wrong destination slogan, so the passive measurement end is when receiving the mixing message, because the destination slogan mistake of UDP message, therefore the passive measurement end is directly with the UDP packet loss, and just receives icmp packet, and returns icmp packet to the active measuring junction.Because icmp packet itself just has and measures data-transformation facility (comprising bandwidth measurement) end to end, and the UDP message is initiatively abandoned by the passive measurement end, therefore, the passive measurement end does not need bandwidth measurement is made any cooperating, has so just reduced the complexity of bandwidth measurement widely.
Above-mentioned UDP message accounts for the ratio of mixing message and is far longer than the ratio that icmp packet accounts for the mixing message, so, in up (initiatively measuring junction sends to the passive measurement end and mixes message) process, because it is bigger to mix the data volume of message, causes the transmission of icmp packet to be subjected to the influence of network condition bigger; In descending (the passive measurement end returns icmp packet to the active measuring junction) process, because the UDP message is dropped, that returns has only icmp packet, data volume significantly reduces, and the interval between the icmp packet is very big, therefore, the influence that icmp packet is subjected to network condition reduces greatly, helps to improve the precision of bandwidth measurement like this.
Step 304, initiatively measuring junction statistics icmp packet average packet loss ratio.
The icmp packet that the active measuring junction returns according to n group mixing message that self sends and passive measurement end, every group of icmp packet packet loss that mixes message in the statistics n group, and the icmp packet packet loss that this n group is mixed message averaged, obtain the icmp packet average packet loss ratio.
Concrete, initiatively measuring junction need be added up the icmp packet average packet loss ratio under current transmission rate.Only the icmp packet packet loss that mixes message with single group serves as when coming the measuring route available bandwidth, can produce bigger error, therefore, when carrying out the measurement of a path available bandwidth, needing initiatively in the above-mentioned
steps 303, measuring junction once sends n (n=1,2,3...) group mixing message, preferably, n can get the integer greater than 1, and calculates every group respectively and mix the icmp packet packet loss of message, i.e. single icmp packet packet loss α that organizes
nGet the mean value of this n group icmp packet packet loss then, obtain the icmp packet average packet loss ratio
So can improve the computational accuracy of icmp packet packet loss.
Below to single group icmp packet packet loss α in this step
nCalculating be described in detail.
When the active measuring junction receives this group that the passive measurement end returns when mixing last icmp packet in message, confirm whether its icmp packet that receives has to lose; If having, loses icmp packet, then single group icmp packet packet loss α in this step
nCalculating can adopt the computational methods of packet loss in the step 301.
If icmp packet is not lost, the computational methods below then adopting:
Can determine extreme bandwidth (maximum bandwidth) B in this path can adopt prior art herein according to current path situation, repeat no more; According to the transmitting time of icmp packet, the transmission that can calculate first icmp packet and last icmp packet is spaced apart t; Turn back to the initiatively time of measuring junction according to icmp packet, can calculate first icmp packet is t+ Δ t with the time interval that last icmp packet turns back to the active measuring junction, wherein,
L is every group of length of mixing message, and unit is bit; When time that certain icmp packet turns back to measuring junction initiatively with first icmp packet turn back to measuring junction initiatively interval greater than t+ Δ t the time, think that this icmp packet is the icmp packet of losing, so can draw the number m that this group is mixed the icmp packet of losing in the message
n, then
Step 305, whether the difference of judging the normal icmp packet packet loss of icmp packet average packet loss ratio and network if not, returns step 302 greater than default packet loss threshold value; If, execution in step 306.
The packet loss threshold gamma can be provided with according to the physical characteristic of current path.
The icmp packet average packet loss ratio is α, the normal icmp packet packet loss of network is β, generally speaking, because the transmission rate of mixing message is than the network transmission rate height of icmp packet just often, therefore, α is greater than β, if alpha-beta≤γ, judge that then the icmp packet average packet loss ratio of mixing message under current transmission rate is suitable with the normal icmp packet packet loss of network, illustrate that the current transmission rate of mixing message is low excessively, with current transmission rate serves as according to measuring the most accurate path available bandwidth, at this moment, initiatively measuring junction stops to send the mixing message with current transmission rate, need to improve the transmission rate of mixing message, return execution in step 302, initiatively measuring junction redefines the transmission rate of mixing message, to mix the transmission rate first time of message, adopt linear the raising, perhaps the mode that doubly improves of index increases transmission rate, and execution in step 303 then, sends once more to mix message to the passive measurement end; It is pointed out that initiatively measuring junction sends when mixing message once more, can select increases the quantity forwarded of mixing message, as compares last pilosity and send several groups to mix messages and/or increase every group and mix the UDP message in the message and the quantity of icmp packet.
If alpha-beta>γ illustrates that mixing the current transmission rate of message does not need to improve again, for the measurement of path available bandwidth, has been a more rational transmission rate, continue execution in step 306.
Step 306, the icmp packet that the active measuring junction returns according to the passive measurement end, statistics passive measurement termination is received the Mean Speed of mixing message, as the available bandwidth of active measuring junction to the passive measurement end.
The icmp packet that the active measuring junction returns according to n group mixing message that self sends and passive measurement end, statistics passive measurement termination is received every group of speed of mixing message in this n group, and the passive measurement termination is received this n group mix the speed of message and average, obtain the passive measurement termination and receive the Mean Speed of mixing message.
Be specially, initiatively measuring junction need be measured under current transmission rate, and passive measurement termination receipts n (n=1,2,3...) group is mixed the Mean Speed of message, and is concrete, and initiatively measuring junction calculates the passive measurement termination earlier and receives the speed V that the list group is mixed message
n, and then add up the mean value V of this n group speed, i.e. passive measurement termination is received the Mean Speed of mixing message
Then this Mean Speed be the current path that measures, promptly initiatively measuring junction to the available bandwidth of passive measurement end.
Initiatively measuring junction statistics passive measurement termination is received speed that single group mixes message and is based on this precondition that influences that icmp packet that the passive measurement end returns is not subjected to network environment, but, in the application of reality, the icmp packet that the passive measurement end returns all can be subjected to the influence of network environment basically, therefore, initiatively measuring junction need carry out the sample filtration to the icmp packet that returns, and chooses to be subjected to network environment to influence minimum icmp packet as receiving single speed of mixing message of organizing according to adding up the passive measurement termination.
Concrete icmp packet sample of the present invention filters the following method that adopts:
1, suppose that the lowest number that measuring junction initiatively receives the icmp packet that the passive measurement end returns is that i, maximum are numbered j, and lowest number icmp packet and maximum numbering icmp packet turn back to initiatively, and the time of measuring junction is respectively T
iAnd T
j, then icmp packet turns back to initiatively that the average time interval of measuring junction is
2, establish and be numbered x (icmp packet of i<x≤j) turns back to initiatively, and the ideal time of measuring junction is T
x'=T
i+ (x-i) * Δ T;
3, initiatively measuring junction is chosen T
x(icmp packet that is numbered x turns back to the initiatively time of measuring junction) and T
x' immediate icmp packet, promptly turn back to measuring junction initiatively time near the icmp packet of ideal time, as receiving the speed of this group mixing message according to calculating the passive measurement termination.
Certainly, the sample of icmp packet filters the sample filter algorithm can also adopt in the prior art other.
Suppose that it is l that this group is mixed the length of icmp packet in the message
ICMP, the UDP message length be l
UDP, unit is bit, the speed that then passive measurement termination is received this group mixing message is:
Wherein k is one group of number that sends UDP message in the interval of mixing message.
In order to realize above-mentioned bandwidth measurement method, the present invention also provides a kind of measurement mechanism, as shown in Figure 5, comprising: active measuring junction 10 and passive measurement end 20, wherein,
Initiatively measuring junction 10 is used to send icmp packet to passive measurement end 20, and counts on the normal icmp packet packet loss of network of passive measurement end 20; Also be used for sending and mix message, and count on the icmp packet average packet loss ratio of passive measurement end 20 to passive measurement end 20; Also be used in the difference of judging icmp packet average packet loss ratio and the normal icmp packet packet loss of network during greater than default packet loss threshold value, statistics passive measurement end 20 receives the Mean Speed of mixing messages;
Passive measurement end 20 is used to receive icmp packet and mixes message.Also be used for when receiving the icmp packet of initiatively measuring junction 10 transmissions, returning this icmp packet and giving initiatively measuring junction 10; When receiving the mixing message of initiatively measuring junction 10 transmissions, with the UDP packet loss in this mixing message, and the icmp packet that will mix in the message returns to initiatively measuring junction 10.
The above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.