A kind of network traffics intelligent controller and its implementation
Technical field
The present invention relates to a kind of intelligent controller, specifically be meant a kind of network traffics intelligent controller and its implementation that can adjust the network bandwidth according to actual operating position automatically.
Background technology
At present, the flow when people can limit different main frames online by the network traffics controller mostly in when online is to reach the purpose of optimizing network.But, these network traffics controllers that present people are adopted 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 network traffics controllers 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 network traffics controllers can not be adjusted automatically 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 the mood and the level of skill that can be subjected to the personnel of disposing to a great extent of bandwidth, so subjective factor is stronger.
Summary of the invention
The objective of the invention is to overcome that present legacy network flow controller adopts that the fixed flow regulatory control then brought can not effectively, farthest rationally utilize bandwidth, and allocated bandwidth is subjected to the defective of the personnel's of disposing subjective factor influence easily, provide a kind of not only structure comparatively simple, and can distribute the network traffics intelligent controller of bandwidth automatically according to the practical operation situation of main frame.
Another object of the present invention provides the implementation method of this network traffics intelligent controller.
Purpose of the present invention is achieved through the following technical solutions: a kind of network traffics intelligent controller, mainly form by 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 by the application recognition module 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, the bandwidth of calculating each data stream bandwidth use amount are used computing module and are used monitoring module to constitute to the bandwidth that current bandwidth is adjusted.
A kind of implementation method of network traffics intelligent controller mainly may further comprise the steps:
(a) by application recognition module the data flow that router produced is discerned, the data flow of different application is stamped its corresponding application identification code respectively;
(b) the sort module data flow that will stamp the application identification sign indicating number 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 uses monitoring module according to the operating position of predefined time value to particular server use PING detection current bandwidth, and current bandwidth is adjusted.
Further, the data dispatch module described in the step (c) is ranked to sorted data flow, and sends specifically according to the packet that priority principle is transmitted the override needs and may further comprise the steps:
(c1) the data dispatch module is at first given formation of every host assignment;
(c2) will classify and have the distribution of flows of different application identification code again in corresponding formation;
(c3) when the network interface card of main frame can send data, this data dispatch module is found out a packet that priority is the highest successively 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 every TOKEN difference that the main frame formation is each simultaneously;
(c4) do you judge that this TOKEN difference is less than zero? be that then this main frame formation is changed to can not transmit queue for the data dispatch module; Not, but then the data dispatch module is changed 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 changed to transmit queue by transmit queue; , then do not repeat this step.
Current bandwidth is adjusted specifically described in the step (d) may further comprise the steps:
(d1) when system initialization, bandwidth is used the bandwidth of computing module for every host assignment 100KB/S being connected;
(d2) do you judge whether current bandwidth uses nervous? be that then using monitoring module by bandwidth is original 2/3 with the distribution bandwidth reduction of each main frame; Deny that then the distribution bandwidth with each main frame increases by 1/4.5, the implementation method of a kind of network traffics intelligent 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) is meant 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 that is meant to use monitoring module to judge according to the result who adopts PING to detect to particular server, if response time t 〉=0.1 of this particular server second is then judged and should current bandwidth be used anxiety; Otherwise, judge that then this current bandwidth use is idle.
Described particular server is meant that then the user is according to autonomous website, webmaster or the DNS (Domain Name Server, name server) that is provided with 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 is brought because of the bandwidth adjustment, reduces maintenance difficulties.
(2) because the network layer of the present invention's router is provided with the intelligent Flow Control program module that is connected with the program scheduler point of this 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 legacy network flow quantity intelligent controller defective of regulating networks bandwidth automatically.
(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 influence, improves user experience.
Description of drawings
Fig. 1 is an overall flow schematic diagram of the present invention.
Fig. 2 sends the schematic flow sheet of packet according to priority level for the present invention.
Embodiment
Below in conjunction with embodiment the present invention is described in further detail, but embodiments of the present invention are not limited thereto.
Embodiment
Network traffics intelligent controller of the present invention mainly is to be provided with an intelligent Flow Control program module that is used for function call that is connected with program scheduler point that router is provided on the network layer of router.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 (promptly has been provided with) an intelligent Flow Control program module, to guarantee that data flow is in the purpose that can realize adjusting automatically later the network bandwidth through this intelligence Flow Control program module.
Be integrated with in the described intelligent Flow Control program module and be used for application recognition module that data flow is discerned, the sort module that data flow is classified, the data dispatch module of packet being transmitted according to priority principle, be used to calculate the bandwidth use computing module of each data stream bandwidth use amount, and the bandwidth that is used for that current bandwidth is adjusted uses monitoring module to constitute jointly.
As shown in Figure 1, the present invention's step of regulating bandwidth automatically through intelligent Flow Control program module is as follows:
(a) at first the data flow that router produced is discerned, the data flow of different application is stamped its corresponding application identification code respectively by application recognition module.Application recognition module of the present invention can be to the recreation of main flow, the crucial application (visited as WEB, POP3, SMTP, QQ etc.), the P2P video is online to be watched and applicating category such as P2P download is discerned, 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, features such as bag size are analyzed and are handled, thereby obtain the applicating category under each packet, and respectively these applicating categories are stamped the application identification sign indicating number of different identification.For example, the game class application program is stamped game class application identification sign indicating number, crucial application class program is stamped crucial application class program identification code or the like, 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 sign indicating number storage of classifying.Promptly, this sort module will be such as the application program of band game class application identification sign indicating number, classify respectively with the online application program of class application identification sign indicating number and the application program of band P2P down load application class application identification sign indicating number of watching of application program, the band P2P video of crucial application class application identification sign indicating number, thereby the data flow of general's script chaotic classification and ordination is as requested come out, and 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 promptly may further comprise the steps as shown in Figure 2:
The first, give formation of every host assignment by the data dispatch module.Promptly allocate a formation that is used for 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 the type that respective queue is used to store data at random, as having preestablished the data flow that the wherein formation of a main frame is exclusively used in storage belt game class application identification sign indicating number, the formation of a main frame is exclusively used in data flow of the crucial application class application identification of storage belt sign indicating number or the like.Therefore, this data dispatch module just can be with the data flow of band game class application identification sign indicating number, be assigned to respectively in the corresponding main frame formation with the online data flow of class application identification sign indicating number and the data flow of band P2P down load application class application identification sign indicating number of watching of data flow, the band P2P video of crucial application class application identification sign indicating number.
The 3rd, when the network interface card of main frame can send data, this data dispatch module is then found out a packet that priority is the highest successively 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 to be used for judging which data need preferentially be transmitted when network interface card can send data, and which data can be transmitted after a while.Such as in medium-sized and small enterprises, the data that the user uses data that POP3/SMTP carries out receiving and dispatching mail promptly can mark to need override to send, the data of http protocol are then taken second place or the like.
Described TOKEN difference is meant 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? be that then this main frame formation is changed to can not transmit queue for the data dispatch module; Not, but then the data dispatch module is changed 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 changed to transmit queue by transmit queue; Not, then repeat this step, finish up to all packet transmissions.In this step, because TOKEN is near zero the time, 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 bigger influence 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 carried out a judgement again as the data scheduler module.
(d) bandwidth uses monitoring module to use 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 is used the bandwidth of computing module for every host assignment 100KB/S being connected; And then use monitoring module to judge that whether current bandwidth uses anxiety by bandwidth? be that then using monitoring module by bandwidth is original 2/3 with the distribution bandwidth reduction of each main frame; Deny that then the distribution bandwidth with each main frame increases by 1/4.
Be in operation, if bandwidth is used frequent particular server (such as typical website www.edu.cn, gateway, DNS etc.) use PING is detected of monitoring module, will certainly waste system resource so, take certain bandwidth, and then influence the use of whole bandwidth.Therefore, bandwidth of the present invention uses monitoring module when using PING to detect according to predefined time value to particular server, and its time interval was preferably for 2 seconds, i.e. broadband use monitoring module institute is 2 seconds according to predefined time value.
Wherein, use monitoring module to judge that current bandwidth uses the whether nervous bandwidth that is meant to use monitoring module that the result that particular server adopts PING to detect is judged by bandwidth, if response time t 〉=0.1 of this particular server second is then judged and should current bandwidth be used anxiety; 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 network traffics intelligent controller just can be adjusted the use of the network bandwidth automatically according to the operating position of actual bandwidth, thereby guarantees that various application programs can well finish.
As mentioned above, just can well realize the present invention.