Background technology
As shown in Figure 1, be the schematic diagram of a plurality of terminals by egress router visit Internet network, in the functional characteristic of enterprise router or Internet bar's router, can support QoS (Quality of Service, service quality), and QoS scheduling depend on link bandwidth (as the QoS scheduling strategy for reached when descending flow rate link bandwidth 80% the time, need restriction to send the speed of the message that takies higher bandwidth to the Internet network, pour in from the Internet network to avoid having high-speed message, cause link that situation about stopping up takes place), therefore in order to carry out the QoS scheduling, the link bandwidth of egress router need be set accurately; If link bandwidth arranges inaccurate, then carry out QoS when scheduling based on inaccurate link bandwidth, can the requirement of QoS scheduling strategy can't be satisfied, and serious packet loss can be caused, cause problem such as go offline then.
For example, with 10M bandwidth mistake be set as 100M the time, based on the QoS scheduling strategy, have only when descending flow rate reaches 80M, just can limit the speed that sends the message that takies higher bandwidth to the Internet network, and in fact when descending flow rate reaches 8M, just need send the speed of the message take higher bandwidth to the Internet network, obviously when downlink traffic speed has reached 8M, can't carry out the QoS scheduling strategy, and can cause serious packet loss.
For link bandwidth is set, all provide the band width configuration item on all egress router at present, fill in link bandwidth by the user, and it is very big to fill out the probability of cable chain road bandwidth; Its reason comprises: how many unclear true link bandwidths of (1) webmaster is, and uses default value (100M), and 100M is little for the physical link bandwidth ratio.(2) user is unfamiliar with the QoS configuration, thinks that link bandwidth is the peak transfer rate of network interface card.
In the prior art, for the link bandwidth of egress router is set, can tests the speed to test the speed in the website or download special URL (Uniform Resource Locator, URL(uniform resource locator)) by software and test the speed by special use.
When test the speed in the website of testing the speed by special use, browser on the user can open a terminal, and visit the disclosed server that tests the speed, and be telecommunications or Netcom under the IP address of the automatic sense terminals of server that tests the speed, provide the background server of correspondence to detect the iptimum speed of terminal automatically.Be illustrated in figure 2 as the speed measuring function execution result schematic diagram that 7999 websites provide.
When testing the speed by the special URL of software download, desktop software (as P2P terminator, 360 etc.) is by HTTP (Hyper Text Transfer Protocol, HTML (Hypertext Markup Language)), download the URL that sets and (be generally bigger file, download BaiduDS_setup_v2.exe file among the disk.baidu.com as the P2P terminator, 360 download the by name of speedtest.360.cn " 16m " file), can obtain speed by measuring consumed time.Be illustrated in figure 3 as 360 result schematic diagrams that test the speed.
But, when the technology that tests the speed in website that special use is tested the speed is applied to egress router, egress router need be analyzed the related content (way of submission that tests the speed as request etc.) of the server site that tests the speed, and test the speed based on the content that analysis obtains, rely on thereby can form the server site that tests the speed; Page layout is closed or adjusted to server site if test the speed, and then the content that can't obtain based on analysis again tests the speed, and cause speed measuring function to lose efficacy.
In the time will downloading technology that special URL tests the speed and be applied to egress router by software, the layout of the supplier of software correspondence to background server will be depended on, if background server only is arranged in Netcom's circuit or telecommunication line, the download of the URL information of announcing at supplier, when if outgoing access takes place, measuring the bandwidth of coming is not the true link bandwidth of egress router.
Summary of the invention
The invention provides a kind of detection method and equipment of link bandwidth, to detect the link bandwidth of egress router.
In order to achieve the above object, the invention provides a kind of detection method of link bandwidth, be used for the link bandwidth of egress router is detected, this method may further comprise the steps:
Described egress router sends the searching request of allocated resource by distributed gnutella network to the Internet network, and receives the response message that seed server that described allocated resource download service is provided in the Internet network is returned;
Described egress router is selected the high quality seed server from the seed server of returning response message, send the download request of described allocated resource to the high quality seed server of selecting, and receive the described allocated resource corresponding file that described high quality seed server returns;
Described egress router is determined link bandwidth according to the size of all allocated resource respective file that self port receives.
Described egress router is selected the high quality seed server from the seed server of returning response message, specifically comprise:
The time of the searching request of described egress router by sending allocated resource and the time that receives the response message that seed server returns are determined the response time of seed server;
Described egress router sorted to seed server according to the response time of each seed server, in the sequencer procedure, if the difference of the response time between two seed server is in the Preset Time scope, then seed server ordering that file is big is near a shortest side of response time;
It is the high quality seed server that described egress router is selected the seed server of default number since a shortest side of response time.
Described default number is determined by the size of actual allocated maximum bandwidth and described allocated resource respective file.
Described egress router sends the download request of described allocated resource to the high quality seed server of selecting, and specifically comprises:
Described egress router is that the downloading task of each allocated resource starts download thread, sends the process of the download request of described allocated resource to the high quality seed server of selecting by the concurrent execution of the download thread of each allocated resource.
Described egress router is determined link bandwidth according to the size of all allocated resource respective file that self port receives, and specifically comprises:
Described egress router is determined link bandwidth according to the file size of all resources that described port receives, and the file size of all resources comprises the size of all allocated resource respective file and the size of visiting the terminal access resource respective file of Internet network by described egress router.
The invention provides a kind of egress router, comprising:
The searching request sending module is used for by the searching request of distributed gnutella network to Internet network transmission allocated resource;
The response message receiver module, the response message that being used for receiving provides described allocated resource download service in the Internet network seed server is returned;
The high quality seed server is selected module, is used for selecting the high quality seed server from the seed server of returning response message;
The download request sending module is for the download request that sends described allocated resource to the high quality seed server of selecting;
The file receiver module is used for receiving the described allocated resource corresponding file that described high quality seed server returns;
The link bandwidth determination module, the size that is used for all allocated resource respective file of receiving according to self port is determined link bandwidth.
Described high quality seed server is selected module, and the concrete time that is used for the time of the searching request by sending allocated resource and receives the response message that seed server returns is determined the response time of seed server; Response time according to each seed server sorts to seed server, in the sequencer procedure, if the difference of the response time between two seed server is in the Preset Time scope, then seed server ordering that file is big is near a shortest side of response time; Selecting the seed server of default number since a shortest side of response time is the high quality seed server.
Described default number is determined by the size of actual allocated maximum bandwidth and described allocated resource respective file.
Described download request sending module specifically is used to the downloading task of each allocated resource to start download thread, sends the process of the download request of described allocated resource to the high quality seed server of selecting by the concurrent execution of the download thread of each allocated resource.
Described link bandwidth determination module, concrete file size for all resources that receive according to described port is determined link bandwidth, and the file size of all resources comprises the size of all allocated resource respective file and the size of visiting the terminal access resource respective file of Internet network by described egress router.
Compared with prior art, the present invention has the following advantages at least:
By producing instantaneous huge flow the link bandwidth that operator distributes to egress router is fully supported, and all data that physical port is received are added up, can truly reflect the link bandwidth of egress router; At utmost guarantee the link bandwidth accuracy, the scheduling accuracy of guaranteed qos makes Internet bar's online no longer go offline owing to link bandwidth arranges mistake.
Embodiment
The present invention proposes a kind of detection method of link bandwidth, and this method is used for the link bandwidth of egress router is detected, and below in conjunction with accompanying drawing, specific embodiments of the present invention is described in detail.Be the grid of reference illustraton of model with Fig. 1, as shown in Figure 4, this method comprises:
Step 401, egress router sends the searching request of allocated resource to the Internet network by distributed gnutella network, this allocated resource is for being fit to produce the resource of downloading flow, as (being LINUX distribution version based on * .avi, ubuntu, file is bigger, is used for seeking and swap file by the internet) and the resource of * .mp3 etc.
When egress router sends the searching request of allocated resource by distributed gnutella network, for the seed server that this allocated resource download service is provided in the Internet network, need return response message to egress router, carry the file size of allocated resource in this response message.For example, egress router sends the searching request of a.avi to the Internet network, the server that the a.avi download service is provided in the Internet network is seed server, and this seed server is returned the response message of the file size of carrying a.avi to egress router.
Concrete, gnutella is network exchange file software simply and easily, when egress router sends the searching request of allocated resource by distributed gnutella network to the Internet network, after server in the Internet network receives the searching request of this allocated resource, can judge whether self can provide the download service of this allocated resource, if, then certainly as seed server, return response message to egress router, and the searching request of this allocated resource continuous server to self is sent; Otherwise, directly the searching request of this allocated resource continuous server to self is sent; By that analogy, all receive the server of the searching request of allocated resource can judge all whether self can provide the download service of this allocated resource, and returns response message to egress router when being.
Step 402, the response message that egress router receives provides the allocated resource download service in the Internet network seed server is returned.Wherein, when receiving the response message that returns, the time of the searching request that egress router can be by sending allocated resource and the time that receives the response message that seed server returns are determined the response time of seed server.
Step 403, egress router are selected the high quality seed server from the seed server of returning response message.Wherein, egress router can sort to seed server according to the response time of each seed server, in sequencer procedure, if the difference of the response time between two seed server is in Preset Time scope (as 50ms), the ordering of seed server that file is big is near a shortest side of response time, and to select the seed server of default number since a shortest side of response time be the high quality seed server.
Concrete, said process can be realized by the mode of the Resources list, being egress router stores the relevant information (as the address (can know) of seed server, the response time of seed server, the file size of allocated resource etc.) of seed server in the Resources list into from response message, and seed server is sorted according to the response time of each seed server in the Resources list, selecting the seed server of default number according to ranking results since a shortest side of response time afterwards is the high quality seed server.When the response time improved successively from top to bottom as the Resources list, then beginning from the top of the Resources list to select the seed server of default number was the high quality seed server.
Among the present invention, default number can be determined by the size of actual allocated maximum bandwidth and allocated resource respective file.For example, the actual allocated maximum bandwidth is that the size of 100M, allocated resource respective file is when being 1M, then 100 files can take the maximum bandwidth of 100M as can be known, when determining that therefore default number is 100, can guarantee that file that 100 high quality seed servers return takes the maximum bandwidth of 100M.
And the link bandwidth of egress router can be less than the actual allocated maximum bandwidth, when therefore default number is 100, can guarantee that also the file that 100 high quality seed servers return takes the link bandwidth of egress router, thereby can accurately determine the link bandwidth of egress router.
Certainly default number also can be selected or select according to actual needs according to the practical experience value, for example is chosen as 1000, repeats no more among the present invention.
In addition, can also adopt other strategies when selecting the high quality seed server, for example, selecting 100 seed server arbitrarily from the seed server of returning response message is the high quality seed server; Selecting the seed server of default number according to the file size of the allocated resource of each seed server in the Resources list is high quality seed server etc.
Step 404, egress router send the download request of allocated resource to the high quality seed server of selecting; Send the download request of a.avi to the high quality seed server as egress router.
Concrete, the downloading task that egress router can be each allocated resource starts download thread, and sends the process of the download request of allocated resource to the high quality seed server of selecting by the concurrent execution of download thread of each allocated resource.For example, egress router is download thread of task start of the download a.avi of each high quality seed server (totally 100), and sends the download request of a.avi simultaneously to 100 high quality seed servers by 100 download thread.
Step 405, the high quality seed server sends the allocated resource corresponding file to egress router.For example, after the download request that receives a.avi, the high quality seed server sends the file of a.avi to egress router.
Step 406, egress router receives the allocated resource corresponding file that each high quality seed server returns by the port of self.
Step 407, egress router is determined link bandwidth according to the size of all allocated resource respective file that self port receives; Be that egress router is determined link bandwidth according to the time that receives all allocated resource respective file and size.
Among the present invention, carry out above-mentioned steps 401-step 407 and can carry out on the opportunity of setting of testing the speed, seldom the time, then can be 4:00 AM as 4:00 AM Internet bar online personnel the opportunity of testing the speed of this setting.
It should be noted that, though surf the Net personnel seldom the opportunity of setting of testing the speed, but the terminal that still may have by egress router visit Internet network exists, therefore the file size of egress router all resources that can receive according to port is determined link bandwidth, and the file size of these all resources can comprise the size of the size of all allocated resource respective file that port receives and the terminal access resource respective file by egress router visit Internet network.
In sum, among the present invention, start a download thread by being each allocated resource, concurrent execution downloading task can produce instantaneous huge flow, thereby the link bandwidth that operator distributes to egress router is fully supported; When carrying out the link bandwidth statistics, added up by all data (total data that comprises each session) that a port statistics process is received physical port, can truly reflect the link bandwidth of egress router.
Inventive concept based on same with said method the invention allows for a kind of egress router, as shown in Figure 5, comprising:
Searching request sending module 51 is used for by the searching request of distributed gnutella network to Internet network transmission allocated resource;
Response message receiver module 52, the response message that being used for receiving provides described allocated resource download service in the Internet network seed server is returned;
The high quality seed server is selected module 53, is used for selecting the high quality seed server from the seed server of returning response message;
Download request sending module 54 is for the download request that sends described allocated resource to the high quality seed server of selecting;
File receiver module 55 is used for receiving the described allocated resource corresponding file that described high quality seed server returns;
Link bandwidth determination module 56, the size that is used for all allocated resource respective file of receiving according to self port is determined link bandwidth.
Described high quality seed server is selected module 53, and the concrete time that is used for the time of the searching request by sending allocated resource and receives the response message that seed server returns is determined the response time of seed server; Response time according to each seed server sorts to seed server, in the sequencer procedure, if the difference of the response time between two seed server is in the Preset Time scope, then seed server ordering that file is big is near a shortest side of response time; Selecting the seed server of default number since a shortest side of response time is the high quality seed server.
Among the present invention, described default number is determined by the size of actual allocated maximum bandwidth and described allocated resource respective file.
Described download request sending module 54 specifically is used to the downloading task of each allocated resource to start download thread, sends the process of the download request of described allocated resource to the high quality seed server of selecting by the concurrent execution of the download thread of each allocated resource.
Described link bandwidth determination module 56, concrete file size for all resources that receive according to described port is determined link bandwidth, and the file size of all resources comprises the size of all allocated resource respective file and the size of visiting the terminal access resource respective file of Internet network by described egress router.
Wherein, each module of apparatus of the present invention can be integrated in one, and also can separate deployment.Above-mentioned module can be merged into a module, also can further split into a plurality of submodules.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of 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, the module in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of above-described embodiment can be merged into a module, also can further split into a plurality of submodules.
The invention described above sequence number does not represent the quality of embodiment just to description.
More than disclosed only be several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.