Summary of the invention
The embodiment of the present invention provides a kind of bandwidth detection method and apparatus, accurately to detect transmitting terminal network
The actual bandwidth value in path between equipment and the receiving terminal network equipment.
In order to achieve the above object, the embodiment of the present invention provides a kind of bandwidth detection method, is applied to include
In the network of the transmitting terminal network equipment and the receiving terminal network equipment, the method comprises the following steps:
The described transmitting terminal network equipment is sent out to the receiving terminal network equipment utilizing pre-configured queuing scheduling mechanism
Deliver newspaper literary composition time, it is judged that whether service message queue has service message;If it is, by service message team
Service message in row adds hardware queue to;If it is not, then by the test packet in test packet queue
Add hardware queue to;
Service message in hardware queue and/or test packet are sent to described by the described transmitting terminal network equipment
The receiving terminal network equipment, is utilized the service message and/or test packet received by the described receiving terminal network equipment
The actual bandwidth value in path between the detection transmitting terminal network equipment and the receiving terminal network equipment.
First order queuing scheduling mechanism, second level queue scheduling machine it is configured with on the described transmitting terminal network equipment
System;Described first order queuing scheduling mechanism is used for making described transmitting terminal network equipment Schedule Quality QoS
Service message in queue, adds the service message in described QoS queue to service message queue;
Described second level queuing scheduling mechanism is used for making the described transmitting terminal network equipment dispatch service message queue
In service message or test packet in scheduling tests message queue, this scheduling process is judgement business
Whether message queue there is service message;If it is, the service message in service message queue is added
To hardware queue;If it is not, then add the test packet in test packet queue to hardware queue.
The described transmitting terminal network equipment adds the test packet in test packet queue to hardware queue, tool
Body includes: the described transmitting terminal network equipment is adding the service message in service message queue to hardware team
After row, determine first rate when service message is added to hardware queue;
The described transmitting terminal network equipment utilizes renting between the transmitting terminal network equipment and the receiving terminal network equipment
Bandwidth and described first rate determine the second speed, and utilize described second speed by test packet queue
In test packet add hardware queue to;Wherein, described second speed is particularly as follows: rent bandwidth described in (
-described first rate) × (1+x%), described x is default value.
Service message in hardware queue and/or test packet are sent to described by the described transmitting terminal network equipment
The receiving terminal network equipment, the most also includes: if the transmitting terminal network equipment is sent to the receiving terminal network equipment
Service message there is loss situation, the most described transmitting terminal network equipment reduce by test packet queue
Test packet adds the speed of hardware queue to, and utilizes the speed after reduction by test packet queue
Test packet adds hardware queue to.
The source IP address of described test packet is the IP address of the described transmitting terminal network equipment, described test report
The IP address that purpose IP address is the described receiving terminal network equipment of literary composition, and described test packet is provided with
Low message priority.
The embodiment of the present invention provides a kind of transmitting terminal network equipment, is applied to include that described transmitting terminal network sets
In the standby network with the receiving terminal network equipment, the described transmitting terminal network equipment specifically includes:
Judge module, for utilizing pre-configured queuing scheduling mechanism to set to described receiving terminal network needing
Preparation deliver newspaper literary composition time, it is judged that whether service message queue has service message;
Processing module, for when judged result is for being, adds the service message in service message queue
To hardware queue;Otherwise, the test packet in test packet queue is added to hardware queue;
Sending module, for being sent to described reception by the service message in hardware queue and/or test packet
The end network equipment, is utilized the service message received and/or test packet detection by the described receiving terminal network equipment
The actual bandwidth value in path between the transmitting terminal network equipment and the receiving terminal network equipment.
First order queuing scheduling mechanism, second level queue scheduling machine it is configured with on the described transmitting terminal network equipment
System;Described first order queuing scheduling mechanism is used for making described transmitting terminal network equipment Schedule Quality QoS
Service message in queue, adds the service message in described QoS queue to service message queue;
Described second level queuing scheduling mechanism is used for making the described transmitting terminal network equipment dispatch service message queue
In service message or test packet in scheduling tests message queue, this scheduling process is judgement business
Whether message queue there is service message;If it is, the service message in service message queue is added
To hardware queue;If it is not, then add the test packet in test packet queue to hardware queue.
Described processing module, specifically for adding the service message in service message queue to hardware team
After row, determine first rate when service message is added to hardware queue;Utilize the transmitting terminal network equipment
And between the receiving terminal network equipment rent bandwidth and described first rate determines the second speed, and utilize institute
State the second speed and add the test packet in test packet queue to hardware queue;Wherein, described second
Speed is particularly as follows: rent bandwidth-described first rate described in () × (1+x%), described x is default value.
Described processing module, is additionally operable to when the transmitting terminal network equipment is sent to the business of the receiving terminal network equipment
When message exists loss situation, reduce and add the test packet in test packet queue to hardware queue
Speed, and utilize the speed after reduction to add the test packet in test packet queue to hardware queue.
The source IP address of described test packet is the IP address of the transmitting terminal network equipment, described test packet
Purpose IP address is the IP address of the described receiving terminal network equipment, and described test packet is provided with minimum report
Literary composition priority.
Compared with prior art, the embodiment of the present invention at least has the advantage that in the embodiment of the present invention,
When crossing over operator's complex network between the transmitting terminal network equipment and the receiving terminal network equipment, for renting
The situation of operator's IP special line, the receiving terminal network equipment can be by the service message received and/or test report
The actual bandwidth value in path between the literary composition detection transmitting terminal network equipment and the receiving terminal network equipment, and can be accurate
Really detect the actual bandwidth value in path between the transmitting terminal network equipment and the receiving terminal network equipment.
Detailed description of the invention
For problems of the prior art, the embodiment of the present invention provides a kind of bandwidth detection method, should
Method is applied to include in the network of the transmitting terminal network equipment and the receiving terminal network equipment, with Fig. 1 as the present invention
The application scenarios schematic diagram of embodiment, under the application scenarios renting operator's IP special line, transmitting terminal network sets
Standby can be user gateway 1, and the receiving terminal network equipment can be user gateway 2.
As in figure 2 it is shown, in the embodiment of the present invention, in order to accurately detect the transmitting terminal network equipment and receiving terminal
The actual bandwidth value in path between the network equipment, in QoS(Quality of Service, service quality) team
After row scheduling, before hardware queue is dispatched, increasing one-level queuing scheduling mechanism, input rank is respectively
For service message queue (for record traffic message) and test packet queue (being used for recording test packet).
The network equipment is in order to be effectively matched LAN(Local Area Network, LAN) and WAN(Wide
Area Network, wide area network) greatest differences of bandwidth, interface all can use queue scheduling and congested
Management technique, to realize the differentiated services to service with different priority levels, i.e. QoS technology;In QoS technology,
The network equipment needs service message to be sent on outgoing interface is sent into QoS queue;Afterwards, network equipment profit
(such as CBWFQ(Class Based Weighted Fair Queuing, based on type add by dispatching algorithm
Power Fair Queue) queue scheduling algorithm etc.) service message in QoS queue is scheduling, and by business
Message adds in hardware queue, sends the service message in hardware queue afterwards.
Based on said process, in the embodiment of the present invention, need to increase industry between QoS queue and hardware queue
Business message queue, in this service message queue, the service message of input is the service message of QoS queue output.
In the embodiment of the present invention, in addition it is also necessary to increased test packet queue, this test report before hardware queue
In literary composition queue, the test packet of input is that the network equipment itself automatically generates, and test packet typically can be arranged
For parcel (i.e. message size is less than the message of default value), and the source IP address of test packet is transmitting terminal
The IP address of the network equipment, the IP address that purpose IP address is the receiving terminal network equipment of test packet, and be
Avoiding service message is produced competitive influence, test packet needs to be set to minimum message priority.
In sum, in the embodiment of the present invention, the transmitting terminal network equipment is configured with first order queue scheduling
Mechanism, second level queuing scheduling mechanism;This first order queuing scheduling mechanism is used for making the transmitting terminal network equipment
Service message in scheduling QoS queue, adds the service message in QoS queue to service message queue;
This second level queuing scheduling mechanism is for making the business report in the scheduling service message queue of the transmitting terminal network equipment
Test packet in literary composition or scheduling tests message queue, by the service message in service message queue or
Test packet in scheduling tests message queue adds hardware queue to.
In the embodiment of the present invention, in above-mentioned service message queue, the speed of incoming traffic message will be based on QoS
The speed of queue outgoing traffic message;Such as: when the speed of QoS queue outgoing traffic message is 8M,
In service message queue, the speed of incoming traffic message is 8M.Additionally, above-mentioned test packet queue inputs
The speed of test packet by based on renting bandwidth between the transmitting terminal network equipment and the receiving terminal network equipment,
And the speed of input test message in test packet queue is set by configuring token bucket rate;Such as: when
When renting between the transmitting terminal network equipment and the receiving terminal network equipment carries a width of 10M, can be by configuring order
It is 10M that board bucket speed arranges the speed of input test message in test packet queue.
Based on service message queue and test packet queue, detailed to second level queuing scheduling mechanism below
Processing procedure is illustrated, as it is shown on figure 3, the method comprises the following steps:
Step 301, the transmitting terminal network equipment is when sending message to the receiving terminal network equipment, it is judged that epicycle report
Whether literary composition scheduling process terminates;If it does not, perform step 302;Otherwise, step 305 is performed.
Step 302, the transmitting terminal network equipment judges whether have service message in service message queue;If it is,
Then perform step 303;Otherwise, step 304 is performed.
Step 303, the transmitting terminal network equipment adds the service message in service message queue to hardware team
Row;After this step terminates, continue executing with step 301.
Step 304, the transmitting terminal network equipment adds the test packet in test packet queue to hardware team
Row;After this step terminates, continue executing with step 301.
Wherein, the scheduling process that the process of above-mentioned steps 301-step 304 is second level queuing scheduling mechanism.
Step 305, the service message in hardware queue and/or test packet are sent by the transmitting terminal network equipment
To the receiving terminal network equipment;I.e. the transmitting terminal network equipment is by renting operator's IP special line by hardware queue
Service message and/or test packet be sent to the receiving terminal network equipment.
In the embodiment of the present invention, above-mentioned hardware queue is specifically including but not limited to: FIFO(First Input First
Output, FIFO) queue.
In the embodiment of the present invention, the scheduling mechanism of the transmitting terminal network equipment is: as long as in service message queue
Have service message, then the transmitting terminal network equipment needs to dispatch the service message in service message queue;Work as industry
When business message queue does not has service message (i.e. service message queue is sky), then the transmitting terminal network equipment
Need the test packet in scheduling tests message queue;Additionally, for test packet queue is not adjusted
The test packet of degree, then the transmitting terminal network equipment can directly abandon this test packet.
Based on this, the transmitting terminal network equipment dispatching service message or during test packet, need based on to
The speed of incoming message and the size of message in hardware queue, during determining epicycle dispatching message
Scheduling times, such as scheduling times per second;Assume that scheduling times per second is 10000, then this 10000
In secondary scheduling process, it is judged that result is epicycle dispatching message process and is not over, perform step 302
And subsequent step;When dispatching for 10001 times, it is judged that result is that epicycle dispatching message process terminates, perform
Step 305, and proceed next round dispatching message process, subsequent treatment repeats no more.
Such as, need according to 10M speed incoming message in hardware queue, industry when the transmitting terminal network equipment
In business message queue, the speed of incoming traffic message is 8M, the speed of input test message in test packet queue
When rate is 10M, for the scheduling process of epicycle message, before input during the message of 8M speed, send
The end network equipment determines in service message queue have service message, it is therefore desirable to by service message queue
Service message adds hardware queue to;After input during the message of 2M speed, the transmitting terminal network equipment determines
Service message queue do not has service message, it is therefore desirable to added by the test packet in test packet queue
To hardware queue.Based on this, the transmitting terminal network equipment is by the service message in hardware queue and test packet
It is sent to the receiving terminal network equipment.
The most such as, when the transmitting terminal network equipment needs according to 10M speed incoming message in hardware queue,
In service message queue, the speed of incoming traffic message is 10M, input test message in test packet queue
Speed when being 10M, for epicycle dispatching message process, when inputting the message of 10M speed, send
The end network equipment determines in service message queue have service message, it is therefore desirable to by service message queue
Service message adds hardware queue to;Based on this, the transmitting terminal network equipment is by the business report in hardware queue
Literary composition is sent to the receiving terminal network equipment.
The most such as, when the transmitting terminal network equipment needs according to 10M speed incoming message in hardware queue,
In service message queue, the speed of incoming traffic message is 0M, input test message in test packet queue
When speed is 10M, for epicycle dispatching message process, when inputting the message of 10M speed, transmitting terminal
The network equipment determines in service message queue do not have service message, it is therefore desirable to by test packet queue
Test packet adds hardware queue to;Based on this, the transmitting terminal network equipment is by the test report in hardware queue
Literary composition is sent to the receiving terminal network equipment.
Based on above-mentioned analysis, in a kind of preferred implementation of the embodiment of the present invention, transmitting terminal network sets
Standby after adding the service message in service message queue to hardware queue, it may be determined that to go out business
Message adds first rate during hardware queue to;Such as, incoming traffic message in service message queue
When speed is 8M, then first rate when service message adds to hardware queue is 8M.
Afterwards, the transmitting terminal network equipment utilizes the rent between the transmitting terminal network equipment and the receiving terminal network equipment
The second speed is determined with bandwidth and first rate;Wherein, this second speed particularly as follows: (rent bandwidth-
First rate) × (1+x%), x is the default value more than or equal to 0;For example, it is assumed that x is 0, send out
Renting between the sending end network equipment and the receiving terminal network equipment carries a width of 10M, then the second speed is 2M.
It should be noted that the reason that x is set greater than the default value equal to 0 is: ensure to send
The end network equipment sends the speed of message more than or equal to renting bandwidth, to avoid the transmitting terminal network equipment to send
The speed of message is less than when renting bandwidth, it is impossible to accurately detect the transmitting terminal network equipment and receiving terminal network
The actual bandwidth value in path between equipment;Generally, x can be set and be equal to 0, now transmitting terminal net
Network equipment sends the speed of message and it is contemplated that the impact such as network jitter, will send equal to renting bandwidth
The end network equipment there will be packet drop when sending message, therefore can arrange x and be more than 0, to protect further
The card transmitting terminal network equipment sends the speed of message can be more than or equal to renting bandwidth.
Afterwards, the transmitting terminal network equipment utilizes the second speed to be added by the test packet in test packet queue
To hardware queue;Such as, when the second speed is 2M, the transmitting terminal network equipment is by test packet queue
Test packet to add the speed of hardware queue to be 2M;Additionally, in test packet queue not by
Adding the test packet of hardware queue to, the transmitting terminal network equipment directly abandons this test packet.
Step 306, the receiving terminal network equipment utilizes the service message received and/or test packet detection to send
The actual bandwidth value in path between the end network equipment and the receiving terminal network equipment.
Concrete, the receiving terminal network equipment is in the service message received from the transmitting terminal network equipment and/or survey
After examination message, utilize the service message received and/or the test packet detection transmitting terminal network equipment and receiving terminal
The actual bandwidth value in path between the network equipment, i.e. utilizing the source IP address actually received is transmitting terminal network
The uninterrupted of the message of equipment determines the reality in path between the transmitting terminal network equipment and the receiving terminal network equipment
Border bandwidth value;Further, the receiving terminal network equipment also needs to from the service message received and/or test report
Literary composition is distinguished service message and test packet;For service message, the receiving terminal network equipment need according to
Normal flow processes service message;For test packet, the receiving terminal network equipment needs to abandon test packet.
In view of operator give user can QoS priority limited, although test packet is set to
Low message priority, but it still is possible to the service message of same message priority brings interference and shadow
Ring;Based on this, in the embodiment of the present invention, the transmitting terminal network equipment by the service message in hardware queue and/
Or after test packet is sent to the receiving terminal network equipment, if sent by comparing the transmitting terminal network equipment
The uninterrupted of service message and the receiving terminal network equipment receive the uninterrupted of service message, determine transmission
The end network equipment is sent to the service message of the receiving terminal network equipment and there is loss situation, then transmitting terminal network
Equipment also needs to reduce and the test packet in test packet queue adds to the speed of hardware queue (i.e. drops
Low second speed), and utilize the speed after reduction to add the test packet in test packet queue to hardware
Queue, to guarantee service message to be produced impact during detection actual bandwidth value.
In a preferred embodiment, this equipment is sent the flow of service message by the transmitting terminal network equipment
Size notifies to Network Management Equipment, and this equipment is received the uninterrupted of service message and leads to by the receiving terminal network equipment
Know to Network Management Equipment;Based on this, Network Management Equipment compares the transmitting terminal network equipment and sends the flow of service message
Size and the receiving terminal network equipment receive the uninterrupted of service message, determine that the transmitting terminal network equipment sends
Whether loss situation is there is to the service message of the receiving terminal network equipment, when there is loss situation, notice
The transmitting terminal network equipment reduces the speed that the test packet in test packet queue adds to hardware queue.
In sum, in the embodiment of the present invention, between the transmitting terminal network equipment and the receiving terminal network equipment
When crossing over operator's complex network, the receiving terminal network equipment can be by the service message received and/or test
The actual bandwidth value in path between the packet check transmitting terminal network equipment and the receiving terminal network equipment, and can
Accurately detect the actual bandwidth value in path between the transmitting terminal network equipment and the receiving terminal network equipment.
Based on the inventive concept as said method, the embodiment of the present invention additionally provides a kind of transmitting terminal
The network equipment, is applied to include in the network of the described transmitting terminal network equipment and the receiving terminal network equipment, as
Shown in Fig. 4, the described transmitting terminal network equipment specifically includes:
Judge module 11, for utilizing pre-configured queuing scheduling mechanism to described receiving terminal network needing
When equipment sends message, it is judged that whether service message queue has service message;
Processing module 12, for when judged result is for being, adds the service message in service message queue
It is added to hardware queue;Otherwise, the test packet in test packet queue is added to hardware queue;
Sending module 13, connects described in the service message in hardware queue and/or test packet being sent to
Recipient network equipment, is utilized the service message received and/or test packet inspection by the described receiving terminal network equipment
Survey the actual bandwidth value in path between the transmitting terminal network equipment and the receiving terminal network equipment.
In the embodiment of the present invention, the described transmitting terminal network equipment is configured with first order queuing scheduling mechanism,
Second level queuing scheduling mechanism;
Described first order queuing scheduling mechanism is used for making described transmitting terminal network equipment Schedule Quality QoS
Service message in queue, adds the service message in described QoS queue to service message queue;
Described second level queuing scheduling mechanism is used for making the described transmitting terminal network equipment dispatch service message queue
In service message or test packet in scheduling tests message queue, this scheduling process is judgement business
Whether message queue there is service message;If it is, the service message in service message queue is added
To hardware queue;If it is not, then add the test packet in test packet queue to hardware queue.
Described processing module 12, specifically for adding the service message in service message queue to hardware
After queue, determine first rate when service message is added to hardware queue;Transmitting terminal network is utilized to set
Between the standby and receiving terminal network equipment rent bandwidth and described first rate determines the second speed, utilize institute
State the second speed and add the test packet in test packet queue to hardware queue;Wherein, described second
Speed is particularly as follows: rent bandwidth-described first rate described in () × (1+x%), described x is default value.
Described processing module 12, is additionally operable to when the transmitting terminal network equipment is sent to the industry of the receiving terminal network equipment
When business message exists loss situation, reduce and add the test packet in test packet queue to hardware queue
Speed, and utilize the speed after reduction to add the test packet in test packet queue to hardware queue.
In the embodiment of the present invention, the source IP address of described test packet is the IP address of the transmitting terminal network equipment,
The purpose IP address of described test packet is the IP address of the described receiving terminal network equipment, and described test report
Literary composition is provided with minimum message priority.
Wherein, the modules of apparatus of the present invention can be integrated in one, it is also possible to separates and disposes.Above-mentioned
Module can merge into a module, it is also possible to is further split into multiple submodule.
Based on the inventive concept as said method, the embodiment of the present invention additionally provides a kind of receiving terminal
The network equipment, is applied to include in the network of the transmitting terminal network equipment and the described receiving terminal network equipment, as
Shown in Fig. 5, the described receiving terminal network equipment specifically includes:
Receiver module 21, for receiving the service message from the described transmitting terminal network equipment and/or test report
Literary composition;
Detection module 22, for utilizing the service message received and/or test packet detection transmitting terminal network to set
The actual bandwidth value in path between the standby and receiving terminal network equipment;
Processing module 23, for distinguish from the service message received and/or test packet service message and
Test packet, and process described service message, and abandon described test packet.
Wherein, the modules of apparatus of the present invention can be integrated in one, it is also possible to separates and disposes.Above-mentioned
Module can merge into a module, it is also possible to is further split into multiple submodule.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive this
Invention can add the mode of required general hardware platform by software and realize, naturally it is also possible to by firmly
Part, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the skill of the present invention
The part that prior art is contributed by art scheme the most in other words can be with the form body of software product
Revealing to come, this computer software product is stored in a storage medium, including some instructions in order to make
Obtain a computer equipment (can be personal computer, server, or the network equipment etc.) to perform
Method described in each embodiment of the present invention.
It will be appreciated by those skilled in the art that accompanying drawing is the schematic diagram of a preferred embodiment, in accompanying drawing
Module or flow process not necessarily implement necessary to the present invention.
It will be appreciated by those skilled in the art that the module in the device in embodiment can be retouched according to embodiment
State in the device carrying out being distributed in embodiment, it is also possible to carry out respective change and be disposed other than the present embodiment
One or more devices in.The module of above-described embodiment can merge into a module, it is also possible to enters
One step splits into multiple submodule.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
The several specific embodiments being only the present invention disclosed above, but, the present invention is not limited to
This, the changes that any person skilled in the art can think of all should fall into protection scope of the present invention.