up previous


Introduction to Linux Advanced Routing and Traffic Management

Rafal Maszkowski <rzm@icm.edu.pl>



ceenet1.ps



Budapest, August 2000

the tools - ipchains/iptables

the tools - ip command

ip route add 10.1/16 via 192.168.1.1 src 10.2.2.1
ip route add unreachable 10.1.2/24

the tools - tc command

example of CBQ+U32+TBF



ipv6/tc.eps



example - basic configuration

To note: single class-filter-queue, next can have id 10:3, filter added without a handle, units.

 

tc qdisc add dev eth0 root handle 10: cbq bandwidth 9765Kbit avpkt 1000 cell 8
tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 9765Kbit rate 9765Kbit allot 1514 cell 8 weight 976Kbit prio 8 maxburst 20 avpkt 1000

tc class add dev eth0 parent 10:1 classid 10:2 cbq bandwidth 9765Kbit rate 200000 allot 1514 cell 8 weight 20000 prio 5 maxburst 20 avpkt 1000
tc qdisc add dev eth0 parent 10:2 tbf rate 200000 buffer 1000000/8 limit 1300000 mtu 1500 peakrate 1000000
tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip  dst 10.0.0.1 flowid 10:2

tc class replace dev eth0 parent 10:1 classid 10:2 cbq bandwidth 9765Kbit rate 100000 allot 1514 cell 8 weight 10000 prio 5 maxburst 20 avpkt 1000
tc qdisc del dev eth0 parent 10:2 tbf rate 200000 buffer 1000000/8 limit 1300000 mtu 1500 peakrate 1000000
tc qdisc add dev eth0 parent 10:2 tbf rate 100000 buffer 1000000/8 limit 1300000 mtu 1500 peakrate 1000000

tbf measurement



ipv6/buffer-peak.ps



example - adding and changing filter

root@rzm:,0# tc filt show dev eth0
filter parent 10: protocol ip pref 100 u32
filter parent 10: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 10: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 10:2
 match 0a000001/ffffffff at 16
filter parent 10: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 10:3
 match 0a000002/ffffffff at 16
...

(why 'at 16')

Delete one (and only one - use handle):

root@rzm:,1# tc filt del dev eth0 parent
10:0 protocol ip prio 100 handle 800::800 u32 match ip dst 10.0.0.1 flowid 10:2

Add with the same handle (next handle otherwise, up to 4K unique handles):

root@rzm:,0# tc filt add dev eth0 parent
10:0 protocol ip prio 100 handle 800::800 u32 match ip dst 10.0.0.1 flowid 10:2

root@rzm:,0# tc filt show dev eth0
filter parent 10: protocol ip pref 100 u32
filter parent 10: protocol ip pref 100 u32 fh 800: ht divisor 1
filter parent 10: protocol ip pref 100 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 10:2
 match 0a000001/ffffffff at 16
filter parent 10: protocol ip pref 100 u32 fh 800::801 order 2049 key ht 800 bkt 0 flowid 10:3
 match 0a000002/ffffffff at 16
...

the tools - cbq.init

DEVICE=eth0,9765Kbit,976Kbit
RATE=10KBps
WEIGHT=1KB
PRIO=5
RULE=10.0.0.1
BUFFER=1000KB/8
LIMIT=1300KB
PEAK=250KBps

documentation

About this document ...

Introduction to Linux Advanced Routing and Traffic Management

This document was generated using the LaTeX2HTML translator Version 99.2beta8 (1.42)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 routing-traffic.tex

The translation was initiated by Rafał Maszkowski on 2000-08-25


up previous
Rafał Maszkowski 2000-08-25