Embodiment
Further specify the technical scheme of the embodiment of the invention below in conjunction with accompanying drawing and specific embodiment.
The flow chart of the flow rate testing methods that Fig. 1 provides for the embodiment of the invention one, as shown in Figure 1, this flow rate testing methods comprises:
Step 101, the corresponding application protocol of all application characteristic information is carried out flow detection.
For example in the DPI technology, flow detection equipment adopts the application characteristic information in the complete application feature database to carry out flow detection to using agreement, comprises all application characteristic information that can discern in the complete application feature database in flow detection and control technology.When new application protocol occurring, the complete application feature database is arrived in the application characteristic information updating of new application protocol, thereby guarantee to comprise all application characteristic information that to discern in the complete application feature database.
Step 102, when satisfying application protocol and detect switching condition, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection.
Flow detection equipment can generate rank application characteristic storehouse in advance, and the application characteristic information in the rank application characteristic storehouse that generates in advance is effectively to gather in the duration, and the identification fluxion satisfies the pairing application characteristic information of pre-conditioned application protocol.Particularly; The acquisition time section that generates rank application characteristic storehouse can be set in advance; Wherein the acquisition time section can be chosen the comparatively busy period of flow detection equipment; For example: " 18:00~24:00 " totally six hours, for example be arranged on effective collection duration required among these six hours: " 2 hours " for example can also be provided with effective identification fluxion in advance: " 1000 ", for example select ranking: " 300 ".The rank application characteristic can comprise in the storehouse: in the acquisition time section that is provided with; When continuous collecting time during more than or equal to the said effective collection duration that is provided with; Identification fluxion to the various application protocols that collect is carried out rank according to order from big to small, satisfy rank before the selection ranking that is provided with and the identification fluxion greater than the pairing application characteristic information of application protocol of the effective identification fluxion that is provided with.For example: in acquisition time section " 18:00~24:00 "; The continuous collecting time of acquisition applications agreement relevant information is " 2 hours 15 minutes "; Greater than effectively gathering duration " 2 hours "; Then this time gather effectively, the identification fluxion of the various application protocols that collect is carried out rank according to order from big to small; Rank (can comprise " 300 ") before in the selection ranking " 300 " that is provided with, and the identification fluxion satisfies the condition that generates rank application characteristic storehouse greater than the application characteristic information of the application protocol of the effective identification fluxion " 1000 " that is provided with.Suppose that rank is TCP at the application protocol of selecting name order " 300 " name; The identification fluxion is " 1030 " greater than effective identification fluxion " 1000 ", can extract rank and generate rank application characteristic storehouse in the application characteristic information of all application protocols of preceding " 300 " (comprising " 300 ").
" stream " wherein discerned in the fluxion is meant an information flow that comprises the IP packet header of five-tuple information; Five-tuple information comprises information such as source address, destination address, source port, destination interface and protocol type, and wherein protocol type for example: TCP, UDP, ICMP etc.The identification fluxion just is meant for each application protocol, detects the number of the information flow in the IP packet header of identifying that comprises five-tuple information.
The effective collection duration that in the acquisition time section that is provided with, satisfies, select ranking and effectively discern the condition of fluxion, can generate rank application characteristic storehouse.Rank application characteristic storehouse can regenerate every day, also can be set the update cycle, gathers, generates rank application characteristic storehouse periodically again according to the update cycle.In addition; When the complete application feature database for example upgrades: when in the complete application feature database new application protocol being arranged; Original rank application data base can be deleted; And when the acquisition time section begins, can gather and generate said rank application characteristic storehouse again according to the method in above-mentioned generation rank application characteristic storehouse.
Generally speaking, flow detection equipment adopts the complete application feature database to carry out flow detection.When satisfying application protocol detection switching condition, switch to the rank application characteristic storehouse that generates in advance and carry out flow detection.Flow detection equipment can be provided with the switching condition that switches to rank application characteristic storehouse from the complete application feature database in advance, and switching condition can be considered packet rate, CPU usage, memory usage, flow or retention time etc.For example: when the total flow of detected application protocol greater than the flow switching threshold that is provided with; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection; Or; When the packet rate of detected application protocol greater than the packet rate switching threshold that is provided with; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection; Or; When the CPU usage switching threshold of the CPU usage of detected application protocol in flow detection equipment greater than setting; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection; Or; When the memory usage switching threshold of the memory usage of detected application protocol in flow detection equipment greater than setting; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection.For example: the characteristic that comprises the application protocol that " 1000 " individual needs detect in the complete application feature database.If flow detection equipment adopts the complete application feature database detected flow maximum to be about " 420M ", then can be set to " 420M " by the flow switching threshold, the retention time is set to " 5 minutes ".When the total flow of flow detection equipment during greater than " 420M "; And the time that continues is greater than " 5 minutes "; Can switch to rank application characteristic storehouse, only need this moment to detect the flow of rank, can detected flow maximum be about " 500M " at the application protocol of preceding " 300 ".More than just switching condition is illustrated, switching condition can be provided with as the case may be, does not enumerate one by one at this.
In addition; When if flow detection equipment adopts the application characteristic information that comprises in the rank application characteristic storehouse to detect; Variation has taken place in switching conditions such as detected packet rate, CPU usage, memory usage, flow or retention time, possibly switch to the complete application feature database again and carry out flow detection.For example: if the total flow of detected application protocol is less than or equal to the flow switching threshold, and the time that continues greater than the retention time of setting, switch to said complete application feature database and carry out flow detection.For example: the flow switching threshold is set to " 420M "; Retention time is set to " 5 minutes "; When the total flow of flow detection equipment is less than or equal to " 420M ", and time that continues during greater than " 5 minutes ", can switch back the complete application feature database and carry out flow detection.
Therefore; If rank account in the total flow of the application protocol of preceding " 300 " all application protocols total flow 99%; Characteristic with 300 the most frequently used application protocols is carried out flow detection, and then the ability of the flow of identification can improve 15% to 20%, improves 80M approximately to 100M; Use the flow detection ability in complete application characteristic storehouse to calculate by flow detection equipment, then use the flow detection ability in rank application characteristic storehouse can bring up to " 500M " for " 420M ".If the total flow that flow detection equipment need detect at present reaches " 488M "; When flow detection equipment adopts rank application characteristic storehouse to carry out flow detection; Only can reduce by 1% stream discrimination (dropping to 68%), other " 500M ", the flow of actual identification " 483M " from 69%; And flow detection equipment is when adopting rank application characteristic storehouse to carry out flow detection, and common recognition is the flow of " 420M " not; Be equivalent to exchange for the flow detection ability of " 80M " with the unidentified flow of 5M, and the identification flow of " 63M ".
Present embodiment adopts the application characteristic information of certain applications agreement commonly used to generate rank application characteristic storehouse; Carry out flow detection according to rank application characteristic storehouse; Can reduce and detect the resource that flow consumed; Under the situation that does not increase lower deployment cost, can improve the ability of flow detection, conserve system resources.
The flow chart of the flow rate testing methods that Fig. 2 provides for the embodiment of the invention two, as shown in Figure 2, on the basis of the embodiment of the invention one, this flow rate testing methods specifically may further comprise the steps:
Step 200, flow detection equipment receive the configuration information that background server periodically issues, and when not reaching switching condition, adopt the complete application feature database to carry out flow detection.Reach switching condition, but also still adopting complete application characteristic storehouse to carry out flow detection when not having rank application characteristic storehouse.Wherein can comprise in the configuration information acquisition time section of setting, effectively gather duration, effectively discern fluxion, select ranking, switching condition etc.
Step 201, flow detection equipment read refresh time last time, obtain the latest edition this shop of complete application feature database from background server, if the existing version of complete application feature database is number inconsistent with latest edition this shop, then upgrade the complete application feature database; Activating rank application characteristic storehouse under the situation that can meet in the condition that rank application characteristic storehouse is upgraded simultaneously upgrades.For example:, then begin to upgrade rank application characteristic storehouse if the measurement period in rank application characteristic storehouse begins.
Step 202, in the acquisition time section that is provided with, when continuous collecting time during, the identification fluxion of the various application protocols that collect is carried out rank according to order from big to small more than or equal to the said effective collection duration that is provided with; With satisfy rank before the selection ranking that is provided with and the identification fluxion generate rank application characteristic storehouse greater than the pairing application characteristic information of the application protocol of the effective identification fluxion that is provided with.
Step 203, compare with old rank application characteristic storehouse; If the application characteristic information of all application protocols in newly-generated rank application characteristic storehouse and the old rank application characteristic storehouse is different; Then use the rank application characteristic storehouse of newly-generated rank application characteristic storehouse replace old; This moment can be with old rank application characteristic storehouse deletion, execution in step 204.Otherwise, do not generate up-to-date rank application characteristic storehouse, execution in step 207.
Step 204, flow detection equipment regularly judge whether to switch to rank application characteristic storehouse from the complete application feature database.
Flow detection equipment switches to rank application characteristic storehouse and carries out flow detection, need satisfy switching condition, and for example: whether (1) has successfully generated up-to-date rank application characteristic storehouse; (2) whether the total flow of detected flow detection equipment is greater than the flow switching threshold; (3) whether the total flow of detected flow detection equipment has surpassed the retention time greater than the duration of flow switching threshold.
If satisfy switching condition, then flow detection equipment switches to rank application characteristic storehouse, and execution in step 205, otherwise execution in step 207 continue to use complete application characteristic storehouse to carry out flow detection.Wherein switching condition except can consideration of flow rate whether greater than the flow switching threshold; Whether the value that also can consider packet rate, CPU usage, memory usage etc. greater than certain preset threshold, and according to the scene of reality for example: the DPI of fixed network, wireless network, various scenes etc. can specifically set.Associated description in the flow rate testing methods that specifically can provide with reference to the embodiment of the invention one.
Step 205, flow detection equipment use rank application characteristic storehouse to carry out flow detection, certain interval of time, execution in step 206.Can specifically set the blanking time of execution in step 206 according to demand.
Step 206, flow detection equipment regularly judge whether to switch to the complete application feature database from rank application characteristic storehouse.
Flow detection is carried out in the storehouse if flow detection equipment uses the rank application characteristic, when satisfying certain condition, also can switch back the complete application feature database and carry out flow detection.For example: when the total flow of detected flow detection equipment is less than or equal to flow switching threshold and duration when having surpassed the retention time that is provided with; Flow detection equipment switches to the complete application feature database and carries out flow detection; Execution in step 207, otherwise execution in step 205.
Step 207, flow detection equipment use complete application characteristic storehouse to carry out flow detection, certain interval of time, execution in step 204.Can specifically set the blanking time of execution in step 204 according to demand.
Present embodiment is when detected total flow is higher; Adopt the rank application characteristic storehouse of the application characteristic information that only comprises certain applications agreement commonly used to carry out flow detection; Can reduce the resource that identification stream is consumed; Under the situation that does not increase lower deployment cost, can improve the ability of flow detection, conserve system resources; And can when total flow fall after rise, can dynamically switch to the complete application feature database and carry out flow detection, detection mode is flexible, and adaptability is strong.
The structural representation of the flow detection equipment that Fig. 3 provides for the embodiment of the invention three, as shown in Figure 3, this flow detection equipment comprises: detection module 31 and handover module 32.
Wherein, detection module 31 is used for the corresponding application protocol of all application characteristic information is carried out flow detection.Handover module 32 is used for when satisfying application protocol detection switching condition, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates in advance being carried out flow detection.
Wherein switching condition can be provided with in advance.Concrete flow rate testing methods can be with reference to the associated description of the embodiment of the invention one.
The application characteristic information of the certain applications agreement that the present embodiment generation module is high with utilization rate generates rank application characteristic storehouse; Handover module switches to rank application characteristic storehouse or complete application feature database and carries out flow detection and carry out flow detection satisfying under the situation of switching condition; Can reduce the resource that identification stream is consumed; Under the situation that does not increase lower deployment cost, improve the ability of flow detection, conserve system resources.
The structural representation of the flow detection equipment that Fig. 4 provides for the embodiment of the invention four, as shown in Figure 4, on the basis of the embodiment of the invention three, handover module 32 can comprise: the first monitoring submodule 320 and first switching submodule 321.
Wherein first monitor submodule 320, whether the total flow that is used to monitor application protocol is greater than the flow switching threshold that is provided with, and whether the time that continues is greater than the retention time of setting.First switching submodule 321; The total flow that is used for working as the application protocol that monitors is greater than the flow switching threshold that is provided with; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection.
Perhaps handover module 32 can comprise: the second monitoring submodule 322 and second switching submodule 323.Wherein second monitor submodule 322, whether the packet rate that is used to monitor application protocol is greater than the packet rate switching threshold that is provided with, and whether the time that continues is greater than the retention time of setting.Second switching submodule 323; The packet rate that is used for working as the application protocol that monitors is greater than the packet rate switching threshold that is provided with; And the time that continues is during greater than retention time of setting; Switch to the rank application characteristic storehouse that generates in advance, the pairing application protocol of application characteristic information in the rank application characteristic storehouse that generates is in advance carried out flow detection.
Further; Flow detection equipment can also comprise: generation module 33; The rank application characteristic storehouse that is used for generating in advance, the application characteristic information in the said rank application characteristic storehouse are effectively to gather in the duration, and the identification fluxion satisfies the pairing application characteristic information of pre-conditioned application protocol.Wherein generation module 33 can comprise: gather submodule 331, rank submodule 332 and generate submodule 333.
Wherein, gather submodule 331, be used in the acquisition time section that is provided with, the identification fluxion of all application protocols being gathered.Rank submodule 332 was used for when continuous collecting time during more than or equal to the said effective collection duration that is provided with, and the identification fluxion of the various application protocols that collect is carried out rank according to order from big to small.Generate submodule 333, be used for according to satisfy rank before the selection ranking that is provided with and the identification fluxion greater than the pairing application characteristic information of application protocol of the effective identification fluxion that is provided with, generate rank application characteristic storehouse.
In addition, generation module 33 can also comprise: updating submodule 334, when being used for the acquisition time section and beginning, gather and generate said rank application characteristic storehouse again.Particularly; Be provided with in advance the acquisition time section that generates rank application characteristic storehouse, effectively gather duration, effectively discern fluxion, select the inferior information of name after; Generation module 33 according to the acquisition time section, effectively gather duration, effectively discern fluxion, select the inferior information of name; Generate rank application characteristic storehouse, the process that generates rank application characteristic storehouse can be the process of one-period property, and week for example update cycle can be set in advance; When arriving the update cycle, just can gather and generate rank application characteristic storehouse again.In addition; If the complete application feature database upgrades; When the application characteristic information of new application protocol is for example arranged; Even without arriving the update cycle, rank also can gathered and obtain to updating submodule 334 in the application characteristic information of selecting ranking and all application protocols before thereof, so that generate said rank application characteristic storehouse.
If successfully generated rank application characteristic storehouse, and satisfy the switching condition of setting, handover module 32 can determine to adopt rank application characteristic storehouse or the complete application feature database carries out flow detection.Remove aforesaid switching condition; Its switching condition also can comprise other situation; Do not limit at embodiment; For example: when the CPU usage of detected application protocol in flow detection equipment greater than the CPU usage switching threshold that is provided with, and time that continues during, switch to the rank application characteristic storehouse that generates in advance greater than retention time of setting; Perhaps, when the memory usage of detected application protocol in flow detection equipment greater than the memory usage switching threshold that is provided with, and time that continues during, switch to the rank application characteristic storehouse that generates in advance etc. greater than retention time of setting.
Wherein generate rank application characteristic storehouse, according to the concrete grammar that switching condition switches, can adopt the associated description in the embodiment of the invention one, two.
The application characteristic information of the certain applications agreement that each sub-module of present embodiment generation module is high with utilization rate generates rank application characteristic storehouse; When total flow, packet rate, CPU usage or the memory usage of flow detection equipment are too high; Switch to rank application characteristic storehouse and carry out flow detection satisfying under the situation of switching condition first, second switching submodule, when total flow, packet rate, CPU usage or the memory usage of flow detection equipment fall after rise, satisfying under the situation of switching condition; Can switch back the complete application feature database and carry out flow detection; Can reduce the resource that identification stream is consumed, under the situation that does not increase lower deployment cost, improve the ability of flow detection; Conserve system resources, and switching mode is flexible, adaptability is strong.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be accomplished through the relevant hardware of program command; Aforesaid program can be stored in the computer read/write memory medium; This program the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
What should explain at last is: above embodiment is only in order to explaining technical scheme of the present invention, but not to its restriction; Although with reference to previous embodiment the present invention has been carried out detailed explanation, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these are revised or replacement, do not make the spirit and the scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.