From: Andy Furniss <andy.furniss@dsl.pipex.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] ppp uplink shaping problems
Date: Thu, 21 Jul 2005 00:18:35 +0000 [thread overview]
Message-ID: <42DEE9DB.5020608@dsl.pipex.com> (raw)
In-Reply-To: <42DB59AF.60106@web.de>
Staenker wrote:
> Hello,
>
> i played a few days with tc htb classes and classified my packets using
> iptables CLASSIFY target.
>
> here is what i did:
> #!/bin/bash
> int='ppp0'
> #making all things clear
> tc qdisc del dev $int root
> iptables -t mangle --flush
> iptables -t mangle --delete-chain
>
> if $1
> then
> #defining classes
> tc qdisc add dev $int root handle 1: htb default 20 r2q 2
> tc class add dev $int parent 1: classid 1:1 htb rate 22kbps
>
> tc class add dev $int parent 1:1 classid 1:10 htb rate 10kbps ceil
> 22kbps prio 0
> tc class add dev $int parent 1:1 classid 1:20 htb rate 9kbps ceil 15kbps
> prio 1
> tc class add dev $int parent 1:1 classid 1:30 htb rate 3kbps ceil 13kbps
> prio 2
> tc qdisc add dev $int parent 1:10 handle 10: sfq perturb 10
> tc qdisc add dev $int parent 1:20 handle 20: sfq perturb 10
> tc qdisc add dev $int parent 1:30 handle 30: sfq perturb 10
>
> iptables -t mangle -N TS_FWD
> iptables -t mangle -A FORWARD -j TS_FWD
>
> iptables -t mangle -A TS_FWD -o ppp0 -p ! icmp --match length --length
> 0:70 -j CLASSIFY --set-class 1:10
> iptables -t mangle -A TS_FWD -o ppp0 -p ! icmp --match length --length
> 0:70 -j RETURN
>
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 80 -j CLASSIFY --set-class 1:20
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 80 -j RETURN
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 443 -j CLASSIFY --set-class 1:20
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 443 -j RETURN
>
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 554 -j CLASSIFY --set-class 1:10
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 -p tcp --source 192.168.0.2
> --destination-port 554 -j RETURN
> #if $2
> #then
> # iptables -t mangle -A TS_FWD -i eth2 -o ppp0 --source 192.168.0.2
> -j LOG
> #fi
> iptables -t mangle -A TS_FWD -i eth2 -o ppp0 --source 192.168.0.2 -j
> CLASSIFY --set-class 1:30
> fi
>
> It works not really good. I tested it using my internal 100MBit network
> interface using multiple ftp connections and classified the packets
> based on their source-ip. That works fine with same classes. Immediately
> all things i expected took place. Also the prio option worked fine. If i
> was running 2 simultanious downloads, the one with the higher piority
> gets all borrowable downloadspeed and the one with the lower priority
> gets his ashured rate.
> But same classes didnt work with my 192kbit 2048kbit ppp link. Well ok,
> they are working, but not like i want them to work. The speed changes
> takes some seconds to take place. And the priority seems to be ignored.
> I have to say, that the i tested the ppp uplink using emule with many
> connections (500 - 800) and the higher priority upload was one active
> ftp connection.
>
> Whats my fault?
I can't see what rule seperates ftp from the rest, so that could be it -
check counters/classification with
tc -s class ls dev ppp0
If ftp is going to the right class then it may be that emule network
traffic consists of loads of small packets. If your ppp0 is adsl then
the difference between the ip length that htb sees and the actual length
used on the wire can be significant enough to make you go over limits
and end up with a 2+ second queue in your modem. Check with ping and
make icmp go to top priority class. It is possible to patch tc/kernel to
allow for this.
Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
prev parent reply other threads:[~2005-07-21 0:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-18 7:26 [LARTC] ppp uplink shaping problems Staenker
2005-07-21 0:18 ` Andy Furniss [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42DEE9DB.5020608@dsl.pipex.com \
--to=andy.furniss@dsl.pipex.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.