Unexpected behavior by 'tc'

Unexpected behavior by 'tc'

Post by Nare » Thu, 09 Aug 2007 08:57:51



Hi all,
    I am trying to find out what the mis-configuration is, when I
issue the commands below.

tc qdisc add dev eth0 root handle 123: htb
tc class replace dev eth0 parent 123: classid 123:100 htb rate 200kbit
ceil 200kbit
tc class replace dev eth0 parent 123:100 classid 123:1 htb rate 0kbit
ceil 200kbit prio 0
tc class replace dev eth0 parent 123:100 classid 123:2 htb rate 0kbit
ceil 200kbit prio 1
tc class replace dev eth0 parent 123:100 classid 123:3 htb rate 0kbit
ceil 200kbit prio 2
tc class replace dev eth0 parent 123:100 classid 123:4 htb rate 0kbit
ceil 200kbit prio 3
tc class replace dev eth0 parent 123:100 classid 123:5 htb rate 0kbit
ceil 200kbit prio 4

What happens is this:
I've two packet streams which are properly classified (I verified this
part) into classid's 123:2 and 123:4. I send data constantly on each
stream at the rate of 300 kbps. As expected, I see 200 kbps devoted to
123:2 and no bandwidth devoted to 123:4, which is what I want.
However, if I raise the "ceil" in all commands and the "rate" in the
second command to 300kbit instead of 200kbit; then ALL packets from
both streams go through and I get an effective output of 600 kbps. I
was expecting 300 kbps from 123:2 and none from 123:4.

Do you know what could be causing this?

 
 
 

1. different behaviour of 'while read' and 'for' loops in bash

I have a command I want to execute on several hosts via ssh. The hosts
are listed in a file "hosts.txt", one per line. I'm using bash.

First I tried this:

while read host; do
   ssh $host hostname
done < hosts.txt

but for some reason this only does the first host listed in hosts.txt,
not the rest. The uglier:

for host in `cat hosts.txt`; do
   ssh $host hostname
done

works fine and processes all hosts as it should.

All I can think is that the ssh in the first form somehow causes bash
to lose its place in the file "hosts.txt", but I have no idea how to
check that, or if that is to be expected...?

TIA for any clarification.

2. Controlling pci bus utilization

3. Misterious behavior of 'dip' and 'find', help if u can...

4. Linux Frequently Asked Questions with Answers (Part 2 of 6)

5. Puzzling Behaviour From tr '\n' ' '

6. Linux only seeng half my RAM on Abit BP6

7. manual for 'tc'

8. Cookbook for Oracle 7.2

9. 'floppy: unexpected interrupt' on SLS .99p8

10. BUG & 'Unexpected hw_pointer value' messages

11. using if and endif in shell scripts - getting 'end of file' unexpected

12. 'end of file' unexpected SAY WHAT?!?

13. No Route to Host; Syntax error '(' Unexpected