Skip to contentSkip to conversation

Script for metropolitan

LARTC Daniel Phlander 2 participants 2 messages Oct 23, 2005 – Oct 24, 2005

lore
Share & tools
lore
#0 lore raw

The script is corect ?

#!/bin/bash

/sbin/iptables -F -t mangle
/sbin/iptables -X

/sbin/iptables -t mangle -N mark_horiz_src /sbin/iptables -t mangle -N mark_horiz_dst /sbin/iptables -t mangle -A PREROUTING -i eth0 -j mark_horiz_src /sbin/iptables -t mangle -A PREROUTING -i eth1 -j mark_horiz_dst /sbin/iptables -t mangle -A OUTPUT -o eth0 -j mark_horiz_dst

/usr/local/bin/mipclasses -s mark_horiz_src -d mark_horiz_dst -m 1 < /start/metro.txt | iptables-restore -n

IF="eth0"
RATE_INET="256kbit"
RATE_METRO="1024kbit"
CEIL="512kbit"

#traficul implicit se duce in clasa 1:20 (internet) tc qdisc add dev $IF root handle 1:0 htb default 20

tc class add dev $IF parent 1:0 classid 1:1 htb rate 240kbit

# clasa 1:10 pt traficul metropolitan 
# clasa 1:20 pt traficul extern 
# poti sa renunti la prio daca nu vrei prioritati diferite 
tc class add dev $IF parent 1:1 classid 1:10 htb rate $RATE_METRO ceil $CEIL prio 2 
tc class add dev $IF parent 1:1 classid 1:20 htb rate $RATE_INET ceil $CEIL prio 1 
# setam disciplinele pentru fiecare clasa 
# poti sa folosesti 'pfifo_fast' (disciplina implicita) 
# in loc de 'sfq perturb 10' 
tc qdisc add dev $IF parent 1:10 handle 10:0 sfq perturb 10 
tc qdisc add dev $IF parent 1:20 handle 20:0 sfq perturb 10 
# clasificam pachetele dupa FW_MARK: 0x1=metropolitan -> 1:10 
tc filter add dev $IF protocol ip parent 1:0 prio 1 handle 1 fw flowid 1:10

Tks !

---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw
Quoted 1 line · Daniel Phlander

The script is corect ?

I don't have any experience with metropolian networks, however the rates you are using in your script are weird.

Quoted 5 lines

RATE_INET="256kbit"
RATE_METRO="1024kbit"
CEIL="512kbit"

tc class add dev $IF parent 1:0 classid 1:1 htb rate 240kbit

So the root class has 240kbit, meaning it's child classes should not be allowed to use more than 240kbit altogether.

Quoted 2 lines

tc class add dev $IF parent 1:1 classid 1:10 htb rate $RATE_METRO ceil $CEIL prio 2

This child class has 1024kbit rate, but only 512kbit ceil (which means it should not be allowed to use more than 512kbit ever), and the parent has only 240kbit, so what rate is it using now?

Quoted 2 lines

tc class add dev $IF parent 1:1 classid 1:20 htb rate $RATE_INET ceil $CEIL prio 1

This child class hase 256kbit rate, 512kbit ceil. That would be okay, if the parent could offer that much rate, which it doesn't.

HTH
Andreas Klauer
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc