Summary of the invention
The embodiment of the present invention provides network bandwidth detection method, device and the network equipment, in order to solve prior art
The middle detection network bandwidth time is longer, and the problem needing to take a large amount of Internet resources.
For solving the problems referred to above, the technical scheme that the embodiment of the present invention provides is as follows:
First aspect, it is provided that a kind of network bandwidth detection method, described method includes:
First network equipment organizes probe messages with first rate to the second network equipment transmission respectively, so that described first
Each equipment in the routing device arranged between the network equipment and described second network equipment and described second network equipment connects
Receive one group of probe messages;
Described first network equipment receives the inefficacy that described each equipment returns according to the quantity of the probe messages received
Message;
The quantity of the packet failure that described first network equipment returns according to described each equipment calculates described first network
The link bandwidth of every section of link between equipment and described second network equipment;
According to the link bandwidth of described every section of link, described first network equipment determines that described first network equipment is with described
The network bandwidth between second network equipment.
In conjunction with first aspect, in the first possible implementation of first aspect, described first network equipment is respectively
Organize probe messages with first rate to the second network equipment transmission more, including:
First network equipment is that described each equipment generates one group of network Internet Control Message Protocol icmp probe message, described often
The value of the life span ttl field in one group of icmp probe message of individual equipment is set to the chain of the link corresponding with described equipment
Road numbering is consistent, the link between the upper hop equipment that link is described equipment and described equipment that described equipment is corresponding;
First network equipment is sent as what described each equipment generated with first rate to described second network equipment respectively
One group of icmp probe message.
In conjunction with first aspect, or the first possible implementation of first aspect, the second in first aspect may
Implementation in, the quantity of the packet failure that described first network equipment returns according to described each equipment calculates described first
The link bandwidth of every section of link between the network equipment and described second network equipment, including:
The quantity of the one group of probe messages sent to described each equipment is deducted described equipment by described first network equipment
The quantity of the packet failure returned, it is thus achieved that the loss message amount on the link that described equipment is corresponding;
By described loss message amount divided by after the quantity of one group of probe messages of described transmission with described first rate phase
Take advantage of, obtain the first product, the difference of described first rate with described first product is defined as link corresponding to described equipment
Link bandwidth.
In conjunction with first aspect, or the first possible implementation of first aspect, or the second of first aspect may
Implementation, in the third possible implementation of first aspect, described first network equipment is according to described every section of chain
The link bandwidth on road determines the network bandwidth between described first network equipment and described second network equipment, including:
Described first network equipment obtains the link bandwidth of minimum from the link bandwidth of described every section of link, by described
Little link bandwidth is defined as the network bandwidth between described first network equipment and described second network equipment.
In conjunction with first aspect, or the first possible implementation of first aspect, or the second of first aspect may
Implementation, in the 4th kind of possible implementation of first aspect, described first network equipment is according to described every section of chain
The link bandwidth on road determines the network bandwidth between described first network equipment and described second network equipment, including:
Described first network equipment obtains the link bandwidth of minimum from the link bandwidth of described every section of link;
Described first network equipment is that the first equipment that the link bandwidth of described minimum is corresponding regenerates one group of detection report
Literary composition, the message amount comprised in the described one group of probe messages regenerated have been received by more than described first equipment described the
The message amount comprised in one group of probe messages that one network equipment sends;
Described first network equipment is to the one group of probe messages regenerated described in described first equipment transmission;
Described first network equipment receives first that described first equipment returns according to the quantity of the probe messages received
Packet failure;
The link bandwidth that quantity according to described first packet failure calculates is defined as described by described first network equipment
The network bandwidth between first network equipment and described second network equipment.
Second aspect, it is provided that a kind of network bandwidth detection device, described device includes:
Transmitting element, organizes probe messages for sending to second network equipment with first rate respectively more, so that described the
Each equipment in the routing device arranged between one network equipment and described second network equipment and described second network equipment
Receive one group of probe messages;
Receive unit, for receiving the inefficacy report that described each equipment returns according to the quantity of the probe messages received
Literary composition;
Computing unit, the quantity of the packet failure that the described each equipment for receiving according to described reception unit returns
Calculate the link bandwidth of every section of link between described first network equipment and described second network equipment;
Determining unit, the link bandwidth of the described every section of link for calculating according to described computing unit determines described first
The network bandwidth between the network equipment and described second network equipment.
In conjunction with second aspect, in the first possible implementation of second aspect, described transmitting element includes:
Probe messages generates subelement, for generating one group of network Internet Control Message Protocol icmp probe for described each equipment
Message, the value of the life span ttl field in one group of icmp probe message of described each equipment is set to and described equipment pair
The link number of the link answered is consistent, between the upper hop equipment that link is described equipment and described equipment that described equipment is corresponding
Link;
Probe messages sends subelement, for being sent as described each with first rate to described second network equipment respectively
One group of icmp probe message that equipment generates.
In conjunction with second aspect, or the first possible implementation of second aspect, the second in second aspect may
Implementation in, described computing unit includes:
Lose message computation subunit, for the quantity of the one group of probe messages sent to described each equipment is deducted institute
State the quantity of the packet failure that equipment returns, it is thus achieved that the loss message amount on the link that described equipment is corresponding;
Link bandwidth determines subelement, for by described loss message amount divided by one group of probe messages of described transmission
It is multiplied with described first rate after quantity, obtains the first product, the difference of described first rate with described first product is determined
Link bandwidth for link corresponding to described equipment.
In conjunction with second aspect, or the first possible implementation of second aspect, or the second of second aspect may
Implementation, in the third possible implementation of second aspect, described determine unit, specifically for from described every section
The link bandwidth of link obtains the link bandwidth of minimum, the link bandwidth of described minimum is defined as described first network equipment
And the network bandwidth between described second network equipment.
In conjunction with second aspect, or the first possible implementation of second aspect, or the second of second aspect may
Implementation, in the 4th kind of possible implementation of second aspect, described determine that unit includes:
Minimum bandwidth obtains subelement, for obtaining the link bandwidth of minimum from the link bandwidth of described every section of link;
Probe messages is lived again subelement, for regenerating one group for the first equipment that the link bandwidth of described minimum is corresponding
Probe messages, the message amount comprised in the described one group of probe messages regenerated has been received by more than described first equipment
The message amount comprised in one group of probe messages that described first network equipment sends;
Probe messages retransmission subpacket unit, for the one group of probe messages regenerated described in described first equipment transmission;
Packet failure receives subelement, returns according to the quantity of the probe messages received for receiving described first equipment
The first packet failure;
The network bandwidth determines subelement, for being determined by the link bandwidth that the quantity according to described first packet failure calculates
For the network bandwidth between described first network equipment and described second network equipment.
The third aspect, it is provided that a kind of network equipment, the described network equipment is as the first net with the second network device communications
Network equipment, including: bus, and network interface, transmitter, receptor and the processor connected by described bus,
Described network interface, for connecting the routing device in network;
Described transmitter, for organizing spy with first rate to the second network equipment transmission by described network interface respectively
Observe and predict literary composition, so that the routing device arranged between described first network equipment and described second network equipment and described second network
Each equipment in equipment receives one group of probe messages;
Described receptor, for receiving the inefficacy report that described each equipment returns according to the quantity of the probe messages received
Literary composition;
Described processor, the quantity of the packet failure for returning according to described each equipment calculates described first network and sets
The link bandwidth of every section of link between standby and described second network equipment, and determine institute according to the link bandwidth of described every section of link
State the network bandwidth between first network equipment and described second network equipment.
In conjunction with the third aspect, in the first possible implementation of the third aspect, described processor, it is additionally operable to as institute
State each equipment and generate one group of network Internet Control Message Protocol icmp probe message, one group of icmp probe message of described each equipment
In the value of life span ttl field to be set to the link number of the link corresponding with described equipment consistent, described equipment is corresponding
The upper hop equipment that link is described equipment and described equipment between link;
Described transmitter, specifically for sending out to described second network equipment with first rate respectively by described network interface
Send the one group of icmp probe message generated for described each equipment.
In conjunction with the third aspect, or the first possible implementation of the third aspect, the second in the third aspect may
Implementation in, described processor, specifically for deducting the quantity of the one group of probe messages sent to described each equipment
The quantity of the packet failure that described equipment returns, it is thus achieved that the loss message amount on the link that described equipment is corresponding, loses described
Lose message amount to be multiplied with described first rate divided by after the quantity of one group of probe messages of described transmission, obtain the first product,
The difference of described first rate with described first product is defined as the link bandwidth of link corresponding to described equipment.
In conjunction with the third aspect, or the first possible implementation of the third aspect, or the second of the third aspect may
Implementation, in the third possible implementation of the third aspect, described processor, specifically for from described every section of chain
The link bandwidth on road obtains minimum link bandwidth, the link bandwidth of described minimum is defined as described first network equipment with
The network bandwidth between described second network equipment.
In conjunction with the third aspect, or the first possible implementation of the third aspect, or the second of the third aspect may
Implementation, in the 4th kind of possible implementation of the third aspect, described processor, be additionally operable to from described every section of link
Link bandwidth in obtain minimum link bandwidth, first equipment corresponding for the link bandwidth of described minimum regenerates one group
Probe messages, the message amount comprised in the described one group of probe messages regenerated has been received by more than described first equipment
The message amount comprised in one group of probe messages that described first network equipment sends;
Described transmitter, is additionally operable to by described network interface to a group regenerated described in described first equipment transmission
Probe messages;
Described receptor, is additionally operable to receive first that described first equipment returns according to the quantity of the probe messages received
Packet failure;
Described processor, is additionally operable to be defined as described by the link bandwidth of the quantity calculating according to described first packet failure
The network bandwidth between first network equipment and described second network equipment.
In the embodiment of the present invention, first network equipment sends many group detection reports with first rate to second network equipment respectively
Literary composition so that between first network equipment and second network equipment arrange routing device and second network equipment in each equipment
Receive one group of probe messages, receive the packet failure that each equipment returns according to the quantity of the probe messages received, according to
The quantity of the packet failure that each equipment returns calculates the link of every section of link between first network equipment and second network equipment
Bandwidth, and determine the network bandwidth between first network equipment and second network equipment according to the link bandwidth of every section of link.This
Inventive embodiments has only in first network equipment side on-premise network bandwidth detection function, and without second network equipment to first
Each packet that the network equipment sends responds, and is therefore effectively shortened the detection time of the network bandwidth, saves net
Network resource;Further, owing to using the embodiment of the present invention link bandwidth of every section of link can also be detected, therefore improve network
The accuracy of detection of bandwidth.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Whole description, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments.Based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under not making creative work premise
Embodiment, broadly falls into the scope of protection of the invention.
In the embodiment of the present invention, the transmission path between first network equipment and second network equipment is provided with multiple road
It is made up of multistage link equipment, i.e. transmission path between first network equipment and second network equipment, it is assumed that first network
Each routing device between equipment, second network equipment or first network equipment and second network equipment is a network joint
Point, then so-called link is exactly one section of transmission path from a network node to adjacent network node, and this transmission path does not has
Other network node.See Fig. 1, for a network architecture schematic diagram of the embodiment of the present invention:
In Fig. 1, between first network equipment and second network equipment, there are m routing device, first network equipment and route
Link between equipment 1 is link 1, i.e. link 1 is the link of routing device 1 correspondence, in like manner, and routing device 1 and routing device 2
Between link be link 2, by that analogy, the link between routing device m-1 and routing device m is link m, routing device m
And the link between second network equipment is link m+1.The embodiment of the present invention is by detecting the link bandwidth of every section of link to obtain
Obtain the network bandwidth between first network equipment and second network equipment, be described in detail below in conjunction with specific embodiment.
See Fig. 2, for an embodiment flow chart of inventive network bandwidth detection method:
Step 201: first network equipment organizes probe messages with first rate to the second network equipment transmission respectively, so that
Each equipment in the routing device arranged between first network equipment and second network equipment and second network equipment receives
One group of probe messages.
In the embodiment of the present invention, first network equipment and second network equipment can be specially the main process equipment in network,
Or switch, or router etc..
In conjunction with Fig. 1, it is assumed that first network equipment has known setting between first network equipment and second network equipment in advance
Quantity m of routing device time, then can be that each equipment in m routing device and second network equipment generates one group of detection
Message also sends one group of probe messages of generation, i.e. symbiosis becomes m+1 group probe messages;If first network equipment is not known by first
During quantity m of routing device arranged between the network equipment and second network equipment, then can generate the spy of n group according to network type
Observing and predicting literary composition, the quantity of n is more than m+1, to ensure that each routing device and second network equipment can receive one group of detection report
Literary composition, such as, for Metropolitan Area Network (MAN), can arrange n is 10, and for strange land network, then can arrange n is about 15.
Concrete, first network equipment can be each equipment including second network equipment and all routing devices
Generate one group of network Internet Control Message Protocol (Internet Control Message Protocol, ICMP) probe messages, each
The value of life span (Time To Live, the TTL) field in one group of icmp probe message of equipment is set to and this equipment pair
The link number of the link answered is consistent, the chain between the upper hop equipment that link is this equipment and this equipment that this equipment is corresponding
Road, understands in conjunction with Fig. 1, and such as, first network equipment is that the TTL of one group of icmp probe message that routing device 2 generates is set to
The numbering of the link 2 of routing device 2 correspondence, i.e. TTL is 2, then first network equipment respectively with first rate to the second network
Equipment is sent as one group of icmp probe message that each equipment generates, and this first rate is default speed, generally can be by the
One speed is set above the speed of the actual bandwidth of network.In the present embodiment, first network equipment can be by icmp probe report
Literary composition is blended in and is transmitted in the data message that second network equipment sends, and now sends the first rate of icmp probe message
Consistent with the transmission rate of data message.
In the present embodiment, ICMP is transmission control protocol/Internet Protocol (TCP/IP, Transmission
Control Protocol/Internet Protocol) a sub-protocol, may be used between IP main frame, router pass
Pass control message.In the present embodiment, icmp probe message can be specially Ping message.Ttl field is icmp probe heading
The field in portion, is used for arranging the number of times that message forwards in a network through the network equipment, and i.e. icmp probe message is often through one
When routing device forwards, the value of the ttl field of this icmp probe header first can be subtracted 1, forward by this routing device
To down hop routing device, when the value of the ttl field of icmp probe header is 0, then routing device abandons this ICMP spy
Observe and predict literary composition, and return the inefficacy report that the packet failure consistent with abandoned icmp probe message amount, i.e. routing device return
The quantity of literary composition reflects the quantity of the icmp probe message that this routing device is an actually-received.
Step 202: first network equipment receives the inefficacy that each equipment returns according to the quantity of the probe messages received
Message.
Step 203: the quantity of the packet failure that first network equipment returns according to each equipment calculates first network equipment
And the link bandwidth of every section of link between second network equipment.
Concrete, first network equipment can will set to each including second network equipment and all routing devices
The quantity of one group of probe messages that preparation is sent deducts the quantity of the packet failure that described each equipment returns, it is thus achieved that described equipment pair
Loss message amount on the link answered, will lose message amount divided by fast with first after the quantity of the one group of probe messages sent
Rate is multiplied, and obtains the first product, and first rate and the difference of the first product are defined as the link of link corresponding to described equipment
Bandwidth.
Step 204: first network equipment determines first network equipment and the second network according to the link bandwidth of every section of link
The network bandwidth between equipment.
Optionally, first network equipment can obtain the link bandwidth of minimum from the link bandwidth of every section of link, will be
Little link bandwidth is defined as the network bandwidth between described first network equipment and described second network equipment.
Optionally, first network equipment can also obtain the link bandwidth of minimum from the link bandwidth of every section of link, for
The first equipment that minimum link bandwidth is corresponding regenerates one group of probe messages, comprises in the one group of probe messages regenerated
One group of probe messages sending of the first network equipment that has been received by more than the first equipment of message amount in the message number that comprises
Amount, sends the one group of probe messages regenerated, receives first equipment number according to the probe messages received to the first equipment
The first packet failure that amount returns, and the link bandwidth that the quantity according to the first packet failure calculates is defined as first network sets
The network bandwidth between standby and second network equipment.This implementation is being obtained can represented by minimum link bandwidth
After the link of the network bandwidth, by improving the quantity of the probe messages sent to the network equipment that this link is corresponding, carry further
The certainty of measurement of the high network bandwidth.
As seen from the above-described embodiment, this embodiment has only in first network equipment side on-premise network bandwidth detection function,
And each packet sent first network equipment without second network equipment responds, therefore it is effectively shortened network
The detection time of bandwidth, save Internet resources;Further, owing to using the embodiment of the present invention every section of link can also be detected
Link bandwidth, therefore improves the accuracy of detection of the network bandwidth.
See Fig. 3, for another embodiment flow chart of inventive network bandwidth detection method, this example show logical
Cross smallest link bandwidth and determine the detection process of the network bandwidth:
Step 301: first network equipment be between first network equipment and second network equipment arrange routing device and
Each equipment in second network equipment generates one group of icmp probe message, in one group of icmp probe message of each equipment
The link number that the value of ttl field is set to the link corresponding with this equipment is consistent.
In conjunction with Fig. 1, it is assumed that first network equipment has known setting between first network equipment and second network equipment in advance
Quantity m of routing device time, then first network equipment can be routing device 1 to m the routing device of routing device m and
Second network equipment generates one group of icmp probe message respectively, altogether m+1 group icmp probe message, in each group of icmp probe message
The message amount comprised can be consistent, wherein, routing device 1 respective links 1, a group therefore will generated for routing device 1
Ttl field in icmp probe message is set to 1, routing device 2 respective links 2, a group therefore will generated for routing device 2
Ttl field in icmp probe message is set to 2, by that analogy, in the one group of icmp probe message that will generate for routing device m
Ttl field be set to m, will for second the network equipment generate one group of icmp probe message in ttl field be set to m+1.
Step 302: first network equipment is sent as what each equipment generated with first rate to second network equipment respectively
One group of icmp probe message.
In the present embodiment, first rate is default speed, and first rate generally can be set above the reality of network
The speed of border bandwidth.In the present embodiment, icmp probe message can be blended in and send out to second network equipment by first network equipment
The data message sent is transmitted, now sends the first rate of icmp probe message and the transmission rate one of data message
Cause.
Step 303: first network equipment receives the inefficacy that each equipment returns according to the quantity of the probe messages received
Message.
In the present embodiment, ttl field is the field of icmp probe header, is used for arranging message in a network through net
The number of times of network device forwards, i.e. icmp probe message are often when a routing device forwards, and this routing device can first will be somebody's turn to do
The value of the ttl field of icmp probe header subtracts 1, is forwarded to down hop routing device the most again, when icmp probe heading
When the value of the ttl field in portion is 0, then routing device abandons this icmp probe message, and returns and abandoned icmp probe report
The quantity of the packet failure that the packet failure that literary composition quantity is consistent, i.e. routing device return reflects this routing device and is an actually-received
The quantity of icmp probe message;In conjunction with Fig. 1, the packet failure that each routing device in m routing device returns can have
Body is TTL packet failure, and the packet failure that second network equipment returns can be specially ICMP response message.
Step 304: the quantity of the packet failure that first network equipment returns according to each equipment calculates first network equipment
And the link bandwidth of every section of link between second network equipment.
In conjunction with Fig. 1, it is assumed that first rate is P, if then link i(i is the natural number between 1 to m) link bandwidth Pi > P
Or Pi=P, then for the icmp probe message of all initial setting up TTL=i received by routing device i, TTL inefficacy all will be returned
Message, and these TTL packet failure all can receive by first network equipment;If the link bandwidth Pi < P of link i, then for route
The icmp probe message of all initial setting up TTL=i received by equipment i, has about t icmp probe message and gathers around because of network
Plug is queued up and is dropped, wherein, N is the message amount comprised in each group of icmp probe message, for this t
Icmp probe message then returns without TTL packet failure, and the quantity of the TTL packet failure that therefore first network equipment receives will be lacked
In the quantity of the icmp probe message of the TTL=i sent, therefore first network equipment can lose efficacy according to the TTL that statistics receives
Quantity n of message is just it is estimated that the link bandwidth P of this section of linki, it is shown below:
Step 305: first network equipment obtains the link bandwidth of minimum from the link bandwidth of every section of link, by this minimum
Link bandwidth be defined as the network bandwidth between first network equipment and second network equipment.
In conjunction with Fig. 1, after first network equipment calculates the link bandwidth of m link, by more therefrom selecting one
Little link bandwidth is as the network bandwidth between first network equipment and second network equipment, the link bandwidth place of this minimum
The nervous link that is referred to as between first network equipment and second network equipment of link.
The embodiment of the present invention can be applied in wide area network (Wide Area Network, WAN), and a kind of typical case of WAN should
It is that local host needs, by WAN, mass data is sent to strange land server by scene, as it is shown in figure 5, due to WAN bandwidth
Resource-constrained, therefore can be detected the network bandwidth of WAN by the application embodiment of the present invention, thus according to the network bandwidth
Testing result determines nervous link, is adjusted data transmission rate, in order to make full use of the network bandwidth of WAN.
As seen from the above-described embodiment, this embodiment has only in first network equipment side on-premise network bandwidth detection function,
And each packet sent first network equipment without second network equipment responds, therefore it is effectively shortened network
The detection time of bandwidth, save Internet resources;Further, owing to using the embodiment of the present invention every section of link can also be detected
Link bandwidth, therefore improves the accuracy of detection of the network bandwidth.
See Fig. 4, for another embodiment flow chart of inventive network bandwidth detection method, this example show logical
Cross and again send probe messages to the routing device that smallest link bandwidth is corresponding, thus the most accurately detect the mistake of the network bandwidth
Journey:
Step 401: first network equipment organizes probe messages with first rate to the second network equipment transmission respectively, so that
Each equipment in the routing device arranged between first network equipment and second network equipment and second network equipment receives
One group of probe messages.
In the embodiment of the present invention, first network equipment and second network equipment can be specially the main process equipment in network,
Or switch, or router etc..
In conjunction with Fig. 1, it is assumed that first network equipment has known setting between first network equipment and second network equipment in advance
Quantity m of routing device time, then can be that each equipment in m routing device and second network equipment generates one group of detection
Message also sends one group of probe messages of generation, i.e. symbiosis becomes m+1 group probe messages;If first network equipment is not known by first
During quantity m of routing device arranged between the network equipment and second network equipment, then can generate the spy of n group according to network type
Observing and predicting literary composition, the quantity of n is more than m+1, to ensure that each routing device and second network equipment can receive one group of detection report
Literary composition, such as, for Metropolitan Area Network (MAN), can arrange n is 10, and for strange land network, then can arrange n is about 15.
Wherein, first network equipment can be that each equipment including second network equipment and all routing devices is raw
Becoming one group of icmp probe message, the value of the ttl field in one group of icmp probe message of each equipment is set to and described equipment
The link number of corresponding link is consistent, the link that described equipment is corresponding be described equipment with the upper hop equipment of described equipment it
Between link, then first network equipment respectively with first rate to second network equipment be sent as each equipment generate one group
Icmp probe message.In the present embodiment, icmp probe message can be blended in and send out to second network equipment by first network equipment
The data message sent is transmitted, now sends the first rate of icmp probe message and the transmission rate one of data message
Causing, this icmp probe message can be specially Ping message.
In conjunction with Fig. 1, such as, first network equipment generates m+1 group Ping message, and each group of Ping message comprises N number of message,
First network equipment sends data with set rate P to second network equipment, then first network equipment can be simultaneously with pre-constant speed
Rate P sends m+1 group Ping message to each routing device and second network equipment.Wherein, the TTL of first group of Ping message is set to
1, the TTL of second group of Ping message is set to 2, the like, the TTL of m group Ping message is set to m, m+1 group Ping message
TTL is set to m+1.Each group of Ping message is often through a routing device, and ttl value subtracts 1, and as TTL=0, routing device can be by
Ping packet loss, and return a packet failure to first network equipment;Wherein, each route in m routing device sets
The standby packet failure returned can be specially TTL packet failure, and the packet failure that second network equipment returns can be specially
ICMP response message.Wherein, the value of N can be arranged as required to, and the value of N is the biggest, then the accuracy of detection of the network bandwidth is more
High.
Step 402: first network equipment receives the inefficacy that each equipment returns according to the quantity of the probe messages received
Message.
In the embodiment of the present invention, ttl field is the field of icmp probe header, is used for arranging message warp in a network
Cross the number of times that the network equipment forwards, i.e. icmp probe message often when routing device forwards, this routing device can first by
The value of the ttl field of this icmp probe header subtracts 1, is forwarded to down hop routing device the most again, when icmp probe message
When the value of the ttl field of head is 0, then routing device abandons this icmp probe message, and returns and abandoned icmp probe
The quantity of the packet failure that the packet failure that message amount is consistent, i.e. routing device return reflects the actual reception of this routing device
The quantity of the icmp probe message arrived.
Step 403: the quantity of the packet failure that first network equipment returns according to each equipment calculates first network equipment
And the link bandwidth of every section of link between second network equipment.
In the embodiment of the present invention, in conjunction with Fig. 1, for each group of Ping message, first network equipment can be according to receiving
The number of TTL packet failure that returns of routing device, determine the link bandwidth of each section of link, such as following formula:
In above formula, i represents the link No. of link, PiRepresenting the link bandwidth of i-th section of link, P represents the pre-set
One speed, N represents the message amount that each group of Ping message is comprised, and n represents the TTL packet failure that network equipment i returns
Quantity.
The calculating process of link bandwidth is described by a specific example below:
Assume between first network equipment and second network equipment, there are four routing devices, (Round two-way time of network
Trip Time, RTT) be the 1s(second), message sends with speed 10MB/s higher than network actual bandwidth.Testing time is
4s, sends altogether 40 Ping messages in this 4s, these Ping messages are divided into 4 groups, and often the value of the ttl field of group Ping message is divided
It is not 1,2,3,4.After the 4s testing time terminates, for each group of Ping message, it is assumed that the TTL that first network equipment receives loses
The quantity of effect message is as shown in table 1 below:
Table 1
Ping packet is numbered |
1 |
2 |
3 |
4 |
Ttl field value |
1 |
2 |
3 |
4 |
Ping message amount N |
10 |
10 |
10 |
10 |
TTL packet failure quantity n |
10 |
8 |
7 |
7 |
In conjunction with upper table 1, for one group of Ping message of TTL=1, lose message amount t=10-10=0, the therefore link of link 1
Bandwidth For one group of Ping message of TTL=2, lose message amount t=
10-8=2, the therefore link bandwidth of link 2 One group of Ping for TTL=3
Message, loses message amount t=10-7=3, the therefore link bandwidth of link 3
For one group of Ping message of TTL=4, lose message amount t=10-7=3, the therefore link bandwidth of link 4
Step 404: first network equipment obtains the link bandwidth of minimum from the link bandwidth of every section of link.
According to the result of calculation in step 403, the link bandwidth of link 3 and link 4 is minimum, for 7MB/s.Therefore may be used
Link 3 to be determined one section of link that the nervous link in network, i.e. link 3 are link in network bandwidth minimum.The most permissible
In follow-up measurement, increase the quantity of the one group of Ping message sent to the routing device of link 3 correspondence, thus improve measurement
Precision.
Step 405: the first equipment that link bandwidth that first network equipment is minimum is corresponding regenerates one group of detection report
Literary composition, the first network equipment that the message amount comprised in the one group of probe messages regenerated has been received by more than the first equipment is sent out
The message amount comprised in the one group of probe messages sent.
From step 404, the link bandwidth of link 3 under, therefore first network equipment can be that link 3 is corresponding again
Routing device generate one group of Ping message, and the value of the ttl field of this group Ping message is set to 3, in order to more accurate
Ground Measurement Network bandwidth, the message amount in the above-mentioned one group of Ping message regenerated can be big as far as possible, such as, message number
Amount is 100 or 1000 etc..
Step 406: first network equipment sends the one group of probe messages regenerated to the first equipment.
Step 407: first network equipment receives first that the first equipment returns according to the quantity of the probe messages received
Packet failure.
Step 408: the link bandwidth that the quantity according to the first packet failure calculates is defined as first by first network equipment
The network bandwidth between the network equipment and second network equipment.
In this step, first network equipment calculates process and the step of link bandwidth according to the quantity of the first packet failure
Description in 403 is consistent, does not repeats them here.
It should be noted that application inventive network bandwidth detection embodiment, not only can be according to the Netowrk tape detected
Width carries out outside data transmission rate regulation, it is also possible to bandwidth detection program be implanted in routing device, so that routing device can
To obtain the link bandwidth of the different links in network, and it is routed accordingly, thus avoids network congestion.
As seen from the above-described embodiment, this embodiment has only in first network equipment side on-premise network bandwidth detection function,
And each packet sent first network equipment without second network equipment responds, therefore it is effectively shortened network
The detection time of bandwidth, save Internet resources;Further, owing to using the embodiment of the present invention every section of link can also be detected
Link bandwidth, therefore improves the accuracy of detection of the network bandwidth.It addition, after above-described embodiment primarily determines that out nervous link, can
With by again sending one group of probe messages to the routing device that this anxiety link is corresponding, to improve network bandwidth accuracy of detection.
Corresponding with the embodiment of inventive network bandwidth detection method, present invention also offers network bandwidth detection device
And the embodiment of the network equipment.
See Fig. 6, for the embodiment block diagram of inventive network bandwidth detecting device:
This network bandwidth detection device includes: transmitting element 610, receive unit 620, computing unit 630 and determine unit
640。
Wherein, transmitting element 610, for organizing probe messages with first rate to the second network equipment transmission respectively more, with
Make in routing device and described second network equipment of setting between described first network equipment and described second network equipment
Each equipment receives one group of probe messages;
Receive unit 620, for receiving the inefficacy that described each equipment returns according to the quantity of the probe messages received
Message;
Computing unit 630, the packet failure that the described each equipment for receiving according to described reception unit 620 returns
Quantity calculate the link bandwidth of every section of link between described first network equipment and described second network equipment;
Determining unit 640, the link bandwidth of the described every section of link for calculating according to described computing unit 630 determines institute
State the network bandwidth between first network equipment and described second network equipment.
In an optional implementation, described transmitting element 610 can include (not shown in Fig. 6):
Probe messages generates subelement, for generating one group of network Internet Control Message Protocol icmp probe for described each equipment
Message, the value of the life span ttl field in one group of icmp probe message of described each equipment is set to and described equipment pair
The link number of the link answered is consistent, between the upper hop equipment that link is described equipment and described equipment that described equipment is corresponding
Link;
Probe messages sends subelement, for being sent as described each with first rate to described second network equipment respectively
One group of icmp probe message that equipment generates.
In another optional implementation, described computing unit 630 can include (not shown in Fig. 6):
Lose message computation subunit, for the quantity of the one group of probe messages sent to described each equipment is deducted institute
State the quantity of the packet failure that equipment returns, it is thus achieved that the loss message amount on the link that described equipment is corresponding;
Link bandwidth determines subelement, for by described loss message amount divided by one group of probe messages of described transmission
It is multiplied with described first rate after quantity, obtains the first product, the difference of described first rate with described first product is determined
Link bandwidth for link corresponding to described equipment.
In another optional implementation, described determine unit 640, can be specifically for from described every section of link
Link bandwidth obtains the link bandwidth of minimum, the link bandwidth of described minimum is defined as described first network equipment with described
The network bandwidth between second network equipment.
In another optional implementation, described determine that unit 640 can include (not shown in Fig. 6):
Minimum bandwidth obtains subelement, for obtaining the link bandwidth of minimum from the link bandwidth of described every section of link;
Probe messages is lived again subelement, for regenerating one group for the first equipment that the link bandwidth of described minimum is corresponding
Probe messages, the message amount comprised in the described one group of probe messages regenerated has been received by more than described first equipment
The message amount comprised in one group of probe messages that described first network equipment sends;
Probe messages retransmission subpacket unit, for the one group of probe messages regenerated described in described first equipment transmission;
Packet failure receives subelement, returns according to the quantity of the probe messages received for receiving described first equipment
The first packet failure;
The network bandwidth determines subelement, for being determined by the link bandwidth that the quantity according to described first packet failure calculates
For the network bandwidth between described first network equipment and described second network equipment.
See Fig. 7, for the embodiment block diagram of inventive network equipment:
This network equipment as the first network equipment with the second network device communications, including bus 710, and passes through
Network interface 720, transmitter 730, receptor 740 and the processor 750 that described bus 710 connects.
Wherein, described network interface 720, for connecting the routing device in network;
Described transmitter 730, for sending to second network equipment with first rate respectively by described network interface 720
Organize probe messages more, so that the routing device arranged between described first network equipment and described second network equipment and described the
Each equipment in two network equipments receives one group of probe messages;
Described receptor 740, for receiving the mistake that described each equipment returns according to the quantity of the probe messages received
Effect message;
Described processor 750, the quantity of the packet failure for returning according to described each equipment calculates described first net
The link bandwidth of every section of link between network equipment and described second network equipment, and the link bandwidth according to described every section of link is true
The fixed network bandwidth between described first network equipment and described second network equipment.
In an optional implementation:
Described processor 750, it is also possible to visit for generating one group of network Internet Control Message Protocol ICMP for described each equipment
Observing and predicting literary composition, the value of the life span ttl field in one group of icmp probe message of described each equipment is set to and described equipment
The link number of corresponding link is consistent, the link that described equipment is corresponding be described equipment with the upper hop equipment of described equipment it
Between link;
Described transmitter 730, can specifically for by described network interface 720 respectively with first rate to described second
The network equipment is sent as one group of icmp probe message that described each equipment generates.
In another optional implementation:
Described processor 750, can be specifically for subtracting the quantity of the one group of probe messages sent to described each equipment
Go the quantity of the packet failure that described equipment returns, it is thus achieved that the loss message amount on the link that described equipment is corresponding, by described
Lose message amount to be multiplied with described first rate divided by after the quantity of one group of probe messages of described transmission, obtain first and take advantage of
Long-pending, the difference of described first rate with described first product is defined as the link bandwidth of link corresponding to described equipment.
In another optional implementation:
Described processor 750, can be specifically for obtaining the link band of minimum from the link bandwidth of described every section of link
Width, is defined as the Netowrk tape between described first network equipment and described second network equipment by the link bandwidth of described minimum
Wide.
In another optional implementation:
Described processor 750, it is also possible to for obtaining the link bandwidth of minimum from the link bandwidth of described every section of link,
One group of probe messages is regenerated, the described one group of detection regenerated for the first equipment that the link bandwidth of described minimum is corresponding
One group of detection that the described first network equipment that the message amount comprised in message has been received by more than described first equipment sends
The message amount comprised in message;
Described transmitter 730, is also additionally operable to again be given birth to described in described first equipment transmission by described network interface 720
The one group of probe messages become;
Described receptor 740, it is also possible to return according to the quantity of the probe messages received for receiving described first equipment
The first packet failure returned;
Described processor 750, it is also possible to the link bandwidth for the quantity according to described first packet failure being calculated is true
It is set to the network bandwidth between described first network equipment and described second network equipment.
As seen from the above-described embodiment, first network equipment organizes detection with first rate to the second network equipment transmission respectively
Message, so that each setting in the routing device arranged between first network equipment and second network equipment and second network equipment
For receiving one group of probe messages, receive the packet failure that each equipment returns, root according to the quantity of the probe messages received
The quantity of the packet failure returned according to each equipment calculates the chain of every section of link between first network equipment and second network equipment
Road bandwidth, and determine the network bandwidth between first network equipment and second network equipment according to the link bandwidth of every section of link.
The embodiment of the present invention has only in first network equipment side on-premise network bandwidth detection function, and without second network equipment to
Each packet that one network equipment sends responds, and is therefore effectively shortened the detection time of the network bandwidth, saves
Internet resources;Further, owing to using the embodiment of the present invention link bandwidth of every section of link can also be detected, therefore improve net
The accuracy of detection of network bandwidth.
Those skilled in the art it can be understood that can add by software to the technology in the embodiment of the present invention required
The mode of general hardware platform realize.Based on such understanding, the technical scheme in the embodiment of the present invention substantially or
Saying that the part contributing prior art can embody with the form of software product, this computer software product can be deposited
Storage, in storage medium, such as ROM/RAM, magnetic disc, CD etc., is used so that a computer equipment is (permissible including some instructions
It is personal computer, server, or the network equipment etc.) perform each embodiment of the present invention or some part institute of embodiment
The method stated.
Each embodiment in this specification all uses the mode gone forward one by one to describe, identical similar portion between each embodiment
Dividing and see mutually, what each embodiment stressed is the difference with other embodiments.Real especially for system
For executing example, owing to it is substantially similar to embodiment of the method, so describe is fairly simple, relevant part sees embodiment of the method
Part illustrate.
Invention described above embodiment, is not intended that limiting the scope of the present invention.Any in the present invention
Spirit and principle within amendment, equivalent and the improvement etc. made, should be included within the scope of the present invention.