A kind of method, apparatus and system of detection bandwidth
Technical field
The present invention relates to technical field of the computer network more particularly to the method, apparatus and system of a kind of detection bandwidth.
Background technique
Detection bandwidth is carried out generally by double-end monitor method.The double-end monitor method of bandwidth are as follows: source equipment with
Preset rate K0 sends detection flows to purpose end equipment, and purpose end equipment records the arrival of each data packet in detection flows
Time, and counted according to the temporal characteristics that the arrival time of each data packet reaches purpose end equipment to detection flows, from
And network delay is calculated according to temporal characteristics, and judge congestion whether occurs on transmission link according to network delay, and will sentence
Disconnected result is sent to source equipment;Source equipment according to judging result adjust detection flows size, and with new rate K1 to
Purpose end equipment sends detection flows.Above-mentioned detection process is executed repeatedly, and up to obtaining on transmission link, there is no congestions
In the case of maximum stream flow, to obtain the bandwidth between source equipment and purpose end equipment.
Go out bandwidth in order to accurate detection, source equipment needs the repeatedly size of adjustment detection flows and to destination
Equipment sends detection flows, causes detection process comparatively laborious, and time-consuming, and occupies a large amount of Internet resources.
Summary of the invention
The embodiment of the present invention provides the method, apparatus and system of a kind of detection bandwidth, can quick detection bandwidth, and not
It will affect normal data transmission on network.
In a first aspect, the embodiment of the invention provides a kind of methods of detection bandwidth, this method comprises:
Source equipment sends the first bandwidth request message to forwarding device, and the purpose of the first bandwidth request message is because of spy
FidonetFido IP address is the IP address of purpose end equipment;
The source equipment receives the bandwidth response message that the forwarding device is sent, wherein the bandwidth response message
IP address and bandwidth including the forwarding device, the bandwidth are that the forwarding device is jumped with the next of the forwarding device
Send out the bandwidth of equipment room;
The source equipment stores the bandwidth, and generates the second bandwidth request message, the second bandwidth request message
Life span TTL value it is bigger by one than the value of the TTL of the first bandwidth request message.
With reference to first aspect, in the first possible implementation of the first aspect, the first bandwidth request message
It is User Datagram Protocol UDP type message with the second bandwidth request message, the UDP type message includes specific first end
Slogan, the specific first end slogan identify that the UDP type message is bandwidth request message for the forwarding device, or
The first bandwidth request message and the second bandwidth request message are transmission control protocol TCP type message, the TCP type report
Text includes specific second end slogan, and the specific second end slogan identifies the TCP type message for the forwarding device
For bandwidth request message;
If the bandwidth response message is UDP type message, the UDP type message includes specific third port number, institute
It states specific third port number and identifies that the UDP type message is bandwidth response message for the source equipment;
If the bandwidth response message is TCP type message, the TCP type message includes specific 4th port numbers, institute
It states specific 4th port numbers and identifies that the TCP type message is bandwidth response message for the source equipment.
Second aspect, the embodiment of the present invention provide a kind of method of detection bandwidth, this method comprises:
Forwarding device receives the first bandwidth request message that source equipment is sent, the purpose of the first bandwidth request message
Internet protocol IP address is the IP address of purpose end equipment, the value etc. of the life span TTL of the first bandwidth request message
Yu Yi, the first bandwidth request message include specific first end slogan or specific second end slogan;
The forwarding device is according to the specific first end slogan or the specific second end slogan, described in confirmation
First bandwidth request message is bandwidth request message;
The forwarding device is to the source equipment transmission bandwidth response message, wherein the bandwidth response message includes
The IP address and bandwidth of the forwarding device, the bandwidth are that the next-hop forwarding of the forwarding device and the forwarding device is set
Bandwidth between standby.
In conjunction with second aspect, in the first possible implementation of the second aspect,
The first bandwidth request message is User Datagram Protocol UDP type message, and the UDP type message includes the spy
Fixed first end slogan, the specific first end slogan identify that the UDP type message is asked for bandwidth for the forwarding device
It seeks message or the first bandwidth request message is transmission control protocol TCP type message, the TCP type message includes described
Specific second end slogan, the specific second end slogan identify that the TCP type message is bandwidth for the forwarding device
Request message;
If the bandwidth response message is UDP type message, the UDP type message includes specific third port number, institute
It states specific third port number and identifies that the UDP type message is bandwidth response message for the source equipment;
If the bandwidth response message is TCP type message, the TCP type message includes specific 4th port numbers, institute
It states specific 4th port numbers and identifies that the TCP type message is bandwidth response message for the source equipment.
The third aspect, the embodiment of the present invention provide a kind of source equipment, which includes:
Sending module, for sending the first bandwidth request message, the mesh of the first bandwidth request message to forwarding device
Internet protocol IP address be purpose end equipment IP address;
Receiving module, the bandwidth response message sent for receiving the forwarding device, wherein the bandwidth response message
IP address and bandwidth including the forwarding device, the bandwidth are that the forwarding device is jumped with the next of the forwarding device
Send out the bandwidth of equipment room;
Execution module for storing the bandwidth, and generates the second bandwidth request message, the second bandwidth request message
Life span TTL value it is bigger by one than the value of the TTL of the first bandwidth request message.
In conjunction with the third aspect, in the first possible implementation of the third aspect, the first bandwidth request message
It is User Datagram Protocol UDP type message with the second bandwidth request message, the UDP type message includes specific first end
Slogan, the specific first end slogan identify that the UDP type message is bandwidth request message for the forwarding device, or
The first bandwidth request message and the second bandwidth request message are transmission control protocol TCP type message, the TCP type report
Text includes specific second end slogan, and the specific second end slogan identifies the TCP type message for the forwarding device
For bandwidth request message;
If the bandwidth response message is UDP type message, the UDP type message includes specific third port number, institute
It states specific third port number and identifies that the UDP type message is bandwidth response message for the source equipment;
If the bandwidth response message is TCP type message, the TCP type message includes specific 4th port numbers, institute
It states specific 4th port numbers and identifies that the TCP type message is bandwidth response message for the source equipment.
Fourth aspect, the embodiment of the present invention provide a kind of forwarding device, which includes:
Receiving module, for receiving the first bandwidth request message of source equipment transmission, the first bandwidth request message
Purpose Internet protocol IP address be purpose end equipment IP address, the life span TTL of the first bandwidth request message
Value be equal to one, the first bandwidth request message includes specific first end slogan or specific second end slogan;
Confirmation module, for confirming institute according to the specific first end slogan or the specific second end slogan
Stating the first bandwidth request message is bandwidth request message;
Sending module, for the source equipment transmission bandwidth response message, wherein the bandwidth response message includes
The IP address and bandwidth of the forwarding device, the bandwidth are that the next-hop forwarding of the forwarding device and the forwarding device is set
Bandwidth between standby.
In conjunction with fourth aspect, in the first possible implementation of the fourth aspect,
The first bandwidth request message is User Datagram Protocol UDP type message, and the UDP type message includes the spy
Fixed first end slogan, the specific first end slogan identify that the UDP type message is asked for bandwidth for the forwarding device
It seeks message or the first bandwidth request message is transmission control protocol TCP type message, the TCP type message includes described
Specific second end slogan, the specific second end slogan identify that the TCP type message is bandwidth for the forwarding device
Request message;
If the bandwidth response message is UDP type message, the UDP type message includes specific third port number, institute
It states specific third port number and identifies that the UDP type message is bandwidth response message for the source equipment;
If the bandwidth response message is TCP type message, the TCP type message includes specific 4th port numbers, institute
It states specific 4th port numbers and identifies that the TCP type message is bandwidth response message for the source equipment.
5th aspect, the embodiment of the present invention provide a kind of system of detection bandwidth, which includes having such as the third aspect
Any one of described in source equipment and multiple forwarding devices as described in any one of fourth aspect.
The present invention provides the method, apparatus and system of a kind of detection bandwidth, sends the to forwarding device by source equipment
One bandwidth request message carrys out the bandwidth between detection source end equipment and purpose end equipment, and source equipment receives what forwarding device was sent
Bandwidth response message judges whether forwarding device is purpose end equipment.When forwarding device is not purpose end equipment, source equipment
Bandwidth in memory bandwidth response message, and generate the second bandwidth request message, the value of the TTL of the second bandwidth request message is than the
The value of the TTL of one bandwidth request message is big by one;When forwarding device is purpose end equipment, source equipment obtain purpose end equipment with
The bandwidth of source equipment room.With this solution, since source equipment can pass through bandwidth response Receive message source equipment and mesh
End equipment between all forwarding devices bandwidth, i.e., message transmit by way of obtain source equipment and purpose end equipment
Between bandwidth, additional bandwidth will not be occupied.Therefore, when can solve through double-end monitor method detection bandwidth, volume is occupied
The problem of outer bandwidth, and can quick detection bandwidth, and will not influence normal data transmission on network.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment
Attached drawing be briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this
For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others
Attached drawing.
Fig. 1 is a kind of flow diagram one of the method for detection bandwidth provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram two of the method for detection bandwidth provided in an embodiment of the present invention;
Fig. 3 is a kind of network link schematic diagram provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram one for source equipment that present invention implementation provides;
Fig. 5 is a kind of structural schematic diagram one for forwarding device that present invention implementation provides;
Fig. 6 is a kind of structural schematic diagram two of source equipment provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram two of forwarding device provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of the system for detection bandwidth that present invention implementation provides.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is clearly retouched
It states, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Based on the present invention
In embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
Embodiment one
The embodiment of the present invention provides a kind of method of detection bandwidth, is as shown in Figure 1 the flow diagram of this method, specifically
Include:
S101, source equipment send the first bandwidth request message to forwarding device.
Purpose Internet Protocol (English: Internet Protocol, abbreviation: IP) address of first bandwidth request message
For the IP address of purpose end equipment.Forwarding device is other in addition to source equipment on source equipment network link detected
Equipment, including all forwarding devices passed through between source equipment and purpose end equipment and purpose end equipment.In real network chain
On the road, forwarding device can be router or three-tier switch.
It should be noted that in the first bandwidth request message including the first bandwidth request message life span (English:
Time to Live, abbreviation: TTL).First bandwidth request message is User Datagram Protocol (English: User Datagram
Protocol, abbreviation: UDP) type message, UDP type message includes specific first end slogan, and specific first end slogan is for turning
Hair equipment identification UDP type message be bandwidth request message or the first bandwidth request message be transmission control protocol (it is English:
Transmission Control Protocol, abbreviation: TCP) type message, TCP type message includes specific second end slogan,
Specific second end slogan is bandwidth request message for forwarding device identification TCP type message.
First bandwidth request message is packaged in IP data packet, and the source IP address of IP data packet is the IP of source equipment
Address, the purpose IP address of IP data packet are the IP address of purpose end equipment.In detection source end equipment between purpose end equipment
Bandwidth when, first bandwidth request message that source equipment is sent, the value of ttl field is 1, source equipment send second
A bandwidth request message, the value of ttl field are 2, successively plus one, until source equipment receives the bandwidth response of purpose end equipment
Message.The embodiment of the present invention is not intended to limit the first bandwidth request message is which bandwidth request message that source equipment is sent.
S102, source equipment receive the bandwidth response message that forwarding device is sent.
Bandwidth response message is also packaged in IP data packet, bandwidth response message include forwarding device IP address and
Bandwidth, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.
Specifically, the next-hop forwarding device of forwarding device refers to can find down from the routing table of forwarding device
One jumps forwarding device, is stored between forwarding device and the next-hop forwarding device of forwarding device in the routing table of forwarding device
Bandwidth.
Bandwidth response message can be UDP type message or internet control message protocol (English: Internet
Control Message Protocol, abbreviation: ICMP) type message.Bandwidth response message can also be other type of messages,
Such as TCP type message.
If bandwidth response message is UDP type message, the bandwidth carried in bandwidth response message is forwarding device and forwarding
Bandwidth between all next-hop forwarding devices of equipment.Since the byte number of UDP type message payload is more, it is set in forwarding
In the case that standby next-hop includes multiple forwarding devices, forwarding device and forwarding can be carried in UDP type bandwidth response message
Bandwidth in the next-hop of equipment between each forwarding device.Wherein, UDP type message further includes specific third port number, specific
Third port number for source equipment identification UDP type message be bandwidth response message.
If bandwidth response message is ICMP type message, the bandwidth carried in bandwidth response message is forwarding device and forwarding
Bandwidth between any one next-hop forwarding device of equipment.Due to the limitation of ICMP type message payload, ICMP type bandwidth response
Message can only carry the bandwidth between forwarding device and any one next-hop forwarding device of forwarding device.Wherein, TCP type message
Including specific 4th port numbers, specific 4th port numbers are bandwidth response message for source equipment identification TCP type message.
Illustratively, it is assumed that the next-hop forwarding device recorded in the routing table of forwarding device A, A is B, C and D, if band
Wide response message is UDP type message, then in the bandwidth response message that forwarding device A is sent the bandwidth that carries be forwarding device A to
B, the bandwidth of A to C and A to D;If bandwidth response message is ICMP type message, the bandwidth carried in bandwidth response message is to turn
Send out the bandwidth of equipment A to B perhaps A to C or A to D.
S103, source equipment memory bandwidth, and generate the second bandwidth request message.
The value of the life span TTL of second bandwidth request message is bigger by one than the value of the TTL of the first bandwidth request message.
Further, bandwidth request message (refers specifically to the first bandwidth request message and the second band in embodiments of the present invention
Wide request message) be UDP type message, which includes specific first end slogan, and specific first end slogan is used for
Forwarding device identifies that UDP type message is bandwidth request message or bandwidth request message is TCP type message, and TCP type message includes
Specific second end slogan, the specific second end slogan are bandwidth request message for forwarding device identification TCP type message.
If bandwidth response message is UDP type message, UDP type message includes specific third port number, specific third port number with
Identify that UDP type message is bandwidth response message in source equipment;If bandwidth response message is TCP type message, TCP type message packet
Specific 4th port numbers are included, specific 4th port numbers are bandwidth response message for source equipment identification TCP type message.
In embodiments of the present invention, specific first end slogan, specific second end slogan, specific third port number and
Specific 4th port numbers are that source equipment and forwarding device are preset, and UDP type message is bandwidth request report for identification
Text or bandwidth response message, the specific port numbers can be any one reserved port numbers, so-called reserved any one
A port numbers refer to be normally applied program need not port numbers.Illustratively, can preset first end slogan is
30000, when forwarding device receives the UDP type message that port numbers are 30000, so that it may determine that the message is bandwidth request report
Text, can also preset third port number is 30001, when source equipment receives the UDP type message that port numbers are 30001,
It is assured that the message is bandwidth response message.
First end slogan and third port number can be set as identical port numbers, also can be set as different ports
Number;Second end slogan and the 4th port numbers can be set as identical port numbers, also can be set as different port numbers.Due to
The end of first end slogan and/or third port number and the message that second end slogan and/or the 4th port numbers are different agreement type
Slogan, therefore they cannot be identical port numbers.
You need to add is that can be the mark (English in icmp packet if bandwidth response message is ICMP type message
Text: code) one new value of field definition is bandwidth response message for identifying the icmp packet.
Specifically, if it is purpose end equipment that source equipment, which judges forwarding device not, source equipment memory bandwidth, and generate
Second bandwidth request message, the value of the value of the life span TTL of the second bandwidth request message than the TTL of the first bandwidth request message
It is big by one.
Illustratively, if the IP address of forwarding device is different from the IP address of purpose end equipment, source equipment is judged
Forwarding device is not purpose end equipment, to obtain the bandwidth in the bandwidth response message of forwarding device return, and stores the band
It is wide.Then the second bandwidth request message is generated, the TTL of the value of the TTL of the second bandwidth request message than the first bandwidth request message
Value it is big by one.
After source equipment generates the second bandwidth request message, the second bandwidth request message is carried out and the first bandwidth request report
The identical operation of text sends the second bandwidth request message (at this point, source equipment sends the second bandwidth request report to forwarding device
The process of text is identical as step S101, i.e., the second bandwidth request message at this time is equal to the first bandwidth request report in S101
Text).After source equipment sends the second bandwidth request message, if the received bandwidth response message of source equipment is not also that destination is set
The bandwidth response message that preparation is sent, then source equipment continues to generate third bandwidth request message, the TTL of third bandwidth request message
Value it is bigger by one than the value of the TTL of the second bandwidth request message, and to forwarding device send third bandwidth request message, so follow
Ring, until source equipment receives the bandwidth response message of purpose end equipment transmission.
Again specifically, source equipment obtains purpose end equipment if source equipment judges that forwarding device is purpose end equipment
With the bandwidth of source equipment room.
Illustratively, when the IP address of forwarding device is identical as the IP address of purpose end equipment, then source equipment judges
The forwarding device is purpose end equipment out.So far, source equipment has been got between source equipment and purpose end equipment
Each bandwidth jumping forwarding device and returning.
Need to obtain due to source equipment is bandwidth between source equipment and purpose end equipment, and purpose end equipment is sent out
The bandwidth carried in the bandwidth response message sent is the band between purpose end equipment and the next-hop forwarding device of purpose end equipment
Width, the bandwidth are unnecessary to source equipment.Therefore, optionally, what the bandwidth response message that purpose end equipment is sent carried
Bandwidth can be bandwidth or the transmission of purpose end equipment between purpose end equipment and the next-hop forwarding device of purpose end equipment
Bandwidth response message can not also carry bandwidth, or set 0 for the bandwidth field in bandwidth response message.
Optionally, each jump forwarding device between the available source equipment of source equipment and purpose end equipment returns
Bandwidth, and the smallest bandwidth is chosen as the bandwidth bottleneck on the network link between source equipment and purpose end equipment.To
So that the occupied bandwidth of business datum transmitted on network link between the source equipment and purpose end equipment is small as far as possible
Minimum bandwidth in this section of chain road, the probability to malfunction when reducing business data transmission.
The present invention provides a kind of method of detection bandwidth, sends the first bandwidth request report to forwarding device by source equipment
Text carrys out the bandwidth between detection source end equipment and purpose end equipment, and source equipment receives the bandwidth response report that forwarding device is sent
Text.When forwarding device is not purpose end equipment, bandwidth in source equipment memory bandwidth response message, and generate the second bandwidth
The value of request message, the TTL of the second bandwidth request message is bigger by one than the value of the TTL of the first bandwidth request message;Work as forwarding device
When being exactly purpose end equipment, source equipment obtains the bandwidth of purpose end equipment and source equipment room.With this solution, due to source
Equipment can be that is, logical by the bandwidth of all forwarding devices between bandwidth response Receive message source equipment and purpose end equipment
The mode for crossing message transmitting obtains bandwidth between source equipment and purpose end equipment, will not occupy additional bandwidth.Therefore, may be used
Extra bandwidth is occupied when solving the problem of through double-end monitor method detection bandwidth, can quick detection bandwidth, and will not shadow
Ring normal data transmission on network.
Embodiment two
The embodiment of the present invention provides a kind of method of detection bandwidth, is illustrated in figure 2 the flow diagram of this method, specifically
Include:
S201, forwarding device receive the first bandwidth request message that source equipment is sent.
The purpose IP address of first bandwidth request message is the IP address of purpose end equipment, and the first bandwidth request message is
When UDP type message, UDP type message includes specific first end slogan, and specific first end slogan identifies UDP for forwarding device
When type message is bandwidth request message or the first bandwidth request message is TCP type message, TCP type message includes specific
Two-port netwerk number, specific second end slogan is bandwidth request message for forwarding device identification TCP type message, and the first bandwidth is asked
The value for seeking TTL in message is one.When the value of TTL in the first bandwidth request message is greater than for the moment, forwarding device asks the first bandwidth
Ask the processing of message same as the prior art, i.e., forwarding device subtracts one to the value of TTL in the first bandwidth request message, and to forwarding
The next-hop forwarding device of equipment sends the first bandwidth request message.
S202, forwarding device confirm that the first bandwidth is asked according to specific first end slogan or specific second end slogan
Seeking message is bandwidth request message.
Bandwidth request message is the message of UDP type, which includes specific first end slogan, specific first
Port numbers are bandwidth request message for forwarding device identification UDP type message;Or bandwidth request message is TCP type message, TCP
Type message includes specific second end slogan, and specific second end slogan is asked for forwarding device identification TCP type message for bandwidth
Seek message.
S203, forwarding device are to source equipment transmission bandwidth response message.
It should be noted that being said since value of the value equal to one, TTL-1 of the TTL of the first bandwidth request message is zero
The time-to-live of bright first bandwidth request message is over, and forwarding device will abandon the first bandwidth request message, and to source
Equipment transmission bandwidth response message.Wherein, bandwidth response message includes the IP address and bandwidth of forwarding device, and bandwidth is that forwarding is set
Bandwidth between the standby next-hop forwarding device with forwarding device.
First bandwidth request message be UDP type message perhaps TCP type message bandwidth response message be UDP type message or
ICMP type message;If bandwidth response message is UDP type message, the bandwidth carried in bandwidth response message is forwarding device and turns
Send out the bandwidth between each next-hop forwarding device of equipment;If bandwidth response message is ICMP type message, bandwidth response message
Bandwidth of the bandwidth of middle carrying between forwarding device and any one next-hop forwarding device of forwarding device, specifically, with reality
Apply identical described in example one, details are not described herein.
If bandwidth response message is UDP type message, UDP type message further includes specific second end slogan, specific the
Two-port netwerk number is bandwidth response message for source equipment identification UDP type message;If bandwidth response message is TCP type message,
TCP type message includes specific 4th port numbers, and specific 4th port numbers are bandwidth for source equipment identification TCP type message
Response message.
In embodiments of the present invention, specific first end slogan, specific second end slogan, specific third port number and
Specific 4th port numbers are that source equipment and forwarding device are preset, and UDP type message and TCP type message are for identification
Bandwidth request message or bandwidth response message, which can be any one reserved port numbers, so-called pre-
Any one port numbers stayed refer to be normally applied program need not port numbers.Illustratively, first end can be preset
Slogan is 30000, when forwarding device receives the UDP type message that port numbers are 30000, so that it may determine that the message is asked for bandwidth
Message is sought, can also preset third port number is 30001, when source equipment receives the UDP type message that port numbers are 30001
When, so that it may determine that the message is bandwidth response message.
Specific first end slogan and specific third port number can be set as identical port numbers, also can be set as
Different port numbers;Specific second end slogan and specific 4th port numbers can be set as identical port numbers, can also be with
It is set as different port numbers.Since first end slogan and/or third port number are with second end slogan and/or the 4th port numbers
The port numbers of the message of different agreement type, therefore they cannot be identical port numbers.
You need to add is that can be the mark (English in icmp packet if bandwidth response message is ICMP type message
Text: code) one new value of field definition is bandwidth response message for identifying the icmp packet.
Illustratively, in network link as shown in Figure 3, source equipment is A, and purpose end equipment is D, this sentences source
Equipment, forwarding device are all router and bandwidth request message and bandwidth response message is all that UDP type message is illustrated.
Bandwidth request message and bandwidth response message all include head and payload.It include source IP address in the IP head of message,
Purpose IP address and TTL.It further include specific source port number and destination port in UDP if message is UDP type message
Number, wherein the payload of bandwidth request message and bandwidth response message newly defines.
Illustratively, the format of the payload of the bandwidth request message of UDP type is as shown in table 1:
Table 1
Wherein, the type field is set as 1, indicates that the message is bandwidth request message, specifically in the present embodiment, the bandwidth
Request message is the first bandwidth request message and the second bandwidth request message.Code field is used to indicate the band of router A request
Wide type, if Code field is 0, what router A was requested is the bandwidth of forward path;If Code field is 1, router A
What is requested is the bandwidth of reverse path, wherein the bandwidth of forward path refers to the bandwidth by source equipment to purpose end equipment,
The bandwidth of reverse path refers to the bandwidth by purpose end equipment to source equipment, the generally feelings in the routing symmetry of network link
Under condition, the bandwidth of forward path and the bandwidth of reverse path are identical.Reserved field is reserved field, is usually arranged as
0.Unused field temporarily without limitation, can extend for follow-up business and be used, be usually arranged as 0.
When bandwidth response message is UDP type message, the format of the payload of UDP type message is as shown in table 2:
Table 2
Wherein, the type field is set as 2, indicates that the message is bandwidth response message.Code field is for indicating router A
The bandwidth types of request, if Code field is 0, what router A was requested is the bandwidth of forward path;If Code field is 1,
What router A was requested is the bandwidth of reverse path.Out Interface Number field indicates the next-hop routing of router
The number of device.Reserved field is reserved field, is usually arranged as 0.
Optionally, Port ID1-Port IDn field is outgoing interface device numbering, when the next-hop of router has multiple set
When standby, they can be numbered, outgoing interface number field occupies two bytes as can be seen from Table 2, than directly returning
The IP address for returning multiple next-hop outgoing interfaces saves data space.Specifically, in the present embodiment, outgoing interface equipment is exactly to turn
Send out the next hop router of equipment.Utilization field be outgoing interface bandwidth availability ratio, value range be 0 to 100 it
Between, indicate the bandwidth availability ratio of some outgoing interface, i.e., the bandwidth that business datum occupies the outgoing interface accounts for the outgoing interface band width in physical
Ratio.Bandwidth Size field is amount of bandwidth, indicates some outgoing interface band width in physical.
In the present embodiment, source IP address is the IP address of router A, and purpose IP address is the IP address of router D,
Code field is 0, and source port number and destination slogan are both configured to 30000.
Specific bandwidth detection process is as follows:
Router A sends the first bandwidth request message of TTL=1 to router B, and router B receives router A transmission
After first bandwidth request message, the value of TTL is subtracted one, finds TTL-1=0, and judge that purpose IP address is not local IP address;
Due to TTL-1=0, so router B abandons the message and searches routing table, the bandwidth of all next hop routers is obtained, is sealed
Router A is sent in bandwidth response message.
After router A receives the bandwidth response message of router B transmission, judges the IP address of router B, it is found that it is not
Purpose end equipment, then store router B IP address and router B to each next hop router bandwidth;Then road
The first bandwidth request message of TTL=2 is sent from device A to router B.
After router B receives the first bandwidth request message of router A transmission, subtract one to the value of TTL, discovery TTL-1 is not
It is 0, routing table is then searched according to the purpose IP address in the first bandwidth request message, determines its next hop router C, and will
First bandwidth request message is transmitted to next hop router C.
After router C receives the first bandwidth request message of router B transmission, subtract one to the value of TTL, finds TTL-1=
0, and judge that purpose IP address is not local IP address;Due to TTL-1=0, so router C abandons the message, and road is searched
By table, the bandwidth of all next-hop outgoing interfaces is obtained, is encapsulated in bandwidth response message, router A is sent to.
After router A receives the bandwidth response message of router C transmission, judges the IP address of router C, it is found that it is not
Purpose end equipment, then store router C IP address and router C to each next hop router bandwidth;Then road
The first bandwidth request message of TTL=3 is sent from device A to router B.
After router B receives the first bandwidth request message of router A transmission, subtract one to the value of TTL, at this time TTL=2,
It is not 0, routing table is then searched according to the purpose IP address in the first bandwidth request message, determines its next hop router C,
And the first bandwidth request message is sent to next hop router C.
After router C receives the first bandwidth request message of router B transmission, subtract one to the value of TTL, at this time TTL=1,
It is not 0, routing table is then searched according to the purpose IP address in the first bandwidth request message, determines its next hop router D,
And the first bandwidth request message is sent to next hop router D.
After router D receives the first bandwidth request message of router C transmission, subtract one to the value of TTL, find TTL=0,
And judge that purpose IP address is exactly local IP address;Due to TTL=0, so router D abandons the message, and routing table is searched,
The bandwidth for obtaining all next-hop outgoing interfaces, is encapsulated in bandwidth response message, is sent to router A.
After router A receives the bandwidth response message of purpose end equipment router D transmission, it is found that the bandwidth response message is
What purpose end equipment was sent, then judge that the first bandwidth request message has arrived at purpose end equipment, then stops sending first band
Wide request message.So far, router A obtains all bandwidth on the network link between router A and router D, thus
The bandwidth bottleneck on network link can be judged according to each bandwidth for jumping forwarding device.
Again illustrative, in network link as shown in Figure 3, source equipment is A, and purpose end equipment is D, this sentences source
End equipment, forwarding device are all router and bandwidth request message is UDP type message, bandwidth response message be ICMP type message into
Row explanation.
Bandwidth request message and bandwidth response message all include head and payload, include source IP address in head, destination IP
Location and TTL.The bandwidth response message of ICMP type is also packaged in IP data packet, wherein UDP type bandwidth request message with it is upper
State identical described in embodiment, the payload of ICMP type bandwidth response message newly defines.
Illustratively, the format of the payload of the bandwidth response message of ICMP type is as shown in table 3:
Table 3
Wherein, the type field indicates the type of ICMP timeout packet, identical as the type field in existing icmp packet.
Code field indicates the type code of ICMP timeout packet, and in the prior art, Code=0 indicates that life cycle is during transmission
0, Code=1 indicates that life cycle is 0 during datagram assembling, and the present invention defines raw during Code=2 expression obtains bandwidth
Cycle of deposit is 0, therefore, in embodiments of the present invention, Code=2.Bandwidth Size field is amount of bandwidth, indicates routing
Bandwidth between device and any one next hop router.
In the present embodiment, source IP address is the IP address of router A, and purpose IP address is the IP address of router D.
The specific bandwidth detection process and the source equipment of above-described embodiment, forwarding device of the present embodiment are all router
And bandwidth response message is identical for the detection process of UDP type message, difference is that the bandwidth response message of the present embodiment is ICMP
Type message, the bandwidth carried in bandwidth response message are the bandwidth between router and any one next hop router, and
It is not the bandwidth that the bandwidth carried as UDP type bandwidth response message is some router Yu its each next hop router.
Preferably, the bandwidth that ICMP type message returns can be the most small band between router and all next hop routers
It is wide.
The present invention provides a kind of method of detection bandwidth, receives source equipment by forwarding device and sends the first bandwidth request
Message, and to source equipment transmission bandwidth response message, wherein bandwidth response message includes the IP address and band of forwarding device
Width, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.With this solution, due to forwarding device energy
Enough to source equipment transmission bandwidth response message, so that source equipment passes through bandwidth response Receive message source equipment to destination
The bandwidth of all forwarding devices between equipment obtains between source equipment and purpose end equipment in such a way that message transmits
Bandwidth, additional bandwidth will not be occupied.Therefore, when can solve through double-end monitor method detection bandwidth, extra band is occupied
Wide problem, can quick detection bandwidth, and will not influence normal data transmission on network.
Embodiment three
The embodiment of the present invention provides a kind of source equipment, is illustrated in figure 4 the structural schematic diagram of the source equipment, comprising:
Sending module 10, for sending the first bandwidth request message, the purpose of the first bandwidth request message to forwarding device
IP address is the IP address of purpose end equipment.
Receiving module 11, for receiving the bandwidth response message of forwarding device transmission, wherein bandwidth response message includes turning
Send out the IP address and bandwidth of equipment, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.
Execution module 12 is used for memory bandwidth, and generates the second bandwidth request message, the TTL of the second bandwidth request message
Value it is bigger by one than the value of the TTL of the first bandwidth request message.
It should be noted that the first bandwidth request message and the second bandwidth request message are UDP type message, UDP type message
Including specific first end slogan, specific first end slogan is bandwidth request message for forwarding device identification UDP type message,
Or first bandwidth request message and the second bandwidth request message be TCP type message, TCP type message includes specific second port
Number, specific second end slogan is bandwidth request message for forwarding device identification TCP type message.
If bandwidth response message is UDP type message, UDP type message includes specific third port number, specific third
Port numbers are bandwidth response message for source equipment identification UDP type message;If bandwidth response message is TCP type message, TCP
Type message includes specific 4th port numbers, and specific 4th port numbers are rung for source equipment identification TCP type message for bandwidth
Answer message.
The embodiment of the present invention provides a kind of source equipment, which sends the first bandwidth request message to forwarding device
Carry out the bandwidth between detection source end equipment and purpose end equipment, which receives the bandwidth response report that forwarding device is sent
Text judges whether the forwarding device is purpose end equipment.When forwarding device is not purpose end equipment, the source equipment storage tape
Bandwidth in wide response message, and the second bandwidth request message is generated, the value of the TTL of the second bandwidth request message is than the first bandwidth
The value of the TTL of request message is big by one;When forwarding device is purpose end equipment, which obtains purpose end equipment and source
The bandwidth of equipment room.With this solution, since source equipment can pass through bandwidth response Receive message source equipment to destination
The bandwidth of all forwarding devices between equipment obtains between source equipment and purpose end equipment in such a way that message transmits
Bandwidth, additional bandwidth will not be occupied.Therefore, when can solve through double-end monitor method detection bandwidth, extra band is occupied
Wide problem, and can quick detection bandwidth, and will not influence normal data transmission on network.
Example IV
The embodiment of the present invention provides a kind of forwarding device, is illustrated in figure 5 the structural schematic diagram of the forwarding device, comprising:
Receiving module 20, for receiving the first bandwidth request message of source equipment transmission, the first bandwidth request message
IP address is the IP address of purpose end equipment, and the value of the TTL of the first bandwidth request message is equal to one, the first bandwidth request message packet
Include specific first end slogan or specific second end slogan.
When first bandwidth request message is UDP type message, UDP type message includes specific first end slogan, and specific the
One end slogan is bandwidth request message for forwarding device identification UDP type message or the first bandwidth request message is TCP type report
Wen Shi, TCP type message include specific second end slogan, and specific second end slogan identifies TCP type message for forwarding device
For bandwidth request message.
Confirmation module 21, for confirming the first bandwidth according to specific first end slogan or specific second end slogan
Request message is bandwidth request message.
Sending module 22 is used for source equipment transmission bandwidth response message, wherein bandwidth response message includes that forwarding is set
Standby IP address and bandwidth, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.
It should be noted that if bandwidth response message is UDP type message, then UDP type message includes specific third port
Number, specific third port number is bandwidth response message for source equipment identification UDP type message;If bandwidth response message is
TCP type message, then TCP type message includes specific 4th port numbers, and specific 4th port numbers identify TCP for source equipment
Type message is bandwidth response message.
A kind of forwarding device provided in an embodiment of the present invention, the forwarding device receive the first bandwidth that source equipment is sent and ask
Seek message, and to source equipment transmission bandwidth response message, wherein bandwidth response message includes the IP address and band of forwarding device
Width, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.With this solution, due to forwarding device energy
Enough to source equipment transmission bandwidth response message, so that source equipment passes through bandwidth response Receive message source equipment to destination
The bandwidth of all forwarding devices between equipment obtains between source equipment and purpose end equipment in such a way that message transmits
Bandwidth, additional bandwidth will not be occupied.Therefore, when can solve through double-end monitor method detection bandwidth, extra band is occupied
Wide problem, and can quick detection bandwidth, and will not influence normal data transmission on network.
Embodiment five
As shown in fig. 6, the embodiment of the present invention provides a kind of source equipment, which may include: 30 He of processor
Communication interface 31.
Processor 30 can be central processing unit (English: central processing unit, abbreviation: CPU) or network
Processor (English: network processor, abbreviation: NP).
If processor 30 is CPU, which further includes memory 32, for storing program code, and by the journey
Sequence code transfer gives the processor 30, and processor 30 is executed instruction according to program code.Memory 32 may include that volatibility is deposited
Reservoir (English: volatile memory), such as random access memory (English: random-access memory, abbreviation:
RAM);Memory 32 also may include nonvolatile memory (English: non-volatile memory), such as read-only storage
Device (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English:
Hard disk drive, abbreviation: HDD) or solid state hard disk (English: solid-state drive, abbreviation: SSD);Memory 32
It can also include the combination of the memory of mentioned kind.It is total by system between processor 30, memory 32 and communication interface 31
Line 33 connects and completes mutual communication.
Communication interface 31 can be by optical transceiver, electric transceiver, wireless transceiver or any combination thereof realization.For example, light
Transceiver can be Small Form-Factor Pluggable (English: small form-factor pluggable transceiver, abbreviation:
SFP) transceiver (English: transceiver), enhancing Small Form-Factor Pluggable (English: enhanced small form-factor
Pluggable, abbreviation: SFP+) transceiver or 10 gigabit Small Form-Factor Pluggables (English: 10 Gigabit small form-
Factor pluggable, abbreviation: XFP) transceiver.Electric transceiver can be Ethernet (English: Ethernet) network interface
Controller (English: network interface controller, abbreviation: NIC).Wireless transceiver can be wireless network and connect
Mouth controller (English: wireless network interface controller, abbreviation: WNIC).
Specifically, the processor 30, for sending the first bandwidth request message to forwarding device by communication interface 31,
The purpose IP address of first bandwidth request message is the IP address of purpose end equipment.The processor 30, is also used to pass through communication
Interface 31 receive forwarding device send bandwidth response message, wherein bandwidth response message include forwarding device IP address and
Bandwidth, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device;The processor 30, is also used to obtain
The bandwidth of purpose end equipment and source equipment room;The processor 30 is also used to for bandwidth being stored in memory 32, and generates
The value of second bandwidth request message, the TTL of the second bandwidth request message is bigger by one than the value of the TTL of the first bandwidth request message.
The bandwidth and control processor 30 that the memory 32 is used in memory bandwidth response message complete the above process
Software program, so that processor 30 completes the above process by executing the software program.
It should be noted that the first bandwidth request message and the second bandwidth request message are User Datagram Protocol UDP type
Message, UDP type message include specific first end slogan, and specific first end slogan identifies UDP type message for forwarding device
It is transmission control protocol TCP type message for bandwidth request message or the first bandwidth request message and the second bandwidth request message,
TCP type message includes specific second end slogan, and specific second end slogan is bandwidth for forwarding device identification TCP type message
Request message.
If bandwidth response message is UDP type message, UDP type message includes specific third port number, specific third
Port numbers are bandwidth response message for source equipment identification UDP type message;If bandwidth response message is TCP type message, TCP
Type message includes specific 4th port numbers, and specific 4th port numbers are rung for source equipment identification TCP type message for bandwidth
Answer message.
A kind of source equipment provided in an embodiment of the present invention sends the first bandwidth request to forwarding device by source equipment
Message carrys out the bandwidth between detection source end equipment and purpose end equipment, and source equipment receives the bandwidth response report that forwarding device is sent
Text judges whether the forwarding device is purpose end equipment.When forwarding device is not purpose end equipment, source equipment memory bandwidth
Bandwidth in response message, and the second bandwidth request message is generated, the value of the TTL of the second bandwidth request message is asked than the first bandwidth
Ask the value of the TTL of message big by one;When forwarding device is purpose end equipment, source equipment obtains purpose end equipment and source equipment
Between bandwidth.With this solution, since source equipment can pass through bandwidth response Receive message source equipment to purpose end equipment
Between all forwarding devices bandwidth, i.e., obtain band between source equipment and purpose end equipment in such a way that message transmits
Width will not occupy additional bandwidth.Therefore, when can solve through double-end monitor method detection bandwidth, extra bandwidth is occupied
Problem, and can quick detection bandwidth, and will not influence normal data transmission on network.
Embodiment six
As shown in fig. 7, the embodiment of the present invention provides a kind of forwarding device, which may include: 40 He of processor
Communication interface 41.
Processor 40 can be CPU or NP.
If processor 40 is CPU, which further includes memory 42 and hardware chip 43.Wherein, memory
42 are transferred to the processor 40 for storing program code, and by the program code, and processor 40 refers to according to program code execution
It enables.Memory 42 may include volatile memory, such as RAM;Memory 42 also may include nonvolatile memory, such as
ROM, flash memory, HDD or SSD;Memory 42 can also include the combination of the memory of mentioned kind.Processor 40 is deposited
It connects by system bus 43 between reservoir 42 and communication interface 41 and completes mutual communication.
Communication interface 41 can be by optical transceiver, electric transceiver, wireless transceiver or any combination thereof realization.For example, light
Transceiver can be SFP transceiver, SFP+ transceiver or XFP transceiver.Electric transceiver can be Ethernet NIC.Wireless receiving and dispatching
Device can be WNIC.
Specifically, hardware chip 43 is used to receive the first bandwidth request report that source equipment is sent by communication interface 41
Text, the purpose IP address of the first bandwidth request message are the IP address of purpose end equipment, and according to the first bandwidth request message
Port numbers confirm that the first bandwidth request message is bandwidth request message, when the value of the TTL of the first bandwidth request message is not equal to
For the moment, 43 down hop forwarding device of hardware chip forwards the bandwidth request message, when the value of the TTL of the first bandwidth request message
Equal to for the moment, hardware chip 43 forwards the bandwidth request message to CPU;Processor 40 is also used to as TTL-1=0, by logical
Believe interface 42 to source equipment transmission bandwidth response message, wherein bandwidth response message includes the IP address and band of forwarding device
Width, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.
It should be noted that the first bandwidth request message is User Datagram Protocol UDP type message, the UDP type message
Including the specific first end slogan, the specific first end slogan identifies the UDP type report for the forwarding device
Text is bandwidth request message or the first bandwidth request message is transmission control protocol TCP type message, the TCP type report
Text includes the specific second end slogan, and the specific second end slogan identifies the TCP type for the forwarding device
Message is bandwidth request message.
It should be noted that if bandwidth response message is UDP type message, then UDP type message includes specific third port
Number, specific third port number is bandwidth response message for source equipment identification UDP type message;If bandwidth response message is
TCP type message, then TCP type message includes specific 4th port numbers, and specific 4th port numbers identify TCP for source equipment
Type message is bandwidth response message.
When the forwarding device includes NP, NP can complete CPU, memory and hardware chip in the present embodiment all
Function, details are not described herein.
A kind of forwarding device provided in an embodiment of the present invention receives the first bandwidth that source equipment is sent by forwarding device
Request message, and to source equipment transmission bandwidth response message, wherein bandwidth response message include forwarding device IP address and
Bandwidth, bandwidth of the bandwidth between forwarding device and the next-hop forwarding device of forwarding device.With this solution, due to forwarding device
It can be to source equipment transmission bandwidth response message, so that source equipment passes through bandwidth response Receive message source equipment to purpose
The bandwidth of all forwarding devices between end equipment, i.e., obtained in such a way that message transmits source equipment and purpose end equipment it
Between bandwidth, additional bandwidth will not be occupied.Therefore, it when can solve through double-end monitor method detection bandwidth, occupies additional
The problem of bandwidth, and can quick detection bandwidth, and will not influence normal data transmission on network.
Embodiment seven
The embodiment of the present invention provides a kind of system of detection bandwidth.
Specifically, the system of the detection bandwidth includes the source equipment as described in embodiment three and multiple such as example IVs
Described in forwarding device or the detection bandwidth system include the source equipment as described in embodiment five and it is multiple strictly according to the facts
Apply forwarding device described in example six.
Illustratively, the networking mode of the system of the detection bandwidth can be as shown in Figure 8.
A kind of system of detection bandwidth provided in an embodiment of the present invention sends first band to forwarding device by source equipment
Wide request message, and the bandwidth response message of forwarding device transmission is received, when forwarding device is not purpose end equipment, source is set
Bandwidth in standby memory bandwidth response message, and generate the second bandwidth request message, the value ratio of the TTL of the second bandwidth request message
The value of the TTL of first bandwidth request message is big by one;When forwarding device when purpose end equipment, source equipment obtains purpose end equipment
With the bandwidth of source equipment room.With this solution, since source equipment can be arrived by bandwidth response Receive message source equipment
The bandwidth of all forwarding devices between purpose end equipment obtains source equipment in such a way that message transmits and sets with destination
Bandwidth between standby, will not occupy additional bandwidth.Therefore, it when can solve through double-end monitor method detection bandwidth, occupies
The problem of extra bandwidth, and can quick detection bandwidth, and will not influence normal data transmission on network.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, and so that corresponding technical solution is departed from the scope of the technical solutions of the embodiments of the present invention.