ppp uplink shaping problems

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

Regards
Richard Hauswald
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux