A kind of Intelligent network traffic controller and its implementation
Technical field
The present invention relates to a kind of intelligent controller, specifically refer to a kind of Intelligent network traffic controller and its implementation that can automatically adjust according to actual operating position the network bandwidth.
Background technology
At present, the flow when people can limit different main frame online by the control of network flow quantity device mostly when online is to reach the purpose of optimized network.But, these control of network flow quantity devices that present people adopt all are the network bandwidths that then distributes different main frames by the fixed flow regulatory control, therefore there is following defective: at first, because after adopting the fixed flow regulatory control then, every assigned network bandwidth of main frame all is changeless, even if these control of network flow quantity devices can not dynamically be adjusted its network bandwidth according to the situation of reality when bandwidth is comparatively idle; Otherwise when bandwidth was nervous, these control of network flow quantity devices can not automatically be adjusted and reduce congested pressure, therefore can not effectively, farthest rationally utilize bandwidth.Secondly, higher to configuration personnel's specification requirement when adopting the fixed flow regulatory control then to come dispense flow rate, the restriction that is distributed in mood and the level of skill that can be subject to a great extent the personnel of disposing of bandwidth, so subjective factor is stronger.
Summary of the invention
The object of the invention is to overcome that present legacy network flow controller adopts that the fixed flow regulatory control then brings can not effectively, farthest rationally utilize bandwidth, and allocated bandwidth is subject to the defective of the personnel's of disposing subjective factor impact easily, provide a kind of not only structure comparatively simple, and can automatically distribute according to the practical operation situation of main frame the Intelligent network traffic controller of bandwidth.
Another object of the present invention provides the implementation method of this Intelligent network traffic controller.
Purpose of the present invention is achieved through the following technical solutions: a kind of Intelligent network traffic controller, comprise router, and on the network layer of this router, also be provided with the intelligent Flow Control program module that is connected with the program scheduler point of this router simultaneously.
In order better to realize the present invention, the sort module that described intelligent Flow Control program module is classified according to the application identification code by other application recognition module of application class that is used for recognition data stream that is integrated in its inside, with data flow, the data dispatch module of packet being transmitted according to priority principle, calculate each data stream bandwidth use amount bandwidth with computing module and according to particular server with PING to current bandwidth with whether the nervous bandwidth usage monitoring module composition of dynamically adjusting the broadband.
A kind of implementation method of Intelligent network traffic controller mainly may further comprise the steps:
(a) by application recognition module the data flow that router produces is identified, the data flow of different application is stamped respectively its corresponding application identification code;
(b) the sort module data flow that will stamp the application identification code storage of classifying;
(c) the data dispatch module is packed, is lined up sorted data flow, and the packet of the override needs being transmitted according to priority principle sends, use computing module that the bandwidth use amount of each packet of transmission is calculated by bandwidth simultaneously, draw the bandwidth use amount of each packet;
(d) bandwidth usage monitoring module uses PING to detect the operating position of current bandwidth according to predefined time value to particular server, and to current bandwidth with whether the nervous broadband of dynamically adjusting.Further, the data dispatch module described in the step (c) is ranked to sorted data flow, and sends according to the packet of priority principle with the forwarding of override needs, specifically may further comprise the steps:
(c1) the data dispatch module is at first given formation of every host assignment;
(c2) will classify and have again the distribution of flows of different application identification code in corresponding formation;
(c3) when the network interface card of main frame can send data, this data dispatch module is found out successively a packet that priority is the highest and is given the network interface card transmission from the formation of every main frame, and consume the TOKEN of this formation according to the data packet length of this transmission, calculate simultaneously every TOKEN difference that the main frame formation is each; Described TOKEN difference refers to the last difference that sends packet required time and current transmission packet required time of this main frame formation;
(c4) do you judge that this TOKEN difference is less than zero? that then this main frame formation is set to can not transmit queue for the data dispatch module; No, but then the data dispatch module is set to transmit queue with this main frame formation, and carrying out next time, data send;
Did (c5) the data dispatch module just recomputate TOKEN difference that can not transmit queue every Δ t second, and judged that this TOKEN difference is less than zero? be, but then this can not be set to transmit queue by transmit queue; No, then repeat this step.
Current bandwidth is adjusted specifically described in the step (d) may further comprise the steps:
(d1) when system initialization, bandwidth uses computing module to be the bandwidth of every host assignment 100KB/S connecting;
(d2) do you judge whether current bandwidth uses nervous? to be original 2/3 by bandwidth usage monitoring module with the distribution bandwidth reduction of each main frame then; No, then the distribution bandwidth with each main frame increases by 1/4.5, the implementation method of a kind of Intelligent network traffic controller according to claim 4 is characterized in that: the value of the Δ t described in the step (c5) is 2~10 seconds.
In order to ensure result of use of the present invention, the TOKEN difference described in step (c4) and the step (c5) refers to the last difference that sends packet required time and current transmission packet required time of this main frame formation.
And the predefined time value described in the step (d) is 2 seconds.
The current bandwidth of judging described in the step (d2) uses the whether nervous bandwidth usage monitoring module that refers to judge according to the result who adopts PING to detect to particular server, if the response time t of this particular server 〉=0.1 second judges that then this current bandwidth use is nervous; Otherwise, judge that then this current bandwidth use is idle.
Described particular server refers to that then the user is according to autonomous website, webmaster or the DNS (Domain Name Server, name server) that arranges of environment.
The present invention compares than prior art, has the following advantages and beneficial effect:
(1) overall structure of the present invention is comparatively simple, cost of manufacture is comparatively cheap, therefore can effectively reduce the maintenance that the network maintenance staff brings because of the bandwidth adjustment, reduces maintenance difficulties.
(2) because the present invention is provided with the intelligent Flow Control program module that is connected with the program scheduler point of this router in the network layer of router, therefore the present invention can automatically regulate bandwidth and distributes according to the actual operating position of current network bandwidth, thereby guarantee to effectively utilize the network bandwidth, overcome the automatically defective of regulating networks bandwidth of legacy network Intelligent flow controller.
(3) the present invention can adjust when bandwidth is nervous automatically, and particularly high bandwidth is used the use to bandwidth of main frame, guarantees that prioritized data is not subjected to congested the impact, improves the user and experiences.
Description of drawings
Fig. 1 is overall flow schematic diagram of the present invention.
Fig. 2 is the present invention sends packet according to priority level schematic flow sheet.
Embodiment
Below in conjunction with embodiment the present invention is described in further detail, but embodiments of the present invention are not limited to this.
Embodiment
Intelligent network traffic controller of the present invention mainly is that the network layer at router is provided with an intelligent Flow Control program module that is used for function call that is connected with program scheduler point that router provides.Because data flow can provide a program scheduler point by operating system when the operating system specific region of process router, and whole accreditation processes of this program scheduler point will be carried out successively, therefore essence of the present invention is that extra registration on this program scheduler point (has namely arranged) an intelligent Flow Control program module, to guarantee that data flow is in the purpose that can realize automatically adjusting later the network bandwidth through this intelligence Flow Control program module.
Be integrated with for the application recognition module that data flow is identified in the described intelligent Flow Control program module, the sort module that data flow is classified, the data dispatch module of packet being transmitted according to priority principle, be used for calculating the bandwidth use computing module of each data stream bandwidth use amount, and the bandwidth usage monitoring module that is used for current bandwidth is adjusted consists of jointly.
As shown in Figure 1, the present invention's step of automatically regulating bandwidth through intelligent Flow Control program module is as follows:
(a) at first by application recognition module the data flow that router produces is identified, the data flow of different application is stamped respectively its corresponding application identification code.Application recognition module of the present invention can be to the game of main flow, the crucial application (accessed such as WEB, POP3, SMTP, QQ etc.), the P2P video is watched online and the applicating category such as P2P download is identified, therefore, when needing only this intelligence Flow Control program module of data flow process that produces when router, this application recognition module just can be automatically to the agreement of various application, port, tagged word, traffic characteristic, the features such as bag size are analyzed and are processed, thereby obtain the applicating category under each packet, and respectively these applicating categories are stamped the application identification code of different identification.For example, the game class application program is stamped game class application identification code, crucial application class program is stamped crucial application class program identification code etc., and choosing then by the user of different application identification code kind and quantity determined according to self environment and needs.
(b) the sort module data flow that will stamp the application identification code storage of classifying.Namely, this sort module will be such as with the application program of game class application identification code, with the application program of crucial application class application identification code, watch the application program of class application identification code and classify respectively with the application program of P2P down load application class application identification code with the P2P video online, thereby the mixed and disorderly unordered data flow of general's script as requested classification and ordination out forms an orderly data queue.Simultaneously, this sort module will be to mark from the data flow which platform main frame will be the data which platform main frame sends maybe will send to according to this data flow also.
(c) the data dispatch module is packed, is lined up sorted data flow, and the packet of the override needs being transmitted according to priority principle sends, use computing module that the bandwidth use amount of each packet of transmission is calculated by bandwidth simultaneously, draw the bandwidth use amount of each packet.Its idiographic flow namely may further comprise the steps as shown in Figure 2:
The first, give formation of every host assignment by the data dispatch module.Namely allocate a formation that is used for the data storage in advance for every the main frame that is connected on this router by data dispatch module controls router.
The second, the distribution of flows of different application identification code will be classified and have to the data dispatch module in corresponding main frame formation.Because the data dispatch module is when giving every the host assignment formation that connects, just pre-determined at random the type of respective queue for the storage data, as having preseted the data flow that the wherein formation of a main frame is exclusively used in storage belt game class application identification code, the formation of a main frame is exclusively used in data flow of the crucial application class application identification of storage belt code etc.Therefore, this data dispatch module just can be with the data flow of game class application identification code, with the data flow of crucial application class application identification code, watch the data flow of class application identification code and be assigned to respectively in the corresponding main frame formation with the data flow of P2P down load application class application identification code with the P2P video online.
The 3rd, when the network interface card of main frame can send data, this data dispatch module is then found out successively a packet that priority is the highest and is given the network interface card transmission from every main frame formation, and consume the TOKEN of this formation according to the data packet length of this transmission, use computing module to calculate the TOKEN difference by bandwidth simultaneously.
The priority level of data is defined according to concrete environment for use by the user in the formation.Described priority level mainly is for judging that when network interface card can send data, which data need to preferentially be transmitted, and which data can be transmitted after a while.Such as in medium-sized and small enterprises, the data that the data that the user carries out receiving and dispatching mail with POP3/SMTP namely can mark need override to send, the data of http protocol are then taken second place etc.
Described TOKEN difference refers to the last difference that sends packet required time and current transmission packet required time of this main frame formation.
Does the 4th, the data dispatch module judge that resulting TOKEN difference is less than zero? that then this main frame formation is set to can not transmit queue for the data dispatch module; No, but then the data dispatch module is set to transmit queue with this main frame formation, and carrying out next time, data send.
The 5th, the data dispatch module just recomputated TOKEN difference that can not transmit queue every Δ t second, and judged that this TOKEN difference whether less than zero, is, but then this can not be set to transmit queue by transmit queue; No, then repeat this step, until all Packet Generations are complete.In this step, because TOKEN is when approaching zero, the data dispatch module still can send data, and can TOKEN be reduced to zero according to the data length that sends, just can stop this moment sending, therefore the TOKEN radix of this moment resends in the process of data afterwards less than zero, then this TOKEN difference just can be less than zero, but is set to transmit queue to guarantee that this can not transmit queue can be listed as.
Because the length of Δ t time has larger impact to transfer of data, so the time range of this Δ t is generally between 2~10 seconds, just every 2 seconds, 5 seconds or 10 seconds TOKEN difference that can not transmit queue is re-started a judgement such as the data scheduler module.
(d) bandwidth usage monitoring module uses PING to detect the operating position of current bandwidth according to predefined time value to particular server, and current bandwidth adjusted, its concrete steps are: at first when system initialization, bandwidth uses computing module to be the bandwidth of every host assignment 100KB/S connecting; Do you and then judge by bandwidth usage monitoring module whether current bandwidth uses nervous? to be original 2/3 by bandwidth usage monitoring module with the distribution bandwidth reduction of each main frame then; No, then the distribution bandwidth with each main frame increases by 1/4.
Be in operation, if bandwidth usage monitoring module uses PING to detect to particular server (such as typical website www.edu.cn, gateway, DNS etc.) frequently, will certainly waste system resource so, take certain bandwidth, and then affect the use of whole bandwidth.Therefore, bandwidth usage monitoring module of the present invention is when using PING to detect according to predefined time value to particular server, and its time interval was preferably for 2 seconds, and namely broadband usage monitoring module institute is 2 seconds according to predefined time value.
Wherein, judge that by bandwidth usage monitoring module current bandwidth uses the whether nervous bandwidth usage monitoring module that refers to that the result that particular server adopts PING to detect is judged, if the response time t of this particular server 〉=0.1 second judges that then this current bandwidth use is nervous; Otherwise, judge that then this current bandwidth use is idle
Accordingly, described particular server can be specified according to actual environment by the user, as specifies above-mentioned typical web site www.edu.cn, gateway, DNS etc., also can specify all the other users to need the hardware of appointment.By above step, this Intelligent network traffic controller just can be adjusted according to the operating position of actual bandwidth the use of the network bandwidth automatically, thereby guarantees that various application programs can well finish.
As mentioned above, just can well realize the present invention.