[LARTC] HTB problem, when using with IMQ

Linux Advanced Routing and Traffic Control

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

 



Hi,

My filter does classified packages to the right HTB classes, but then HTB
seems to not work on ingress traffic with IMQ (0 packages are dropped, 0
overlimits), besides when i use almost identical configuration with ppp0
interface HTB seems to work fine, so can anyone tell me where is the
problem.

My ip_ingres file:
#!/bin/sh
TC="/usr/local/sbin/tc"
IPT="/sbin/iptables"
IP="/sbin/ip"
TCCLASS="$TC class add dev imq0 parent"
TCQDISC="$TC qdisc add dev imq0 parent"
TCFILTER="$TC filter add dev imq0 parent"
TOTAL=115200
USERS=4
PERUSER=`expr $TOTAL / $USERS`
$TC qdisc add dev imq0 root handle 1:0 htb r2q 1 default 10
    $TCCLASS 1:0 classid 1:1 htb rate $TOTAL ceil $TOTAL
        $TCCLASS 1:1 classid 1:10 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:20 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:30 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:40 htb rate $PERUSER ceil $TOTAL
$TCQDISC 1:10 handle 10:0 pfifo limit 5
$TCQDISC 1:20 handle 20:0 pfifo limit 5
$TCQDISC 1:30 handle 30:0 pfifo limit 5
$TCQDISC 1:40 handle 40:0 pfifo limit 5
$TCFILTER 1:0 protocol ip u32 match ip dst 192.168.1.2 flowid 1:20
$TCFILTER 1:0 protocol ip u32 match ip dst 192.168.1.3 flowid 1:30
$TCFILTER 1:0 protocol ip u32 match ip dst 192.168.1.4 flowid 1:40
$IPT -t mangle -A PREROUTING -i ppp0 -j IMQ
$IP link set imq0 up

====================================================
My ip_egress file (this seems to work):
#!/bin/sh
TC="/usr/local/sbin/tc"
IPT="/sbin/iptables"
TCCLASS="$TC class add dev ppp0 parent"
TCQDISC="$TC qdisc add dev ppp0 parent"
TCFILTER="$TC filter add dev ppp0 parent"
TOTAL=115200
USERS=4
PERUSER=`expr $TOTAL / $USERS`
$IPT -t mangle -A PREROUTING -s 192.168.1.2 -j MARK --set-mark 2
$IPT -t mangle -A PREROUTING -s 192.168.1.3 -j MARK --set-mark 3
$IPT -t mangle -A PREROUTING -s 192.168.1.4 -j MARK --set-mark 4
$TC qdisc add dev ppp0 root handle 1:0 htb r2q 1 default 10
    $TCCLASS 1:0 classid 1:1 htb rate $TOTAL ceil $TOTAL
        $TCCLASS 1:1 classid 1:10 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:20 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:30 htb rate $PERUSER ceil $TOTAL
        $TCCLASS 1:1 classid 1:40 htb rate $PERUSER ceil $TOTAL
$TCQDISC 1:10 handle 10:0 pfifo limit 5
$TCQDISC 1:20 handle 20:0 pfifo limit 5
$TCQDISC 1:30 handle 30:0 pfifo limit 5
$TCQDISC 1:40 handle 40:0 pfifo limit 5
$TCFILTER 1:0 protocol ip handle 2 fw flowid 1:20
$TCFILTER 1:0 protocol ip handle 3 fw flowid 1:30
$TCFILTER 1:0 protocol ip handle 4 fw flowid 1:40

===================================================
server:~# tc -s -d qdisc show dev ppp0
qdisc pfifo 40: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 30: limit 5p
 Sent 163373 bytes 2858 pkts (dropped 0, overlimits 0)

 qdisc pfifo 20: limit 5p
 Sent 310628 bytes 1140 pkts (dropped 5, overlimits 0)
 backlog 4p

 qdisc pfifo 10: limit 5p
 Sent 4725 bytes 73 pkts (dropped 0, overlimits 0)

 qdisc htb 1: r2q 1 default 10 direct_packets_stat 0 ver 3.10
 Sent 478726 bytes 4071 pkts (dropped 5, overlimits 96)
 backlog 4p

====================================================
server:~# tc -s -d qdisc show dev imq0
qdisc pfifo 40: limit 5p
 Sent 0 bytes 0 pkts (dropped 0, overlimits 0)

 qdisc pfifo 30: limit 5p
 Sent 3816001 bytes 3012 pkts (dropped 0, overlimits 0)

 qdisc pfifo 20: limit 5p
 Sent 575284 bytes 1179 pkts (dropped 0, overlimits 0)

 qdisc pfifo 10: limit 5p
 Sent 8534 bytes 79 pkts (dropped 0, overlimits 0)

 qdisc htb 1: r2q 1 default 10 direct_packets_stat 0 ver 3.10
 Sent 4399819 bytes 4270 pkts (dropped 0, overlimits 0)





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