OpenWrt Forum Archive

Topic: Need P2P QOS help using ipp2p

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

i followed the steps lited in this topic  however i am still having problems, this is what i have done so far


root@OpenWrt:/# ipkg update
Downloading http://downloads.openwrt.org/whiterussi … s/Packages
Updated list of available packages in /usr/lib/ipkg/lists/whiterussian
Downloading http://downloads.openwrt.org/whiterussi … e/Packages
Updated list of available packages in /usr/lib/ipkg/lists/non-free
Downloading http://openwrt.org/downloads/experiment … s/Packages
Updated list of available packages in /usr/lib/ipkg/lists/experimental
Successfully terminated.
root@OpenWrt:/#



root@OpenWrt:/# ipkg install iptables-extra
Installing iptables-extra (1.3.1-1) to root...
Downloading http://openwrt.org/downloads/experiment … mipsel.ipk
An error ocurred, return value: 1.
Collected errors:
Package iptables-extra wants to install file /usr/lib/iptables/libipt_conntrack.so
        But that file is already provided by package iptables
root@OpenWrt:/#


root@OpenWrt:/# ipkg install kmod-iptables-extra
Package kmod-iptables-extra (2.4.30-brcm-2) installed in root is up to date.
Nothing to be done
Successfully terminated.
root@OpenWrt:/#


root@OpenWrt:/# insmod /lib/modules/2.4.30/ipt_ipp2p.o
Using /lib/modules/2.4.30/ipt_ipp2p.o
root@OpenWrt:/#

root@OpenWrt:~# iptables -A FORWARD -m ipp2p --ipp2p -j MARK --set-mark 0x01
iptables: No chain/target/match by that name
root@OpenWrt:~#

the Iptables command i ran came from the iptables -m ipp2p --help listing

ok, got it to work, and it will now accept mark commands.

the question now is if i have my wondershaper script as shown below, what do i need to mark these packets with to make them go to the 1:30 class and have low bandwith?



root@OpenWrt:/etc/init.d# cat S65wshaper
#!/bin/ash

# Wonder Shaper
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits. Also set the device that is to be shaped.
DOWNLINK=3500
UPLINK=490
DEV=vlan1

# low priority OUTGOING traffic - you can leave this blank if you want
# low priority source netmasks
NOPRIOHOSTSRC=80

# low priority destination netmasks
NOPRIOHOSTDST=

# low priority source ports
NOPRIOPORTSRC=

# low priority destination ports
NOPRIOPORTDST=

# Now remove the following two lines :-)

#echo Please read the documentation in 'README' first :-\)
#exit

#########################################################

if [ "$1" = "status" ]
then
        tc -s qdisc ls dev $DEV
        tc -s class ls dev $DEV
        exit
fi


# 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

if [ "$1" = "stop" ]
then
        exit
fi

###### uplink

# install root CBQ

$DEBUG 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

$DEBUG 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:

$DEBUG 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:

$DEBUG tc class add dev $DEV parent 1:1 classid 1:20 cbq rate $((9*$UPLINK/10))kbit \
   allot 1600 prio 2 avpkt 1000

# 'traffic we hate'
$DEBUG tc class add dev $DEV parent 1:1 classid 1:30 cbq rate $((8*$UPLINK/10))kbit \
   allot 1600 prio 2 avpkt 1000

# all get Stochastic Fairness:
$DEBUG tc qdisc add dev $DEV parent 1:10 handle 10: sfq perturb 10
$DEBUG tc qdisc add dev $DEV parent 1:20 handle 20: sfq perturb 10
$DEBUG tc qdisc add dev $DEV parent 1:30 handle 30: sfq perturb 10

# start filters
# TOS Minimum Delay (ssh, NOT scp) in 1:10:
$DEBUG 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:
$DEBUG tc filter add dev $DEV parent 1:0 protocol ip prio 11 u32 \
        match ip protocol 1 0xff flowid 1:10

# prioritize small packets (<64 bytes)

$DEBUG 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 \
   flowid 1:10


# some traffic however suffers a worse fate
for a in $NOPRIOPORTDST
do
        $DEBUG tc filter add dev $DEV parent 1: protocol ip prio 14 u32 \
           match ip dport $a 0xffff flowid 1:30
done

for a in $NOPRIOPORTSRC
do
        $DEBUG tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
           match ip sport $a 0xffff flowid 1:30
done

for a in $NOPRIOHOSTSRC
do
        $DEBUG tc filter add dev $DEV parent 1: protocol ip prio 16 u32 \
           match ip src $a flowid 1:30
done

for a in $NOPRIOHOSTDST
do
        $DEBUG tc filter add dev $DEV parent 1: protocol ip prio 17 u32 \
           match ip dst $a flowid 1:30
done




# rest is 'non-interactive' ie 'bulk' and ends up in 1:20

$DEBUG tc filter add dev $DEV parent 1: protocol ip prio 18 u32 \
   match ip dst 0.0.0.0/0 flowid 1:20


########## downlink #############
# slow downloads down to somewhat less than the real speed  to prevent
# queuing at our ISP. Tune to see how high you can set it.
# ISPs tend to have *huge* queues to make sure big downloads are fast
#
# attach ingress policer:

$DEBUG tc qdisc add dev $DEV handle ffff: ingress

# filter *everything* to it (0.0.0.0/0), drop everything that's
# coming in too fast:

$DEBUG tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \
   0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1

root@OpenWrt:/etc/init.d#

what other information is needed to help me with this problem?

Btw. check your /etc/ipkg.conf file. You have packages from the obsolete experimental and the new White Russian realease mixed. That's not good.

(Last edited by olli_04 on 8 Nov 2005, 22:48)

what should i put in the file? and what should i update?

Since you have mixed up the different OpenWrt versions already, best way would be if you start over with a fresh and clean White Russian RC3 image.

while i could probably do that myself, just to verify how should i do that?

The discussion might have continued from here.