LDP/LDP/howto/docbook/Traffic-Control-HOWTO/elements.xml

182 lines
6.5 KiB
XML

<!-- start of file -->
<!-- This .xml file is part of the Traffic-Control-HOWTO document -->
<!-- $Id$ -->
<!--
The article was authored by Martin A. Brown <martin@linux-ip.net>
for the linux community, and has been released under the GNU Free
Documentation License (GFDL) through The Linux Documentation
Project (TLDP).
This was initially authored while Martin A. Brown worked for
SecurePipe, Inc.
This HOWTO is likely available at the following address:
http://tldp.org/HOWTO/Traffic-Control-HOWTO/
-->
<!-- conventions used in this documentation....
- each section is a separate file
-->
<section id="elements">
<title>Traditional Elements of Traffic Control</title>
<para>
</para>
<section id="e-shaping">
<title>Shaping</title>
<para>
Shapers delay packets to meet a desired rate.
</para>
<para>
Shaping is the mechanism by which packets are delayed before
transmission in an output queue to meet a desired output rate. This is
one of the most common desires of users seeking bandwidth control
solutions. The act of delaying a packet as part of a traffic control
solution makes every shaping mechanism into a non-work-conserving
mechanism, meaning roughly: "Work is required in order to delay
packets."
</para>
<para>
Viewed in reverse, a non-work-conserving queuing mechanism is performing
a shaping function. A work-conserving queuing mechanism (see
&link-sch_prio;) would not be capable of delaying a packet.
</para>
<para>
Shapers attempt to limit or ration traffic to meet but not exceed a
configured rate (frequently measured in packets per second or bits/bytes
per second). As a side effect, shapers can smooth out bursty traffic
<footnote>
<para>
This smoothing effect is not always desirable, hence the HTB
parameters burst and cburst.
</para>
</footnote>.
One of the advantages of shaping bandwidth is the ability to control
latency of packets. The underlying mechanism for shaping to a rate is
typically a token and bucket mechanism. See also
<xref linkend="o-tokens"/> for further detail on tokens and buckets.
</para>
</section>
<section id="e-scheduling">
<title>Scheduling</title>
<para>
Schedulers arrange and/or rearrange packets for output.
</para>
<para>
Scheduling is the mechanism by which packets are arranged (or
rearranged) between input and output of a particular queue. The
overwhelmingly most common scheduler is the FIFO (first-in first-out)
scheduler. From a larger perspective, any set of traffic control
mechanisms on an output queue can be regarded as a scheduler, because
packets are arranged for output.
</para>
<para>
Other generic scheduling mechanisms attempt to compensate for various
networking conditions. A fair queuing algorithm (see &link-sch_sfq;)
attempts to prevent any single client or flow from dominating the
network usage. A round-robin algorithm (see &link-sch_wrr;) gives each
flow or client a turn to dequeue packets. Other sophisticated
scheduling algorithms attempt to prevent backbone overload (see
&link-sch_gred;) or refine other scheduling mechanisms (see
&link-sch_esfq;).
</para>
</section>
<section id="e-classifying">
<title>Classifying</title>
<para>
Classifiers sort or separate traffic into queues.
</para>
<para>
Classifying is the mechanism by which packets are separated for
different treatment, possibly different output queues. During the
process of accepting, routing and transmitting a packet, a networking
device can classify the packet a number of different ways.
Classification can include
<link linkend="e-marking">marking</link> the packet, which usually
happens on the boundary of a network under a single administrative
control or classification can occur on each hop individually.
</para>
<para>
The Linux model (see
<xref linkend="c-filter"/>) allows for a packet to cascade across a
series of classifiers in a traffic control structure and to be
classified in conjunction with
<link linkend="e-policing">policers</link> (see also
<xref linkend="c-police"/>).
</para>
</section>
<section id="e-policing">
<title>Policing</title>
<para>
Policers measure and limit traffic in a particular queue.
</para>
<para>
Policing, as an element of traffic control, is simply
a mechanism by which traffic can be limited. Policing is most
frequently used on the network border to ensure that a peer is not
consuming more than its allocated bandwidth. A policer will accept
traffic to a certain rate, and then perform an action on traffic
exceeding this rate. A rather harsh solution is to
<link linkend="e-dropping">drop</link> the traffic, although the
traffic could be
<link linkend="e-classifying">reclassified</link> instead of being
dropped.
</para>
<para>
A policer is a yes/no question about the rate at which traffic is
entering a queue. If the packet is about to enter a queue below a given
rate, take one action (allow the enqueuing). If the packet is about to
enter a queue above a given rate, take another action. Although the
policer uses a token bucket mechanism internally, it does not have the
capability to delay a packet as a &elements-shaping; mechanism does.
</para>
</section>
<section id="e-dropping">
<title>Dropping</title>
<para>
Dropping discards an entire packet, flow or classification.
</para>
<para>
Dropping a packet is a mechanism by which a packet is discarded.
</para>
<para>
</para>
</section>
<section id="e-marking">
<title>Marking</title>
<para>
Marking is a mechanism by which the packet is altered.
</para>
<note>
<para>
This is not &fwmark;. The &iptables; target &ipt-mark; and the
&ipchains; &ipc-mark; are used to modify packet metadata, not the packet
itself.
</para>
</note>
<para>
Traffic control marking mechanisms install a DSCP on the packet
itself, which is then used and respected by other routers inside an
administrative domain (usually for DiffServ).
</para>
</section>
</section>
<!-- end of file -->