[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is TC possibly hardware dependent!?



Dear all,

My apology if you received this email twice. It appears that the first one has
gone down to the drain...

I have a problem not directly related to Diffserv but concerned with the
setting of queue priority in TC. I did some testings and found out that my tc
srcipt worked only on one type of network card (pcmcia waveLAN) but not the
others (e.g. ethernet, isa waveLAN). Details are as follow...

As a newbie in this area, I did several cut and paste of some good works that
people had done and come up with a simple script (see attached file "my_tc2q").
Basically I have a high and a low priority queue in my traffic controller.
Packets with a specific destination IP address and port number goes to the high
priority queue, while all default traffic goes to the low priority queue. Below
is the status information of tc after running my_tc2q script:

qdisc sfq 8002: quantum 1514b perturb 15sec
qdisc sfq 8001: quantum 1514b perturb 15sec
qdisc cbq 1: rate 7Mbit (bounded,isolated) prio no-transmit
class cbq 1: root rate 7Mbit (bounded,isolated) prio no-transmit
class cbq 1:1 parent 1: leaf 8001: rate 4Mbit (bounded) prio 1
class cbq 1:2 parent 1: leaf 8002: rate 3Mbit prio 7
filter parent 1: protocol ip pref 1 u32
filter parent 1: protocol ip pref 1 u32 fh 800: ht divisor 1
filter parent 1: protocol ip pref 1 u32 fh 800::800 order 2048 key ht 800 bkt 0
flowid 1:1
  match 829bbeda/ffffffff at 16
  match 00002329/0000ffff at 20

To verify my script, I have a very simple network setup using two machines:

my_machine_with_tc ---->  130.155.190.128

I generated three continuous data streams in my tests. With my_tc2q script,
packets with port number 9001 should go to the high priority queue, and packets
with port numbers 6001 and 7001 should go to the low priority queue. I
conducted my tests in these sequences:
* activate my_tc2q script
* use ttcp to pumpt high priority traffic (port #9001) to 130.155.190.128
* use ttcp to pumpt low priority traffic (port #6001 and #7001) to
130.155.190.128
* observe the bandwidth consumed by each data stream (port #9001, #6001 and
#7001)

Ideally, the injection of low priority traffic (port #6001 and #7001) should
not affect the bandwdith of the high priority traffic.  I have done four
seperate tests as below:

(1) my_laptop (pcmcia waveLAN) ----> (ISA waveLAN) 130.155.190.128
total bandwidth = 1.2M, high priority bandwidth = 800K, low priority bandwidth
= 400K

Result: The script works as expected. That is, the high priority traffic
consumes 800Kbps all the time, and the remaining 400Kbps bandwidth is shared
between two low priority data streams (200Kbps each).

(2) my_laptop (pcmcia 10baseT ether) ----> (ISA 10baseT ether) 130.155.190.128
total bandwidth = 7M, high priority bandwidth = 4M, low priority bandwidth = 3M

Result: The script can shape the high priority traffic to 4M when it is alone.
As soon as low priority traffic comes in, the high priority traffic gives away
part of its bandwidth and all traffic shares the total bandwidth equally.

(3) my_desktop (ISA waveLAN) ----> (ISA waveLAN) 130.155.190.128
total bandwidth = 1.7M, high priority bandwidth = 800K, low priority bandwidth
= 900K

Result: Similar to (2). The script can shape the high priority traffic to 800K
when it is alone. When low priority traffic comes, there
is no difference between them.

(4) my_desktop (ISA 10baseT ehter) ----> (ISA 10baseT ether) 130.155.190.128
total bandwidth = 7M, high priority bandwidth = 4M, low priority bandwidth = 3M

Result: Same as (2).

I know it sounds very odd, but it seems to me that my script works only on the
pcmcia waveLAN card!? It would be appreciate so
much if someone can give me a hint what may go wrong... (my script, the
compiled kernel, u32 filter in tc, etc)

Thanks for your patience reading this lengthy email...

Best Regards,
Jonathan Chan
#! /bin/sh

# This script trys to demonstrate the traffic priority of TC. It consists of two queues:
# - default traffic goes to the low priority queue
# - traffic identified by its destination IP and port# goes to the high priority queue


DEV="dev eth0"           # interface
TBW=7Mbit                # total bandwidth of interface
HBW=4Mbit                # bandwidth for high priority traffic
LBW=3Mbit                # bandwidth for low priority traffic
ADDR=130.155.190.218     # packet with this IP address and port number
PORT=9001                # goes to the high priority queue

# clear everything
tc qdisc del $DEV root

# attach CBQ on DEV, with max bw of TBW
tc qdisc add $DEV root handle 1: cbq bandwidth $TBW cell 8 avpkt 1000 mpu 64

# install a u32 classifier for the traffic to class 1:0
tc filter add $DEV parent 1:0 prio 1 protocol ip u32

# set up class 1:1 to be high priority (1)
tc class add $DEV parent 1:0 classid 1:1 cbq bandwidth $TBW rate $HBW \
allot 1514 weight $HBW prio 1 maxburst 50 avpkt 1000 bounded

# attach sfq qdisc to class 1:1
tc qdisc add $DEV parent 1:1 sfq quantum 1514b perturb 15

# define a filter for class 1:1
tc filter add $DEV parent 1:0 prio 1 u32 match ip dst $ADDR \
match ip dport $PORT 0xffff flowid 1:1

# set up class 1:2 to be low priority (7), default traffic goes here
tc class add $DEV parent 1:0 classid 1:2 cbq bandwidth $TBW rate $LBW \
allot 1514 weight $LBW prio 7 maxburst 50 avpkt 1000 split 1:0 defmap ffff

# attach sfq qdisc to class 1:2
tc qdisc add $DEV parent 1:2 sfq quantum 1514b perturb 15