Skip to contentSkip to conversation

iptables marked packets want's to be queued.

LARTC Christian Parpart 2 participants 4 messages Apr 15, 2002

lore
Share & tools
lore
#0 lore raw

Hi all,

that is yet another problem I can't solve.
I want to use the iptables to match the packets to be queued but do not know how to tell my tc queues wich marked packages to use.

EXAMPLE:

ppp0 with (768Kbit downstream and 128Kbit upstream) the privileges local port 27005 should get 512/96

# the marked packets below shall be privileged.
$IPTABLES -t mangle -A PREROUTING -o ppp0 -p udp --sport 27005 \
          -j MARK --set-mark 21
$IPTABLES -t mangle -A POSTROUTING -i ppp0 -p udp --dport 27005 \
          -j MARK --set-mark 22
# the other packets may get the remaining bandwidth
# attach cbq to device ppp0 with handle 1: (1:0 ?)
$TC qdisc add dev ppp0 root handle 1: cbq bandwidth 768Kbit avpkt mpu 64
# create the root class (1:1)
$TC class add dev ppp0 parent 1:0 classid :1 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 768Kbit
# create class A (privileged 1:10)
$TC class add dev ppp0 parent 1:1 classid 1:10 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 512Kbit allot 1514 maxburst 50 avpkt 1000

$TC qdisc add dev ppp0 parent 1:10 sfq quantum 1514b perturb 15

# create class B (the remaining 1:20)
$TC class add dev ppp0 parent 1:1 class 1:20 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 256Kbit allot 1514 maxburst 50 avpkt 1000

$TC qdisc add dev ppp0 parent 1:20 sfq quantum 1514b perturb 15

END EXAMPLE.

So. But how do I tell TC to use the iptables marked packets to queue?

Many many thanks,
Christian.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#1 lore raw

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 10:11 Will put all packets marked with 21 in the class 10:11

Stef

Quoted 46 lines · Christian Parpart

Hi all,

that is yet another problem I can't solve.
I want to use the iptables to match the packets to be queued but do not know how to tell my tc queues wich marked packages to use.

EXAMPLE:

ppp0 with (768Kbit downstream and 128Kbit upstream) the privileges local port 27005 should get 512/96

# the marked packets below shall be privileged.
$IPTABLES -t mangle -A PREROUTING -o ppp0 -p udp --sport 27005 \
          -j MARK --set-mark 21
$IPTABLES -t mangle -A POSTROUTING -i ppp0 -p udp --dport 27005 \
          -j MARK --set-mark 22
# the other packets may get the remaining bandwidth
# attach cbq to device ppp0 with handle 1: (1:0 ?)
$TC qdisc add dev ppp0 root handle 1: cbq bandwidth 768Kbit avpkt mpu 64
# create the root class (1:1)
$TC class add dev ppp0 parent 1:0 classid :1 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 768Kbit
# create class A (privileged 1:10)
$TC class add dev ppp0 parent 1:1 classid 1:10 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 512Kbit allot 1514 maxburst 50 avpkt 1000

$TC qdisc add dev ppp0 parent 1:10 sfq quantum 1514b perturb 15

# create class B (the remaining 1:20)
$TC class add dev ppp0 parent 1:1 class 1:20 est 1sec 4sec cbq \
    bandwidth 768Kbit rate 256Kbit allot 1514 maxburst 50 avpkt 1000

$TC qdisc add dev ppp0 parent 1:20 sfq quantum 1514b perturb 15

END EXAMPLE.

So. But how do I tell TC to use the iptables marked packets to queue?

Many many thanks,
Christian.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

Signature · 7 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Christian Parpart
Quoted 2 lines · Stef Coene

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 10:11 Will put all packets marked with 21 in the class 10:11

Oops :) (still party time in my head)

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 21 fw classid 10:11

Will put all packets marked with 21 in the class 10:11

Stef
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#3 lore raw
In reply to Christian Parpart

Stef Coene inspired the electrons to say:

Quoted 5 lines · Stef Coene
Quoted 3 lines

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 2 fw classid 10:11 Will put all packets marked with 21 in the class 10:11

Quoted 8 lines

Oops :) (still party time in my head)

tc filter add dev eth0 parent 1: protocol ip prio 3 handle 21 fw classid 10:11

Will put all packets marked with 21 in the class 10:11

Stef

Ah. So the handle parameter gets the marked value.

Have many thanks,
Christian.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/