Embodiment
Fig. 1 illustrates one embodiment of the present of invention.Network processing unit 1 comprises processing unit 2.Two features of processing unit 2 are called as the first and second resource R1, R2 in this explanation.As understanding in this explanation, resource can be any one in a large amount of dissimilar features, and provides several examples at this.In addition, processing unit can present plural resource usually, referring to reference Fig. 3 hereinafter.One or more resource R1, R2 can be the treatment elements that is suitable for deal with data.Alternatively, one or more resource R1,, R2 can be the performance parameter relevant with processing unit 2.In this embodiment of the present invention, two resources are performance parameter.More specifically, the first resource R1 is the bit rate capacity of processing unit 2, and the second resource R2 is the packet rates capacity of processing unit 2.
Processing unit 2 can be any one in the multiple known type, comprises the asynchronous process pipeline, as described in described in International Patent Application PCT/SE2005/001969, incorporate it into this specification in this mode by reference.Thus, any or all resource R1, R2 can be and processing unit 2, the perhaps performance parameter of the treatment element that processing pipeline is relevant, and its quantity can be far longer than two.Any such treatment element can be the access point of access process equipment or engine, described at WO2004/010288, in this mode by reference it is comprised in this manual.
Alternatively, processing unit 2 can be the combination of RISC (Reduced Instruction Set Computer) processor, microcoding engine, hard coded engine or a type or polytype a plurality of processing unit.
In Fig. 1, data communication is from left to right sent.Packet D1, D2, D3 enter processor by the Data Input Interface that comprises input port 3, and are stored in the following manner in the input buffer 4 before being allowed to enter processing unit 2.After withdrawing from from processing unit 2, be grouped in be transmitted by output port 7 before, be stored in the output buffer 6.
Determined to permit entering processing unit 2 by the first and second reshaper S1, S2, reshaper is respectively the form of bit rate reshaper S1 and packet rate shaper S2.Bit rate reshaper S1 is restricted to the bit rate of processing unit 2.Based on the first resource R1, i.e. the limited characteristic of the bit rate Capacity Selection bit rate reshaper S1 of processing unit 2.Packet rate shaper S2 is restricted to the data packet flows of processing unit 2.Based on the second resource R2, i.e. the limited characteristic of the packet rates Capacity Selection packet rate shaper S2 of processing unit 2.
Reshaper S1, the S2 of any suitable form can be provided, for example as a software program or a part wherein, or as the numeral or the analog circuit of electricity, light or mechanical component.
With reference to Fig. 2.Reshaper S1, S2 all use token bucket algorithm, make the access of data based on separately credit parameter CS1, CS2.All compare in this each of these values CS1, CS2 that also is called as credit value CS1, CS2 with separately the first boundary L1S1, L1S2.If any credit value CS1, CS2 are lower than separately the first boundary L1S1, L1S2, then do not allow the reshaper of any data communication by separately.
If credit value CS1, CS2 neither are lower than separately the first boundary L1S1, L1S2 in the token bucket of reshaper S1, S2, next grouping D1 then be allowed to enter processing unit 2 in the input buffer then.When grouping D1 is allowed to enter processing unit, the credit value of bit rate reshaper S1 has reduced the amount corresponding to the amount of bits of grouping D1, and the credit value CS2 of packet rate shaper S2 has reduced the amount corresponding to the number of the grouping of permitting entering, i.e. grouping.
As an alternative, the credit value CS2 of packet rate shaper S2 can be conditioned, as described in described in International Patent Application PCT/SE2005/001969, incorporate it into this specification in this mode by reference.Therefore, each packet D1, D2, D3 can comprise the header with information, and packet rate shaper S2 can be suitable for reading this information, this information can be relevant with the cost of packet, promptly makes any treatment element of processing unit 2 keep busy with separately packet D1, D2, D3 and can't to accept the maximum duration of new data packet relevant.Alternatively or in addition, such header information can be used to set up the sign of the resource (being treatment element) of the grouping D1, the D2 that participate in handling separately, D3.Further, this header can also comprise the information about separately data packet size.When grouping was allowed to enter processing unit, the credit value CS2 of packet rate shaper S2 had been reduced the amount corresponding to header information, for example cost information.
As shown in Figure 2, the second boundary L2S1, the L2S2 of reshaper S1, S2 separately are greater than separately the first boundary L1S1, L1S2.Alternatively, the second boundary L2S1, the L2S2 of reshaper S1, S2 separately can be identical with the first boundary L1S1, L1S2 separately.If the credit value CS1 of bit rate reshaper S1 is lower than the second boundary L2S1, then credit value CS1 termly (for example each clock cycle of processor) increase fixing credit.The value of this fixed credit amount is based on frequency (for example each clock cycle) and the first resource R1, i.e. the bit rate capacity of processing unit 2 of regular increase.Similarly, if the credit value of packet rate shaper S2 is lower than the second boundary L2S2, then credit value CS2 increases fixing credit termly, and this fixing credit is based on the frequency and the second resource R2 of regular increase, i.e. the packet rates capacity of processing unit 2.
Preferably, reshaper S1, S2 use so-called loose token bucket (loose token bucket) algorithm, promptly the first boundary L1S1, L1S2 are zero, and when credit value CS1, CS2 be non-when negative, divide into groups D1 then be allowed to enter processing unit 2 of the next one in input buffer 4.
If the credit value of any one reshaper S1, S2 is lower than the first boundary L1S1, L1S2, then the credit value of another reshaper S1, S2 can not be increased to the second boundary L2S1, the L2S2 greater than separately.If the credit value of any one reshaper S1, S2 is lower than the first boundary L1S1, L1S2, then the credit value of other reshaper S1, S2 is restricted to the second boundary L2S1 separately, the buffer capacity demand that L2S2 will reduce processing unit 2 with any one.This will be explained by following example:
Allow unrestricted increase of credit level and no matter the independent reshaper of the credit level in other reshaper can not prevent situation as described below: afterwards, the credit value of the second reshaper S2 will reach high relatively level at the packet sequence (promptly being relative long packet in this example) of the second resource R2 that consumes first a large amount of relatively resource R1 and relatively small amount.If consume the packet sequence of following the first resource R1 that consumes relatively small amount after such packet sequence of a large amount of first resource R1 and a small amount of second resource R2 (promptly being relative short packet in this example), then packet burst will be allowed to, and drop to below the first boundary L1S2 up to the credit value CS2 of the second reshaper S2.Accordingly, consuming a large amount of second resource R2 and only the packet sequence of a small amount of first resource R1 (promptly being relative packet of lacking in this example) is afterwards, the credit value of the first reshaper S1 will reach high level, thereby allow to consume the burst of the follow-up packet sequence (promptly being short relatively packet in this example) of the relatively small amount second resource R2, drop to below the first boundary L1S1 up to the credit value CS1 of the first reshaper S1.
The present invention will prevent the formation of big credit value in the process of a large amount of a kind of resources relevant with the another kind of resource of processor of data sequence consumption.This will significantly reduce the size that happens suddenly, itself so that will allow lower descending buffer capacity demand.At processing unit 2 is under the situation of asynchronous process pipeline, as as described in described in International Patent Application PCT/SE2005/001969, the demand to the treatment element buffering will be provided with the buffer of first-in first-out (FIFO) form that provided before treatment element in the present invention.
As mentioned above, reshaper S1, S2 preferably use loose token bucket algorithm, but alternatively, can use any other suitable access algorithm.Using under the situation of so-called strict token bucket algorithm, the first boundary L1S1, L1S2 can be positive, and arrive at least greatly with separately the first boundary L1S1, when L1S2 is corresponding as credit value CS1, CS2, and the D1 that divides into groups is allowed to enter processing unit 2.
When using strict token bucket algorithm, the first boundary L1S1, the L1S2 of any or all reshaper can be determined in advance, and can equate for all packets of reshaper S1, S2 by separately.Alternatively, for each grouping, the first boundary L1S1, L1S2 can be independent, reshaper S1, S2 separately (for example is suitable for reading before access in this case, the above-mentioned type) header information of each packet D1, D2, D3, and the first boundary L1S1, L1S2 are set based on this header information.For example, packet D1, D2 separately, the header information of D3 can comprise cost C1, C2, C3, corresponding to first boundary value L1S1, the L1S2 of one of reshaper S1, S2.Therefore, the header information of the first grouping D1 from input buffer 4 has read cost C1, and first boundary value L1S1, L1S2 are defined as L1S1 (or L1S2)=C1.
Further, when using strict token bucket algorithm, the second boundary L2S1, L2S2 (if the credit value of separately reshaper S1, S2 is lower than its first boundary L1S1, L1S2, then the credit value of another reshaper S1, S2 can not be increased to greater than the second boundary L2S1, L2S2) can be equal to, or greater than the first boundary L1S1, L1S2.Under latter event, can the second boundary L2S1, L2S2 be arranged to surpass the value of the first boundary L1S1, L1S2 scheduled volume separately at each grouping.
Fig. 3 illustrates another embodiment of the present invention.Processing unit 2 presented have resource R1, the R2...RN form more than two feature, each feature can be any one in a large amount of dissimilar features.For example, the first and second resource R1, R2 can be respectively the bit rate capacity and the packet rates capacity of processing unit 2, and further resource can be the treatment element that is suitable for deal with data.
Determined to permit entering processing unit 2 by reshaper S1, S2...SN, the quantity of described reshaper is identical with the quantity of processor device resource R1, R2...RN.Select the limited characteristic of the first reshaper S1 based on the first resource R1, and select the limited characteristic of the second reshaper S2 based on the second resource R2, or the like.
Preferably, each reshaper S1, S2...SN uses token bucket algorithm, makes the access of data based on value CS1 separately, the CS2...CSN of credit parameter.If credit value CS1, CS2...CSN are lower than the first boundary L1S1, L1S2...L1SN, then do not allow the reshaper of any data communication by separately.With corresponding to the above access of carrying out data communication with reference to the described mode of Fig. 1 and 2.Therefore, if credit value CS1, the CS2...CSN of any reshaper S1, S2...SN are lower than separately the first boundary L1S1, L1S2...L1SN, then credit value CS1, CS2...CSN separately termly (for example each clock cycle of processor 1) increase separately fixed credit amount.The value of fixed credit amount separately is based on frequency (for example each clock cycle) and separately resource R1, the R2...RN of regular increase.
If the credit value of any reshaper S1, S2...SN is lower than separately the first boundary L1S1, L1S2...L1SN, then the credit value of other reshaper S1, S2...SN can not be increased to the second boundary L2S1, the L2S2...L2SN greater than separately.The second boundary L2S1, L2S2...L2SN can be more than or equal to the first boundary L1S1, L1S2...L1SN separately.
In the embodiment that reference Fig. 1-3 describes, its access is identical based on the packet of the value CS1 of the first credit parameter with its access based on packet D1, D2, the D3 of the value CS2 of the second credit parameter.Yet, shown in Figure 4 as following reference, the present invention also is revisable, make the packet of winning arrive the access of processing device 2 based on first credit parameter, described first credit parameter increases according to the value of the second credit parameter, second packet is allowed to enter processing unit based on second credit parameter, and described second packet is different with first packet.In the example of Fig. 4, first and second packets enter processor by the interface that separates.
With reference to Fig. 4, show another embodiment of the present invention.Network processing unit 1 comprises the processing unit 2 with asynchronous process pipeline 2 forms, the description in a more close step among International Patent Application PCT/SE2005/001969 as described, it is comprised in this manual the synchronous element 8 that this processing unit comprises asynchronous process element P1...PK and has elastic buffer 9,10 in this mode by reference.As under the situation of the described embodiment of reference Fig. 1 and 2, can alternatively provide processing unit 2 with another form, for example in risc processor, provide.
What a more close step described among International Patent Application PCT/SE2005/001969 as described, by reference it is comprised in this manual at this, packet D11...D1M by comprise respectively input port 31,32 ... the interface of 3M enters processor, and be stored in separately input buffer 41,42 ... among the 4M, in addition pipeline moderator 11, S1, S2 ... SM comprise scheduler 11 and a plurality of reshaper S1, S2 ... SM.Especially, for every pair of input port 31,32 ... 3M and input buffer 41,42 ... 4M, provide reshaper S1, S2 ... SM.By reshaper S1, S2 ... SM and scheduler 11 determines to permit entering pipeline 2, and scheduler 11 is according to circulation (Round Robin) algorithm work, scheduler 11 with continuous polling sequence to reshaper S1, S2 ... SM provides the access to pipeline.Except round-robin algorithm, can also use alternative scheduling rule, for example Weighted Fair Queuing, difference circulation, the circulation of weighting difference, strict preference are lined up, are expired the earliest preferentially and First Come First Served.
Preferably, each reshaper S1, S2 ... SM uses token bucket algorithm, make the data access based on value CS1 separately, the CS2 of credit parameter ... CSM.If credit value CS1, CS2 ... CSM be lower than the first boundary L1S1, L1S2 ... L1SM does not then allow the reshaper of any data communication by separately.If any reshaper S1, S2 ... credit value CS1, the CS2 of SM ... CSM be lower than separately the first boundary L1S1, L1S2 ... L1SM, then credit value CS1, CS2 separately ... CSM termly (for example each clock cycle of processor 1) increase separately fixed credit amount.Fixed credit value separately is based on the resource of processing unit 2, for example its packet rates capacity, regularly (for example, each clock cycle) frequency of increasing and input port 31,32 ... the quantity of 3M.Reshaper S1, S2 ... the fixed credit amount of SM increase based on the resource of processing unit 2 may instead be the bit rate capacity of processing unit 2, or its any other performance parameter.As further substituting, different reshaper S1, S2 ... the fixed credit amount increase of SM can based on different treatment element P1 ... PK, 8, from the communication addressing of separately reshaper to described treatment element.
If any reshaper S1, S2 ... the credit value of SM be lower than separately the first boundary L1S1, L1S2 ... L1SM[ZF1], then other reshaper S1, S2 ... the credit value of SM can not be increased to greater than separately the second boundary L2S1, L2S2 ... L2SM.The second boundary L2S1, L2S2 ... L2SM can more than or equal to separately the first boundary L1S1, L1S2 ... L1SM.This has prevented the formation of big credit in the reshaper at interface in the time period of the communication stream that received communication or reception are not few relatively, makes when this time period is over and done with, can avoid the data burst from this interface.(should be noted in the discussion above that in this explanation the reshaper that provides at interface or input port place represents that it is physically provided by this interface or this input port, perhaps is functionally connected to this interface or this input port).
Still with reference to Fig. 4, what should propose is, each interface or input port 31,32 ... the 3M place can provide a plurality of reshapers, and is as above described with reference to Fig. 1-3, the credit of regulating the reshaper of each interface based on the resource separately of processing unit respectively.Therefore, if the credit value of any reshaper is lower than first boundary separately, then can not be increased to second boundary greater than separately at the credit value of other reshaper of same interface.Alternatively, if the credit value of any reshaper is lower than first boundary separately, all other reshapers then, the credit value that comprises the reshaper of other interface can not be increased to second boundary greater than separately.
Alternatively or in addition, can regulate the above any embodiment that describes with reference to Fig. 1-4, if make any input buffer 4,41,42 ... 4M be a sky, then be suitable for from this input buffer 4,41,42 ... the credit value of the reshaper of 4M received communication (or a plurality of reshaper) can not be increased to greater than the second boundary L2S1, L2S2 ... L2SM.This has prevented the formation of big credit in the reshaper at interface in the time period of the communication stream that received communication or reception are not few relatively, makes when this time period is over and done with, can avoid the data burst from this interface.