A kind of extendible full-flow priority dispatching method and system
Technical field
The present invention relates to network management and network monitoring technical field, particularly a kind of extendible full-flow priority dispatching method and system.
Background technology
Burgeoning number of users and flow have a strong impact on key business and normally use.How to ensure key business, it is crucial carrying out traffic management.Increase bandwidth, may temporarily solve the slack-off phenomenon of network speed, the network quality of key business makes moderate progress.Yet the very fast non-key service traffics by undying growth of bandwidth that increase are occupied.So the reasonable distribution Internet resources, ensure that the key of key business is: how (1) can reasonably be assigned to each stream with bandwidth; (2) how to implement monitoring and the directly various application traffics of control, different priority levels is set, provide fast to guarantee key business used, network service accurately according to different application.Be proprietary formation of each flow distribution, add that suitable scheduling goes out group algorithm, can provide allocated bandwidth and service guarantee.Yet it is faced with a plurality of difficult problems: the number of simultaneous stream is in 1,000,000 magnitudes in the high-speed network appliance, and along with the further growth of the network bandwidth, the number of stream also increases thereupon.And in express network the time interval of adjacent two bags had only for tens nanoseconds.If the stream of 1,000,000 magnitudes is stored among at a slow speed the DRAM, can not reaches linear speed and handle; And if 1,000,000 stream is stored in fast storage, in SRAM, cost will be very high.
Stream is commonly defined as the network packet set (as the five-tuple of ICP/IP protocol) that network data packet header has the specific phase same area.The network packet of same stream requires the identical grade of service.The method that current academia and industrial quarters extensively adopt be with second or minute as the processing time granularity (promptly think second or minute in the stream of existence), under this granularity, the number that flows system in is in 1,000,000 magnitudes.Integrated service (IntServ) is as the pioneer of scheduling structure, and it is each simultaneous stream reservation of resource, because the flow amount of its processing is in 1,000,000 magnitudes.So it handles the complexity height, has limited its extensive use.A kind of thinking in addition is to adopt hardware-accelerated formation tissue of ASIC and scheduling, yet this kind method construction cycle is long, and the cost height is used not extensive in common hardware.Another widely used dispatching algorithm CBQ (Class-Based Queueing) [Main page of CBQ.www.icir.org/floyd/cbq.html] in linux system adopts the institutional framework of tree, root node is represented bandwidth resources really, each child node is represented a kind of resource allocation unit under it, and different branches can adopt different dispatching algorithms according to strategy.Yet this algorithm only is fit to handle the stream of height cluster, if handle fine-grained stream, as the stream with identical five-tuple (source IP, source port, purpose IP, destination interface, agreement), it is very big that the height of this tree structure will become, thereby handles the complexity height.
Summary of the invention
(1) goal of the invention
The purpose of this invention is to provide a kind of extendible full-flow priority dispatching method, this method has realized that the service differentiation of full stream and bandwidth guarantee.
(2) summary of the invention
A kind of extendible full-flow priority dispatching method, this method is one group with the flow point of equal priority, scheduling according to priority between group by the scheduling of difference polling mode, may further comprise the steps in the group:
S1: the receiving network data bag, resolve described network packet stream label;
S2:, and network packet is inserted into affiliated flow queue according to dequeue order in the stream label computing network data packet group;
S3: between the network data package according to priority, in the group by dequeue order dequeue;
S4: network packet is sent.
Wherein, described step S2 comprises step:
Whether be present in the active stream table according to flowing under the stream label inspection network packet;
Dequeue order in the computing network data packet group if affiliated stream is present in the active stream table, adds 1 with the network packet number of affiliated stream, otherwise, obtain the priority of stream, apply for one should stream empty queue, and the initialization schedule information that should flow;
Described network packet is inserted affiliated flow queue;
The network packet number of flow queue place priority groups adds 1;
Whether the network packet number of judging described priority groups is 1, if then the bit vectors position with the correspondence of priority groups described in the bit vectors is made as 1.
Wherein, described step S2 also comprises step:
When affiliated stream is not present in the active stream table, should be inserted into active stream table afterbody by affiliated stream, and set up stream and flow queue dynamic mapping relationship.
Wherein, described step S3 comprises step:
Find a non-NULL priority groups with limit priority;
Obtain one on the described priority groups and take turns the network packet of linked list head, and upgrade the remaining quota of network packet place stream;
Whether the remaining quota of stream is greater than the length of described network packet under judging, if, described network packet dequeue, and the remaining quota, the network packet number of affiliated stream and the network packet number of described priority groups that flow under upgrading go out team's wheel otherwise upgrade described priority groups;
Whether the network packet number of stream is 0 under the judgement, if, flow and upgrade described priority groups under in the active stream table, deleting and go out team's wheel, otherwise, directly upgrade described priority groups and go out team's wheel;
The network packet number of described priority groups subtracts 1;
Judge whether the network packet number is 0 in the described priority groups, if the bit vectors position of the correspondence of priority groups described in the bit vectors is made as 0, otherwise finishes.
Wherein, the schedule information of described initialization stream comprises network packet number, the quota of stream and the current residual quota of stream in the initialization stream.
A kind of extendible full-flow priority dispatching system comprises:
The network packet receiver module is used for the receiving network data bag, and resolves described network packet stream label;
Network packet is gone into the formation module, is used for according to dequeue order in the stream label computing network data packet group, and network packet is inserted into affiliated flow queue;
Network packet dequeue module, be used between the network data package according to priority, in the group by dequeue order dequeue;
The network packet sending module is used for network packet is sent.
Wherein, described network packet is gone into the formation module and is comprised:
Continuous query module in the active stream table is used for whether being present in the active stream table according to stream under the stream label requester network packet;
The flow queue preparation module is used for dequeue order in the computing network data packet group, if affiliated stream is present in the active stream table, the network packet number of affiliated stream is added 1, otherwise, the priority of stream obtained, apply for the empty queue that to flow, and the schedule information of stream is somebody's turn to do in initialization;
The flow queue insert module is used for network packet is inserted affiliated flow queue;
The priority groups update module is used for the network packet number of flow queue place priority groups is added 1;
Bit vectors is provided with module, is used to judge whether the network packet number of described priority groups is 1, if then the bit vectors position with the correspondence of priority groups described in the bit vectors is made as 1.
Wherein, described network packet dequeue module comprises:
The highest non-NULL priority groups is searched module, is used to the non-NULL priority groups that finds to have limit priority;
The network packet acquisition module of scheduling wheel linked list head is used to obtain the network packet that one on the described priority groups taken turns linked list head, and upgrades the remaining quota of network packet place stream;
The dequeue judge module, whether the remaining quota of stream is greater than the length of described network packet under being used to judge, if, described network packet dequeue, and the remaining quota, the network packet number of affiliated stream and the network packet number of described priority groups that flow under upgrading, go out team's wheel otherwise upgrade described priority groups;
The network packet that flows is counted judge module, and whether the network packet number of stream is 0 under being used to judge, if, flow and upgrade described priority groups under in the active stream table, deleting and go out team's wheel, otherwise, directly upgrade described priority groups and go out team's wheel;
The priority groups update module is used for the network packet number of described priority groups is subtracted 1;
Bit vectors is provided with module, is used for judging whether described priority groups network packet number is 0, if the bit vectors position of the correspondence of priority groups described in the bit vectors is made as 0, otherwise finishes.
(3) beneficial effect
The extendible full-flow priority dispatching method that the present invention proposes has realized that the service differentiation of full stream and bandwidth guarantee, by the experiment of resultant flow, show that this method has higher performance really on service guarantees.
Description of drawings
Fig. 1 is the basic flow sheet according to extendible full-flow priority dispatching method of the present invention;
Fig. 2 advances the formation flow chart according to extendible full-flow priority dispatching method of the present invention;
Fig. 3 is the dequeue flow chart according to extendible full-flow priority dispatching method of the present invention;
Fig. 4 is the active stream table depth map according to three various flows in the experiment of extendible full-flow priority dispatching method of the present invention;
Fig. 5 is the cumulative probability distribution curve according to different rates stream relative deviation in the experiment of extendible full-flow priority dispatching method of the present invention.
Embodiment
The extendible full-flow priority dispatching method that the present invention proposes, be called for short AFL-SFQ-DRR (active stream table-strict-priority-difference polling dispatching) method, with the flow point of equal priority is one group, and scheduling is according to priority dispatched by the difference polling mode in the group between group.Accompanying drawings is as follows.
As shown in Figure 1, step S1 receiving network data bag p, and resolve network packet stream label fi, stream label is described with following data structure:
Header
{
Int32 sIP, dIP; // 32 potential source address and destination addresses
Int16 sport, dPort; // 32 potential source port and target ports
Int8 protocol; // 8 bit protocols
};
Step S2 is according to dequeue order in the stream label computing network data packet group, and network packet is inserted into affiliated flow queue.As shown in Figure 2, in this step, inquire about according to stream label fi and to flow fi->qk under this network packet and whether be present in the active stream table; If exist, the network packet number of affiliated stream is added 1, be fi->PktNum++, otherwise the priority of obtaining stream (is set in advance by network system administrator, 0 is that priority is the highest, below successively decrease), apply for an empty queue qk that should flow, if there is the priority of priority groups pri identical with the priority of this empty queue, then this empty queue is added this priority groups, otherwise, this empty queue is a priority groups pri, the schedule information that initialization subsequently should be flowed, i.e. network packet in the initialization stream is counted fi->PktsNum=1, the current residual quota fi->DC=0 of quota fi-of stream>Quantum=Qi (set-point) and stream; The team that goes out of calculating this network packet p before joining the team takes turns, and directly network packet p is put into out team then and takes turns among the pairing formation qk, be i.e. flow queue under the network packet; The network packet number of the priority groups pri at flow queue place is added 1; Whether the network packet number of judging this priority groups pri is 1, if then the bit vectors position of the pri of priority groups described in bit vectors correspondence is made as 1, otherwise bit vectors is not done any processing; When stream under the network packet p is not present in the active stream table, also affiliated stream to be added active stream table afterbody, and set up stream and flow queue dynamic mapping relationship.
Wherein the active stream table is used for the feature of recorded stream, owing to need calculate the difference of each stream when advancing group, weight etc. determining team's order, for adding the computing of F.F. team, with the difference of scheduling etc., are written among the active stream table Entry.Because comprising, the list item operation inserts and deletion, so adopt the double linked list structure.Its data structure is as follows:
AFLEntry
{
Header?head;
int?16?QueueIndex
int16 Quantum;
int32 ByteNum;
int32 PacketNum;
int32 priority;
AFLEntry?*pre;
AFLEntry?*next;
};
Head storage flow label wherein; QueueIndex is the index of dynamic assignment formation; Quantum is the quota of flow distribution, and ByteNum is the byte number of current stream, and PacketNum is the network packet number.Priority is the priority of stream.Char PriorityGroup[16] come memory priority level group, its group number is generally 2 integral number power, as 128, for safeguarding above vector, need current group of interior network number-of-packet of record, so need the number of current network packet in each group of vector record: Int32PGPacketNum[128].For the highest priority group of quick indexing to non-NULL, adopt a bit vector, every bit is represented a priority groups.If corresponding group is non-NULL, then this bit is 1, otherwise is 0.During priority scheduling, check bit vectors, dispatch the group of first non-VB vacancy bit correspondence.
Step S3, between the network data package according to priority, in the group by dequeue order dequeue, promptly as priority groups i when be empty, group (i+1) just has and can obtain to dispatch, and organizes that interior to go out team in proper order definite when joining the team.As shown in Figure 3, in this step, find a non-NULL priority groups K with limit priority according to bit vectors; Obtain one on this priority groups and take turns the network packet p of linked list head, and upgrade the remaining quota of network packet p place stream fi, promptly; Fi->DC+=fi->Quantum; Whether the quota fi->DC that judges this stream 8 length greater than described network packet p, if, described network packet dequeue, and upgrade the quota fi->DC-=fi->Quantum of described stream, network packet is counted the network packet of fi->PksNum--and priority groups K and is counted K->PksNum--, goes out the wheel K->dequeueround++ of team otherwise upgrade described priority groups; Whether the network packet number of judging stream fi is 0, if, this stream of deletion fi from the active stream table, and upgrade described priority groups and go out the wheel K->dequeueround++ of team, otherwise, directly upgrade described priority groups and go out the wheel K->dequeueround++ of team; The network packet number of priority groups K subtracts 1; Judge whether the network packet number is 0 among the priority groups K, if the bit vectors position of the K of priority groups described in bit vectors correspondence is made as 0, otherwise finishes.
Wherein, going out team and may being interrupted by high-priority queue of low priority goes out the succession of team, int32 LastDequeueRound[128 in order to keep Low Priority Queuing] preserve last time for each group and go out group position.In each priority groups, go out team order and when advancing group, determine.Its structure is every chained list of taking turns scheduling.The sequential access chained list gets final product when going out group.This mechanism is the head and tail portion pointer of each chained list of storage in SIAM only.System is simultaneous, and to go out team's wheel number be M, to simplify the process it regarded as 2 integral number power.As 256.
Packet* RoundHead[256];
Packet* RoundRear[256];
The invention allows for a kind of extendible full-flow priority dispatching system, this system comprises:
The network packet receiver module is used for the receiving network data bag, and resolves described network packet stream label;
Network packet is gone into the formation module, is used for according to dequeue order in the stream label computing network data packet group, and network packet is inserted into affiliated flow queue;
Network packet dequeue module, be used between the network data package according to priority, in the group by dequeue order dequeue;
The network packet sending module is used for network packet is sent.
Wherein, described network packet is gone into the formation module and is comprised:
Continuous query module in the active stream table is used for whether being present in the active stream table according to stream under the stream label requester network packet;
The flow queue preparation module is used for dequeue order in the computing network data packet group, if affiliated stream is present in the active stream table, the network packet number of affiliated stream is added 1, otherwise, the priority of stream obtained, apply for the empty queue that to flow, and the schedule information of stream is somebody's turn to do in initialization;
The flow queue insert module is used for network packet is inserted affiliated flow queue;
The priority groups update module is used for the network packet number of flow queue place priority groups is added 1;
Bit vectors is provided with module, is used to judge whether the network packet number of described priority groups is 1, if then the bit vectors position with the correspondence of priority groups described in the bit vectors is made as 1.
Wherein, described network packet dequeue module comprises:
The highest non-NULL priority groups is searched module, is used to the non-NULL priority groups that finds to have limit priority;
The network packet acquisition module of scheduling wheel linked list head is used to obtain the network packet that one on the described priority groups taken turns linked list head, and upgrades the remaining quota of network packet place stream;
The dequeue judge module, whether the quota that is used to judge described stream is greater than the length of described network packet, if, described network packet dequeue, and upgrade the network packet number of quota, network packet number and the described priority groups of described stream, go out team's wheel otherwise upgrade described priority groups;
The network packet of stream is counted judge module, is used to judge whether the network packet number of described stream is 0, if, the described stream of deletion and upgrade described priority groups and go out team wheel in the active stream table, otherwise, directly upgrade described priority groups and go out team's wheel;
The priority groups update module is used for the network packet number of described priority groups is subtracted 1;
Bit vectors is provided with module, is used for judging whether described priority groups network packet number is 0, if the bit vectors position of the correspondence of priority groups described in the bit vectors is made as 0, otherwise finishes.
The performance that below is extendible full-flow priority dispatching method of the present invention compares.
Test data adopts the synthetic of real traffic and emulation flow.Real traffic is flowed as a setting, to its stream that adds different rates to check performance of the present invention.For increasing credibility of the present invention, real traffic has adopted OC3, OC48 that NLANR provides and the stream of three kinds of different rates of OC192.By adjusting, making load all is 0.95.The distribution of its active stream as shown in Figure 4.Can see that therefrom active stream only is 256 under the worst case, the number (flows in progress) of the concurrent stream in the table one.
Table 1 stream information statistics
Trace |
NLANR1 |
NLANR2 |
NLANR3 |
avcrage?trace?rate |
14.4Mbps |
372Mbps |
557Mbps |
original?output?capacity |
155Mbps |
2.5Gbps |
10Gbps |
regulate?output?capacity |
15.2Mbps |
392Mbps |
586Mbps |
packets?number |
10M |
20M |
100M |
flows?in?progress |
53K |
75K |
100K |
MTU |
1500byte |
1537bytes |
9000bytes |
The emulation flow of synthetic 1,8,16,32,64 in real traffic, 128 6 kind of different rates is as protected stream.The size of each network packet is 1024byte.
The protection effect of three kinds of machine-processed convection current by the active stream table relatively.This method abbreviates AFL-SFQ-DRR (active stream table-strict-priority-difference polling dispatching) as.Other two kinds is AFL-FIFO and AFL-DRR.
The time delay of adjacent networks packet is an important indicator of test network speed.Definition herein:
Expectation time=network data packet length/flow velocity
And relative deviation is defined as:
Relative deviation=(experimental result-expectation time)/expectation time.
Can find out that the relative deviation of this method is less from the relative deviation of the relative deviation of Fig. 5 (a) 1Mbps stream, (b) 32Mbps stream with (c) the relative deviation of 128Mbps stream, shown in figure Smalt curve.
The extendible full-flow priority dispatching method of this method only is simultaneous flowable state binding physical queue in the system, thereby has realized full flow queue by using the active stream table.Increased two-layer scheduling strategy on this basis, realized that the service differentiation of full stream and bandwidth guarantee.By the experiment of resultant flow, show that this method has higher performance really on service guarantees.Along with broad application of Internet, the rise of various application has different time delays and bandwidth requirement to network.Guarantee by fine-grained service differentiation and bandwidth, be directly connected to the popularization and the user experience of every application.This method is by adopting full-flow priority dispatching, and whole data structure is limited in the high-speed SRAM, makes it be easy to use in express network and expand.
Above execution mode only is used to illustrate the present invention; and be not limitation of the present invention; the those of ordinary skill in relevant technologies field; under the situation that does not break away from the spirit and scope of the present invention; can also make various variations and modification; therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.