TC and Diffserv on IPv6
Hi all,
does somebody have experience with IPv6 traffic control?
I have tried different tools - but, none of them seemed to work the way it works with IPv4. Our project, Multi-Media-Conferencing, builds upon IPv6 and is intended to use Diffserv for supporting differentiated services requirements.
Is that feasible? At the moment we're facing the following problems:
1.) Settings made using tc don't have an effect on IPv6-traffic. (Is it due to tc or to the kernel?)
2.) ip6tables does not support the TOS target or equivalent traffic class setting.
3.) mgen6 does not support traffic class marking.
4.) ping6 returns the message: "Flowinfo is not supported."
Thanks
viktor
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
Quoted 3 lines · Viktor Kemmet
Hi all,
does somebody have experience with IPv6 traffic control?
partly the same thing, partly not.
Quoted 2 lines
1.) Settings made using tc don't have an effect on IPv6-traffic. (Is it due to tc or to the kernel?)
tc filter won't currently match ipv6, but tc commands will shape *all* packets going out.
Quoted 3 lines
2.) ip6tables does not support the TOS target or equivalent traffic class setting.
but does it support --mark? If it does so, you can shape on that.
Quoted 3 lines
3.) mgen6 does not support traffic class marking.
4.) ping6 returns the message: "Flowinfo is not supported."
Bug Alexey, i think he will care - tc filter should do ipv6.
Regards,
bert
Signature · 6 lines
http://www.PowerDNS.com Versatile DNS Software & Services http://www.tk the dot in .tk http://lartc.org Linux Advanced Routing & Traffic Control HOWTO _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
Quoted 10 lines · bert hubert
Quoted 3 lines · Viktor Kemmet
Hi all,
does somebody have experience with IPv6 traffic
control?
partly the same thing, partly not.
Quoted 8 lines
Quoted 1 line
1.) Settings made using tc don't have an effect on
IPv6-traffic. (Is it
Quoted 1 line
due to tc or to the kernel?)
tc filter won't currently match ipv6, but tc commands will shape *all*
packets going out.
Does that mean, I cannot use the tc filter command with IPv6? How can I shape without filter?
The attached script "setup-01.tc.sh" works fine with v4. The traffic is shaped according to the qdisc tbf settings.
With v6 these setting move all packets to the class, the prio-map maps the Best-Effort traffic to.
Is this because the tc filter on the destination ports already fails?
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $VIDEO_PORT 0xffff flowid 1:2Quoted 7 lines
Quoted 2 lines
2.) ip6tables does not support the TOS target or
equivalent traffic
Quoted 1 line
class setting.
but does it support --mark? If it does so, you can shape on that.
Yes, MARK seems to work ("Edge1new.sh").
ip6tables -I OUTPUT -t mangle -p udp --destination-port 5001 \
-j MARK --set-mark 1 ip6tables -L OUTPUT -t mangle
... lists the desired settings. But again
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 1 fw
classid 1:1
does not what it should.
What do you mean by shaping on fw-mark? Is that possible without using tc filter?
Quoted 4 lines
Quoted 4 lines
3.) mgen6 does not support traffic class marking.
4.) ping6 returns the message: "Flowinfo is not
Quoted 9 lines
supported."
Bug Alexey, i think he will care - tc filter should do ipv6.
Regards,
bert
viktor
TC="tc"
DEV="dev eth0"
efrate="1Mbit ";
afrate1="1Mbit ";
afrate2="1Mbit ";
MTU="1024";
AUDIO_PORT=1516 # Virtual Places Audio data AUDIO_PORT_CONTROL=1517 # Virtual Places Audio control VIDEO_PORT=1518 # Virtual Places Video data VIDEO_PORT_CONTROL=1519 # Virtual Places Video control TELNET_PORT=23 # Telnet SSH_PORT=22 # SSH Remote Login Protocol HTTP_PORT=80 # World Wide Web HTTP SMTP_PORT=25 # Simple Mail Transfer FTP_PORT=20 # File Transfer [Default Data] FTP_PORT_CONTROL=21 # File Transfer [Control]
# Root qdisc of prio type
$TC qdisc del $DEV root
# Four classes are created instantly, for each band one (bands = 4).
$TC qdisc add $DEV handle 1:0 root prio bands 4 \
priomap 1 3 3 3 1 1 0 0 3 2 2 2 2 2 2 2# priomap 2 3 3 3 1 1 0 0 2 2 2 2 2 2 2 2
# Create Filters for classifying packets by destination-port
# ----------------------------------------------------------------------
# EF: Audio -----------> Band 0 (class 1:1)
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $AUDIO_PORT 0xffff flowid 1:1$TC qdisc add $DEV parent 1:1 tbf rate $efrate burst $MTU limit 1.6kB
# ----------------------------------------------------------------------
# AF(1): Video --------> Band 1
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $VIDEO_PORT 0xffff flowid 1:2$TC qdisc add $DEV parent 1:2 tbf rate $afrate1 burst $MTU limit 1.6kB
# ----------------------------------------------------------------------
# AF(2): Telnet/HTTP ---> Band 2
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $TELNET_PORT 0xffff flowid 1:3
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $HTTP_PORT 0xffff flowid 1:3$TC qdisc add $DEV parent 1:3 tbf rate $afrate2 burst $MTU limit 1.6kB
# ---------------------------------------------------------------------- # BE: SMTP/FTP --------> Band 3 (class 1:4)
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $SMTP_PORT 0xffff flowid 1:4
$TC filter replace $DEV parent 1:0 protocol ip prio 1 u32 \
match ip dport $FTP_PORT 0xffff flowid 1:4$TC qdisc add $DEV parent 1:4 red limit 60KB \
min 15KB max 45KB burst 20 avpkt 1000 bandwidth 1Mbit \
probability 0.4# ----------------------------------------------------------------------
echo " ------------ QDISC ------------ "
tc -s qdisc ls $DEV
echo " ------------ CLASS ------------ "
tc -s class ls # $DEV
echo " ------------ FILTER ------------ "
tc -s filter ls $DEV
echo " --------------------------------- "
###############################################################################
# DS-marking packets using ip6tables fw-marking
TC=tc
IP=ip
EGDEV="dev eth0"
#
# Flush chain
ip6tables -F OUTPUT -t mangle
# Mark Packets according to destination port number
ip6tables -I OUTPUT -t mangle -p udp --destination-port 5003 -j MARK --set-mark 3 ip6tables -I OUTPUT -t mangle -p udp --destination-port 5002 -j MARK --set-mark 2 ip6tables -I OUTPUT -t mangle -p udp --destination-port 5001 -j MARK --set-mark 1 echo "-------------- ip6tables OUTPUT chain settings ------------" ip6tables -L OUTPUT -t mangle
echo
# attach a dsmarker
#
$TC qdisc add $EGDEV handle 1:0 root dsmark indices 64 set_tc_index
#
# values of the DSCP to change depending on the class
#
#becomes EF
$TC class change $EGDEV classid 1:1 dsmark mask 0x3 \
value 0xb8
#becomes AF11
$TC class change $EGDEV classid 1:2 dsmark mask 0x3 \
value 0x28
#becomes AF21
$TC class change $EGDEV classid 1:3 dsmark mask 0x3 \
value 0x48
#
#
# The class mapping
#
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 1 fw classid 1:1
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 2 fw classid 1:2
$TC filter add $EGDEV parent 1:0 protocol ip prio 4 handle 3 fw classid 1:3
#echo "---- qdisc parameters Egress ----------"
$TC qdisc ls $EGDEV
echo "---- Class parameters Egress ----------"
$TC class ls $EGDEV
echo "---- filter parameters Egress ----------"
$TC filter ls $EGDEV parent 1:0