Smith normal form: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
Line 1: Line 1:
The '''token bucket''' is an [[algorithm]] used in [[packet-switching|packet switched]] [[computer network]]s and [[telecommunication| telecommunications networks]]. It can be used to check that [[data transmission]]s, in the form of [[Network packet|packets]], conform to defined limits on [[Bandwidth (computing)|bandwidth]] and [[burst transmission|burstiness]] (a measure of the unevenness or variations in the [[Network traffic measurement|traffic]] flow). It can also be used as a [[scheduling algorithm]] to determine the timing of transmissions that will comply with the limits set for the bandwidth and burstiness: see [[network scheduler]].  
Marvella is what you can contact her but it's not the most feminine title out there. Since she was 18 she's been operating as a meter reader but she's  at home std testing at home std testing usually needed her personal business. He is truly  at home std testing fond of doing ceramics but he is having [http://www.huffingtonpost.ca/colette-kenney/dating-with-herpes_b_1609226.html difficulties] to find time for it. California is our birth place.<br><br>Feel free to surf to my website; home std test kit ([http://yadget.ru/blog/1189280/tips-about-how-to-overcome-yeast-infection-easily/ click the next web site])
 
== Overview ==
The token bucket algorithm is based on an [[analogy]] of a fixed capacity [[bucket]] into which [[Type–token distinction|tokens]], normally representing a unit of bytes or a single [[Network packet|packet]] of predetermined size, are added at a fixed rate. When a packet is to be checked for conformance to the defined limits, the bucket is inspected to see if it contains sufficient tokens at that time. If so, the appropriate number of tokens, e.g. equivalent to the length of the packet in bytes, are removed ("cashed in"), and the packet is passed, e.g., for transmission. If there are insufficient tokens in the bucket the packet does not conform and the contents of the bucket are not changed. Non-conformant packets can be treated in various ways:
*They may be dropped.
*They may be enqueued for subsequent transmission when sufficient tokens have accumulated in the bucket.
*They may be transmitted, but marked as being non-conformant, possibly to be dropped subsequently if the network is overloaded.
 
A conforming flow can thus contain traffic with an average rate up to the rate at which tokens are added to the bucket, and have a burstiness determined by the depth of the bucket. This burstiness may be expressed in terms of either a jitter tolerance, i.e. how much sooner a packet might conform (e.g. arrive or be transmitted) than would be expected from the limit on the average rate, or a burst tolerance or maximum burst size, i.e. how much more than the average level of traffic might conform in some finite period.
 
== Algorithm ==
The token bucket algorithm can be conceptually understood as follows:
*A token is added to the bucket every <math>1/r</math> seconds.
*The bucket can hold at the most ''b'' tokens. If a token arrives when the bucket is full, it is discarded.
*When a packet (network layer [[Protocol data unit|PDU]]) of ''n'' bytes arrives, ''n'' tokens are removed from the bucket, and the packet is sent to the network.
*If fewer than ''n'' tokens are available, no tokens are removed from the bucket, and the packet is considered to be ''non-conformant''.
 
=== Variations ===
Implementers of this algorithm on platforms lacking the clock resolution necessary to add a single token to the bucket every <math>1/r</math> seconds may want to consider an alternative formulation.  Given the ability to update the token bucket every S milliseconds, the number of tokens to add every S milliseconds = <math>(r*S)/1000</math>.
 
=== Properties ===
 
==== Average rate ====
Over the long run the output of conformant packets is limited by the token rate, <math>r</math>.
 
==== Burst size ====
Let M be the maximum possible transmission rate in bytes/second.
 
Then <math>T_\text{max} =
\begin{cases}
b/(M -r) & \text{ if } r < M \\
\infty & \text{ otherwise }
\end{cases}
</math> is the maximum burst time, that is the time for which the rate M is fully utilized.
 
The maximum burst size is thus <math>L_\text{max} = T_\text{max}*M</math>
 
=== Uses ===
The token bucket can be used in either [[traffic shaping]] or [[traffic policing]]. In traffic policing, nonconforming packets may be discarded (dropped) or may be reduced in priority (for downstream traffic management functions to drop if there is congestion). In traffic shaping, packets are delayed until they conform. Traffic policing and traffic shaping are commonly used to protect the network against excess or excessively bursty traffic, see [[bandwidth management]] and [[congestion avoidance]]. Traffic shaping is commonly used in the [[Network interface controller|network interfaces]] in [[Host (network)|hosts]] to prevent transmissions being discarded by traffic management functions in the network.
 
== Comparison to leaky bucket ==
The token bucket algorithm is directly comparable to one of the two versions of the [[leaky bucket]] algorithm described in the literature.<ref name="Turner"/><ref name="Tanenbaum-lbaq"/><ref name="ATMF-GCRA"/><ref name="ITU-T-GCRA"/> This comparable version of the leaky bucket is described on the relevant Wikipedia page as the [[leaky bucket#The Leaky Bucket Algorithm as a Meter|leaky bucket algorithm as a meter]]. This is a mirror image of the token bucket, in that conforming packets add fluid, equivalent to the tokens removed by a conforming packet in the token bucket algorithm, to a finite capacity bucket, from which this fluid then drains away at a constant rate, equivalent to the process in which tokens are added at a fixed rate.  
 
There is, however, another version of the leaky bucket algorithm,<ref name="Tanenbaum-lbaq"/> described on the relevant Wikipedia page as the [[leaky bucket#The Leaky Bucket Algorithm as a Queue|leaky bucket algorithm as a queue]]. This is a special case of the leaky bucket as a meter, which can be described by the conforming packets passing through the bucket. The leaky bucket as a queue is therefore applicable only to traffic shaping, and does not, in general, allow the output packet stream to be bursty, i.e. it is jitter free. It is therefore significantly different from the token bucket algorithm.
 
These two versions of the [[leaky bucket]] algorithm have both been described in the literature under the same name. This has led to considerable confusion over the properties of that algorithm and its comparison with the token bucket algorithm. However, fundamentally, the two algorithms are the same, and will, if implemented correctly and given the same parameters, see exactly the same packets as conforming and nonconforming.
 
==Hierarchical token bucket==
{{Expand section|date=June 2008}}
 
The Hierarchical Token Bucket (HTB) is a faster replacement for the [[class-based queueing]] (CBQ) [[queuing discipline]] in [[Linux]].<ref name="Linux_HTB"/>
 
HTBs help in controlling the use of the outbound [[Bandwidth (computing)|bandwidth]] on a given [[Data link|link]].
HTB allows using one single physical [[Data link|link]] to simulate multiple slower links and to send different kinds of [[Internet traffic|traffic]] on different simulated links. In both cases, one has to specify how to divide the physical link into simulated links and how to decide which simulated link  a given packet is to be sent across.
 
In other words, HTB is very useful to limit a client's [[download]]/[[upload]] rate. Thus, the limited client cannot saturate the total bandwidth.
 
== See also ==
* [[Leaky bucket]]
* [[Rate limiting]]
* [[Traffic shaping]]
 
== References ==
{{Reflist|30em|refs=
<ref name="Turner" >Turner, J., ''New directions in communications (or which way to the information age?)''. Communications Magazine, IEEE 24 (10): 8–15. ISSN 0163-68041986.</ref>
<ref name="Tanenbaum-lbaq" >Andrew S. Tanenbaum, ''Computer Networks, Fourth Edition'', ISBN 0-13-166836-6, Prentice Hall PTR, 2003., page 401.</ref>
<ref name="ATMF-GCRA" >ATM Forum, The User Network Interface (UNI), v. 3.1, ISBN 0-13-393828-X, Prentice Hall PTR, 1995.</ref>
<ref name="ITU-T-GCRA" >ITU-T, ''Traffic control and congestion control in B ISDN'', Recommendation I.371, International Telecommunication Union, 2004, Annex A, page 87.</ref>
<ref name="Linux_HTB" >{{cite web |title=Linux HTB Home Page |url=http://luxik.cdi.cz/~devik/qos/htb/ |accessdate=2013-11-30}}</ref>
}}
 
== Further reading ==
* {{cite book |title=Deploying IP and MPLS QoS for Multiservice Networks: Theory and Practice |author=John Evans, Clarence Filsfils |publisher=Morgan Kaufmann |date=2007 |ISBN=0-12-370549-5}}
* {{cite book |author=Ferguson P., Huston G. |title=Quality of Service: Delivering QoS on the Internet and in Corporate Networks |publisher=John Wiley & Sons, Inc. |date=1998 |ISBN=0-471-24358-2}}
* {{cite web |title=Implementation of the token bucket algorithm in python |url=http://code.activestate.com/recipes/511490/ |accessdate=2013-11-30}}
 
{{DEFAULTSORT:Token Bucket}}
 
[[Category:Networking algorithms]]
[[Category:Network performance]]
[[Category:Scheduling algorithms]]

Revision as of 10:53, 13 February 2014

Marvella is what you can contact her but it's not the most feminine title out there. Since she was 18 she's been operating as a meter reader but she's at home std testing at home std testing usually needed her personal business. He is truly at home std testing fond of doing ceramics but he is having difficulties to find time for it. California is our birth place.

Feel free to surf to my website; home std test kit (click the next web site)