Skip to contentSkip to conversation

Rate goes over setting

LARTC Stef Coene 3 participants 3 messages Jan 3, 1980 – Mar 12, 2002

lore
Share & tools
lore

Stef Coene

author
#0 lore raw
Quoted 7 lines · Allan Gee

-----Original Message-----
From: Allan Gee
Sent: Tuesday, March 12, 2002 3:27 PM
To: '[email protected]'
Subject: Rate goes over setting

Quoted 8 lines

Hi guys I have a small problem that I want to limit each network behind us to different rates. The box sits between our router to the internet and the clients. I have attached a mrtg graph to show the stats and one can see that every now and then the rate goes over the limit. This is the code I use for that client who has 64kbit from us and we give him 16kbit only with no borrowing. As you can see from the script I have tried to set the burst rate to as low as possible but it still goes over.
What am I doing wrong?

The script looks OK.

But like Devik said, the output of tc is important. I have some scripts if you are interested to create graphs of the output of tc. It records allmost all available counters. You can find it on www.docum.org under GUI (example can be found on http://home.docum.org/stef.coene/qos/gui/rrd.html). It uses snmp to get remote information and uses rrd to store the data and to create graphs.
This gives you the oppurtinity to get more information when there is a problem.

Stef

Signature · 7 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw

-----Original Message-----
From: Allan Gee
Sent: Tuesday, March 12, 2002 3:27 PM
To: '[email protected]'
Subject: Rate goes over setting

Hi guys I have a small problem that I want to limit each network behind us to different rates. The box sits between our router to the internet and the clients. I have attached a mrtg graph to show the stats and one can see that every now and then the rate goes over the limit. This is the code I use for that client who has 64kbit from us and we give him 16kbit only with no borrowing. As you can see from the script I have tried to set the burst rate to as low as possible but it still goes over.
What am I doing wrong?

#!/bin/sh
cbq stop
/home/allang/resetFW
TCHTB="/sbin/tc"
BURS="burst 0.1kbit cburst 0.1kbit"

# Destination
TCCLASSDST="/sbin/tc class add dev eth1 parent" TCQDISCDST="/sbin/tc qdisc add dev eth1 parent" TCFILTERDST="/sbin/tc filter add dev eth1 parent 1:0 protocol ip prio 1 u32"

# Source
TCCLASSSRC="/sbin/tc class add dev eth0 parent" TCQDISCSRC="/sbin/tc qdisc add dev eth0 parent" TCFILTERSRC="/sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32" #
# For Transparent Proxy
#
iptables -A PREROUTING -t nat -s 192.168.178.0/24 -p tcp --dport 80 -j DNAT --to 192.168.177.231:3128
iptables -A POSTROUTING -t nat -s 192.168.178.0/24 -d 192.168.177.231 -j SNAT --to 192.168.177.15

# Root & Default Class
$TCHTB qdisc add dev eth1 root handle 1: htb default 11 $TCCLASSDST 1: classid 1:10 htb rate 100Mbit $TCCLASSDST 1:10 classid 1:11 htb rate 100Mbit ceil 100Mbit $TCQDISCDST 1:11 handle 12: sfq perturb 10

$TCHTB qdisc add dev eth0 root handle 1: htb default 11 $TCCLASSSRC 1: classid 1:10 htb rate 100Mbit $TCCLASSSRC 1:10 classid 1:11 htb rate 100Mbit ceil 100Mbit $TCQDISCSRC 1:11 handle 12: sfq perturb 10

# The 16kbit client
$TCCLASSDST 1: classid 1:20 htb rate 16kbit ceil 16kbit $BURS $TCCLASSDST 1:20 classid 1:21 htb rate 16kbit ceil 16kbit $BURS $TCQDISCDST 1:21 handle 22: sfq perturb 10 $TCFILTERDST match ip dst 129.0.0.0/24 flowid 1:21

$TCCLASSSRC 1: classid 1:20 htb rate 16kbit ceil 16kbit $BURS $TCCLASSSRC 1:20 classid 1:21 htb rate 16kbit ceil 16kbit $BURS $TCQDISCSRC 1:21 handle 22: sfq perturb 10 $TCFILTERSRC match ip src 129.0.0.0/24 flowid 1:21

Regards Allan Gee
Equation
021 4181777

#2 lore raw
In reply to Stef Coene

Hi, I have not X terminal here so I don't see the gif, but what ammount is the difference ?
Also attach please tc -s -d class show ethX output in times of bad shaping.
devik

Quoted 7 lines

Hi guys I have a small problem that I want to limit each network behind us to different rates. The box sits between our router to the internet and the clients. I have attached a mrtg graph to show the stats and one can see that every now and then the rate goes over the limit. This is the code I use for that client who has 64kbit from us and we give him 16kbit only with no borrowing. As you can see from the script I have tried to set the burst rate to as low as possible but it still goes over.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/