Skip to contentSkip to conversation

htb on Gigabit Interfaces

LARTC Marco Aurelio 1 participant 1 message Oct 10, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 23 lines · hhoxha

Hi every body

I have a linux server with Intel(R) Xeon(TM) CPU 3.20GHz , and 2 Gigabit of RAM , kernel version 2.6.22.6 , and 2 Intel 82541PI Gigabit Ethernet controllers

In simple situation i would like to limit bandwidth for 2 customers 1) ( to 34 Mb/s ) and 2) 68 Mb/s .

My conf is as below ///////////////////////////////////////////////////// #IFACE FACONG THE CUSTOMERS

/sbin/tc qdisc add dev eth0 root handle 1:0 htb

#IFACE FACING THE INTERNET

/sbin/tc qdisc add dev eth1 root handle 1:0 htb

Quoted 6 lines
/sbin/tc class add dev eth0  parent 1:0 classid 1:1 htb rate  150mbit quantum 30000
/sbin/tc class add dev eth1  parent 1:0 classid 1:1 htb rate  150mbit quantum 30000

#second customer download

/sbin/tc class add dev eth0 parent 1:0 classid 1:2 htb rate 68mbit ceil 68mbit quantum 30000

try parent 1:1

Quoted 4 lines

#seconf customer upload

/sbin/tc class add dev eth1 parent 1:0 classid 1:2 htb rate 68000kbit ceil 68000kbit quantum 30000

and here

Quoted 4 lines
# first customer download

/sbin/tc class add dev eth0 parent 1:0 classid 1:3 htb rate 34mbit ceil 34mbit quantum 30000

and here

Quoted 4 lines
# first customer upload

/sbin/tc class add dev eth1 parent 1:0 classid 1:3 htb rate 34mbit ceil 34mbit quantum 30000

aand here

Quoted 48 lines

#then iptable classify rules

#TO_FIRST CUSTOMER

/opt/sbin/iptables -t mangle -I POSTROUTING -o eth0 -d $DESTINATIONIP -j CLASSIFY --set-class 1:2

#FROM_FIRST CUSTOMER

/opt/sbin/iptables -t mangle -I POSTROUTING -o eth1 -s $SOURCEIP -j CLASSIFY --set-class 1:2

#TO_SECOND CUSTOMER

/opt/sbin/iptables -t mangle -I POSTROUTING -o eth0 -d $DESTINATIONIP -j CLASSIFY --set-class 1:3

#FROM_SECOND CUSTOMER

/opt/sbin/iptables -t mangle -I POSTROUTING -o eth1 -s $SOURCEIP -j CLASSIFY --set-class 1:3

/////////////////////////////////

For the customer with 34 Mb/s of bandwidth i can hardly reach 8 Mb/s and
at this point i can notice an increased number of packets in the htb scheduler queue .

With the tc ( htb disabled ) the line rate of nearly 100 Mb.s of the customer can be reached easily

Is there any special tunning or conf that should be done considering the gig interfaces in place

Thank you

Hysen Hoxha
AlbTelecom
Albania

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

Signature · 7 lines
Marco Casaroli
SapucaiNet Telecom
+55 35 34712377 ext. 5
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc