Re: PRIO qdisc traffic does not work as expected

Linux Advanced Routing and Traffic Control

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

 



I've made the following script.. It should redirect traffic according to TOS, but SSH, SCP, HTTP download, etc., but it does not and everything goes through 1:2.

Any idea ?

I can see that using :
 tc -s qdisc ls dev ifb0
 tc -s class ls dev ifb0

_________________
DOWNRATE=1500

tc=/sbin/tc
EHT=eth0
IFB=ifb0
modprobe ifb
modprobe act_mirred
ethtool -K $EHT tso off gso off gro off

$tc qdisc del dev $EHT root 2>/dev/null
$tc qdisc del dev $EHT ingress 2>/dev/null
$tc qdisc del dev $IFB root 2>/dev/null
$tc qdisc del dev $IFB ingress 2>/dev/null

### INGRESS ###
$tc qdisc add dev $EHT handle ffff: ingress
ifconfig $IFB up
$tc filter add dev $EHT parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev $IFB

### HTB ##
$tc qdisc add dev $IFB root handle 1:0 htb default 1
$tc class add dev $IFB parent 1:0 classid 1:1 htb rate ${DOWNRATE}kbps

### PRIO ###
$tc qdisc add dev $IFB parent 1:1 handle 10: prio
$tc qdisc add dev $IFB parent 10:1 handle 101: sfq
$tc qdisc add dev $IFB parent 10:2 handle 102: sfq
$tc qdisc add dev $IFB parent 10:3 handle 103: sfq
___________________


Le 19/06/2014 21:06, Dave Taht a écrit :
I'm not huge on strict prio queues. And you need to ratelimit in both
directions, and ifb is best.

On Thu, Jun 19, 2014 at 6:58 AM, Andy Furniss <adf.lists@xxxxxxxxx> wrote:
GGounot wrote:


The diagram is : Internet <=> eth0 <=> eth1 <=> Client computer
(which downloads using Firefox)

So shaping on eth1 outgoing traffic should limit the rate Client
receives data from Internet.

Would shaping on eth0 using : tc qdisc add dev eth0handle ffff:
ingress ifconfig ifb0 up tc filter add dev eth0 parent ffff: protocol
all u32 match u32 0 0 action mirred egress redirect dev ifb0 and run
the script on ifb0 be a better solution ?

You could but don't need to as you can do it on eth1.

Which ever way you are going to be shaping from the wrong end of the
bottleneck so will need to sacrifice some bandwidth for it to work.

My previous answer 2. was a bit misleading as it would only have applied
if you were maxing eth speed.


Other way : eth0 has a public IP (is directly connected to
Internet).

eth0 and eth1 are 100Mb/s network PCI cards.

The Internet link has a rate of ~4000Kb/s.

Is the use of PRIO qdisc the problem ? (since it (maybe) acts on the
  network card rate, not the actual Internet connection rate)

Yes, prio is the problem you need to send the traffic from the internet
to something like htb with the rate set to eg. 3500kbit then you can use
htb classes to give prio for some traffic over other. You could if you
wanted use prio qdisc as a child of htb.



--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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