Skip to contentSkip to conversation

u32 filters dont appear to work

LARTC Mark Beck 2 participants 3 messages Feb 16, 2002

lore
Share & tools
lore

Mark Beck

author
#0 lore raw

Hi,

I am using example 15.8 from the HOWTO.

http://ds9a.nl/lartc/HOWTO//cvs/2.4routing/output/2.4routing-15.html#ss15.8

I have some concerns and a number of easy questions.

1. How do I list the configuration used? (I have included the script below that was used).
2. How do I backup the configuration - where is it stored?
3. From the example I thought all traffic is going to 1:20 and we manually direct some traffic to 1:10 (TCP ACK's, ICMP, TOS 0x10 and UDP). Below we can see queue 10 and not 20 is receiving my FTP upload. The FTP is the only main processes uploading. Can some one please explain whats going on.

Thanks in advance,
Mark

[root@box root]# tc -s qdisc
qdisc sfq 20: dev ppp0 quantum 1500b perturb 10sec
Sent 1437371 bytes 14229 pkts (dropped 0, overlimits 0)

qdisc sfq 10: dev ppp0 quantum 1500b perturb 10sec Sent 173635397 bytes 162459 pkts (dropped 0, overlimits 0) backlog 1p

qdisc cbq 1: dev ppp0 rate 10Mbit (bounded,isolated) prio no-transmit Sent 175075880 bytes 176692 pkts (dropped 0, overlimits 419681) backlog 1p
borrowed 0 overactions 0 avgidle 624 undertime 0

[root@box root]# tc -s qdisc
qdisc sfq 20: dev ppp0 quantum 1500b perturb 10sec
Sent 1440953 bytes 14284 pkts (dropped 0, overlimits 0)

qdisc sfq 10: dev ppp0 quantum 1500b perturb 10sec Sent 175462195 bytes 163813 pkts (dropped 0, overlimits 0) backlog 5p

qdisc cbq 1: dev ppp0 rate 10Mbit (bounded,isolated) prio no-transmit Sent 176906260 bytes 178101 pkts (dropped 0, overlimits 423273) backlog 5p
borrowed 0 overactions 0 avgidle 624 undertime 0

[root@box root]# cat qos
#!/bin/bash

# The Ultimate Setup For Your Internet Connection At Home #
#
# Set the following values to somewhat less than your actual download

# and uplink speed. In kilobits
DOWNLINK€0
UPLINK$0
DEV=ppp0
# clean existing down- and uplink qdiscs, hide errors
tc qdisc del dev $DEV root    2> /dev/null > /dev/null
tc qdisc del dev $DEV ingress 2> /dev/null > /dev/null

###### uplink

# install root CBQ

tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit

# shape everything at $UPLINK speed - this prevents huge queues in your
# DSL modem which destroy latency:
# main class

tc class add dev $DEV parent 1: classid 1:1 cbq rate ${UPLINK}kbit \
allot 1500 prio 5 bounded isolated

# high prio class 1:10:

tc class add dev $DEV parent 1:1 classid 1:10 cbq rate ${UPLINK}kbit \

    allot 1600 prio 1 avpkt 1000
# bulk and default class 1:20 - gets slightly less traffic,
#  and a lower priority:

tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $[9*$UPLINK/10]kbit \

    allot 1600 prio 2 avpkt 1000
# both get Stochastic Fairness:
tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
# start filters
# TOS Minimum Delay (ssh, NOT scp) in 1:10:
tc filter add dev $DEV parent 1:0 protocol ip prio 10 u32 \
       match ip tos 0x10 0xff  flowid 1:10

# ICMP (ip protocol 1) in the interactive class 1:10 so we

# can do measurements & impress our friends:
tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 \
         match ip protocol 1 0xff flowid 1:10

# UDP
tc filter add dev $DEV parent 1:0 protocol ip prio 14 u32 \

         match ip protocol 17 0xff flowid 1:10

# To speed up downloads while an upload is going on, put ACK packets in

# the interactive class:

tc filter add dev $DEV parent 1: protocol ip prio 12 u32 \

    match ip protocol 6 0xff \
    match u8 0x05 0x0f at 0 \
    match u16 0x0000 0xffc0 at 2 \
    match u8 0x10 0xff at 33 \
    flowid 1:10
# rest is 'non-interactive' ie 'bulk' and ends up in 1:20

tc filter add dev $DEV parent 1: protocol ip prio 13 u32 \

    match ip dst 0.0.0.0/0 flowid 1:20

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

#1 lore raw
Quoted 10 lines · Mark Beck

Hi,

I am using example 15.8 from the HOWTO.

http://ds9a.nl/lartc/HOWTO//cvs/2.4routing/output/2.4routing-15.html#ss15.8

I have some concerns and a number of easy questions.

1. How do I list the configuration used? (I have included the script below that was used).

tc -s qdisc ls is the best you can do.

Quoted 1 line

2. How do I backup the configuration - where is it stored?

That is up to you to decide. I have it in /etc/ppp/ip-up.d/shaper.

Quoted 4 lines

3. From the example I thought all traffic is going to 1:20 and we manually direct some traffic to 1:10 (TCP ACK's, ICMP, TOS 0x10 and UDP). Below we can see queue 10 and not 20 is receiving my FTP upload. The FTP is the only main processes uploading. Can some one please explain whats going on.

Can you tcpdump -v -s 1500 when you are uploading?

Otherwise, try figuring out which 'tc filter add' statement is sending your ftp traffic to 1:10. Just delete tc filter statements from the script until you see ftp go to 1:20.

Please let me know - I'm very interested in bug reports.

Regards,

bert

Signature · 7 lines
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/
author
#2 lore raw
In reply to Mark Beck
Quoted 7 lines
Quoted 3 lines

1. How do I list the configuration used? (I have included the script

below

Quoted 1 line

that was used).

tc -s qdisc ls is the best you can do.

Aghh!

Quoted 5 lines

Can you tcpdump -v -s 1500 when you are uploading?

Otherwise, try figuring out which 'tc filter add' statement is sending your ftp traffic to 1:10. Just delete tc filter statements from the script until you see ftp go to 1:20.

I ran TCP dump and see the following:

6:44:38.229976 213.123.200.246.10277 > 62.49.249.62.2394: . [tcp sum ok] 1164420368:1164421828(1460) ack 244583466 win 5840 (DF) [tos 0x10] (ttl 64, id 55961, len 1500)

Well the problem is the packets have an incorrect TOS setting, so this is now easy to fix ;)

Out of interest I didn't see 1:10 or 1:20 mentioned in the dump.

Thanks for the ideas :)
Mark

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