howto reduce the ping?

Linux Advanced Routing and Traffic Control

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

 



Hi,

with the attached config my gaming ping is still +20ms, even if the line isn't  
saturated..can anybody give me a hint how to get a better response time? 
my line: 1024/128kbit

outbound:
one htb qdisc for gaming (7kbps) prio 0 ceil 14kbps<- should get more traffic 
when needed. 
Htb again for irc and default.


inbound:
css, irc, p2p, default <- same shema as before, give css enough bandwith and 
allocate the rest for the other classes.

Are packets in 1:10 (css) are transfered as fast as they arrive?


 

Same config without line breaks:
http://phpfi.com/140959

#!/bin/bash

OUTBOUND_DEV=ppp0
INBOUND_DEV=imq0

start_outbound()
{
    echo "Starting outbound"

    tc qdisc add dev ppp0 root handle 1: htb default 90
    #max upload
    tc class add dev ppp0 parent 1: classid 1:1 htb rate 14kbps

    #css
    tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 9kbps ceil 14kbps 
prio 1
    iptables -t mangle -A POSTROUTING -p tcp --dport 27020:27039 -j 
CLASSIFY --set-class 1:10
    iptables -t mangle -A POSTROUTING -p udp --dport 27000:27015 -j 
CLASSIFY --set-class 1:10

    #irc
    tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 1kbps ceil 1kbps 
prio 2
    iptables -t mangle -A POSTROUTING -p tcp --dport 6667 -j 
CLASSIFY --set-class 1:20

    #default
    tc class add dev ppp0 parent 1:1 classid 1:90 htb rate 4kbps ceil 4kbps 
prio 3
}

stop_outbound_tc()
{
    echo "Stopping outbound tc"
    tc qdisc del dev ppp0 root    2> /dev/null > /dev/null
    tc qdisc del dev ppp0 ingress 2> /dev/null > /dev/null
}

stop_outbound_iptables()
{
    echo "Stopping outbound iptables"

    #css
    iptables -t mangle -D POSTROUTING -p tcp --dport 27020:27039 -j 
CLASSIFY --set-class 1:10
    iptables -t mangle -D POSTROUTING -p udp --dport 27000:27015 -j 
CLASSIFY --set-class 1:10

    #irc
    iptables -t mangle -D POSTROUTING -p tcp --dport 6667 -j 
CLASSIFY --set-class 1:20

    #default
    iptables -t mangle -D POSTROUTING -j CLASSIFY --set-class 1:90
}

start_inbound_device()
{
    echo "Starting inbound device"
    ip link set $INBOUND_DEV up
}

stop_inbound_device()
{
    echo "Stopping inbound device"
    ip link set $INBOUND_DEV down
}

start_inbound()
{
    echo "Starting inbound"
    tc qdisc add dev imq0 root handle 1: htb default 90

    #max download rate
    tc class add dev $INBOUND_DEV parent 1: classid 1:1 htb rate 110kbps


    #css
    tc class add dev $INBOUND_DEV parent 1:1 classid 1:10 htb rate 30kbps ceil 
110kbps prio 1
    iptables -t mangle -A PREROUTING -i ppp0 -p udp --sport 27000:27015 -j 
MARK --set-mark 1
    iptables -t mangle -A PREROUTING -i ppp0 -p tcp --sport 27020:27039 -j 
MARK --set-mark 1
    tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 1 handle 1 fw 
classid 1:10

    #irc
    tc class add dev $INBOUND_DEV parent 1:1 classid 1:20 htb rate 10kbps ceil 
10kbps prio 2
    iptables -t mangle -A PREROUTING -i ppp0 -p tcp --sport 6667 -j 
MARK --set-mark 2
    tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 2 handle 2 fw 
classid 1:20

    #p2p
    tc class add dev $INBOUND_DEV parent 1:1 classid 1:30 htb rate 40kbps ceil 
40kbps prio 3
    iptables -t mangle -A PREROUTING -p tcp --dport 6881:6999 -j 
MARK --set-mark 3
    tc filter add dev $INBOUND_DEV parent 1:0 protocol ip prio 3 handle 3 fw 
classid 1:30

    #default
    tc class add dev $INBOUND_DEV parent 1:1 classid 1:90 htb rate 30kbps ceil 
30kbps prio 4
  
    #fetch all incoming stuff and redirect it to imq0
    iptables -t mangle -A PREROUTING -i ppp0 -j IMQ --todev 0
}

stop_inbound_tc()
{
    echo "Stopping inbound tc"
    tc qdisc del dev $INBOUND_DEV root    2> /dev/null > /dev/null
    tc qdisc del dev $INBOUND_DEV ingress 2> /dev/null > /dev/null
}

stop_inbound_iptables()
{
    echo "Stopping inbound iptables"
    #css
    iptables -t mangle -D PREROUTING -i ppp0 -p udp --sport 27000:27015 -j 
MARK --set-mark 1
    iptables -t mangle -D PREROUTING -i ppp0 -p tcp --sport 27020:27039 -j 
MARK --set-mark 1
 
    #irc
    iptables -t mangle -D PREROUTING -i ppp0 -p tcp --sport 6667 -j 
MARK --set-mark 2
   
    #p2p
    iptables -t mangle -D PREROUTING -p tcp --dport 6881:6999 -j 
MARK --set-mark 3
   
    #default
    iptables -t mangle -D PREROUTING -j MARK --set-mark 4

    #fetch all incoming stuff and redirect it to imq0
    iptables -t mangle -D PREROUTING -i ppp0 -j IMQ --todev 0
}

start()
{
    start_outbound
    start_inbound_device
    start_inbound
}

stop()
{
    stop_outbound_tc
    stop_outbound_iptables
    stop_inbound_tc
    stop_inbound_device
    stop_inbound_iptables
}

show()
{
    echo "Outbound --- Outbound --- Outbound --- Outbound --- Outbound --- 
Outbound"
    echo "qdisc: -------------------------------------"
    tc -s -d qdisc show dev $OUTBOUND_DEV
    echo "classes: -----------------------------------"
    tc -s class show dev $OUTBOUND_DEV
    echo "filters: -----------------------------------"
    tc filter show dev $OUTBOUND_DEV

    echo "Inbound --- Inbound --- Inbound --- Inbound --- Inbound --- Inbound"
    echo "qdisc: -------------------------------------"
    tc -s -d qdisc show dev $INBOUND_DEV
    echo "classes: -----------------------------------"
    tc -s class show dev $INBOUND_DEV
    echo "filters: -----------------------------------"
    tc filter show dev $INBOUND_DEV
}


case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    show)
        show
        ;;
    *)
        echo "Usage: /etc/init.d/shaper {start|stop|show}"
        exit 1
        ;;
esac



greets
Julius
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

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