tc gred diffserv AF11 issues

Linux Advanced Routing and Traffic Control

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

 



I have been trying to get an example of Linux tc Diffserv AF to work.
I am trying to follow the example at web_dot_opalsoft_dot_net slash
qos example acfbq.
I had to change the order of the commands as best I could figure out
as noted in the web page description of the commands.
I have also looked at the perl script at: github_dot_com slash
sivasankariit slash iproute2 slash blob slash master slash examples
slash diffserv slash afcbq

I first run into trouble with the tc qdisc change .... DP X
probability 0x01 prio 2
commands because the example uses DP 3 but I get rejected for that value.
I shifted to values 0, 1 and 2 instead of the 1, 2 and 3 in the example.
I am actually trying to include EF and C 6 queues and I have had that working in
a bigger script with the AF system but the AF frames are not showing
as getting queued when doing the qdisc show:
tc -s -d qdisc show

I see the AF packets I am sending from a test set enter the dsmark 1: and
the qdisk htb 2: stats but they do not show up under any vq or even
the BE queue.
I am sending the DS bits for AF11: 00101000b  (0x28) which becomes
0x0A after the shift 2.

I am including my script at the end of the emal for AF and BE which is
about as close as I can get to the opalsoft example at the end of the
email.

I understand the tcindex mask 0xfc shift 2 will give me only the diffserv bits.
The command:
# ---- AF Class 1
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 10 tcindex
classid 1:111
Should then match on the 10 (0x0A) AF11 value and give it id 0x111
# -- Main AF htb classifier's elements
tc filter add dev agl0 parent 2:0 protocol ip prio 1 tcindex mask 0xf0
shift 4 pass_on
Should give me a 0x01?
And this should be matched by the filter handle 1:
# 11 -- AF Class 1
tc filter add dev agl0 parent 2:1 protocol ip prio 1 handle 1 tcindex
classid 2:10
Which I would expect to end up in vq0 of the 2:10 queue.

Any hints or help would be greatly appreciated.
This is something that I need to
get working and is not some homework assignment.

Thanks,
James Munn



 bin script below:



















echo "Creating AGL0 DiffServ Default construct"

echo "Disabling ARP on AGL0"
ip link set dev agl0 arp off


# Notes:
# Show qdisc:  tc -d qdisc deg agl0
# Show filters:  tc filter show dev agl0
# Show Filters of other classes:  tc filter show dev agl0 filter parent 2:1

# REMOVE any OLD RULES!
tc qdisc del dev agl0 root

# - Main dsmark and classifier
tc qdisc add dev agl0 handle 1:0 root dsmark indices 64 set_tc_index
tc filter add dev agl0 parent 1:0 protocol ip prio 1 tcindex mask 0xfc
shift 2 pass_on

echo " After Main dsmark and classifier"

# - Main dsmark classifier's elements

# ---- AF Class 1
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 10 tcindex
classid 1:111
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 12 tcindex
classid 1:112
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 14 tcindex
classid 1:113

# ---- AF Class 2
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 18 tcindex
classid 1:121
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 20 tcindex
classid 1:122
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 22 tcindex
classid 1:123

# ---- AF Class 3
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 26 tcindex
classid 1:131
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 28 tcindex
classid 1:132
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 30 tcindex
classid 1:133

# ---- AF Class 4
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 34 tcindex
classid 1:141
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 36 tcindex
classid 1:142
tc filter add dev agl0 parent 1:0 protocol ip prio 1 handle 38 tcindex
classid 1:143

echo "After AF Class 4"

# ---- BE
###  I am not sure this should be here or what it does?
tc filter add dev agl0 parent 1:0 protocol ip prio 2 handle 0 tcindex
classid 1:1


# - Main htb qdisc & class and Max Rate
tc qdisc add dev agl0 parent 1:0 handle 2:0 htb
tc class add dev agl0 parent 2:0 classid 2:1 htb rate 10Mbit ceil 156Mbit

echo "After Main htb qdisc"

# - Class Selector 6 (2:10) Just Max Queue Depth
### tc class add dev agl0 parent 2:1 classid 2:10 htb rate 10Mbit ceil 156Mbit
# Response: HTB: quantum of class 20010 is big. Consider r2q change.
### tc qdisc add dev agl0 parent 2:10 pfifo limit 50
### tc filter add dev agl0 parent 2:0 protocol ip prio 1 handle 0x30
tcindex mask 0x003f classid 2:10 pass_on

# - EF Class (2:20) Just Max Queue Depth
### tc class add dev agl0 parent 2:1 classid 2:20 htb rate 1500Kbit ceil 156Mbit
# Response: HTB: quantum of class 20020 is big. Consider r2q change.
### tc qdisc add dev agl0 parent 2:20 pfifo limit 5
### tc filter add dev agl0 parent 2:0 protocol ip prio 1 handle 0x2e
tcindex mask 0x003f classid 2:20 pass_on

echo "After EF Class filter"

# -- Main AF htb classifier's elements
tc filter add dev agl0 parent 2:0 protocol ip prio 1 tcindex mask 0xf0
shift 4 pass_on

echo "After Main AF htb classifer's elements"

# - AF Class 1 (2:30) Service Rate, Drop Precedence
tc class add dev agl0 parent 2:1  classid 2:10 htb rate 10Mbit ceil 156Mbit
#tc qdisc add dev agl0 parent 2:10 red limit 60KB min 15KB max 45KB
burst 29 avpkt 100 bandwidth 10Mbit probability 0.4
tc qdisc add dev agl0 parent 2:10 gred setup DPs 3 default 2 grio
# if default == 3 then response "default" must be less than "vqs"
# 11 -- AF Class 1
tc filter add dev agl0 parent 2:1 protocol ip prio 1 handle 1 tcindex
classid 2:10

echo "After AF Class 1 (2:10)"

#tc qdisc change dev agl0 root gred limit <bytes> min <bytes> max
<bytes> burst <packets> bandwidth 156Mbit \
#  DP <vq> probability <number> prio <number>
tc qdisc change dev agl0 parent 2:10 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 0 probability 0.01 prio 2
echo "After qdiscc change 2:10"
tc qdisc change dev agl0 parent 2:10 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 1 probability 0.01 prio 3
tc qdisc change dev agl0 parent 2:10 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 2 probability 0.01 prio 4

echo "After qdisc change DP 1 - 3 2:10"

### tc filter add dev agl0 parent 2:0 protocol ip prio 6 handle 0x08
tcindex mask 0x39 classid 2:30 pass_on

# - AF Class 2 (2:40) Service Rate, Drop Precedence
tc class add dev agl0 parent 2:1  classid 2:20 htb rate 10Mbit ceil 156Mbit
#tc qdisc add dev agl0 parent 2:40 red limit 60KB min 15KB max 45KB
burst 29 avpkt 100 bandwidth 10Mbit probability 0.4
tc qdisc add dev agl0 parent 2:20 gred setup DPs 3 default 2 grio
#tc qdisc change dev agl0 root gred limit <bytes> min <bytes> max
<bytes> burst <packets> bandwidth 156Mbit \
#  DP <vq> probability <number> prio <number>
tc qdisc change dev agl0 parent 2:20 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 0 probability 0.01 prio 2
tc qdisc change dev agl0 parent 2:20 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 1 probability 0.01 prio 3
tc qdisc change dev agl0 parent 2:20 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 2 probability 0.01 prio 4
tc filter add dev agl0 parent 2:0 protocol ip prio 6 handle 0x10
tcindex mask 0x39 classid 2:20 pass_on
# 12 -- AF Class 2
tc filter add dev agl0 parent 2:1 protocol ip prio 1 handle 2 tcindex
classid 2:20

echo "After AF Class 2 2:20"

# - AF Class 3 (2:50) Service Rate, Drop Precedence
tc class add dev agl0 parent 2:1  classid 2:30 htb rate 10Mbit ceil 156Mbit
#tc qdisc add dev agl0 parent 2:50 red limit 60KB min 15KB max 45KB
burst 29 avpkt 100 bandwidth 10Mbit probability 0.4
tc qdisc add dev agl0 parent 2:30 gred setup DPs 3 default 2 grio
#tc qdisc change dev agl0 root gred limit <bytes> min <bytes> max
<bytes> burst <packets> bandwidth 156Mbit \
#  DP <vq> probability <number> prio <number>
tc qdisc change dev agl0 parent 2:30 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 0 probability 0.01 prio 2
tc qdisc change dev agl0 parent 2:30 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 1 probability 0.01 prio 3
tc qdisc change dev agl0 parent 2:30 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 2 probability 0.01 prio 4
tc filter add dev agl0 parent 2:0 protocol ip prio 6 handle 0x18
tcindex mask 0x39 classid 2:30 pass_on
# 13 -- AF Class 3
tc filter add dev agl0 parent 2:1 protocol ip prio 1 handle 3 tcindex
classid 2:30

echo "After Class 3 2:30"

# - AF Class 4  Service Rate, Drop Precedence
tc class add dev agl0 parent 2:1  classid 2:40 htb rate 10Mbit ceil 156Mbit
tc qdisc add dev agl0 parent 2:40 gred setup DPs 3 default 2 grio

echo "After AF Class 4 qdisc add parent 2:40"
tc qdisc change dev agl0 parent 2:40 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 0 probability 0.01 prio 2
echo "After AF 4 qdisc change DP 0 parent 2:40"

tc qdisc change dev agl0 parent 2:40 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 1 probability 0.01 prio 3
tc qdisc change dev agl0 parent 2:40 gred limit 60KB min 15KB max 45KB
burst 121 avpkt 128 bandwidth 156Mbit \
  DP 2 probability 0.01 prio 4

echo "Before AF Class 4 filter parent 2:1"
tc filter add dev agl0 parent 2:1 protocol ip prio 1 handle 4 tcindex
classid 2:40

echo "After AF Class 4"

# - BE Class (2:60) Best Effort, no Drop Precedence
#### tc class add dev agl0 parent 2:1  classid 2:60 htb rate 5Mbit ceil 10Mbit
#### tc qdisc add dev agl0 parent 2:60 red limit 60KB min 15KB max
45KB burst 20 avpkt 1000 bandwidth 10Mbit probability 0.4
# Set filter to lower priority (8) since this is the default action
#### tc filter add dev agl0 parent 2:0 protocol ip prio 2 handle 0
tcindex mask 0 classid 2:60 pass_on

tc filter add dev agl0 parent 2:0 protocol ip prio 1 handle 0 tcindex
classid 2:50
tc class add dev agl0 parent 2:1  classid 2:50 htb rate 10Mbit ceil 156Mbit
tc qdisc add dev agl0 parent 2:50 pfifo limit 50
# Set filter to lower priority (8) since this is the default action
### tc filter add dev agl0 parent 2:0 protocol ip prio 1 handle 0
tcindex mask 0 classid 2:50 pass_on



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux