Embodiment
Device embodiment one:
Fig. 1 is the schematic diagram according to flow scheduling device in apparatus of the present invention embodiment one packet network.As shown in Figure 1, the device of flow scheduling in the present embodiment packet network, comprise queue management module 102, overall mandate surplus maintenance module 104, wherein: overall mandate surplus maintenance module, for the overall mandate surplus of the whole queue of real-time servicing, surplus totally will be authorized to be distributed to the queue waited for and authorizing, and to send first and to give out a contract for a project enable signal; Queue management module, for giving out a contract for a project enable signal according to receiving first, sends the packet in the queue waiting for and authorizing.
Present embodiments providing a kind of total surplus bucket of authorizing machine-processed, in order to safeguard total mandate surplus value of each queue, and asking always authorizing surplus to lend some selectively in advance and not yet authorized queue.Mandate surplus value fragmentary for each queue can gather and be used by this mode, thus improves the utilance of real-time bandwidth.
Device embodiment two:
Flow scheduling device in packet network to device embodiment one is specifically described by the present embodiment.Fig. 2 is the Organization Chart according to flow scheduling device in apparatus of the present invention embodiment two packet network.As shown in Figure 2, in the present embodiment:
The packet that each queue was in charge of and was operated to queue management module is joined the team out team.When packet is joined the team, then send bag long message and safeguard the respective queue degree of depth to overall surplus maintenance module of authorizing.When receiving overall enable signal of giving out a contract for a project of authorizing surplus maintenance module to send, just send the packet in respective queue.This module is a passive executor.
Scheduler module, mainly carries out the distribution of authorizing.This module produces the mandate representing fixed word joint number by the fixed cycle, receive the authorization requests of overall bandwidth on demand of authorizing surplus maintenance module to send, according to parameters such as priority, weight, shaping bandwidth, by adopting various dispatching algorithm, at utmost distribution authorization gives each queue liberally, to meet their bandwidth request.
Overall mandate surplus maintenance module, in order to safeguard queue depth's (long sum of all bags in a queue) of each queue and to authorize surplus, and the overall mandate surplus (Total value) that is always authorized all queues of surplus bucket real time record is set, namely represent not by the total remaining bandwidth be finished in time.When arbitrary queue obtains a mandate, Total value just adds that is authorized a granularity; When certain queue sends a packet, Total value just deducts corresponding byte number.By always authorizing setting up of surplus bucket, effectively can utilize the mandate surplus value remained by individual queue, fragmentary bandwidth left is gathered, lend the queue of being badly in need of authorizing and use.
The present embodiment is the specific implementation of device embodiment one, and has whole beneficial effects of above-described embodiment, no longer repeats herein.
Device embodiment three:
Packet Generation strategy in the present embodiment is, giving out a contract for a project of queue adopts following mechanism to perform with authorizing surplus maintenance strategy: input side packet enter queue after elder generation to the mandate of outlet side scheduler request, after queue only has the mandate obtaining and be more than or equal to current first packet bag length, this packet just can send.When can send out (queue depth is zero) when certain queue has not had packet and have mandate surplus, the surplus of queue authorize itself is reset but always authorizes surplus bucket not reset.
In the present embodiment, overall surplus maintenance module of authorizing is also for safeguarding single mandate surplus and the single queue degree of depth of each queue.Overall mandate surplus maintenance module comprises: overall mandate surplus upgrades submodule, for authorizing surplus to upgrade to overall; Single mandate surplus upgrades submodule, for upgrading single mandate surplus; The single queue degree of depth upgrades submodule, for upgrading the single queue degree of depth; Borrowing in advance qualification submodule, be greater than single mandate surplus value, and in queue, first packet bag is grown up in single mandate surplus value for the queue depth corresponding when queue, then queue obtains borrowing in advance qualification; Borrowing in advance submodule, for when overall authorize surplus to be greater than preset value time, send first and to give out a contract for a project enable signal, the first enable signal instruction of giving out a contract for a project has totally authorizing surplus to be distributed to the queue borrowing qualification in advance.Be described to the method for each module actual motion below.
Overall mandate surplus upgrades submodule, for upgrading described overall mandate surplus in such a way: A, has queue to obtain the authorization, and overall mandate granularity of authorizing surplus to add mandate correspondence; B, has Packet Generation in queue, and overall bag of authorizing surplus to deduct packet is long.
Borrowing in advance submodule, for when overall authorize surplus to be greater than predetermined threshold value time, transmission first is given out a contract for a project enable signal.Preferably, above-mentioned predetermined threshold value is 0.
Single mandate surplus upgrades submodule, and for upgrading the single mandate surplus of single queue in such a way: A, queue is authorized, then corresponding single mandate surplus adds authorizes corresponding mandate granularity; B, queue sends a packet, then the bag that the single mandate surplus that queue is corresponding deducts packet is long.
The single queue degree of depth upgrades submodule, and for upgrading the queue depth of single queue in such a way: C, queue has data to wrap into team, then to add the bag of packet long for the single queue degree of depth of its correspondence; D, queue sends a packet, then the bag that the single queue degree of depth that queue is corresponding deducts packet is long.
Borrowing in advance qualification submodule, is greater than single mandate surplus value for the queue depth corresponding when queue, and in queue, first packet bag is grown up in single mandate surplus value, then queue obtains borrowing in advance qualification.
Borrowing in advance submodule, for when overall authorize surplus to be greater than predetermined threshold value time, transmission first is given out a contract for a project enable signal.
In the present embodiment, single mandate surplus upgrades submodule and single queue degree of depth renewal submodule adopts the form of form to carry out storing and upgrading.
The present embodiment has whole beneficial effects of device embodiment one, and by the control to borrowing in advance qualification, namely in queue, first packet bag is grown up in the queue acquisition borrowing in advance qualification of single mandate surplus value, can effectively reduce the delay and jitter that packet in queue (especially large bag) sends.Flow exports in as far as possible level and smooth mode, avoids the formation of several large bag and sends and the burst that brings and the impact to subsequent module buffer memory simultaneously.
Embodiment of the method one:
Fig. 3 is the flow chart according to traffic scheduling method in the inventive method embodiment one packet network.As shown in Figure 3, the present embodiment comprises:
Step S302, overall overall mandate surplus of authorizing the whole queue of surplus maintenance module real-time servicing, will totally authorize surplus to be distributed to the queue waited for and authorizing, and send first and to give out a contract for a project enable signal;
Step S304, queue management module to be given out a contract for a project enable signal according to receiving first, sends the packet in the queue waiting for and authorizing.
The present embodiment is corresponding with device embodiment one, and has whole beneficial effects of this embodiment, no longer repeats herein.
Embodiment of the method two:
The Packet Generation strategy of the present embodiment is, giving out a contract for a project of queue adopts following mechanism to perform with authorizing surplus maintenance strategy: input side packet enter queue after elder generation to the mandate of outlet side scheduler request, after queue only has the mandate obtaining and be more than or equal to current first packet bag length, this packet just can send.When can send out (queue depth is zero) when certain queue has not had packet and have mandate surplus, the surplus of queue authorize itself is reset but always authorizes surplus bucket not reset.
Fig. 4 is giving out a contract for a project and the schematic diagram of authorizing surplus to safeguard according to single queue in traffic scheduling method in the inventive method embodiment two packet network.As shown in Figure 4, in the present embodiment:
1) each queue will be safeguarded and authorize surplus and queue depth's information, and their renewal has 3 kinds of trigger conditions:
A. queue obtains a mandate, then it authorizes surplus value to add a mandate granularity;
B. queue sends a packet, then its queue depth and to authorize surplus value all to deduct this data handbag long;
C. queue has data to wrap into team, then its queue depth adds that this data handbag is long;
2) after mandate surplus value or queue depth's information have renewal, the size of two values is compared:
A. when queue depth be less than authorize surplus value time, by all Packet Generations in queue, be then clearly zero by unnecessary mandate surplus;
B. when queue depth is greater than mandate surplus value, compare queue first packet and the size of authorizing surplus value: if a) first packet bag long being less than authorizes surplus value, then send this packet, and upgrade queue depth and mandate surplus value; If b) first packet bag is grown up in mandate surplus value, then continue to wait for and authorize, and this queue obtains from total qualification of authorizing the borrowing in advance of surplus bucket to authorize.
Because Bao Changyu authorizes granularity not necessarily can mate, will produce mandate surplus, time after giving out a contract for a project, queue depth is empty, the mandate surplus in queue will be cleared.Arrange one and always authorize surplus bucket.The overall mandate surplus (Total value) of all queues of total mandate surplus bucket real time record, namely represents not by the total remaining bandwidth be finished in time.Fig. 5 is the schematic diagram according to the maintenance strategy of Total value in traffic scheduling method in the inventive method embodiment two packet network.As shown in Figure 5, in the present embodiment:
1) renewal of Total value has 2 kinds of trigger conditions:
As long as A. there is a queue to obtain a mandate, Total value just adds that is authorized a granularity;
As long as B. have Packet Generation, Total value just deducts corresponding byte number;
2) the positive and negative of Total value is then judged:
A. when Total value is less than 0, then the renewal waiting for Total value is continued;
B. when Total value is more than or equal to 0, then selecting one and waiting for the queue of authorizing and giving out a contract for a project, lending the corresponding byte number of this queue in advance by totally authorizing surplus.
Specifically, when each queue obtains a mandate, total Total value of surplus bucket of authorizing authorizes granularity accordingly with regard to needing to add, when often sending a bag, it is long that Total value just deducts corresponding bag, and total surplus bucket of authorizing can not fall clearly unnecessary mandate surplus.Like this, the mandate surplus being equivalent to single queue is taken in total mandate surplus bucket public.For the mandate surplus that these are public, total surplus bucket of authorizing adopts certain selection mechanism, lends certain first packet and is greater than himself mandate surplus value and is waiting for the queue of authorizing and providing, can first borrow to authorizing and giving out a contract for a project.Total mandate surplus bucket, only when Total value is greater than 0, just can be authorized toward for public use.And after a queue borrows mandate to give out a contract for a project in advance, also can obtain the mandate of previously application, additional surplus can be cleared again and be placed on and always be authorized in surplus bucket, for now other need the queue of bandwidth.
It is machine-processed that the present embodiment have employed a kind of total surplus bucket of authorizing, and in order to safeguard total mandate surplus value (Total value) of each queue, and asking always authorizing surplus to lend some selectively in advance and not yet authorized queue.Mandate surplus value fragmentary for each queue can gather and be used by this mode, thus improves the utilance of real-time bandwidth, and effectively reduces the delay and jitter that packet in queue (especially large bag) sends.Flow exports in as far as possible level and smooth mode, avoids the formation of several large bag and sends and the burst that brings and the impact to subsequent module buffer memory simultaneously.
Embodiment of the method three:
The present embodiment is by giving out a contract for a project and authorizing that surplus is safeguarded, the maintenance strategy of Total value is described respectively to single queue.Fig. 6 is according to schematic diagram of authorizing surplus bucket mechanism total in traffic scheduling method in the inventive method embodiment three packet network.Traffic scheduling method in composition graphs 5 pairs of packet networks is described in detail by the present embodiment.
As shown in Figure 6, suppose a scheduler, input side is connected to each and every one queue limited, and all likely packet receiving is given out a contract for a project and sent authorization requests state to carry out bandwidth application.The distribution scheduling of authorizing and traffic shaping all remain relatively independent, according to the information such as priority, weight, the mandate (be called one authorize granularity) representing fixed size is distributed to each queue liberally according to the fixed cycle, this represent a fixing outlet bandwidth value.Such as under the clock frequency of 500MHz, every 20 clk distribute the mandate of a 400B, represent the outlet bandwidth of 10Gbps.Queue depth's information and the mandate earnings information of individual queue are stored in overall mandate in the queue depth/mandate surplus Maintenance Table of surplus maintenance module.
Under the strategy that the present embodiment uses, newly wrap into team when certain queue has, the bag long message sending this bag is authorized surplus maintenance module to overall by queue management module.This module queue depth/mandate surplus Maintenance Table is safeguarded the queue depth of individual queue and is authorized earnings information, and these two all in units of byte.Surplus maintenance module can be authorized to give out a contract for a project to queue and send out how many bag make judgement according to this table is overall, can give out a contract for a project, send an enable signal of giving out a contract for a project to queue management module, then corresponding data bag wherein just can send by respective queue.
Queue 0: had that a 8000B's wrap into team greatly, and due to positive credit mechanism, waiting for the distribution of mandate, now have accumulated 10 mandates, still needed 10, this large bag could be sent; Meanwhile, this queue is qualified authorizes borrowing in advance surplus bucket to authorize from total;
Queue 1: have the parcel of 3 80B to join the team (queue depth 80*3=240B), and obtained a mandate (total mandate surplus bucket is corresponding adds that is authorized a granularity) in a upper warrant distributing moment; These 3 parcels of subsequent time can send, and mandate surplus are deducted 240B (Total value also deduct 240B) simultaneously, when judging that queue depth is 0 afterwards by the mandate surplus clear 0 of 400-240=160B;
Queue 2: had that a 8000B's wrap into team greatly, is waiting for the distribution of mandate, now have accumulated 11 mandates, still needed 9, could send this large bag; Meanwhile, this queue is qualified authorizes borrowing in advance surplus bucket to authorize from total; Next, total mandate surplus bucket (Total > 0) will be borrowed in advance and license to this queue, and the large bag of this 8000B is sent, and authorizes surplus to be updated to 400*11-8000=-3600B;
Queue 3: had the packet of 1 1000B to join the team, and saved bit by bit 1 mandate, need to continue to wait for mandate; Meanwhile, this queue is qualified authorizes borrowing in advance surplus bucket to authorize from total;
Queue 4: had the parcel of two 60B and 80B to join the team, and applying for authorizing; Now have the packet of 1 1000B to join the team, queue depth will be updated to 60+80+1000=1140B; In a following warrant distributing moment, this queue can obtain a mandate, authorizes surplus to be updated to 0+400=400B;
Queue X: the initial queue degree of depth is 0, is just having that a 600B's newly wrap into team, and queue depth is updated to 600B, and at subsequent time to scheduler application mandate; Meanwhile, this queue also will obtain from total qualification of authorizing the borrowing in advance of surplus bucket to authorize.
In the present invention, after queue receives mandate, do not give out a contract for a project immediately enable to actual arrays corresponding in queue management module, but first upgrade the table that degree of depth is number of queues, safeguard the mandate surplus content of corresponding list item.
The present embodiment giving out a contract for a project and authorizing that surplus is safeguarded, the maintenance strategy of Total value has been described in detail single queue, have whole beneficial effects of embodiment of the method three, and exploitativeness is stronger.
Embodiment of the method four:
As shown in Figure 6, arrange total mandate surplus bucket, the real-time distribution that statistics is authorized and overall surplus, unit is byte B.When Total value is greater than zero, total surplus bucket of authorizing can borrow the queue licensing to some mandates deficiency (queue depth > authorizes surplus) in advance.If scheduler mandate granularity is 400B, certain moment only has four queue request mandates, they are obtained the authorization with polling mode equal proportion, and each queue has that a 8000B's wrap into team greatly simultaneously, needs 8000/400=20 mandate could send the large bag of a 8000B under normal circumstances.Table 1 is Total borrowing in advance licensing process table.As shown in table 1:
Table 1 is Total borrowing in advance licensing process table.
Authorization cycles |
0 |
1-4 |
.. |
17-20 |
20 |
.. |
37-40 |
40 |
.. |
57-60 |
60 |
... |
80 |
Total(*400B) |
-20 |
-16 |
.. |
0 |
-20 |
.. |
0 |
-20 |
.. |
0 |
-20 |
... |
0 |
a(*400B) |
-20 |
-19 |
. |
-15 |
-15 |
.. |
-10 |
-10 |
.. |
-5 |
-5 |
... |
0 |
b(*400B) |
0 |
1 |
.. |
5 |
-15 |
.. |
-10 |
-10 |
.. |
-5 |
-5 |
... |
0 |
c(*400B) |
0 |
1 |
.. |
5 |
5 |
.. |
10 |
-10 |
.. |
-5 |
-5 |
... |
0 |
d(*400B) |
0 |
1 |
.. |
5 |
5 |
|
10 |
10 |
|
15 |
-5 |
... |
0 |
When system is initial, the queue depth of individual queue is all 8000B, and mandate surplus is 0, Total=0.Due to Total non-negative, so can borrow mandate in advance, then first queue a borrows in advance and authorizes and can give out a contract for a project, and is authorized surplus to become-20*400B=-8000B, and Total value also becomes-8000B.Then authorize and issue this four queues in turn, often distributing a Total value also increases 400B.
At all after dates of the 20th warrant distributing, Total becomes 0, now can borrow mandate in advance again, and queue b can obtain borrowing in advance power, and it authorizes surplus to become (5-20) * 400B=-6000B, Total=-20*400B=-8000B.
At all after dates of the 40th warrant distributing, Total value reverts to 0 again, and now always authorize the borrowing in advance of surplus bucket to license to queue c, it authorizes surplus to be updated to (10-20) * 400B=-4000B, Total=-20*400B=-8000B.
At all after dates of the 60th warrant distributing, Total value reverts to 0 again, and now always authorize the borrowing in advance of surplus bucket to license to queue d, it authorizes surplus to be updated to (15-20) * 400B=-2000B, Total=-20*400B=-8000B.
After 80 warrant distributing cycles altogether, the large bag of 8000B in four queues is sent equably, and individual queue mandate surplus all returns into 0 with Total value.
And under the former technical scheme not adopting total mandate surplus bucket mechanism, four queue poll equal proportions are obtained the authorization, and between the 76th warrant distributing cycle, do not have packet to send the 1st warrant distributing cycle, and in the end four warrant distributing cycles, send the large bag of 4 8000B continuously, form burst flow, this can cause congested to subsequent module buffer memory.The present invention arrange total authorize surplus bucket after, by the stand-by period of authorizing surplus borrowing in advance to reduce packet, and burst is carried out level and smooth, alleviates congested.
Borrowing in advance mechanism can only allow a queue borrowing in advance to authorize a moment, therefore can not form several large bag simultaneously by means of forming another kind of burst situation to bandwidth.And once borrow in advance, Total can be kept at most-8000B, so also only need 20 warrant distributing cycles just just can return, and borrow in advance next time.
The present embodiment is the specific implementation of embodiment of the method two, and has whole beneficial effects of embodiment of the method two, no longer repeats herein.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, and in some cases, step shown or described by can performing with the order be different from herein, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.