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

diffserv filtering question...




hello,

Can someone point out what is going wrong in the following ? i am trying 
to use diffserv/tc for real audio traffic on a very simple network:

<Node1>eth0----eth0<Node2>eth1----eth1<Node3>eth0

where Node1 is a linux machine running real audio client
      Node2 is a linux machine running diffserv/tc/iproute2
Node3 is a linux machine running diffserv/tc/iproute2 and real audio server

Node1 is connected to Node2's eth0
Node2's eth1 is connected to Node3's eth1
Node3's eth0 (ip: 10.0.0.3) runs the real audio server (i.e. the server
binds to
this ip address). 

The problem I am having is that all the packets on Node2 are going through
the 
second qdisc/classid instead of the first one which is setup for EF
 (scripts are below). So, it could
be that the TOS tag in the packets are not being marked by Node3, or there
may be other problem. here is what i get on Node2:

$ ./tc -s class ls dev eth1

 class cbq 2: root rate 10Mbit (bounded,isolated) prio no-transmit
 Sent 317541 bytes 4673 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 624 undertime 0
class cbq 2:1 parent 2: leaf 8003: rate 3500Kbit (bounded,isolated) prio 1
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 14390 undertime 0
class cbq 2:2 parent 2: leaf 8004: rate 3500Kbit prio 7
 Sent 316869 bytes 4657 pkts (dropped 0, overlimits 0) 
  borrowed 0 overactions 0 avgidle 36505 undertime 0

Many thanks for  anyone who can point out what's missing.
Abhijit

-----
Here are the scripts...
On Node3:
=========
for now, only thing Node3 should do is mark all packets coming from
10.0.0.3
as 0x2e and pass it on to Node2:

#!/bin/sh
DEV=eth1
TC=/usr/local/iproute2/tc/tc

$TC qdisc add dev $DEV handle 1:0 root dsmark indices 64 set_tc_index
$TC class change dev $DEV classid 1:2 dsmark mask 0xc0 value 0x2e  
$TC filter add dev $DEV parent 1:0 protocol ip prio 4 handle 1: u32
divisor 1
$TC filter add dev $DEV parent 1:0 prio 4 u32 \
    match ip src 10.0.0.3 \
    flowid 1:2

On Node2:
==========
here, classid 2:1 is set up to handle EF traffic and a filter that handles
0x2e.
pass_on, overlimits  go to classid 2:2

#!/bin/sh
DEV=eth1
TC=/usr/local/iproute2/tc/tc

$TC qdisc add dev $DEV handle 1:0 root dsmark indices 64 set_tc_index

# mask out ECN bits and shift by 2 bits for DSCP bits
$TC filter add dev $DEV parent 1:0 protocol ip prio 1 tcindex \
    mask 0xfc shift 2
    
# Attach qdisc cbq, add filter to forward EF traffic
$TC qdisc add dev $DEV parent 1:0 handle 2:0 cbq bandwidth 10Mbit \
    allot 1514 cell 8 avpkt 1000 mpu 64 

$TC class add dev $DEV parent 2:0 classid 2:1 cbq bandwidth 10Mbit \
    rate 3500Kbit avpkt 1000 prio 1 bounded isolated \
    allot 1514 weight 1 maxburst 10 defmap 1

$TC qdisc add dev $DEV parent 2:1 pfifo limit 5
    
$TC filter add dev $DEV parent 2:0 protocol ip prio 1 \
    handle 0x2e tcindex classid 2:1 pass_on

# attach another class for rest of the traffic
$TC class add dev $DEV parent 2:0 classid 2:2 cbq bandwidth 10Mbit \
    rate 3500Kbit avpkt 1000 prio 7 allot 1514 \
    weight 1 maxburst 21 borrow

$TC qdisc add dev $DEV parent 2:2 red limit 60KB min 15KB max 45KB \
    burst 20 avpkt 1000 bandwidth 10Mbit probability 0.4
    
$TC filter add dev $DEV parent 2:0 protocol ip prio 2 \
    handle 0 tcindex mask 0 classid 2:2 pass_on