[LARTC] TC and Diffserv on IPv6

Linux Advanced Routing and Traffic Control

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

 



--------------1014721646LISA3c7b6c6eb2cb1

bert hubert wrote:
> On Tue, Feb 26, 2002 at 12:28:36AM +0100, Viktor Kemmet 
> wrote: 
> > Hi all,
> > 
> > does somebody have experience with IPv6 traffic 
> control? 
> 
> partly the same thing, partly not.
> 
> 
> > 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.
> 
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:2

> > 
> > 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. 

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? 

> 
> > 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
> 
viktor
--------------1014721646LISA3c7b6c6eb2cb1
Content-Type: text/plain; name="setup-01.tc.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="setup-01.tc.sh"

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 " --------------------------------- "

--------------1014721646LISA3c7b6c6eb2cb1
Content-Type: text/plain; name="Edge1new.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="Edge1new.sh"

###############################################################################
#  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









--------------1014721646LISA3c7b6c6eb2cb1--


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