From mboxrd@z Thu Jan 1 00:00:00 1970 From: ddaas Date: Sat, 30 Jul 2005 16:03:02 +0000 Subject: [LARTC] Qos wiht HTB for ADSL/Home Message-Id: <42EBA4B6.7050409@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi, My home setup is as following: - 1024/128 kbit ADSL - FC3 I set up HTB to prioritize traffic. I am not very pleased with the=20 obtained results. The scope of my setup is to have some ssh sessions with remote servers=20 while browsing websites and running aMule Nothing complicated (I=20 think... ;). The very high priority traffic (ssh), gets stuck when I start aMule and=20 make an FTP download. Although there is an improvement. High priority (WEB) traffic has some delay when I have a lot of bulk=20 traffic (aMule, FTP). It waits a few seconds for DNS lookup, and other=20 synchronizations and then in a blink of the eye the whole page appears.=20 I think that this means that the queue is still to long. So, I have some questions: 1) Do I need to use ppp0 or eth0 for shaping traffic? 2) Are the default values for quantum, burst, cburst acceptable or=20 should I tune these values? 3) I've seen in some tutorials that decreasing the queue (as I know it=20 is 100 in Linux as the default) with #ip link set dev eth0 qlen, they=20 have been obtained better results. Should I try to decrease the queue?=20 To what value? 3) The same with mtu. A less value (ex 1000) should be better? 4) If your are in my situation (ADSL =96 for home), what is your htb=20 configuration? 5)Does it worth configuring policing for inbound traffic (with imq)? 6)So, am I on the right way with my script or should I change it=20 fundamental? In my setup I have 3 categories of traffic: 1)very high priority traffic: ssh, DNS, ACK, SYN+ACK, RST, FIN+ACK=20 (40kbit > CEIL) 2) high priority traffic: web, online radio, online tv (72kbit->CEIL) 3)low priority traffic - default class: aMule, P2P, other type of=20 traffic(8Kbit->CEIl) THANKS, ddaas My htb script is: #!/bin/bash YAHOOMSG=3D"216.155.193.0/24" RADIO=3D"xxx.xxx.xxx.xxx" TRI=3D"xxx.dnsalias.net" TV=3D"xxx.xxx.xxx.xxx" DNSSERVER=3D"217.237.150.225" IF=3D"ppp0" CEIL=3D"120" #flush everything tc qdisc del dev $IF root iptables -F OUTPUT -t mangle #root qdisc tc qdisc add dev $IF root handle 1: htb default 12 #class 1:1 attached to root qdisc tc class add dev $IF parent 1: classid 1:1 htb rate ${CEIL}kbit ceil=20 ${CEIL}kbit #class 1:10 -> 40kbit-CEIL for ACK,SSH tc class add dev $IF parent 1:1 classid 1:10 htb rate 40kbit ceil=20 ${CEIL}kbit prio 1 #class 1:11 (web,radio,tv) tc class add dev $IF parent 1:1 classid 1:11 htb rate 72kbit ceil=20 ${CEIL}kbit prio 2 #default class 1:12 for bulk traffic (aMule, ftp) tc class add dev $IF parent 1:1 classid 1:12 htb rate 8kbit ceil=20 ${CEIL}kbit prio 5 #mark ack,syn ack,rst,fin, ssh packets and add them to class 1:10 (high=20 prioroty) iptables -A OUTPUT -t mangle -o $IF -p tcp --sport 22 -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -o $IF -p tcp --sport 22 -j RETURN iptables -A OUTPUT -t mangle -o $IF -p tcp --dport 22 -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -o $IF -p tcp --dport 22 -j RETURN iptables -A OUTPUT -t mangle -o $IF -p tcp --tcp-flags SYN,RST,ACK=20 SYN,FIN -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -o $IF -p tcp --tcp-flags SYN,RST,ACK=20 SYN,FIN -j RETURN #mark dns packets iptables -A OUTPUT -t mangle -o $IF -d $DNSSERVER -j MARK --set-mark 1 iptables -A OUTPUT -t mangle -o $IF -d $DNSSERVER -j RETURN tc filter add dev $IF parent 1: protocol ip handle 1 fw classid 1:10 #mark www,radio,tv,tri,yahoomsg iptables -A OUTPUT -t mangle -o $IF -p tcp -m multiport --dports 80,443=20 -j MARK --set-mark 2 iptables -A OUTPUT -t mangle -o $IF -d $RADIO -p tcp --dport 8000 -j=20 MARK --set-mark 2 iptables -A OUTPUT -t mangle -o $IF -d $YAHOOMSG -p tcp --dport 5050 -j=20 MARK --set-mark 2 iptables -A OUTPUT -t mangle -o $IF -d $TV -p tcp -m multiport --dports=20 554,6970 -j MARK --set-mark 2 iptables -A OUTPUT -t mangle -o $IF -d $TRI -j MARK --set-mark 2 tc filter add dev $IF parent 1: protocol ip handle 2 fw classid 1:11 #other type of traffic in default class 1:12 tc qdisc add dev $IF parent 1:10 handle 100: sfq perturb 10 tc qdisc add dev $IF parent 1:11 handle 110: sfq perturb 10 tc qdisc add dev $IF parent 1:12 handle 120: sfq perturb 10 ##INGRESS - drop everithing over 1000kbit tc qdisc del dev $IF ingress tc qdisc add dev $IF handle ffff: ingress tc filter add dev $IF parent ffff: protocol ip prio 10 u32 match \ ip src 0.0.0.0/0 police rate 1000kbit burst 80kbit drop flowid :1 _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc