All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] IMQ & HTB
@ 2003-07-01  5:40 Chijioke Kalu
  0 siblings, 0 replies; 4+ messages in thread
From: Chijioke Kalu @ 2003-07-01  5:40 UTC (permalink / raw)
  To: lartc

Hi All,

I am a newbie

I have gone thru the archive for a couple of days now, and kind find 
postings that related to what am trying to do, I would appreciate it, if 
someone could help me with their sample script which I can tweak.

My setup involves eth0 - Internet, eth1 - LAN

I have 10 computers and 1 VoIP Telephone on the LAN, 256kb downlink/128kb 
uplink, and running Squid 2.5 STABLE 3 with NAT enabled

I was told IMQ can hangle VoIP traffic properly, so wanted to try it out, 
how can I configure this properly so I always have clear voice quality, also 
I would like to divide the bandwidth such that each system gets 10kb 
downlink no matter what and 5kb uplink, while the telephone has 64kb 
downlink and 64kb uplink

I believe the enabling NAT will effect the ingress and egress queues?

On the squid, some applications connect to my squid port 3128, and establish 
up to 50 connections at a time, thus eating up the bandwidth, how can i 
restrict the connections to a limit of say 5 without drawing performance?

Please any suggestions and sample scripts would be greatly appreciated, I 
have gone thru the document at docum.org, but still cant apply it properly.

Thanks

KC

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?pageþatures/featuredemail

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LARTC] imq + htb
@ 2005-10-01  0:58 choros
  2005-10-01 12:42 ` Andy Furniss
  2005-10-01 14:56 ` choros
  0 siblings, 2 replies; 4+ messages in thread
From: choros @ 2005-10-01  0:58 UTC (permalink / raw)
  To: lartc

Hi, i am running imq + htb on my router , the situation is like this

eth0 = uplink to my provider
eth1 = 1st customer
eth2 = 2nd customer
eth3 = 3th customer

eth0 has limit 512 and i want to share this between eth1 eth2 and eth3 , 
but not working , this is the script i used,
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin

iptables -t mangle -F  2>/dev/null
iptables -t mangle -X  2>/dev/null
iptables -t mangle -N markov
iptables -t mangle -I PREROUTING -j markov
iptables -t mangle -N markov2
iptables -t mangle -I POSTROUTING -j markov2

tc qdisc del dev imq0 root >/dev/null 2>&1
tc qdisc del dev imq1 root >/dev/null 2>&1

#bring up the imq0
ip link set dev imq0 up

#marking of  incoming from eth1,eth2,eth3
iptables -t mangle -A markov -i eth1 -j MARK --set-mark 1
iptables -t mangle -A markov -i eth2 -j MARK --set-mark 2
iptables -t mangle -A markov -i eth3 -j MARK --set-mark 3

#forward it to imq0
iptables -t mangle -A PREROUTING -i eth1 -j IMQ --todev 0
iptables -t mangle -A PREROUTING -i eth2 -j IMQ --todev 0
iptables -t mangle -A PREROUTING -i eth3 -j IMQ --todev 0

tc qdisc add dev imq0 root handle 10: htb default 20
tc class add dev imq0 parent 10: classid 10:2 \
 htb rate 512Kbit ceil 512Kbit
#####################################################
#class for eth1
tc class add dev imq0 parent 10:2 classid 10:21 htb rate 128Kbit ceil 
512Kbit
# mark
tc filter add dev imq0 parent 10:2 protocol ip prio 1 handle 1 fw 
classid 10:21
tc qdisc add dev imq0 parent 10:21 sfq perturb 15
#######################################################
# class for eth2
tc class add dev imq0 parent 10:2 classid 10:22 htb rate 128Kbit ceil 
512Kbit
#mark
tc filter add dev imq0 parent 10:2 protocol ip prio 1 handle 2 fw 
classid 10:22
tc qdisc add dev imq0 parent 10:22 sfq perturb 15
#########################################
# class for eth3
tc class add dev imq0 parent 10:2 classid 10:23 htb rate 128Kbit ceil 
512Kbit
#mark
tc filter add dev imq0 parent 10:2 protocol ip prio 1 handle 3 fw 
classid 10:23
tc qdisc add dev imq0 parent 10:23 sfq perturb 15
##############################################
##############################################
# outgoing traffic to eth1,eth2,eth3
#bring up  imq1
ip link set dev imq1 up
#make marks
iptables -t mangle -A markov2 -o eth1 -j MARK --set-mark 21
iptables -t mangle -A markov2 -o eth2 -j MARK --set-mark 22
iptables -t mangle -A markov2 -o eth3 -j MARK --set-mark 23
#forward it to imq1
iptables -t mangle -A POSTROUTING -o eth1 -j IMQ --todev 1
iptables -t mangle -A POSTROUTING -o eth2 -j IMQ --todev 1
iptables -t mangle -A POSTROUTING -o eth3 -j IMQ --todev 1

tc qdisc add dev imq1 root handle 10: htb default 20
tc class add dev imq1 parent 10: classid 10:2  htb rate 512Kbit ceil 512Kbit
##################################
# class for eth1
tc class add dev imq1 parent 10:2 classid 10:21 htb rate 128Kbit ceil 
512Kbit
# mark
tc filter add dev imq1 parent 10:2 protocol ip prio 1 handle 21 fw 
classid 10:21
tc qdisc add dev imq1 parent 10:21 sfq perturb 15
####################################
# class for eth2
tc class add dev imq1 parent 10:2 classid 10:22 htb rate 128Kbit ceil 
512Kbit
#mark
tc filter add dev imq1 parent 10:2 protocol ip prio 1 handle 22 fw 
classid 10:22
tc qdisc add dev imq1 parent 10:22 sfq perturb 15
#####################################
#class for eth3
tc class add dev imq1 parent 10:2 classid 10:23 htb rate 128Kbit ceil 
512Kbit
#mark
tc filter add dev imq1 parent 10:2 protocol ip prio 1 handle 23 fw 
classid 10:23
tc qdisc add dev imq1 parent 10:23 sfq perturb 15
######################################
######################################

But the traffic is unshaped, i think maybe somethink wrong with the 
filters becouse  if i do
tc -s class show dev imq0 or imq1 while uploading or downloading traffic 
doesnt get to right
class. If i take look in iptables -t mangle -L -n -v the packets are 
marked well
OUTPUT OF tc -s class show dev imq0
class htb 10:22 parent 10:2 leaf 8026: prio 0 rate 128000bit ceil 
512000bit burst 1615b cburst 1.625Kb
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 103424 ctokens: 26624

class htb 10:23 parent 10:2 leaf 8027: prio 0 rate 128000bit ceil 
512000bit burst 1615b cburst 1.625Kb
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 103424 ctokens: 26624
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
PARTIAL OUTPUT of iptables -t mangle -L -n -v
Chain markov (1 references)
 pkts bytes target     prot opt in     out     source               
destination
   96  8578 MARK       all  --  eth1   *       0.0.0.0/0            
0.0.0.0/0           MARK set 0x1
25004   36M MARK       all  --  eth2   *       0.0.0.0/0            
0.0.0.0/0           MARK set 0x2
    0     0 MARK       all  --  eth3   *       0.0.0.0/0            
0.0.0.0/0           MARK set 0x3

Chain markov2 (1 references)
 pkts bytes target     prot opt in     out     source               
destination
    7  1750 MARK       all  --  *      eth1    0.0.0.0/0            
0.0.0.0/0           MARK set 0x15
24874   36M MARK       all  --  *      eth2    0.0.0.0/0            
0.0.0.0/0           MARK set 0x16
    6  2222 MARK       all  --  *      eth3    0.0.0.0/0            
0.0.0.0/0           MARK set 0x17

class htb 10:2 root rate 512000bit ceil 512000bit burst 1.625Kb cburst 
1.625Kb
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 26624 ctokens: 26624

class htb 10:21 parent 10:2 leaf 8025: prio 0 rate 128000bit ceil 
512000bit burst 1615b cburst 1.625Kb
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 rate 0bit 0pps backlog 0b 0p requeues 0
 lended: 0 borrowed: 0 giants: 0
 tokens: 103424 ctokens: 26624
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
THANKS A LOT FOR HELP
Jorge Sanchez
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] imq + htb
  2005-10-01  0:58 [LARTC] imq + htb choros
@ 2005-10-01 12:42 ` Andy Furniss
  2005-10-01 14:56 ` choros
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Furniss @ 2005-10-01 12:42 UTC (permalink / raw)
  To: lartc

choros wrote:

> tc filter add dev imq0 parent 10:2 protocol ip prio 1 handle 3 fw 
> classid 10:23

The filters need to be on the root - 10: or  you need another filter on 
10: to filter the packets to 10:2.

Andy.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] imq + htb
  2005-10-01  0:58 [LARTC] imq + htb choros
  2005-10-01 12:42 ` Andy Furniss
@ 2005-10-01 14:56 ` choros
  1 sibling, 0 replies; 4+ messages in thread
From: choros @ 2005-10-01 14:56 UTC (permalink / raw)
  To: lartc

Andy Furniss wrote:

> choros wrote:
>
>> tc filter add dev imq0 parent 10:2 protocol ip prio 1 handle 3 fw 
>> classid 10:23
>
>
> The filters need to be on the root - 10: or  you need another filter 
> on 10: to filter the packets to 10:2.
>
> Andy.

thanks for your help .  I did what you say and everything seems to be ok..
Jorge
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-01 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-01  0:58 [LARTC] imq + htb choros
2005-10-01 12:42 ` Andy Furniss
2005-10-01 14:56 ` choros
  -- strict thread matches above, loose matches on Subject: below --
2003-07-01  5:40 [LARTC] IMQ & HTB Chijioke Kalu

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.