Author: Ivan Delchev Course: Networks and Distributed...

15
Linux Traffic Control Author: Ivan Delchev Course: Networks and Distributed Systems Seminar Instructor: Prof. Juergen Schoenwaelder International University Bremen, Spring 2006

Transcript of Author: Ivan Delchev Course: Networks and Distributed...

Linux Traffic Control

Author: Ivan DelchevCourse: Networks and Distributed Systems SeminarInstructor: Prof. Juergen SchoenwaelderInternational University Bremen, Spring 2006

Processing of Network Data

Packets arrive via an input interface Input Traffic Control (policing) Input De-Multiplexing – determine whether packet is for local node "Forwarding" selects the output interface, the next hop etc. Output Traffic Control Device driver picks up packets and emits them on the network.

Fig. 1: Processing of network data by the linux kernel [2]

Definition of Traffic Control(TC)

Sets of queuing systems and mechanisms bywhich packets are received and transmitted ona router• Determine which packets to accept and at what rate on the

input of an interface• Determine which packets to transmit in what order and at

what rate on the output of an interface

Why Use Traffic Control?

Lack of differentiation between types of flows. Traffic control allows an administrator to queue

packets differently based on attributes of thepackets leading to:

More predictable usage of network resources Less volatile contention for network resources

Common Traffic Control Solutions

Limit total bandwidth to a known rate Limit the bandwidth of a particular user Reserve bandwidth for a particular application Prefer latency sensitive traffic Ensure that a particular type of traffic is

dropped

Terms

Queue – a buffer containing a finite number of itemswaiting for an action or service. Typically FIFO.

Flow - a distinct connection or conversation betweentwo hosts. Any unique set of packets between twohosts can be regarded as a flow.

Token - A particular message or bit pattern thatsignifies permission to transmit.

Bucket - type of data buffer, containing a number oftokens

Traditional Elements of TC

Shaping - delay packets to meet a desired rate.

Scheduling - arrange and/or rearrange packets foroutput

Classifying - sort or separate traffic into queues fordifferent treatment

Policing - measure and limit traffic in a particularqueue

Dropping - discard an entire packet, flow orclassification

Marking - a mechanism by which a packet is altered.

Classless Queuing Disciplines 1 Classless qdisc - a

qdisc with noconfigurable internalsubdivisions

FIFO (pfifo and bfifo)no shaping orrearranging of packets.

FIFO Fast(pfifo_fast)default for all interfaces.Provides three differentbands (individual FIFOs)for separating traffic.Fig. 2 FIFO Fast queuing discipline[1]

Classless Queuing Disciplines 2

Stochastic FairQueuing(SFQ)

Goal - fairly distributeopportunity to transmitdata among flows

Uses a hash function toseparate the traffic

Dequeue queues in around-robin fashion

Perturb hash functionperiodically to avoidunfairnessFig. 3 Stochastic Fair Queuing [1]

Classless Queuing Disciplines 3

Token BucketFilter(TBF)

Goal - shape/limit traffictransmitted on aninterface

Generate tokens at adesired rate

Send packets only ifthere are sufficienttokens available.

Fig. 4 Token Bucket Filter [1]

Classful Queuing Disciplines 1

Classful qdiscs can contain filters and classes Filters distinguish among different classes of packets

and process each class in a specific way – e.g. passto different internal class object

The queuing discipline on the respective class takescare

Fig. 5: Example of a queuing discipline containing filters and classes [2]

Classful Queuing Disciplines 2

Hierarchical Token Bucket(HTB)• HTB is an arbitrary number of token buckets

arranged in a hierarchy• User can define the characteristics of the tokens

and buckets used and to nest these buckets in anarbitrary fashion.

• “rate” - sets the guaranteed bandwidth available fora given class (“tokens” bucket)

• “ceil” - sets the maximum bandwidth that class isallowed to consume. (“ctokens” bucket)

Classful Queuing Disciplines 3 –HTB Contd.

Fig. 6 Hierarchical link-sharing structure using HTB [2]

Use one physical link to simulate several slowerlinks and send different kinds of traffic ondifferent simulated links

References

[1] http://www.roseindia.net/linux/tutorial/linux-howto/Traffic-Control-HOWTO/index.html

[2] http://www.opalsoft.net/qos/