JP4601657B2 - Traffic shaping apparatus and method - Google Patents

Traffic shaping apparatus and method Download PDF

Info

Publication number
JP4601657B2
JP4601657B2 JP2007277842A JP2007277842A JP4601657B2 JP 4601657 B2 JP4601657 B2 JP 4601657B2 JP 2007277842 A JP2007277842 A JP 2007277842A JP 2007277842 A JP2007277842 A JP 2007277842A JP 4601657 B2 JP4601657 B2 JP 4601657B2
Authority
JP
Japan
Prior art keywords
value
token
token counter
packet
transmission request
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.)
Active
Application number
JP2007277842A
Other languages
Japanese (ja)
Other versions
JP2009105829A (en
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.)
NTT Electronics Corp
Nippon Telegraph and Telephone Corp
Nippon Telegraph and Telephone West Corp
Nippon Telegraph and Telephone East Corp
Original Assignee
NTT Electronics Corp
Nippon Telegraph and Telephone Corp
Nippon Telegraph and Telephone West Corp
Nippon Telegraph and Telephone East 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 NTT Electronics Corp, Nippon Telegraph and Telephone Corp, Nippon Telegraph and Telephone West Corp, Nippon Telegraph and Telephone East Corp filed Critical NTT Electronics Corp
Priority to JP2007277842A priority Critical patent/JP4601657B2/en
Publication of JP2009105829A publication Critical patent/JP2009105829A/en
Application granted granted Critical
Publication of JP4601657B2 publication Critical patent/JP4601657B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、通信網におけるパケットの転送、出力を指定された帯域に制限し、かつ平滑化するトラヒックシェーピング装置および方法に関する。   The present invention relates to a traffic shaping apparatus and method for limiting and smoothing the transfer and output of packets in a communication network to a designated band.

従来、通信網におけるパケットの転送、出力においては、送信要求されたパケットを指定された帯域に制限し、かつ平滑化してパケットを出力するトラヒックシェーピング(パケットシェーピング)装置が用いられている。例えば、特許文献1には、トークンバケツモデルおよびリーキバケツモデルを用いたトラヒックシェーピング装置(シェーパ)が開示されている。   Conventionally, in packet transfer and output in a communication network, a traffic shaping (packet shaping) device that limits a packet requested for transmission to a designated band and outputs the packet after being smoothed is used. For example, Patent Document 1 discloses a traffic shaping device (shaper) using a token bucket model and a leaky bucket model.

このようなトークンバケツモデルまたはリーキバケツモデルのトラヒックシェーピング装置におけるトークンカウント方法としては、システムクロックを分周し、分周したタイミングで、トークンバケツにトークンカウント値を加算している。このとき、トークンカウント値が加算される頻度を示すトークンレートは,システムクロックをClk、分周比をN、加算値をTとすると、以下の式のようになる。
トークンレート=8×Clk×T/N
上記式が示すように、トークンレートは、システムクロックを分周比Nで除算することで算出されるため、トークンレートが高い場合には粗くしか設定できず、また、低い場合には必要以上に密に設定されるという問題があった。
As a token counting method in such a token bucket model or leaky bucket model traffic shaping device, the system clock is divided and the token count value is added to the token bucket at the divided timing. At this time, the token rate indicating the frequency with which the token count value is added is expressed by the following equation, where Clk is the system clock, N is the frequency division ratio, and T is the addition value.
Token rate = 8 x Clk x T / N
As the above formula shows, the token rate is calculated by dividing the system clock by the division ratio N, so it can only be set coarsely when the token rate is high, and more than necessary when the token rate is low. There was a problem of being set densely.

この問題を解決するために、特許文献2には、システムクロックを設定された分周比に分周し、分周されたシステムクロックをカウントして、カウントされたカウンタ値が予め設定された比較値以下の場合に分周されたクロックを出力し、一方、カウントされたカウンタ値が予め設定された比較値を超えた場合に分周されたクロックを出力しないことにより、単位時間あたりのトリガの生成を調整して、トークンレートの設定を行う方法が提案されている。   In order to solve this problem, Patent Document 2 divides the system clock to a set division ratio, counts the divided system clock, and compares the counted counter value with a preset value. When the count value is less than the value, the divided clock is output.On the other hand, the divided clock is not output when the counted counter value exceeds the preset comparison value. A method for adjusting the generation and setting the token rate has been proposed.

また、特許文献3には、このようなシェーパを多段的に複数備え、前段回路からのパケット送信要求と当該パケットのフレーム情報を受け取り、トークンの状態によって送信要求を後段回路に出力し、後段回路から受信したパケット受理信号を前段回路に出力する多段QoSモジュールが開示されている。
特開2007−088998号公報 特開2007−088994号公報 特開2005−323230号公報
Patent Document 3 includes a plurality of such shapers in multiple stages, receives a packet transmission request from the preceding circuit and frame information of the packet, outputs a transmission request to the succeeding circuit according to the state of the token, Discloses a multi-stage QoS module that outputs a packet reception signal received from the first stage circuit.
JP 2007-088998 A JP 2007-088994 A JP 2005-323230 A

しかしながら、上述の特許文献2に示す方法でも、分周されたクロックをカウントするカウンタ手段に設定された加算値により、周期的にクロックが出力と停止を繰り返すため、設定される値によりトークンレートの精度は上下するという問題がある。   However, even in the method shown in Patent Document 2 described above, since the clock is periodically output and stopped by the addition value set in the counter unit that counts the divided clock, the token rate is set according to the set value. There is a problem that accuracy increases and decreases.

本発明は、このような状況に鑑みてなされたもので、所望のトークンレートに対して高い精度でトークンレートを制御するトラヒックシェーピングが可能なトラヒックシェーピング装置を提供する。   The present invention has been made in view of such a situation, and provides a traffic shaping device capable of traffic shaping for controlling a token rate with high accuracy with respect to a desired token rate.

上述の課題を解決するために、本発明は、予め定められたトークンカウンタ値の最大値であるトークンサイズを上限値として、予め定められた周期により加算されるトークンカウンタ値を記憶するトークンカウンタ記憶部を備え、トークンカウンタ記憶部に記憶されるトークンカウンタ値に基づいてパケット送信を制御するトラヒックシェーピング装置であって、予め定められたシフト値を記憶するシフト値記憶手段と、トークンカウンタ値に加算値を加算する際に、トークンカウンタ値と、トークンサイズをシフト値により左シフト演算した値とを比較し、トークンカウンタ値の方が、トークンサイズをシフト値により左シフト演算した値よりも大きい場合に、トークンサイズを、トークンカウンタ値としてトークンカウンタ記憶部に記憶させる第1の演算手段と、パケットの送信要求を受信した場合に、トークンカウンタ値に基づいて、パケットの送信要求を行う制御手段と、制御手段がパケットの送信要求を行った場合に、パケットのフレームサイズ値をシフト値により左シフト演算した値を、トークンカウンタ値から減算する第2の演算手段と、を備えることを特徴とする。   In order to solve the above-described problem, the present invention provides a token counter storage that stores a token counter value that is added at a predetermined period, with a token size that is a maximum value of a predetermined token counter value as an upper limit value. A traffic shaping device that controls packet transmission based on a token counter value stored in a token counter storage unit, a shift value storage means for storing a predetermined shift value, and an addition to the token counter value When adding values, the token counter value is compared with the value obtained by calculating the token size with the shift value to the left, and the token counter value is greater than the value obtained by calculating the token size with the shift value to the left The token size is stored in the token counter storage unit as the token counter value. A first calculation means for controlling the packet transmission request when receiving a packet transmission request, and a control means for making a packet transmission request based on the token counter value, and when the control means makes a packet transmission request, And second calculating means for subtracting a value obtained by left-shifting the frame size value by the shift value from the token counter value.

本発明は、上述の制御手段が、パケットの送信要求を受信した場合に、トークンカウンタ値が、パケットのフレームサイズ値をシフト値により左シフト演算した値以上である場合に、パケットの送信要求を行うことを特徴とする。   In the present invention, when the above-mentioned control means receives a packet transmission request, the packet counter requests the packet transmission request when the token counter value is equal to or larger than the value obtained by left-shifting the frame size value of the packet by the shift value. It is characterized by performing.

本発明は、上述の制御手段が、パケットの送信要求を受信した場合に、トークンカウンタ値が、予め定められたトークンカウンタ値の初期値以上である場合に、パケットの送信要求を行うことを特徴とする。   The present invention is characterized in that, when the above-described control means receives a packet transmission request, the packet transmission request is made when the token counter value is equal to or greater than a predetermined initial value of the token counter value. And

本発明は、上述の制御手段が、送信要求を行った後、予め定められた待機時間の間、新たなパケットの送信要求を受信しない場合に、トークンカウンタ記憶部に記憶されたトークンカウンタ値に初期値を記憶させる第3の演算手段と、を備えることを特徴とする。   In the present invention, when the above-mentioned control means does not receive a transmission request for a new packet for a predetermined waiting time after making a transmission request, the control means stores the token counter value stored in the token counter storage unit. And a third calculating means for storing an initial value.

本発明は、予め定められたトークンカウンタ値の最大値であるトークンサイズを上限値として、予め定められた周期により加算されるトークンカウンタ値を記憶するトークンカウンタ記憶部に記憶されるトークンカウンタ値に基づいてパケット送信を制御するトラヒックシェーピング方法であって、第1の演算手段が、トークンカウンタ値に加算値を加算する際に、トークンカウンタ値と、トークンサイズを予め定められたシフト値により左シフト演算した値とを比較し、トークンカウンタ値の方が、トークンサイズをシフト値により左シフト演算した値よりも大きい場合に、トークンサイズを、トークンカウンタ値としてトークンカウンタ記憶部に記憶させるステップと、制御手段が、パケットの送信要求を受信した場合に、トークンカウンタ値に基づいて、パケットの送信要求を行うステップと、第2の演算手段が、制御手段がパケットの送信要求を行った場合に、パケットのフレームサイズ値をシフト値により左シフト演算した値を、トークンカウンタ値から減算するステップと、を備えることを特徴とする。   The present invention provides a token counter value stored in a token counter storage unit that stores a token counter value that is added in a predetermined cycle, with a token size that is a maximum value of a predetermined token counter value as an upper limit value. A traffic shaping method for controlling packet transmission based on the first counter, when the addition value is added to the token counter value, the token counter value and the token size are shifted to the left by a predetermined shift value. Comparing with the calculated value, and when the token counter value is larger than the value obtained by calculating the left shift by the shift value, the token size is stored in the token counter storage unit as the token counter value; When the control means receives a packet transmission request, the token counter A step of making a packet transmission request based on the data value, and a value obtained by performing a left shift operation on the frame size value of the packet by the shift value when the control unit makes a packet transmission request by the control unit. Subtracting from the token counter value.

以上説明したように、本発明によれば、予め定められた周期(Clk)により加算値(T)が加算されるトークンカウンタ値に基づいてパケット送信を制御するトラヒックシェーピング装置が、パケットの送信要求を受信した場合に、パケットのフレームサイズ値を予め定められたシフト値(N)により左シフト演算した値と、前記トークンカウンタ値とを比較して大小を判定し、トークンカウンタ値の方が大きいと判定された場合に、前記パケットを送信すると、前記フレームサイズ値を、トークンカウンタ値から減算するようにしたので、トークンレートの値の算出式を、トークンレート=8×Clk×T/2とすることができ、従来と比べて精度の高いトークンレートによるトラヒックシェーピングを行うことが可能となる。 As described above, according to the present invention, a traffic shaping device that controls packet transmission based on a token counter value to which an addition value (T) is added at a predetermined period (Clk) Is received, the frame counter value of the packet is shifted to the left by a predetermined shift value (N) and the token counter value is compared to determine the magnitude, and the token counter value is larger When the packet is transmitted, the frame size value is subtracted from the token counter value. Therefore, the token rate value calculation formula is token rate = 8 × Clk × T / 2 N Therefore, it is possible to perform traffic shaping at a token rate with higher accuracy than in the past.

さらに、本発明によれば、パケットを送信した後、予め定められた待機時間の間、新たなパケットの送信要求を受信しない場合に、トークンカウンタ記憶部に記憶されたトークンカウンタ値に初期値を記憶させてトークンカウンタ値をリセットするようにしたので、リーキバケツモデルでのパケットの送受信の間隔が長い場合、その間もトークンカウンタ値には加算値が加算され、トークンカウンタ値が0以上となり、早い時点でのトークン加算の停止によるトークンレートの低下を抑え、所望するトークンレートを保つことが可能となる。   Furthermore, according to the present invention, after transmitting a packet, when a request for transmitting a new packet is not received for a predetermined waiting time, an initial value is set to the token counter value stored in the token counter storage unit. Since the token counter value is stored and reset, when the packet transmission / reception interval in the leaky bucket model is long, the added value is added to the token counter value during that time, and the token counter value becomes 0 or more, which is fast. It is possible to suppress a decrease in the token rate due to the stop of token addition at the time point and to maintain a desired token rate.

以下、本発明の一実施形態について、図面を参照して説明する。
本発明の説明中で、M<<N(M、Nは任意の数)とは、Mの値をNの値分左シフト演算を行うことを示す。また、本発明の説明中で、(条件)?(真値):(偽値)とは、三項演算子であり、(条件)が真であれば(真値)をとり、(条件)が偽であれば(偽値)をとることを示す。また、本発明の説明中で、(条件A)==(条件B)とは、(条件A)が示す条件と(条件B)が示す条件とが一致するか否かの判定を行い、一致すれば真とし、一致しなければ偽とする条件式を示す。また、本発明の説明中で、(条件A)&&(条件B)とは、(条件A)が示す条件と(条件B)が示す条件とのAND(論理積)をとることを示す。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
In the description of the present invention, M << N (M, N is an arbitrary number) indicates that the value of M is left-shifted by the value of N. In the description of the present invention, (conditions)? (True value): (False value) is a ternary operator that takes (true value) if (condition) is true and takes (false value) if (condition) is false. Show. In the description of the present invention, (Condition A) == (Condition B) determines whether the condition indicated by (Condition A) matches the condition indicated by (Condition B). A conditional expression that is true if it is true and false if it does not match is shown. In the description of the present invention, (condition A) && (condition B) indicates that an AND (logical product) of the condition indicated by (condition A) and the condition indicated by (condition B) is taken.

<第1の実施形態>
図1の(a)は、第1の実施形態によりトークンバケツモデルで動作するトラヒックシェーピング装置の構成を示すブロック図である。
トラヒックシェーピング装置100は、トークンバケツモデルにより送信要求されたパケットの帯域を平滑化して出力し、トークンサイズ設定部101と、加算値設定部102と、トークンカウンタ103と、シフト値設定部104と、フレーム長設定部105と、演算部106と、制御部107とを備えている。
<First Embodiment>
FIG. 1A is a block diagram illustrating a configuration of a traffic shaping device that operates in a token bucket model according to the first embodiment.
The traffic shaping device 100 smoothes and outputs the bandwidth of the packet requested to be transmitted by the token bucket model, the token size setting unit 101, the addition value setting unit 102, the token counter 103, the shift value setting unit 104, A frame length setting unit 105, a calculation unit 106, and a control unit 107 are provided.

ここで、図2を参照して、トークンバケツモデルの処理概念を説明する。この図が示すようにトークンバケツモデルは、所望の帯域に合わせたレート(トークンレート)でトークンをトークンバケツに入れてゆき、予め定められたトークンサイズを最大とするトークンが蓄積される。   Here, the processing concept of the token bucket model will be described with reference to FIG. As shown in this figure, in the token bucket model, tokens are put into a token bucket at a rate (token rate) that matches a desired bandwidth, and a token that maximizes a predetermined token size is accumulated.

そして、フレームバッファからフレームの送出要求を得た場合、送出要求フレームのサイズと現在のトークンバケツに蓄積されているトークン量とが比較され、送出要求フレームのサイズよりもトークン量が少ない場合には、トークン量が送出要求フレームのサイズ以上になるまでフレームは送出されない。一方、トークン量が送出要求フレームのサイズ以上であれば、送出要求フレームが送出され、トークンバケツに蓄積されているトークンから送出されたフレームのサイズ(フレーム長)分のトークンを減算する。   When a frame transmission request is obtained from the frame buffer, the size of the transmission request frame is compared with the token amount stored in the current token bucket, and if the token amount is smaller than the size of the transmission request frame, The frame is not transmitted until the token amount exceeds the size of the transmission request frame. On the other hand, if the token amount is equal to or larger than the size of the transmission request frame, the transmission request frame is transmitted, and the token corresponding to the size (frame length) of the transmitted frame is subtracted from the token accumulated in the token bucket.

図1に戻り、トークンサイズ設定部101は、トークンバケツに蓄積されるトークン量の最大値であるトークンサイズを記憶する。加算値設定部102は、トークンカウンタ103に加算する加算値(T)を記憶する。トークンカウンタ103は、トークンバケツに蓄積されているトークン量としてのトークンカウンタ値を記憶する。シフト値設定部104は、フレーム長とトークンカウンタ値とを比較する際に用いるシフト値を記憶する。フレーム長設定部105は、前段回路10から入力されるフレームのサイズを記憶する。演算部106は、システムクロック周波数に合わせて、トークンカウンタ103に記憶されたトークンカウンタ値に、トークンサイズ設定部101に記憶されたトークンサイズを最大値として、加算値設定部102に記憶された加算値を加算するトークンカウント処理を実行する。図1の(b)に、演算部106が行う比較処理を示す式を示す。   Returning to FIG. 1, the token size setting unit 101 stores a token size that is the maximum value of the token amount accumulated in the token bucket. The addition value setting unit 102 stores an addition value (T) to be added to the token counter 103. The token counter 103 stores a token counter value as a token amount accumulated in the token bucket. The shift value setting unit 104 stores a shift value used when comparing the frame length with the token counter value. The frame length setting unit 105 stores the size of the frame input from the pre-stage circuit 10. The calculation unit 106 adds the token counter value stored in the token counter 103 to the token size stored in the token size setting unit 101 as the maximum value and the addition value stored in the addition value setting unit 102 in accordance with the system clock frequency. Execute token count processing to add values. FIG. 1B shows an expression indicating the comparison process performed by the calculation unit 106.

制御部107は、トラヒックシェーピング装置100の各機能部の動作を制御する。図3は、本実施形態における制御部107の状態遷移を示す図である。制御部107は、IDLE(待機)、ReqSnd(後段回路20へのパケット送信要求出力)、AckWait(後段回路20からのパケット受理信号待ち)、AckSnd(後段回路20からの受理信号を後段回路20に送信)のうちいずれかの状態をとる。   The control unit 107 controls the operation of each functional unit of the traffic shaping device 100. FIG. 3 is a diagram illustrating a state transition of the control unit 107 in the present embodiment. The control unit 107 outputs IDLE (standby), ReqSnd (output of a packet transmission request to the subsequent circuit 20), AckWait (waiting for a packet reception signal from the subsequent circuit 20), and AckSnd (accepting signal from the subsequent circuit 20 to the subsequent circuit 20). (Transmission).

制御部107の初期状態は、IDLEである。IDLE状態にて、制御部107に、前段回路10からフレーム送信要求が入力され、一定の条件を満たすと、制御部107は、ReqSnd状態に遷移する。制御部107は、ReqSnd状態に遷移すると、後段回路20にフレームの送信要求を出力する。そして、制御部107は、AckWait状態となり、後段回路20からの応答を待つ。   The initial state of the control unit 107 is IDLE. In the IDLE state, when a frame transmission request is input from the pre-stage circuit 10 to the control unit 107 and a certain condition is satisfied, the control unit 107 transitions to the ReqSnd state. When transitioning to the ReqSnd state, the control unit 107 outputs a frame transmission request to the subsequent circuit 20. Then, the control unit 107 enters an AckWait state and waits for a response from the subsequent circuit 20.

制御部107は、AckWait状態にて後段回路20から受理信号を受信すると、AckSnd状態となり、受理信号を前段回路10に出力する。図1の(c)に、制御部107が行う処理動作を示す式を示す。ここで、前段回路10と後段回路20とは、例えば、他のトラヒックシェーピング装置100や、パケットの送信制御に関連する、パケットのキュー制御を行うキュー制御回路、パケットの優先制御、重み付け構成制御などを行うスケジューラ回路などである。   When the control unit 107 receives an acceptance signal from the subsequent circuit 20 in the AckWait state, the control unit 107 enters the AckSnd state and outputs the acceptance signal to the upstream circuit 10. FIG. 1C shows an expression indicating the processing operation performed by the control unit 107. Here, the pre-stage circuit 10 and the post-stage circuit 20 are, for example, other traffic shaping apparatuses 100, queue control circuits that perform packet queue control related to packet transmission control, packet priority control, weighting configuration control, and the like. For example, a scheduler circuit.

次に、図4を参照して、本発明によるトラヒックシェーピング装置100が、トラヒックシェーピングを行う動作例を説明する。
ユーザは、トラヒックシェーピング装置100の、トークンサイズ設定部101と、加算値設定部102と、シフト値設定部104とに、所定の値を記憶させておく。また、制御部107の初期状態はIDLEとする(ステップS501)。
Next, with reference to FIG. 4, an operation example in which the traffic shaping apparatus 100 according to the present invention performs traffic shaping will be described.
The user stores predetermined values in the token size setting unit 101, the addition value setting unit 102, and the shift value setting unit 104 of the traffic shaping device 100. The initial state of the control unit 107 is IDLE (step S501).

演算部106は、トークンカウント処理を開始する。すなわち、演算部106は、一定周期で、トークンカウンタ103に記憶されたトークンカウンタ値(トークン量)を読み出し、加算値設定部102に記憶された加算値を、読み出したトークンカウンタ値に加算する。そして、演算部106は、トークンカウンタ値が、トークンサイズ設定部101に記憶されたトークンサイズをシフト値設定部104に記憶されたシフト値分左シフトした値より大きくなった場合は、トークンサイズ設定部101に記憶された値をシフト値分左シフトした値を、トークンカウンタ103にトークンカウンタ値として記憶させる。   The calculation unit 106 starts token count processing. That is, the calculation unit 106 reads the token counter value (token amount) stored in the token counter 103 at a constant cycle, and adds the addition value stored in the addition value setting unit 102 to the read token counter value. When the token counter value becomes larger than the value obtained by shifting the token size stored in the token size setting unit 101 to the left by the shift value stored in the shift value setting unit 104, the calculation unit 106 sets the token size. A value obtained by shifting the value stored in the unit 101 to the left by the shift value is stored in the token counter 103 as a token counter value.

一方、トークン量が、トークンサイズ設定部101に記憶されたトークンサイズをシフト値設定部104に記憶されたシフト値分左シフトした値より小さければ、上述のように、加算値を加算したトークンカウンタ値をトークンカウンタ103に記憶させる(ステップS502)。以降、演算部106は、ステップS502において説明したトークンカウント処理を実行し続ける。   On the other hand, if the token amount is smaller than the value obtained by shifting the token size stored in the token size setting unit 101 to the left by the shift value stored in the shift value setting unit 104, the token counter added with the addition value as described above. The value is stored in the token counter 103 (step S502). Thereafter, the calculation unit 106 continues to execute the token count process described in step S502.

制御部107は、前段回路10からフレーム送信要求を受信するとともに、パケットのフレーム長を受信すると、フレーム長設定部105にフレーム長を記憶させ、トークンカウンタ103に記憶されたトークンカウンタ値を読み出すとともに、シフト値設定部104からシフト値を読み出す(ステップS503)。ここで、トークンカウンタ103に記憶されたトークンカウンタ値は、ステップS502にて、一定周期で、加算値が加算されている。   When the control unit 107 receives the frame transmission request from the pre-stage circuit 10 and receives the frame length of the packet, the control unit 107 stores the frame length in the frame length setting unit 105 and reads the token counter value stored in the token counter 103. Then, the shift value is read from the shift value setting unit 104 (step S503). Here, the token counter value stored in the token counter 103 is added with an added value at a constant period in step S502.

そして、制御部107は、読み出したトークンカウンタ値が、フレーム長設定部105に記憶されたフレーム長をシフト値分左シフトした値以上である(YES)か否(NO)かを判定する(ステップS504)。制御部107が、ステップS504の判定処理で、NOと判定すれば、再度、トークンカウンタ103の値を読み出し、ステップS503とステップS504との処理を繰り返す。   Then, the control unit 107 determines whether or not the read token counter value is equal to or greater than (YES) or (NO) the value obtained by shifting the frame length stored in the frame length setting unit 105 to the left by the shift value (step). S504). If the control unit 107 determines NO in the determination process in step S504, the value of the token counter 103 is read again, and the processes in steps S503 and S504 are repeated.

一方、制御部107が、ステップS504の判定処理で、YESと判定すれば、制御部107は、制御部107の状態をIDLEからReqSndに遷移させる(ステップS505)。すなわち、演算部106が、シフト値設定部104に記憶されたシフト値分フレーム長を左にシフトさせた値を算出し、加算値設定部102に記憶された加算値をトークンカウンタ103に記憶されたトークンカウンタ値に加算し、加算されたトークンカウンタ値からフレーム長をシフト値分左にシフトした値を減算し、減算した結果をトークンカウンタ103に記憶させる(ステップS506)。   On the other hand, if the control unit 107 determines YES in the determination process of step S504, the control unit 107 changes the state of the control unit 107 from IDLE to ReqSnd (step S505). That is, the calculation unit 106 calculates a value obtained by shifting the frame length by the shift value stored in the shift value setting unit 104 to the left, and the addition value stored in the addition value setting unit 102 is stored in the token counter 103. A value obtained by shifting the frame length to the left by the shift value is subtracted from the added token counter value, and the result of the subtraction is stored in the token counter 103 (step S506).

そして、制御部107は、後段回路20に送信要求を出力すると、制御部107の状態をReqSndからAckWaitに遷移させる(ステップS508)。制御部107は、後段回路20から受理信号を受信すると、制御部107の状態をAckWaitからAckSndに遷移させる(ステップS508)。そして、制御部107は、前段回路10に受理信号を出力すると、制御部107の状態をAckSndからIDLEに遷移させる(ステップS509)。以後、トラヒックシェーピング装置100は、ステップS503からステップS509までの処理を繰り返す。   And the control part 107 will change the state of the control part 107 from ReqSnd to AckWait, if a transmission request is output to the back | latter stage circuit 20 (step S508). When receiving the acceptance signal from the subsequent circuit 20, the control unit 107 changes the state of the control unit 107 from AckWait to AckSnd (step S508). And the control part 107 will change the state of the control part 107 from AckSnd to IDLE, if an acceptance signal is output to the pre-stage circuit 10 (step S509). Thereafter, the traffic shaping device 100 repeats the processing from step S503 to step S509.

以上説明したように、本実施形態によれば、加算値をT、システムクロックをClk、シフト値をNとすると、トークンレートは以下の式で表される。
トークンレート=8×T×Clk/2
上式を用いると、トークンレートの設定ステップΔは、Δ=8×(T+1)×Clk/2−8×T×Clk/2=8×Clk/2で表される。ここで、設定ステップΔは、シェーピングレートをつかさどるTに無関係である。そのため、トラヒックシェーピング装置100は、トークンレートの高低にかかわらず一定の設定ステップを取ることが出来る。また、上式が示すように、2で除算を行うことで、除算をシフト演算に変形することが出来るため、計算コストが低いという特長を持つ。
As described above, according to the present embodiment, when the addition value is T, the system clock is Clk, and the shift value is N, the token rate is expressed by the following equation.
Token rate = 8 x T x Clk / 2 N
Using the above equation, the token rate setting step Δ is expressed by Δ = 8 × (T + 1) × Clk / 2 N −8 × T × Clk / 2 N = 8 × Clk / 2 N. Here, the setting step Δ is irrelevant to T that controls the shaping rate. Therefore, the traffic shaping device 100 can take a certain setting step regardless of the token rate. Further, as shown by the above equation, by dividing by 2N , the division can be transformed into a shift operation, so that the calculation cost is low.

<第2の実施形態>
図5の(a)は、第2の実施形態によりリーキバケツモデルで動作するトラヒックシェーピング装置の構成を示すブロック図である。第2の実施形態によるトラヒックシェーピング装置200は、第1の実施形態と同様の構成をしており、第1の実施形態と同様の構成・動作については、その説明を省略する。
<Second Embodiment>
FIG. 5A is a block diagram illustrating a configuration of a traffic shaping device that operates in accordance with a leaky bucket model according to the second embodiment. The traffic shaping device 200 according to the second embodiment has the same configuration as that of the first embodiment, and the description of the same configuration and operation as those of the first embodiment will be omitted.

トラヒックシェーピング装置200は、リーキバケツモデルにより送信要求されたパケットの帯域を平滑化して出力し、トークンサイズ設定部201と、加算値設定部202と、トークンカウンタ203と、シフト値設定部204と、フレーム長設定部205と、演算部206と、制御部207とを備えている。ここで、リーキバケツモデルは、トークン量が正あるいは0である場合にフレームを送出するとともに、トークンバケツに蓄積されているトークンからフレーム長分のトークンを減算するシェーピングモデルである。   The traffic shaping device 200 smoothes and outputs the bandwidth of the packet requested to be transmitted by the leaky bucket model, the token size setting unit 201, the addition value setting unit 202, the token counter 203, the shift value setting unit 204, A frame length setting unit 205, a calculation unit 206, and a control unit 207 are provided. Here, the leaky bucket model is a shaping model that transmits a frame when the token amount is positive or 0, and subtracts a token corresponding to the frame length from the token accumulated in the token bucket.

図6は、本実施形態における制御部207の状態遷移を示す図である。本実施形態による制御部207の状態遷移は、第1の実施形態とほぼ同様であるが、本実施形態では、制御部207の状態がIDLEからReqSndへ遷移する要因が、第1の実施形態と異なる。すなわち、第1の実施形態のトークンバケツモデルででは、後段回路20に送信要求を出力する状態(ReqSnd)へ移行する条件が、トークンカウンタ値≧(フレーム長<<シフト値)であるのに対し、第2の実施形態のリーキバケツモデルの場合は、トークンカウンタ値≧0である。図5の(b)に、制御部207が行う処理動作を示す式を示す。   FIG. 6 is a diagram illustrating state transition of the control unit 207 in the present embodiment. The state transition of the control unit 207 according to the present embodiment is almost the same as that of the first embodiment. However, in this embodiment, the cause of the transition of the state of the control unit 207 from IDLE to ReqSnd is the same as that of the first embodiment. Different. That is, in the token bucket model of the first embodiment, the condition for shifting to the state (ReqSnd) in which a transmission request is output to the post-stage circuit 20 is token counter value ≧ (frame length << shift value). In the case of the leaky bucket model of the second embodiment, the token counter value ≧ 0. FIG. 5B shows an expression indicating the processing operation performed by the control unit 207.

次に、図7を参照して、本発明によるトラヒックシェーピング装置200が、トラヒックシェーピングを行う動作例を説明する。ステップS601からステップS603までの動作は、第1の実施形態におけるステップS501からステップS503までの動作と同様である。そしてステップS603の後、制御部207が、トークンカウンタ203に記憶されたトークンカウンタ値を読み出し、読み出したトークンカウンタ値が0以上(YES)か否(NO)かを判定する(ステップS604)。   Next, an operation example in which the traffic shaping device 200 according to the present invention performs traffic shaping will be described with reference to FIG. The operations from step S601 to step S603 are the same as the operations from step S501 to step S503 in the first embodiment. After step S603, the control unit 207 reads the token counter value stored in the token counter 203, and determines whether the read token counter value is 0 or more (YES) or not (NO) (step S604).

ステップS604の判定処理で、制御部207がNOと判定すれば、再度、トークンカウンタ103に記憶されたトークンカウンタ値を読み出し、ステップS603とステップS604とを繰り返す。
一方、ステップS604の判定処理で、制御部207がYESと判定すれば、第1の実施形態と同様に、制御部207の状態をIDLEからReqSndに遷移させ(ステップS605)、第1の実施形態と同様の動作を行う。
If the control unit 207 determines NO in the determination process of step S604, the token counter value stored in the token counter 103 is read again, and steps S603 and S604 are repeated.
On the other hand, if the control unit 207 determines YES in the determination process in step S604, the state of the control unit 207 is changed from IDLE to ReqSnd as in the first embodiment (step S605), and the first embodiment. The same operation is performed.

このように、第2の実施形態においても、第1の実施形態と同様、トークンレートを示す式は、トークンレート=8×T×Clk/2となり、従来の分周比で単に除算する場合の問題である、設定可能なトークンレートが高い場合、粗くなり、低い場合、必要以上に細かいという点を改善できる。 Thus, in the second embodiment as well, as in the first embodiment, the equation indicating the token rate is token rate = 8 × T × Clk / 2 N , and is simply divided by the conventional division ratio. The problem is that when the settable token rate is high, it becomes coarse, and when it is low, it can be improved more finely than necessary.

以上説明したように、第2の実施形態によれば、リーキバケツモデルによっても設定ステップΔを一定にすることができる。次に、本実施形態によるトラヒックシェーピング装置200を、図8に示すような多段QoSモジュールにおけるシェーパとして用いる場合を考える。   As described above, according to the second embodiment, the setting step Δ can be made constant even by a leaky bucket model. Next, consider a case where the traffic shaping device 200 according to the present embodiment is used as a shaper in a multi-stage QoS module as shown in FIG.

図8に示す例では、トークンレートが200Mbit/sであるシェーパAと、トークンレートが90Mbit/sであるシェーパBと、トークンレートが100Mbit/sであるシェーパCとを想定する。シェーパAには、フレーム長1500Byteのパケットが入力され、シェーパBには、フレーム長64Byteのパケットが入力される。スケジューラ回路21は、予め定められた優先度に応じてパケットの出力を選択する。ここで、スケジューラ回路21によって、シェーパBの出力が、シェーパAの出力よりも優先される。   In the example illustrated in FIG. 8, a shaper A having a token rate of 200 Mbit / s, a shaper B having a token rate of 90 Mbit / s, and a shaper C having a token rate of 100 Mbit / s are assumed. A packet with a frame length of 1500 bytes is input to the shaper A, and a packet with a frame length of 64 bytes is input to the shaper B. The scheduler circuit 21 selects packet output according to a predetermined priority. Here, the scheduler circuit 21 gives priority to the output of the shaper B over the output of the shaper A.

図9は、図8におけるシェーパA、シェーパB、シェーパCを動作させた場合の各シェーパのトークンカウンタ値を示す表である。ここで、各シェーパのシステムクロック周波数を40MHzとしたトークン加算値を用いている。また、シフト量を16ビットとして扱っているため実数であらわしている。図9に示される時刻の項は、システムクロックのクロック数を示す。   FIG. 9 is a table showing token counter values of each shaper when the shaper A, shaper B, and shaper C in FIG. 8 are operated. Here, a token addition value in which the system clock frequency of each shaper is 40 MHz is used. Since the shift amount is handled as 16 bits, it is represented by a real number. The term of time shown in FIG. 9 indicates the number of system clocks.

図9に示されるように、スケジューラ回路21の出力先に接続されたシェーパCのトークンレートが、スケジューラ回路21の高優先入力に接続されているシェーパBのトークンレートに近い場合、低優先入力のパケット出力時間中に高優先側に接続されているシェーパBのトークンがいっぱいになってしまい、次の高優先入力が選択されるまで加算されなくなる(時刻456から時刻5006まで)。   As shown in FIG. 9, when the token rate of the shaper C connected to the output destination of the scheduler circuit 21 is close to the token rate of the shaper B connected to the high priority input of the scheduler circuit 21, the low priority input During the packet output time, the token of the shaper B connected to the high priority side becomes full, and is not added until the next high priority input is selected (from time 456 to time 5006).

このため、指定されたレートでパケットをシェーピングできなくなる場合がある。図9に示されるように、シェーパCのトークン加算量の累積は、時刻7280において2275Byteである。よって2275Byte×8/(7280/40MHz)=100Mbit/sとなり、システム全体のレートは100Mbit/sであり設定値どおりであるが、シェーパBのトークン加算量の累計は、時刻7280において7687.8125Byteである。そのため、767.8125×8/(7280/40MHz)=33.76Mbit/sとなり設定値とまったく異なるレートになってしまう。この原因は、先に示したようにトークンが加算されない期間が存在するためである。   For this reason, the packet may not be shaped at the specified rate. As shown in FIG. 9, the accumulated token addition amount of shaper C is 2275 bytes at time 7280. Therefore, 2275 bytes × 8 / (7280/40 MHz) = 100 Mbit / s, and the system-wide rate is 100 Mbit / s, which is the set value. However, the accumulated token addition amount of shaper B is 7687.8125 bytes at time 7280. is there. Therefore, 767.8125 × 8 / (7280/40 MHz) = 33.76 Mbit / s, which is a completely different rate from the set value. This is because there is a period in which no token is added as described above.

このように、第2の実施形態では、制御部207の状態がAckSndの状態で前段回路10に受理信号を出力した場合、制御部207の状態はIDLEに遷移する。ここで、図7のステップS602に示すように、前段回路10から次の送信要求信号を受信するまでの間、演算部106は、トークンカウンタ203に記憶されたトークンカウンタ値は加算値設定部202に設定された加算値をトークンサイズ設定部201に設定されたトークンサイズになるまで加算し続ける。そして、トークンカウンタ203に記憶されたトークンカウンタ値は、トークンサイズ設定部201に記憶されたトークンサイズに達した時点で加算が行われなくなる。   As described above, in the second embodiment, when the control unit 207 is in the AckSnd state and an acceptance signal is output to the pre-stage circuit 10, the state of the control unit 207 transitions to IDLE. Here, as shown in step S <b> 602 in FIG. 7, until the next transmission request signal is received from the preceding circuit 10, the arithmetic unit 106 determines that the token counter value stored in the token counter 203 is the added value setting unit 202. Are added until the token size set in the token size setting unit 201 is reached. The token counter value stored in the token counter 203 is not added when the token size stored in the token size setting unit 201 is reached.

<第3の実施形態>
図10は、第3の実施形態によりリーキバケツモデルで動作するトラヒックシェーピング装置の構成を示すブロック図である。第3の実施形態によるトラヒックシェーピング装置300は、第2の実施形態と同様の構成をしており、第2の実施形態と同様の構成・動作については、その説明を省略する。
<Third Embodiment>
FIG. 10 is a block diagram illustrating a configuration of a traffic shaping device that operates in accordance with a leaky bucket model according to the third embodiment. The traffic shaping device 300 according to the third embodiment has the same configuration as that of the second embodiment, and the description of the same configuration and operation as those of the second embodiment will be omitted.

本実施形態によるトラヒックシェーピング装置300は、トークンサイズ設定部301と、加算値設定部302と、トークンカウンタ303と、シフト値設定部304と、フレーム長設定部305と、演算部306と、制御部307と、ウェイト値設定部308と、ウェイトカウンタ309とを備えている。   The traffic shaping device 300 according to the present embodiment includes a token size setting unit 301, an addition value setting unit 302, a token counter 303, a shift value setting unit 304, a frame length setting unit 305, a calculation unit 306, and a control unit. 307, a weight value setting unit 308, and a weight counter 309.

このように、第3の実施形態によるトラヒックシェーピング装置300は、第2の実施形態によるトラヒックシェーピング装置200に加え、ウェイト制御に関連する機能部が加えられている。ウェイト値設定部308は、ウェイト値の最大値(JudgeWait)を記憶する。ウェイトカウンタ309は、ウェイト値(WaitCnt)を記憶する。図11は、本実施形態における制御部307の状態遷移を示す図である。本実施形態では、制御部307は、後段回路20から受信信号を受信した後、TimeWaitの状態をとることが可能である。制御部307は、TimeWaitの状態では、ウェイト値設定部308に設定されたウェイト値の最大値が示す間、送信処理を待機する。   As described above, the traffic shaping device 300 according to the third embodiment is added with the functional units related to weight control in addition to the traffic shaping device 200 according to the second embodiment. The weight value setting unit 308 stores the maximum value of the weight value (Judge Wait). The wait counter 309 stores a wait value (WaitCnt). FIG. 11 is a diagram illustrating a state transition of the control unit 307 in the present embodiment. In the present embodiment, the control unit 307 can take a TimeWait state after receiving a reception signal from the post-stage circuit 20. In the state of TimeWait, the control unit 307 waits for transmission processing while the maximum value of the weight value set in the weight value setting unit 308 is indicated.

次に、図12を参照して、本発明によるトラヒックシェーピング装置300が、トラヒックシェーピングを行う動作例を説明する。
ユーザは、トークンサイズ設定部301、加算値設定部302、トークンカウンタ303、シフト値設定部304、ウェイト値設定部308に所定の値を記憶させておく。また制御部307の初期状態はIDLEとする(ステップS701)。演算部306は、トークンカウンタ303からトークンカウンタ値を読み出し、また、制御部307の状態を読み出し、制御部307の状態がIDLEで、かつ、トークンカウンタ≧0なら、トークンカウンタを0にリセットする。図1の(b)には、演算部306が行う処理動作を表す式が示されている。
Next, with reference to FIG. 12, an operation example in which the traffic shaping device 300 according to the present invention performs traffic shaping will be described.
The user stores predetermined values in the token size setting unit 301, the addition value setting unit 302, the token counter 303, the shift value setting unit 304, and the weight value setting unit 308. The initial state of the control unit 307 is IDLE (step S701). The calculation unit 306 reads the token counter value from the token counter 303, reads the state of the control unit 307, and resets the token counter to 0 if the state of the control unit 307 is IDLE and the token counter ≧ 0. FIG. 1B shows an expression representing the processing operation performed by the calculation unit 306.

一方、演算部306は、制御部307の状態がIDLEではないか、または、トークンカウンタ<0の場合には、加算値設定部302に設定された加算値をトークンカウンタ303のトークンカウンタ値に加算する。加算した結果、トークンカウンタ値がトークンサイズ設定部301に記憶された値をシフト値分左シフトした値より大きくなった場合は、トークンカウンタ303の値を、トークンサイズ設定部301に記憶された値をシフト債分左シフトした値に設定する(ステップS702)。   On the other hand, when the state of the control unit 307 is not IDLE or the token counter <0, the arithmetic unit 306 adds the addition value set in the addition value setting unit 302 to the token counter value of the token counter 303. To do. As a result of addition, when the token counter value becomes larger than the value left-shifted from the value stored in the token size setting unit 301 by the shift value, the value of the token counter 303 is set to the value stored in the token size setting unit 301. Is set to a value left shifted by the shift bond (step S702).

制御部307は、前段回路10から送信要求を受信するとともに、パケットのフレーム長を受信すると、トークンカウンタ303の値を読み出し(ステップS703)、トークンカウンタ303の値が0以上(YES)か否(NO)かを判定する(ステップS704)。制御部307は、ステップS704でNOと判定した場合は、所定の周期で、トークンカウンタ303の値を読み出しステップS703とステップS704とを繰り返す。一方、制御部307は、ステップS70でYESと判定した場合は、制御部307の状態をIDLEからReqSndに遷移させる(ステップS705)。   When the control unit 307 receives the transmission request from the pre-stage circuit 10 and receives the frame length of the packet, the control unit 307 reads the value of the token counter 303 (step S703), and whether the value of the token counter 303 is 0 or more (YES) ( NO) is determined (step S704). If the control unit 307 determines NO in step S704, the control unit 307 reads the value of the token counter 303 and repeats step S703 and step S704 in a predetermined cycle. On the other hand, when it determines with YES by step S70, the control part 307 changes the state of the control part 307 from IDLE to ReqSnd (step S705).

演算部306は、制御部307の状態がReqSndである場合、加算値設定部302に設定された加算値をトークンカウンタ303に記憶されたトークンカウンタ値に加算し、トークンカウンタ値から、シフト値設定部104に記憶されたシフト値分フレーム長を左にシフトした値を減算した算出結果をトークンカウンタ303にトークンカウンタ値として記憶させる(ステップS706)。   When the state of the control unit 307 is ReqSnd, the arithmetic unit 306 adds the addition value set in the addition value setting unit 302 to the token counter value stored in the token counter 303, and sets the shift value from the token counter value. A calculation result obtained by subtracting a value obtained by shifting the frame length to the left by the shift value stored in the unit 104 is stored in the token counter 303 as a token counter value (step S706).

制御部307は、後段回路20へ送信要求を出力すると、制御部307の状態をReqSndからAckWaitに遷移させる(ステップS707)。そして、制御部307が、後段回路20から受理信号を受信すると、制御部307の状態をAckWaitからAckSndに遷移させる(ステップS708)。演算部306は、ウェイト値設定部308に記憶されたウェイトカウント最大値を、ウェイトカウンタ309にウェイトカウント値として記憶させる(ステップS709)。   When outputting the transmission request to the subsequent circuit 20, the control unit 307 changes the state of the control unit 307 from ReqSnd to AckWait (step S707). Then, when the control unit 307 receives the acceptance signal from the subsequent circuit 20, the state of the control unit 307 is changed from AckWait to AckSnd (step S708). The calculation unit 306 causes the weight counter 309 to store the maximum weight count value stored in the weight value setting unit 308 as a weight count value (step S709).

次に、制御部307は、前段回路10に受理信号を出力し、制御部107の状態をAckSndからTimeWaitに遷移させる(ステップS710)。演算部306は、ウェイトカウンタ309に記憶されたウェイトカウント値を1減算する。演算部306は、ウェイトカウンタ309に記憶された値が0になるまで、所定の周期で減算処理を繰り返す(ステップS711、ステップS712)。   Next, the control unit 307 outputs an acceptance signal to the pre-stage circuit 10 and changes the state of the control unit 107 from AckSnd to TimeWait (step S710). The calculation unit 306 subtracts 1 from the weight count value stored in the weight counter 309. The calculation unit 306 repeats the subtraction process at a predetermined cycle until the value stored in the weight counter 309 becomes 0 (steps S711 and S712).

制御部307は、ウェイトカウンタ309に記憶された値が0であり、かつ、前段回路10から送信要求を受信した場合は、ステップS702に戻り、以降の処理動作を繰り返す(ステップS713:YES)。制御部307は、ウェイトカウンタ309に記憶されたウェイトカウント値が0であり、前段回路10から送信要求を受信しない場合(ステップS713:NO)は、制御部307の状態をTimeWaitからIDLEに遷移させ、ステップS702に戻り、以降の処理動作を繰り返す(ステップS714)。   When the value stored in the wait counter 309 is 0 and the transmission request is received from the preceding circuit 10, the control unit 307 returns to step S702 and repeats the subsequent processing operations (step S713: YES). When the wait count value stored in the wait counter 309 is 0 and the control unit 307 does not receive a transmission request from the pre-stage circuit 10 (step S713: NO), the control unit 307 changes the state of the control unit 307 from TimeWait to IDLE. Returning to step S702, the subsequent processing operation is repeated (step S714).

このように、第3の実施形態によれば、制御部307の状態がAckSndであり、前段回路10に受理信号を出力した場合、制御部307の状態として、TimeWaitの状態を設け、このTimeWaitの状態に遷移させ、ウェイト値設定部308に設定した値になるまで、前段からの次の送信要求の受信を待ち、設定した時間内に次の送信要求の受信がない場合に、制御部の状態をIDLEにするとともに、演算部306において、トークンカウンタ303に記憶されたトークンカウンタ値が0以上の場合には、トークンカウンタ値を0にリセットする。   Thus, according to the third embodiment, when the state of the control unit 307 is AckSnd and an acceptance signal is output to the pre-stage circuit 10, the state of the TimeWait is provided as the state of the control unit 307. The state of the control unit is waited until the next transmission request is received from the previous stage until the value set in the weight value setting unit 308 is reached and the next transmission request is not received within the set time. Is set to IDLE, and if the token counter value stored in the token counter 303 is 0 or more in the calculation unit 306, the token counter value is reset to 0.

例えば、以上説明したようなトラヒックシェーピング装置300を、図13に示したような多段QoSモジュールにおけるシェーパとして用いる場合を考える。ここで、シェーパA´、シェーパB´、シェーパC´はいずれも本実施形態におけるトラヒックシェーピング装置300である。各シェーパのトークンレート、システムクロック周波数、フレーム長などの値は第2の実施形態において図8を用いた説明と同様である。   For example, consider a case where the traffic shaping apparatus 300 as described above is used as a shaper in a multi-stage QoS module as shown in FIG. Here, the shaper A ′, the shaper B ′, and the shaper C ′ are all the traffic shaping device 300 in the present embodiment. Values such as the token rate, system clock frequency, and frame length of each shaper are the same as those described with reference to FIG. 8 in the second embodiment.

図14は、図13におけるシェーパA´、シェーパB´、シェーパC´を動作させた場合の各シェーパのトークンカウンタ値を示す表である。トラヒックシェーピング装置300は、後段回路20からの受理信号を受信し、前段回路10に受理信号を送信し、もし次に送出すべき送信要求がある場合には、ウェイトカウンタ309に記憶されたウェイトカウンタ値が0になる前に前段回路10から送信要求を受理する。   FIG. 14 is a table showing token counter values of each shaper when the shaper A ′, shaper B ′, and shaper C ′ in FIG. 13 are operated. The traffic shaping device 300 receives the acceptance signal from the subsequent circuit 20, transmits the acceptance signal to the preceding circuit 10, and if there is a transmission request to be transmitted next, the weight counter stored in the weight counter 309. A transmission request is accepted from the pre-stage circuit 10 before the value becomes zero.

時刻「5005」で、シェーパC´のトークンカウンタ値が0または正になるので、トラヒックシェーピング装置300は、スケジューラ回路21に要求信号を出力し、それに対して受理信号がその後戻ってくる。つまり、加算停止していた時刻「456」から時刻「5006」の区間においてシェーパBのトークンカウンタヘの加算は継続される。従って、前段回路からの次の送信要求の受信時のトークンカウンタの値は正常となり、指定されたレートでパケットをシェーピングすることが可能となる。   At time “5005”, since the token counter value of the shaper C ′ becomes 0 or positive, the traffic shaping device 300 outputs a request signal to the scheduler circuit 21, and the acceptance signal thereafter returns. That is, the addition to the token counter of the shaper B is continued in the section from the time “456” to the time “5006” when the addition is stopped. Therefore, the value of the token counter at the time of receiving the next transmission request from the preceding circuit becomes normal, and it becomes possible to shape the packet at the designated rate.

すなわち、演算部106は、時刻「456」の段階で加算停止せず、加算値設定部102に記憶された加算値をトークンカウンタ103に加算し続ける。これにより、時刻「7282」のときのシェーパB´のトークン累積値が2048.062500であり、シェーパB´のトークンレートは、2048.0625×8/(7282/40MHz)=90Mbit/sとなり、指定されたレートで正しくシェーピング動作をしていることがわかる。   That is, the calculation unit 106 does not stop the addition at the time “456” and continues to add the addition value stored in the addition value setting unit 102 to the token counter 103. Thus, the accumulated token value of the shaper B ′ at time “7282” is 2048.062500, and the token rate of the shaper B ′ is 2048.625 × 8 / (7282/40 MHz) = 90 Mbit / s, which is designated. It can be seen that the shaping operation is correctly performed at the determined rate.

ただし、演算部106は、加算を続けるままでは、トークンバケツモデルのようにバーストで送信要求を行うことを許容してしまうことになるので、ウェイト値が0になった場合、すなわち設定されたトークンレートより入力される送信要求速度が低い場合には、先の加算は必要ないので、トークンカウンタを0にする。   However, since the calculation unit 106 allows the transmission request to be performed in a burst like the token bucket model if the addition is continued, when the weight value becomes 0, that is, the set token If the transmission request speed input is lower than the rate, the previous addition is not necessary, so the token counter is set to zero.

以上説明したように、本発明によるトラヒックシェーピング装置は、前段回路からの送信要求をフレーム長とともに受信し、トークンカウンタの値により決定される送信可能状態である場合に、送信要求を後段回路にフレーム長とともに送信し、後段回路から受理信号を受信した場合、前段回路に受理信号を送信する制御部を具備し、制御部の状態により加算値をトークンカウンタに加算し、トークンサイズよりトークンカウンタの値が大きくなったときトークンカウンタの値をトークンサイズにし、制御部が送信要求を後段に送信したときトークンサイズから送信したフレーム長を減算する演算部を具備する。   As described above, the traffic shaping device according to the present invention receives the transmission request from the preceding circuit together with the frame length, and transmits the transmission request to the subsequent circuit when the transmission request is determined by the value of the token counter. When the reception signal is received from the succeeding circuit, the control unit transmits the acceptance signal to the preceding circuit, and the addition value is added to the token counter depending on the state of the control unit. When the value becomes larger, the token counter value is set to the token size, and when the control unit transmits a transmission request to the subsequent stage, a calculation unit is provided that subtracts the transmitted frame length from the token size.

さらに、本発明は、トークンサイズおよびフレームサイズを指定されたシフト値により左シフトした値とトークンカウンタとを比較する演算部を具備する。また、前段回路に受理信号を送出した後、指定された待ち時間の間トークンカウンタを加算し続け、待ち時間経過しても前段回路からの送信要求がない場合、トークンカウンタ値をリセットする。   Furthermore, the present invention includes a calculation unit that compares a token counter and a value obtained by shifting the token size and the frame size to the left by a designated shift value. Further, after sending the acceptance signal to the preceding circuit, the token counter is continuously added for the designated waiting time, and if there is no transmission request from the preceding circuit even after the waiting time has elapsed, the token counter value is reset.

このように、本発明によれば、リーキバケツモデル時において、ウェイト制御機能を設け、後段回路に送信要求を出力して、後段回路から受理信号を受信し、前段回路に受理信号を出力してから、次の送信要求を受信するまでの時間を調整する待ち時間が経過するまでの間、トークンサイズに指定された値までトークンカウンタに加算値を加算し続け、待ち時間が経過しても送信要求信号の受信がない場合、トークンカウンタを0にする制御を行っている。このことにより、前段回路に受理信号を出力してから次の送信要求を受信するまでの時間がかかる場合、その間、トークンカウンタに加算値が加算されるため、トークンカウンタ値が0以上となり、早い時点でトークンの加算が停止する状況が発生し、そのため、トークンレートが下がり、指定されたレートでパケットをシェーピングできなくなるという問題を解消できる。   Thus, according to the present invention, in the case of a leaky bucket model, a wait control function is provided, a transmission request is output to the subsequent circuit, an acceptance signal is received from the subsequent circuit, and an acceptance signal is output to the upstream circuit. Until the waiting time for adjusting the time until receiving the next transmission request elapses, the addition value is continuously added to the token counter up to the value specified for the token size. When no request signal is received, the token counter is set to zero. As a result, when it takes time until the next transmission request is received after the acceptance signal is output to the preceding circuit, the addition value is added to the token counter during that time, so the token counter value becomes 0 or more and is fast. There is a situation in which token addition stops at that point, which can reduce the problem that the token rate drops and packets cannot be shaped at the specified rate.

以上、本発明の実施の形態について説明した。本実施形態によるトラヒックシェーピング装置の各手段は、専用のハードウェア(例えば、ワイヤードロジック等)により実現されるが、メモリおよびCPU(中央処理装置)により構成され、各部の機能を実現するためのプログラムをメモリからロードして実行することによりその機能を実現させるものであってもよい。また、本発明における処理部の機能を実現するためのプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータシステムに読み込ませ、実行することによりトラヒックシェーピングを行ってもよい。なお、ここでいう「コンピュータシステム」とは、OSや周辺機器等のハードウェアを含むものとする。また、「コンピュータシステム」は、ホームページ提供環境(あるいは表示環境)を備えたWWWシステムも含むものとする。また、「コンピュータ読み取り可能な記録媒体」とは、フレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置のことをいう。さらに「コンピュータ読み取り可能な記録媒体」とは、インターネット等のネットワークや電話回線等の通信回線を介してプログラムが送信された場合のサーバやクライアントとなるコンピュータシステム内部の揮発性メモリ(RAM)のように、一定時間プログラムを保持しているものも含むものとする。   The embodiment of the present invention has been described above. Each unit of the traffic shaping device according to the present embodiment is realized by dedicated hardware (for example, wired logic), but is configured by a memory and a CPU (central processing unit), and a program for realizing the function of each unit The function may be realized by loading and executing from the memory. Further, a traffic shaping is performed by recording a program for realizing the function of the processing unit in the present invention on a computer-readable recording medium, causing the computer system to read and execute the program recorded on the recording medium. May be. The “computer system” here includes an OS and hardware such as peripheral devices. The “computer system” includes a WWW system having a homepage providing environment (or display environment). The “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM and a CD-ROM, and a hard disk incorporated in a computer system. Further, the “computer-readable recording medium” refers to a volatile memory (RAM) in a computer system that becomes a server or a client when a program is transmitted via a network such as the Internet or a communication line such as a telephone line. In addition, those holding programs for a certain period of time are also included.

また、上記プログラムは、このプログラムを記憶装置等に格納したコンピュータシステムから、伝送媒体を介して、あるいは、伝送媒体中の伝送波により他のコンピュータシステムに伝送されてもよい。ここで、プログラムを伝送する「伝送媒体」は、インターネット等のネットワーク(通信網)や電話回線等の通信回線(通信線)のように情報を伝送する機能を有する媒体のことをいう。また、上記プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、前述した機能をコンピュータシステムにすでに記録されているプログラムとの組み合わせで実現できるもの、いわゆる差分ファイル(差分プログラム)であっても良い。   The program may be transmitted from a computer system storing the program in a storage device or the like to another computer system via a transmission medium or by a transmission wave in the transmission medium. Here, the “transmission medium” for transmitting the program refers to a medium having a function of transmitting information, such as a network (communication network) such as the Internet or a communication line (communication line) such as a telephone line. The program may be for realizing a part of the functions described above. Furthermore, what can implement | achieve the function mentioned above in combination with the program already recorded on the computer system, and what is called a difference file (difference program) may be sufficient.

本発明の第1の実施形態によるトラヒックシェーピング装置の構成を示す図である。It is a figure which shows the structure of the traffic shaping apparatus by the 1st Embodiment of this invention. トークンバケツを用いたトラヒックシェーピングの概念を示す図である。It is a figure which shows the concept of the traffic shaping using a token bucket. 本発明の第1の実施形態による制御部の状態遷移を示す図である。It is a figure which shows the state transition of the control part by the 1st Embodiment of this invention. 本発明の第1の実施形態によるトラヒックシェーピング装置の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the traffic shaping apparatus by the 1st Embodiment of this invention. 本発明の第2の実施形態によるトラヒックシェーピング装置の構成を示す図である。It is a figure which shows the structure of the traffic shaping apparatus by the 2nd Embodiment of this invention. 本発明の第2の実施形態による制御部の状態遷移を示す図である。It is a figure which shows the state transition of the control part by the 2nd Embodiment of this invention. 本発明の第2の実施形態によるトラヒックシェーピング装置の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the traffic shaping apparatus by the 2nd Embodiment of this invention. 本発明の第2の実施形態によるトラヒックシェーピング装置の実施例を示す図である。It is a figure which shows the Example of the traffic shaping apparatus by the 2nd Embodiment of this invention. 本発明の第2の実施形態によるトラヒックシェーピング装置の実施例によるトークンカウンタ値を示す図である。It is a figure which shows the token counter value by the Example of the traffic shaping apparatus by the 2nd Embodiment of this invention. 本発明の第3の実施形態によるトラヒックシェーピング装置の構成を示す図である。It is a figure which shows the structure of the traffic shaping apparatus by the 3rd Embodiment of this invention. 本発明の第3の実施形態による制御部の状態遷移を示す図である。It is a figure which shows the state transition of the control part by the 3rd Embodiment of this invention. 本発明の第3の実施形態によるトラヒックシェーピング装置の動作例を示すフローチャートである。It is a flowchart which shows the operation example of the traffic shaping apparatus by the 3rd Embodiment of this invention. 本発明の第3の実施形態によるトラヒックシェーピング装置の実施例を示す図である。It is a figure which shows the Example of the traffic shaping apparatus by the 3rd Embodiment of this invention. 本発明の第3の実施形態によるトラヒックシェーピング装置の実施例によるトークンカウンタ値を示す図である。It is a figure which shows the token counter value by the Example of the traffic shaping apparatus by the 3rd Embodiment of this invention.

符号の説明Explanation of symbols

10 前段回路
20 後段回路
21 スケジューラ回路
100 トラヒックシェーピング装置
101 トークンサイズ設定部
102 加算値設定部
103 トークンカウンタ
104 シフト値設定部
105 フレーム長設定部
106 演算部
107 制御部
200 トラヒックシェーピング装置
201 トークンサイズ設定部
202 加算値設定部
203 トークンカウンタ
204 シフト値設定部
205 フレーム長設定部
206 演算部
207 制御部
300 トラヒックシェーピング装置
301 トークンサイズ設定部
302 加算値設定部
303 トークンカウンタ
304 シフト値設定部
305 フレーム長設定部
306 演算部
307 制御部
308 ウェイト値設定部
309 ウェイトカウンタ
DESCRIPTION OF SYMBOLS 10 Pre-stage circuit 20 Post-stage circuit 21 Scheduler circuit 100 Traffic shaping apparatus 101 Token size setting part 102 Addition value setting part 103 Token counter 104 Shift value setting part 105 Frame length setting part 106 Calculation part 107 Control part 200 Traffic shaping apparatus 201 Token size setting Unit 202 addition value setting unit 203 token counter 204 shift value setting unit 205 frame length setting unit 206 arithmetic unit 207 control unit 300 traffic shaping device 301 token size setting unit 302 addition value setting unit 303 token counter 304 shift value setting unit 305 frame length Setting unit 306 Calculation unit 307 Control unit 308 Weight value setting unit 309 Wait counter

Claims (5)

予め定められたトークンカウンタ値の最大値であるトークンサイズを上限値として、予め定められた周期により加算されるトークンカウンタ値を記憶するトークンカウンタ記憶部を備え、当該トークンカウンタ記憶部に記憶される前記トークンカウンタ値に基づいてパケット送信を制御するトラヒックシェーピング装置であって、
予め定められたシフト値を記憶するシフト値記憶手段と、
前記トークンカウンタ値に加算値を加算する際に、当該トークンカウンタ値と、前記トークンサイズを前記シフト値により左シフト演算した値とを比較し、前記トークンカウンタ値の方が、前記トークンサイズを前記シフト値により左シフト演算した値よりも大きい場合に、前記トークンサイズを、前記トークンカウンタ値として前記トークンカウンタ記憶部に記憶させる第1の演算手段と、
前記パケットの送信要求を受信した場合に、前記トークンカウンタ値に基づいて、前記パケットの送信要求を行う制御手段と、
前記制御手段が前記パケットの送信要求を行った場合に、前記パケットのフレームサイズ値を前記シフト値により左シフト演算した値を、前記トークンカウンタ値から減算する第2の演算手段と、
を備えることを特徴とするトラヒックシェーピング装置。
A token counter storage unit that stores a token counter value that is added at a predetermined cycle with a token size that is a maximum value of a predetermined token counter value as an upper limit value is stored in the token counter storage unit A traffic shaping device that controls packet transmission based on the token counter value,
Shift value storage means for storing a predetermined shift value;
When adding an addition value to the token counter value, the token counter value is compared with a value obtained by left-shifting the token size by the shift value. A first calculating means for storing the token size in the token counter storage unit as the token counter value when the shift value is larger than a value obtained by left shift calculation;
Control means for making a transmission request for the packet based on the token counter value when the transmission request for the packet is received;
Second calculating means for subtracting a value obtained by left-shifting the frame size value of the packet by the shift value from the token counter value when the control means makes a transmission request for the packet;
A traffic shaping device comprising:
前記制御手段は、前記パケットの送信要求を受信した場合に、前記トークンカウンタ値が、前記パケットのフレームサイズ値を前記シフト値により左シフト演算した値以上である場合に、前記パケットの送信要求を行う
ことを特徴とする請求項1に記載のトラヒックシェーピング装置。
When the control means receives the packet transmission request, the control means sends the packet transmission request when the token counter value is equal to or larger than a value obtained by left-shifting the frame size value of the packet by the shift value. The traffic shaping device according to claim 1, wherein the traffic shaping device is performed.
前記制御手段は、前記パケットの送信要求を受信した場合に、前記トークンカウンタ値が、予め定められたトークンカウンタ値の初期値以上である場合に、前記パケットの送信要求を行う
ことを特徴とする請求項1に記載のトラヒックシェーピング装置。
The control means, when receiving the packet transmission request, performs the packet transmission request when the token counter value is equal to or greater than a predetermined initial value of the token counter value. The traffic shaping device according to claim 1.
前記制御手段が、前記送信要求を行った後、予め定められた待機時間の間、新たなパケットの送信要求を受信しない場合に、前記トークンカウンタ記憶部に記憶されたトークンカウンタ値に初期値を記憶させる第3の演算手段と、
を備えることを特徴とする請求項1から請求項3のいずれか1項に記載のトラヒックシェーピング装置。
When the control means does not receive a transmission request for a new packet for a predetermined waiting time after making the transmission request, an initial value is set to the token counter value stored in the token counter storage unit. A third computing means for storing;
The traffic shaping device according to any one of claims 1 to 3, further comprising:
予め定められたトークンカウンタ値の最大値であるトークンサイズを上限値として、予め定められた周期により加算されるトークンカウンタ値を記憶するトークンカウンタ記憶部に記憶される前記トークンカウンタ値に基づいてパケット送信を制御するトラヒックシェーピング方法であって、
第1の演算手段が、前記トークンカウンタ値に加算値を加算する際に、当該トークンカウンタ値と、前記トークンサイズを予め定められたシフト値により左シフト演算した値とを比較し、前記トークンカウンタ値の方が、前記トークンサイズを前記シフト値により左シフト演算した値よりも大きい場合に、前記トークンサイズを、前記トークンカウンタ値として前記トークンカウンタ記憶部に記憶させるステップと、
制御手段が、前記パケットの送信要求を受信した場合に、前記トークンカウンタ値に基づいて、前記パケットの送信要求を行うステップと、
第2の演算手段が、前記制御手段が前記パケットの送信要求を行った場合に、前記パケットのフレームサイズ値を前記シフト値により左シフト演算した値を、前記トークンカウンタ値から減算するステップと、
を備えることを特徴とするトラヒックシェーピング方法。
A packet based on the token counter value stored in the token counter storage unit that stores a token counter value that is added at a predetermined period, with the token size that is the maximum value of the predetermined token counter value as an upper limit value. A traffic shaping method for controlling transmission,
When the first calculating means adds the added value to the token counter value, the token counter value is compared with a value obtained by calculating the left shift of the token size by a predetermined shift value, and the token counter Storing the token size in the token counter storage unit as the token counter value when the value is larger than the value obtained by left-shifting the token size by the shift value;
When the control means receives the packet transmission request, based on the token counter value, performs the packet transmission request;
A step of subtracting, from the token counter value, a value obtained by left-shifting the frame size value of the packet by the shift value when the control means makes a transmission request for the packet;
A traffic shaping method comprising:
JP2007277842A 2007-10-25 2007-10-25 Traffic shaping apparatus and method Active JP4601657B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007277842A JP4601657B2 (en) 2007-10-25 2007-10-25 Traffic shaping apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007277842A JP4601657B2 (en) 2007-10-25 2007-10-25 Traffic shaping apparatus and method

Publications (2)

Publication Number Publication Date
JP2009105829A JP2009105829A (en) 2009-05-14
JP4601657B2 true JP4601657B2 (en) 2010-12-22

Family

ID=40707064

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007277842A Active JP4601657B2 (en) 2007-10-25 2007-10-25 Traffic shaping apparatus and method

Country Status (1)

Country Link
JP (1) JP4601657B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6589497B2 (en) * 2015-09-17 2019-10-16 日本電気株式会社 BAND CONTROL DEVICE, BAND CONTROL METHOD, AND PROGRAM

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1023040A (en) * 1996-06-19 1998-01-23 Pmc Sierra Inc Variable bit-rate scheduler
JP2007088994A (en) * 2005-09-26 2007-04-05 Nippon Telegr & Teleph Corp <Ntt> Traffic shaping apparatus and method
JP2007088998A (en) * 2005-09-26 2007-04-05 Nippon Telegr & Teleph Corp <Ntt> Packet shaping apparatus and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1023040A (en) * 1996-06-19 1998-01-23 Pmc Sierra Inc Variable bit-rate scheduler
JP2007088994A (en) * 2005-09-26 2007-04-05 Nippon Telegr & Teleph Corp <Ntt> Traffic shaping apparatus and method
JP2007088998A (en) * 2005-09-26 2007-04-05 Nippon Telegr & Teleph Corp <Ntt> Packet shaping apparatus and method

Also Published As

Publication number Publication date
JP2009105829A (en) 2009-05-14

Similar Documents

Publication Publication Date Title
US11709534B2 (en) Method and apparatus for managing global chip power on a multicore system on chip
US8965942B1 (en) Systems and methods for sample rate tracking
WO2015096692A1 (en) Method and system for controlling data reception traffic and computer storage medium
CN110391873B (en) Method, apparatus and computer program product for determining a data transfer mode
CN113783793B (en) Traffic scheduling method for time-sensitive data frames and related equipment
CN111338575B (en) Storage service quality control method, device, equipment and storage medium
JP4915172B2 (en) Arbitration circuit
JP4601657B2 (en) Traffic shaping apparatus and method
JP7127743B2 (en) Communication device, communication method and program
JP2008010905A (en) Priority control method and apparatus at packet transmission
TWI573018B (en) Information processing device and information processing method
Claeys et al. Tail distribution of the delay in a general batch-service queueing model
JP7420228B2 (en) Distributed processing system and distributed processing method
JP3957696B2 (en) IP network terminal device
JP4806716B2 (en) Communication quality control apparatus and communication quality control method
JP4637154B2 (en) Traffic control method and apparatus
JP5644531B2 (en) Data transfer apparatus and data transfer method
CN109257245A (en) Flow monitoring, the method and apparatus for uploading control
US7603400B2 (en) Method and system for filter loop with saturation
CN116318516B (en) DP protocol-based dynamic accurate realization method and device for regenerated stream clock
US11863451B2 (en) Hardware accelerated temporal congestion signals
JP2007079836A (en) Data communication device and data communication method
JP4995304B2 (en) Method and apparatus for controlling packet transfer apparatus
JP6389149B2 (en) Call processing apparatus and operation method thereof
TW202301842A (en) Nonlinear traffic shaper with automatically adjustable cost parameters

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100906

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100914

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100928

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131008

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4601657

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250