1 1 Welcome ANK is a hero, genius, but not practical 2 1 Goals This should help you read existing documentation 3 1 Stuff I will talk about So you know where we are in the presentation 4 2 Concepts queue != qdisc 5 2 Queues are our friend and enemy If you remember 1 thing: No queue -> no effect! This means you can only shape what you send No control over what comes in Setups trying to maximize download speed have huge queues, VoIP wants zero queues. 6 3 Queues between user & hardware this is important, lots of en/dequeuing going on 7 2 The Queue you are already using Sits on each interface This is why shaping is so robust 8 1 A sample CBQ configuration Skip over lightly Original goal of lecture 9 1 Why all this complexity? Incidentally, there is a 'tcng' project 10 2 Very Simpleminded Shaper, 1Mbit/s HZ is relatively fixed 11 2 At 10mbit/s 50mbit/s, becomes inpossible No future path Raise HZ 12 2 The Token Bucket Filter Qdisc Important, shares stuff with HTB 13 1 TBF details Drops slow TCP/IP down - we won't be overlimits all that much. Also, we don't really sleep, just throttle. Should burst happen, can limit if desired 14 2 TBF configuration 3 numbers! Limit/burst determine latency Also configure other way around, specify latency 15 2 Stochastic Fairness Queuing Make sure you are the place with the queue!! Attaching an SFQ to your ppp->ADSL connection will not help! 16 2 The CBQ Queueing Discipline Quite clever! 17 1 CBQ for shaping 18 1 CBQ is complex & doesn't work as a shaper! The 'Sendmail effect'. 19 2 Classes for multiple queuing disciplines 20 3 Flow of packets in a classful queue NOTE: the qdisc has to call the filter! Not the other way around! 21 1 CBQ and HTB qdiscs Again stress that ANK is a hero 'Easy things should be easy, hard things should be possible' With CBQ, easy things are hard :-) Mention Martin Devera (, helped a lot) 22 2 Configuration basics First HTB does no shaping. 23 2 Now add the classes 24 2 Filtering to classify traffic iptables, MARK option helps 25 1 Advanced Queues within Queues 26 2 HTB setup with bells & whistles 27 2 UN situation Huge queues in the wrong places Desperate need for prioritization Broken by design 28 1 Even Linux is not Magic 29 1 Additional information