CN1607767A - Flow-control method based on network processor - Google Patents

Flow-control method based on network processor Download PDF

Info

Publication number
CN1607767A
CN1607767A CN 200310106647 CN200310106647A CN1607767A CN 1607767 A CN1607767 A CN 1607767A CN 200310106647 CN200310106647 CN 200310106647 CN 200310106647 A CN200310106647 A CN 200310106647A CN 1607767 A CN1607767 A CN 1607767A
Authority
CN
China
Prior art keywords
token
data packet
current data
token bucket
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 200310106647
Other languages
Chinese (zh)
Inventor
胡福军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN 200310106647 priority Critical patent/CN1607767A/en
Publication of CN1607767A publication Critical patent/CN1607767A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A flow control method based on a network processor includes: designing parameters for the flow control algorithm, computing parameters related to the arrived time scale of the current data packet, transmitting said data packet and token if L is smaller than C2 according to the compared result to the length L of the current data packet and current token number C2 in the token bucket, otherwise, they are given up, regulating the two parameter values of the token number and time scale in said token bucket.

Description

The flow control methods of processor Network Based
Technical field
The present invention relates to the flow control methods of data communication field, particularly relate to a kind of control method that on network processing unit, realizes broadband network user's online flow.
Background technology
At present, along with the popularization and the development of broadband network, the number of users of broadband network sharply increases.Because the user of most use broadband networks comparatively disperses, therefore, telecom operators not only will carry out general service management to the broadband user who inserts, also need to possess the ability that the service of the different grades of service is provided at the user of different brackets, promptly will control respectively the bandwidth that the user uses; Each flow control methods is based on different hardware, and it should satisfy the general requirement of customer flow control, also simple to operate, precise control.
In the present network equipment, flow control methods is varied, and wherein the algorithm of most methods is general, but because of the restriction and the influence of the factors such as complexity that are subjected to concrete hardware configuration, CPU computing capability and algorithm, its specific implementation process is different.At present, following three kinds of flow control methods are arranged:
1. in flow control methods, adopt the Token Bucket method
The function ratio of this method own is more complete, but it not only needs token is stored, and need carry out buffer memory to the packet that arrives, and simultaneously, need certain tolerance be arranged to the burst time interval; Therefore comparatively complicated on realizing, the especially very difficult effective control that realizes flow in the process of microcode speed limit forwarding packet;
2. in flow control methods, adopt the method for utilizing software timer
The timing unit that this method adopts the software timer conduct on the CPU that customer flow is controlled because the inexactness of software timer can cause the error in the calculating, thereby influences the accuracy of microcode flow control;
3. in flow control methods, adopt the method for utilizing hardware timer
Though this method has adopted hardware timer, its control mode be with second as unit of account, every mistake refreshed timer in one second No. one time, thereby caused the unsmooth of flow, from control the result on, customer flow situation off and on can appear.
In sum, exist in the existing flow control technique algorithm realize complicated, control is inaccurate, controlled flow is unsmooth, and service time is fixing and be difficult for general etc. problem, problem at above various algorithms existence, and, need to propose a kind of flow control methods of the processor Network Based that addresses the above problem according to the suffered condition restriction of network processing unit in the prior art itself.
Summary of the invention
Purpose of the present invention is just at the defective that exists in the above-mentioned background technology, a kind of flow control methods of processor Network Based is proposed, the timer that adopts hardware to provide is realized the accuracy of control, simultaneously, in the process of control, use bag to trigger the mode of control, guaranteed the flatness of customer flow in transmission course.
The flow control methods of a kind of processor Network Based proposed by the invention is characterized in that, this method may further comprise the steps:
(1) parameter of carrying out flow control, step 201 are set;
The parameter that needs to be provided with comprises:
When token bucket capacity C, token arrival rate P, a last packet due in t1, current data packet due in t2, current data packet arrival, remaining token number is the length L of C1, current data packet in the token bucket;
(2) calculate the parameter relevant, step 202 with the current data packet due in;
The current data packet delivery time is t2-t1, and at t2 constantly: the token number in the token bucket is C2=min{C, C1+ (t2-t1) * P}
(3) according to the result that current token number C2 in the token bucket is compared with the length L of current data packet, if L<=C2 sends this packet and token; Otherwise, abandon this packet and token; And
(4) token number in the token bucket after the token number in the adjustment token bucket and these two parameter values constantly, wherein current token number equal to calculate in (3); Token number=C2-L in the time can sending in the token bucket; Token number=C2 in the time can not sending in the token bucket; Adjustment constantly equals the value of the t1 after the calculating in (3), can send maybe cannot send all constantly to be updated to the moment that current bag arrives, i.e. t1=t2.
Compared with prior art, adopt the method for the invention, have realize that simple, precise control, flow are level and smooth, fix service time, estimating system have during the processing time detailed test data as a reference, be easy in like product generally, and have compatibility for series processors or other network processing units that counter is arranged of INTEL.
The implementation platform of the method is the IXP1200 series network processing unit of intel company, is easy in like product general.And for other network processing units, as long as inside provides hardware timer also can use the method.
Be elaborated below in conjunction with embodiment and with reference to the technical scheme of accompanying drawing to this invention.
Description of drawings
Fig. 1 is an abstract model schematic diagram of the present invention;
Fig. 2 is the general flow chart of flow control methods of the present invention;
Fig. 3 is a flow control methods embodiment flow chart of the present invention.
Embodiment
As shown in Figure 1, be abstract model schematic diagram of the present invention, with the foundation of the token in the token bucket 102 101 as the forwarding of packet 103, token 101 is put in the token bucket 102 according to certain speed, packet 103 is got token 101 from token bucket 103 when transmitting, if the quantity of token 101 then sends this token, otherwise abandons more than or equal to the required token number of packet 103.
Abstract model of the present invention is a token bucket algorithm model that has token that is similar to the Token Bucket algorithm of standard, different with the Token Bucket algorithm of standard, owing to do not need bag is carried out buffer memory, therefore, packet wherein and token all might abandon.
As shown in Figure 2, be flow control methods flow chart of the present invention, implementation method of the present invention comprises the steps:
(1) parameter of carrying out flow control algorithm, step 201 are set;
The parameter that needs to be provided with comprises:
Token bucket capacity C (byte);
(the K byte/S), owing to do not cushion, C should equal P to user bandwidth=token arrival rate=P;
A last packet due in t1 (S), its initial value is 0;
Current data packet due in t2 (S);
When current data packet arrived, remaining token number was C1 (byte) in the token bucket;
The length L of current data packet (byte).
(2) calculate the parameter relevant, step 202 with the current data packet due in;
At t2 constantly:
Token number in the token bucket is C2=min{C, C1+ (t2-t1) * P}
(3) according to the result that current token number in the token bucket is compared with the length of current data packet, the packet in the token bucket is transmitted or discard processing step 203.
If L<=C2
Can send;
Token number=C2-L in the token bucket;
t1=t2;
Otherwise
Discarded packets;
Token number=C2 in the token bucket;
t1=t2;
That is to say, be in the token bucket of current data packet due in t2, if token number then sends this packet and token more than or equal to the required token number of current data packet, otherwise packet discard and token;
(4) token number in the adjustment token bucket and these two parameter values constantly, step 204.
Token number in the token bucket after current token number equals to calculate in (3); Token number=C2-L in the time can sending in the token bucket; Token number=C2 in the time can not sending in the token bucket;
Adjust the value of the t1 after equaling to calculate in (3) constantly; Can send and maybe cannot send all and will be updated to the moment that current bag arrives, i.e. t1=t2 constantly.
With a specific embodiment, further specify technical scheme of the present invention below.
In this specific embodiment, utilize the network processing unit IXP1200 of Intel Company to realize the flow control methods of the processor Network Based that the present invention proposes,, have only a counter owing in IXP1200, there is not clock, therefore, chronomere's conversion second need be become cycle.Counter among the IXP1200 is consistent with the dominant frequency of CPU, is 200MHz/ second.Done relevant test at the network processing unit IXP1200 of Intel, embodiment is as follows:
Hardware environment: IXP1200 network
The treatment step of software section is as follows:
Controlled CPU is after the user inserts, and with user's bandwidth value P write memory, as one of input parameter of algorithm, and the initial value of remaining token number C1 is 0 in the last data bag due in t1 of this moment and the token bucket;
When reaching, finishes by bag the control of customer flow according to the method for Fig. 3;
The flow process that parameter is provided with part comprises:
Current data packet arrives, and obtains this data packet length L, step 301;
The length of current bag is L (byte);
Read the parameters of previous state of the relative current state of relevant token bucket and packet, comprise C1, t1 and user bandwidth value C, step 302:
A. token bucket capacity C (unit: byte)
B. (unit: K byte/S), illustrate: owing to do not cushion, C should equal P to user bandwidth=token arrival rate=P;
C. (unit: S), its initial value is 0 to go up a packet due in t1;
The flow process that related parameter is arranged of calculating current data packet comprises:
By the value of the current counter that reads, calculate the moment t2 that current data packet arrives, step 303;
Judge whether the t2 value overflows step 304; Wherein, if counter uses 64 bits, if based on the 166MHz dominant frequency, 64 bits needed just can overflow in 83 years, so need not consider overflow problem; But, if use the counter of 32 bits, then need the problem of considering that counter overflows, overflow as the t2 value, then need to adjust earlier its value, step 305; Then, calculate current bag and arrive the used time of token bucket, promptly follow formula t2-t1, step 306; Because present employed CPU is generally 32, therefore when making multiplication and division arithmetic, should be noted that the situation of overflowing.
Calculate (t2-t1)/(2 * 10^16), be cycle with the unit conversion of t1 and t2, step 307; Calculate (t2-t1)/(2 * 10^16) * C obtains the middle during this period of time token number that arrives that current data packet arrives token bucket, step 308;
Wherein, the value of P is write in the internal memory by Controlled CPU, has a crucial computational process in this algorithm, in the multiplication of (t2-t1) * P, owing to use cycle as chronomere, must carry out necessary conversion to unit that is:.In order to address this problem, solve by following step:
A. adjust unit of account
The unit of P is the K byte per second, so the P byte per second is scaled cycle, its algorithm is P/ (2 * 10^8) (K bytes/cycle), and, (2 * 10^8) ((2 * 10^5) (byte/cycle), the cycle with corresponding 200MHz of per 1 second time in IXP1200 calculates K byte/cycle)=P/ P/;
B. adjust computational methods, adopt approximate data
Owing to can't finish such operation divided by 10^5 in IXP1200, therefore, all multiplication and division can only be finished with shifting function and addition, promptly need, for convenience of calculation, be similar to 10^5 with 2^16+2^16/2, its error is: [10^5-(2^16+2^16/2)]/10^5=1.7%
So have:
P/(2×(2^16+2^16/2))+delta=P/(2×10^5)
If delta is for adjusting the factor, its value can be by precomputing, as input parameter;
Wherein:
P/ (2 * (2^16+2^16/2))=P/ (2^16 * 3)=P/2^16/3 (formula 1)
Like this, can operate by displacement, satisfy the calculating in the microcode, but also need to solve problem divided by 3 by P/2^16;
C. solve problem divided by 3
Owing to have the problems referred to above among the embodiment,, calculate (t2-t1)/(2 * 10^16) * C/3, step 309 so need to increase the step that solves divided by 3 problem;
If:
Y=1/4+1/16+1/64+ ... 1/4^N+ ... (formula 2)
2Y=1/2+1/8+1/32+ ... 1/2^ (2 * N-1)+... (formula 3)
(formula 2)+(formula 3) obtains:
3Y=1/2+1/4+1/8+……1/2^N+……
Because have:
1/2+1/4+1/8+……1/2^N+……=1
So have:
Y=1/3
Therefore:
X/3=X×(1/4+1/16+1/64+……)
In the actual operation process, the number that can represent all is an integer, in order to be accurate to a position, needs X is enlarged 10 times before calculating, and after calculating is finished, the result is dwindled 10 times.In the actual operation process,, the multiple that enlarges and dwindle is decided to be 16 times owing to can only use shifting function.
Calculating arrives t2 constantly in current data packet, the token number in the token bucket, step 310;
At t2 constantly:
Token number in the token bucket is C2=min{C, and C1+ (t2-t1) * P} wherein, if the C value is little, then establishes C2=C, step 311; All the other situations are then established C2=C1+ (t2-t1)/2^16) * C, step 312; Length and the current data packet of judging current data packet arrive t2 constantly, the magnitude relationship of the token number in the token bucket, step 313; If L<=C2 represents that then packet can send step 314; Residue token number C1=C2-L in the token bucket, step 315; Otherwise the expression packet can abandon step 316; Residue token number C1=C2 in the token bucket, step 317; After upgrading C1, the timer time of adjusting token bucket is t1=t2, step 318; When new by the time packet arrived, t2 promptly became the moment with respect to the last data bag arrival of new data packets.

Claims (3)

1. the flow control methods of a processor Network Based is characterized in that, this method may further comprise the steps:
(1) parameter of carrying out flow control algorithm is set;
The parameter that needs to be provided with comprises:
When token bucket capacity C, token arrival rate P, a last packet due in t1, current data packet due in t2, current data packet arrival, remaining token number is the length L of C1, current data packet in the token bucket;
(2) calculate the parameter relevant with the current data packet due in;
The current data packet delivery time is t2-t1, and at t2 constantly: the token number in the token bucket is C2=min{C, C1+ (t2-t1) * P}
(3) according to the result that current token number C2 in the token bucket is compared with the length L of current data packet, if L<=C2 sends this packet and token; Otherwise, abandon this packet and token; And
(4) token number in the token bucket after the token number in the adjustment token bucket and these two parameter values constantly, wherein current token number equal to calculate in (3); Token number=C2-L in the time can sending in the token bucket; Token number=C2 in the time can not sending in the token bucket; Adjustment constantly equals the value of the t1 after the calculating in (3), can send maybe cannot send all constantly to be updated to the moment that current bag arrives, i.e. t1=t2.
2. the flow control methods of processor Network Based as claimed in claim 1 is characterized in that, and is in the step of the parameter that described calculating is relevant with the current data packet due in, further comprising the steps of:
Judge whether the t2 value overflows;
If this value is overflowed, then need adjust earlier.
3. the flow control methods of processor Network Based as claimed in claim 1 is characterized in that, the step of the parameter that described calculating is relevant with the current data packet due in also comprises following flow process:
Calculate (t2-t1)/(2 * 10^16), be cycle with the unit conversion of t1 and t2;
Adopt approximate calculation, be similar to 10^5 with 2^16+2^16/2;
Calculate (t2-t1)/(2 * 10^16) * C/3.
CN 200310106647 2003-10-16 2003-10-16 Flow-control method based on network processor Pending CN1607767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200310106647 CN1607767A (en) 2003-10-16 2003-10-16 Flow-control method based on network processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200310106647 CN1607767A (en) 2003-10-16 2003-10-16 Flow-control method based on network processor

Publications (1)

Publication Number Publication Date
CN1607767A true CN1607767A (en) 2005-04-20

Family

ID=34757652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200310106647 Pending CN1607767A (en) 2003-10-16 2003-10-16 Flow-control method based on network processor

Country Status (1)

Country Link
CN (1) CN1607767A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007128208A1 (en) * 2006-04-24 2007-11-15 Huawei Technologies Co., Ltd. An access device, a method and means for bandwidth control made by the access device
CN100454897C (en) * 2005-08-25 2009-01-21 华为技术有限公司 Method for effectively preventing attack of network apparatus
WO2009103236A1 (en) * 2008-02-20 2009-08-27 华为技术有限公司 A method and device for traffic shaping
CN101043457B (en) * 2007-03-21 2010-07-07 华为技术有限公司 Packet wideband monitoring method and its apparatus, packet discarding probability tagging device
CN101110716B (en) * 2007-08-13 2010-08-11 杭州华三通信技术有限公司 Method and device for monitoring flux of slicing messages
CN101060471B (en) * 2006-06-23 2010-09-08 华为技术有限公司 Token resource stream control method
CN101873261A (en) * 2010-06-07 2010-10-27 北京网康科技有限公司 Method and equipment for improving fluid control effect of token bucket
CN101193061B (en) * 2006-12-14 2011-07-13 中兴通讯股份有限公司 Multi-Qos-based traffic control method
CN101094180B (en) * 2007-07-20 2012-05-23 杭州华三通信技术有限公司 Method and device for watching and controlling compressed flux
CN101820380B (en) * 2009-02-26 2012-09-12 高通创锐讯通讯科技(上海)有限公司 Token updating method of meter
CN106302211A (en) * 2016-07-18 2017-01-04 网易无尾熊(杭州)科技有限公司 The request amount control method of a kind of Internet resources and device

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100454897C (en) * 2005-08-25 2009-01-21 华为技术有限公司 Method for effectively preventing attack of network apparatus
WO2007128208A1 (en) * 2006-04-24 2007-11-15 Huawei Technologies Co., Ltd. An access device, a method and means for bandwidth control made by the access device
CN101060471B (en) * 2006-06-23 2010-09-08 华为技术有限公司 Token resource stream control method
CN101193061B (en) * 2006-12-14 2011-07-13 中兴通讯股份有限公司 Multi-Qos-based traffic control method
CN101043457B (en) * 2007-03-21 2010-07-07 华为技术有限公司 Packet wideband monitoring method and its apparatus, packet discarding probability tagging device
CN101094180B (en) * 2007-07-20 2012-05-23 杭州华三通信技术有限公司 Method and device for watching and controlling compressed flux
CN101110716B (en) * 2007-08-13 2010-08-11 杭州华三通信技术有限公司 Method and device for monitoring flux of slicing messages
WO2009103236A1 (en) * 2008-02-20 2009-08-27 华为技术有限公司 A method and device for traffic shaping
CN101820380B (en) * 2009-02-26 2012-09-12 高通创锐讯通讯科技(上海)有限公司 Token updating method of meter
CN101873261A (en) * 2010-06-07 2010-10-27 北京网康科技有限公司 Method and equipment for improving fluid control effect of token bucket
CN101873261B (en) * 2010-06-07 2012-10-03 北京网康科技有限公司 Method and equipment for improving fluid control effect of token bucket
CN106302211A (en) * 2016-07-18 2017-01-04 网易无尾熊(杭州)科技有限公司 The request amount control method of a kind of Internet resources and device

Similar Documents

Publication Publication Date Title
CN1200539C (en) Device and method for reducing delay jitter in data transmission
CN1284324C (en) System and method for clock synchronization of general serial bus receiver apparatus
CN1607767A (en) Flow-control method based on network processor
CN1960242A (en) Method, device, system for implementing clock synchronization, and distribution system
CN1878094A (en) Method for testing maximum available bandwidth of network
CN1454420A (en) Selecting content to be communicated based on automatic detection of communication bandwidth
CN1647463A (en) Method and system of data packet transmission timing for controlling bandwidth
CN1226850C (en) Method and system for scheduling information using disconnection/reconnection of network server
CN101057439A (en) Transmitter, receiver and communication system
CN106411773B (en) Flow shaping method in transmission of video based on token bucket and system
CN1509094A (en) Downstream data-pack dispatching system and method in mobile communication system
CN1558623A (en) Method and system for immediately processing real time media stream data packets
CN1669281A (en) Method and system for encapsulating cells
CN1549535A (en) Method for ordering to eliminate its jitter time delay by rank of RTP data packet
CN1833422A (en) Packet communication device
CN1917708A (en) Reception contro method based on measurement and QoS in broadband radio access system
CN1130085C (en) Method for producing ATM information source for low bit speed rate application
CN101043282A (en) Data storage means for multi-channel voice process
CN1293739C (en) High speed link control protocol transmission processing/module and data processing/method
US20030165116A1 (en) Traffic shaping procedure for variable-size data units
CN1453964A (en) Processing of business quantity in synchro communication network
CN102821423B (en) Message method of reseptance and device
CN1878132A (en) Method and system for realizing variable-length packet switching
CN1630293A (en) A method and apparatus for multi-path data transmission in communication system
CN1798099A (en) Method for implementing dynamic speed adjustment for data packets based on logic

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication