Re: [LARTC] What is wrong here (continued...)?

2004-12-24 Thread Mark Williams (MWP)
> On Friday 24 December 2004 08:42, Mark Williams (MWP) wrote:
> > > On Thursday 23 December 2004 17:52, Mark Williams (MWP) wrote:
> > > > > >As you can see class 25 has priority 8, so all other traffic should
> > > > > > get preference, which is not happening.
> > > > > >It almost seems like all the priorities are reversed...
> > > > >
> > > > > Err... I haven't checked the docs, but I think that's because the
> > > > > priorities are the other way around...
> > > >
> > > > Nope, the HTB man page says:
> > > >
> > > >   prio priority
> > > >   In the round-robin process, classes with the lowest
> > > >   priority  field are tried for packets first. Manda-
> > > >   tory.
> > > >
> > > > I did actually try reversed priorities after i made the graph, etc
> > > > though. It just made things worse... so they are in the correct order.
> > >
> > > If you have classes with different prio's, you have to know what's going
> > > on. The class with the lowest prio has the highest priority.  This means
> > > that that class will get the lowes delay ONLY if this class is not
> > > sending more then the configured rate.  This also means that this class
> > > will get the remaining bandwidth of the parent AFTER the other child
> > > classes are served.
> >
> > Ok, so priorities are ignored as soon as used bandwidth of a class goes
> > above the "rate" setting?
> If a class goes aboive the rate setting, the class will get a bad (big) 
> delay.  
> If it stays under the rate, it will get a low delay.
> 
> So prio does 2 things, and in most cases you don't need prio to do what you 
> want to do.  Prio is perfect to speed up low rate traffic like ack, telnet, 
> ssh (no scp), ...

I see...

Ok, ive just tried:

class add dev $INTERFACE parent 1: classid 1:1 htb rate 256kbit
class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 256kbit ceil 256kbit 
prio 1
class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 32kbit ceil 128kbit 
prio 8

Even with this, class 25 still seems to get preference of traffic... it just
sticks at 128kbit outbound no matter what class 20 is doing.

With what youve said above, i cant see how this is the case?

Thanks again, and Merry Christmas to all,
 Mark.
___
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/


Re: [LARTC] What is wrong here (continued...)?

2004-12-24 Thread Stef Coene
On Friday 24 December 2004 08:42, Mark Williams (MWP) wrote:
> > On Thursday 23 December 2004 17:52, Mark Williams (MWP) wrote:
> > > > >As you can see class 25 has priority 8, so all other traffic should
> > > > > get preference, which is not happening.
> > > > >It almost seems like all the priorities are reversed...
> > > >
> > > > Err... I haven't checked the docs, but I think that's because the
> > > > priorities are the other way around...
> > >
> > > Nope, the HTB man page says:
> > >
> > >   prio priority
> > >   In the round-robin process, classes with the lowest
> > >   priority  field are tried for packets first. Manda-
> > >   tory.
> > >
> > > I did actually try reversed priorities after i made the graph, etc
> > > though. It just made things worse... so they are in the correct order.
> >
> > If you have classes with different prio's, you have to know what's going
> > on. The class with the lowest prio has the highest priority.  This means
> > that that class will get the lowes delay ONLY if this class is not
> > sending more then the configured rate.  This also means that this class
> > will get the remaining bandwidth of the parent AFTER the other child
> > classes are served.
>
> Ok, so priorities are ignored as soon as used bandwidth of a class goes
> above the "rate" setting?
If a class goes aboive the rate setting, the class will get a bad (big) delay.  
If it stays under the rate, it will get a low delay.

So prio does 2 things, and in most cases you don't need prio to do what you 
want to do.  Prio is perfect to speed up low rate traffic like ack, telnet, 
ssh (no scp), ...

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


Re: [LARTC] What is wrong here (continued...)?

2004-12-23 Thread Mark Williams (MWP)
> On Thursday 23 December 2004 17:52, Mark Williams (MWP) wrote:
> > > >As you can see class 25 has priority 8, so all other traffic should get
> > > >preference, which is not happening.
> > > >It almost seems like all the priorities are reversed...
> > >
> > > Err... I haven't checked the docs, but I think that's because the
> > > priorities are the other way around...
> >
> > Nope, the HTB man page says:
> >
> >   prio priority
> >   In the round-robin process, classes with the lowest
> >   priority  field are tried for packets first. Manda-
> >   tory.
> >
> > I did actually try reversed priorities after i made the graph, etc though.
> > It just made things worse... so they are in the correct order.
>
> If you have classes with different prio's, you have to know what's going on.  
> The class with the lowest prio has the highest priority.  This means that 
> that class will get the lowes delay ONLY if this class is not sending more 
> then the configured rate.  This also means that this class will get the 
> remaining bandwidth of the parent AFTER the other child classes are served.

Ok, so priorities are ignored as soon as used bandwidth of a class goes above
the "rate" setting?

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


Re: [LARTC] What is wrong here (continued...)?

2004-12-23 Thread Stef Coene
On Thursday 23 December 2004 17:52, Mark Williams (MWP) wrote:
> > >As you can see class 25 has priority 8, so all other traffic should get
> > >preference, which is not happening.
> > >It almost seems like all the priorities are reversed...
> >
> > Err... I haven't checked the docs, but I think that's because the
> > priorities are the other way around...
>
> Nope, the HTB man page says:
>
>   prio priority
>   In the round-robin process, classes with the lowest
>   priority  field are tried for packets first. Manda-
>   tory.
>
> I did actually try reversed priorities after i made the graph, etc though.
> It just made things worse... so they are in the correct order.
If you have classes with different prio's, you have to know what's going on.  
The class with the lowest prio has the highest priority.  This means that 
that class will get the lowes delay ONLY if this class is not sending more 
then the configured rate.  This also means that this class will get the 
remaining bandwidth of the parent AFTER the other child classes are served.

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


Re: [LARTC] What is wrong here (continued...)?

2004-12-23 Thread Mark Williams (MWP)
> >As you can see class 25 has priority 8, so all other traffic should get
> >preference, which is not happening.
> >It almost seems like all the priorities are reversed...
> > 
> 
> Err... I haven't checked the docs, but I think that's because the 
> priorities are the other way around... 

Nope, the HTB man page says:

  prio priority
  In the round-robin process, classes with the lowest
  priority  field are tried for packets first. Manda-
  tory.

I did actually try reversed priorities after i made the graph, etc though.
It just made things worse... so they are in the correct order.

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


[LARTC] What is wrong here (continued...)?

2004-12-23 Thread Mark Williams (MWP)
Hi all,

Here is a RRD graph ive just made of my packet shaping setup:

http://www.overclockers.com.au/~mwp/temp/tc-1hour.png

The app creating the P-25 traffic is bittorrent on the Linux box also doing the
shaping.
P-22 and P-23 is created by FTP transfers.

Starts with bittorrent running.
At 00:03, an FTP transfer is started on "cool.comp" (windows box).
At 00:09, bittorrent is stopped.
At 00:13, an FTP transfer is started on "ian.comp" (another windows box).
At 00:18, bittorrent is restarted.
At 00:21, FTP on "ian.comp" is stopped.
At 00:25, FTP on "cool.comp" is stopped.

Now whats happening in the graph is the exact opposite of what i want to happen.
P-25 is clearly getting more priority than P-22 and P23.

I just cant see how this can be happening with the config below:

#root device
$TC qdisc add dev $INTERFACE root handle 1: htb default 25

#root class
$TC class add dev $INTERFACE parent 1: classid 1:1 htb rate 256kbit

#20 - ICMP, DNS, SYN, SSH
$TC class add dev $INTERFACE parent 1:1 classid 1:20 htb rate 128kbit ceil 
256kbit prio 1
$TC qdisc add dev $INTERFACE parent 1:20 handle 20: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 20 fw 
flowid 1:20

#21 - HTTP/FTP out
$TC class add dev $INTERFACE parent 1:1 classid 1:21 htb rate 128kbit ceil 
256kbit prio 2
$TC qdisc add dev $INTERFACE parent 1:21 handle 21: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 21 fw 
flowid 1:21

#22 - All cool.comp traffic
$TC class add dev $INTERFACE parent 1:1 classid 1:22 htb rate 128kbit ceil 
256kbit prio 3
$TC qdisc add dev $INTERFACE parent 1:22 handle 22: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 22 fw 
flowid 1:22

#23 - All ian.comp traffic
$TC class add dev $INTERFACE parent 1:1 classid 1:23 htb rate 64kbit ceil 
256kbit prio 4
$TC qdisc add dev $INTERFACE parent 1:23 handle 23: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 23 fw 
flowid 1:23

#24 - HTTP/FTP in
$TC class add dev $INTERFACE parent 1:1 classid 1:24 htb rate 64kbit ceil 
256kbit prio 5
$TC qdisc add dev $INTERFACE parent 1:24 handle 24: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 24 fw 
flowid 1:24

#25 - Everything else
$TC class add dev $INTERFACE parent 1:1 classid 1:25 htb rate 15kbit ceil 
180kbit prio 8
$TC qdisc add dev $INTERFACE parent 1:25 handle 25: sfq perturb 10
$TC filter add dev $INTERFACE parent 1:0 prio 0 protocol ip handle 25 fw 
flowid 1:25

As you can see class 25 has priority 8, so all other traffic should get
preference, which is not happening.
It almost seems like all the priorities are reversed...

Any ideas?

Thanks,
 Mark Williams.
___
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/