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

Isolated paramter



Hello!

As someone wrote:

> > 	* isolated
> 
> indicates that the class will not share bandwidth with any of
> non-descendant classes
> 

To verify the behaviour,I would like to show you a very simple CBQ scripts
 (you can tune the shaping performance by changing the parameters listed
 in the biginning of the scripts).

Class 1:2 and 1:3 should not exceed 500Kbit, because they are not allowed to
share their bandwidth.

However the result is not like this.
(Note that if you set "bounded" to TYPE12 & TYPE13 instead,
 both traffic are shaped properly)

Can anyone tell me if there is a mistake in the script,
or giving me a simple example which can "isolate" traffic would be appreciated.

---------------------------------------------------------------------------

#! /bin/sh
# shape traffic according to the IP address
# defined class 1:1 1:2 1:3 
# 2000/6/14 T.OKABE

# terminal IP address list
PC1=192.168.40.45
PC2=192.168.40.26

#parameters
BW=10Mbit
RATE11=1Mbit;WEIGHT11=0.1Mbit;PR11=8;TYPE11="bounded"
RATE12=500Kbit;WEIGHT12=50Kbit;PR12=7;TYPE12="isolated"
RATE13=500Kbit;WEIGHT13=50Kbit;PR13=7;TYPE13="isolated"

# delete all settings
tc qdisc del dev eth0 root

# Attach CBQ to eth0

tc qdisc add dev eth0 root handle 1: cbq \
  bandwidth $BW allot 1514 cell 8 avpkt 1500 \
  mpu 64

# base 1:1
tc class add dev eth0 parent 1:0 classid 1:1 cbq \
  bandwidth $BW rate $RATE11 allot 1514 cell 8 \
  weight $WEIGHT11 prio $PR11 maxburst 21 avpkt 1500 \
  $TYPE11

# class 1:2 & 1:3

tc class add dev eth0 parent 1:1 classid 1:2 cbq \
  bandwidth $BW rate $RATE12 allot 1514 cell 8 \
  weight $WEIGHT12 prio $PR12 maxburst 21 avpkt 1500 \
  $TYPE12

tc class add dev eth0 parent 1:1 classid 1:3 cbq \
  bandwidth $BW rate $RATE13 allot 1514 cell 8 \
  weight $WEIGHT13 prio $PR13 maxburst 21 avpkt 1500 \
  $TYPE13

# filter definition

tc filter add dev eth0 parent 1:0 protocol ip prio $PR12 u32 \
   match ip dst $PC1 flowid 1:2

tc filter add dev eth0 parent 1:0 protocol ip prio $PR13 u32 \
   match ip dst $PC2 flowid 1:3


# List all parameters:

echo "---- qdisc parameters ----------"
tc qdisc ls dev eth0
echo "---- class parameters ----------"
tc class ls dev eth0
echo "---- filter parameters----------"
tc filter show dev eth0
echo "---- parameter list end ----------"

-----------------------------------------------------------------
Tadashi OKABE
Computer and Communication R&D Centre
TEPCO, JAPAN