|
ADSL is a paradize for QoS: the only queue that you control
(your queue going out to your ISP) is the number one bottleneck,
as soon as you start to be more than just a client. We will see here how to prioritize outgoing traffic on a DSL link, with one of the simplest Linux qdisc (queueing discipline): PRIO. | ||
| From tc's man page: | ||
|
|
# # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_CSZ=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m CONFIG_NET_CLS_POLICE=y |
#!/usr/bin/perl -w
use strict;
my (%sent, %oldsent, %comp, %drop, %olddrop);
while (1) {
open FILE, "/sbin/tc -s qdisc show dev ppp0 |";
my $queue;
while (
|
/etc/ppp/ip-up.d),
and then run the QoS monitoring script.
prio 1 11055 Backlog: 9p Dropped: 0 pfifo 11 74 Backlog: 0p Dropped: 0 pfifo 12 190 Backlog: 0p Dropped: 0 tbf 13 10791 Backlog: 9p Dropped: 0 prio 1 7813 Backlog: 9p Dropped: 0 pfifo 11 0 Backlog: 0p Dropped: 0 pfifo 12 366 Backlog: 0p Dropped: 0 tbf 13 7447 Backlog: 9p Dropped: 0 |
prio 1 is your main qdisc. It provides the aggregated statistics.You see, per one-second interval,
| |||||||||
pfifo 11 is a qdisc just to provide statistics on band #1.That's where the highest priority traffic goes, typically ssh. | |||||||||
pfifo 12 is for "normal" traffic, band #2. I use it for http and RealPlayer (it needs to be configured for that).
| |||||||||
tbf 13 is not called pfifo 13 because the script
attaches a Token Bucket Filter to that band, to tune its behaviour. |
|
In particular, make sure your ssh traffic goes in the right band. Launch a ssh connection, and look at what traffic increases.
| |
|
You have some background traffic, like GNUtella? It should be in band 3.
| |
|
Start using your ssh, and look at the backlog increase for your GNUtella, not for your band #1.
| |
Reduce the "latency 500ms" in the tbf qdisc, and you will see that you start to drop earlier. Increase, and you will see the backlog increase but the drops decrease. |