[Ninux-Calabria] traffic shaping

Vincenzo Pirrone linuspax a gmail.com
Lun 12 Maggio 2014 22:12:04 UTC


Il 11/05/2014 21:45, Giuseppe De Marco ha scritto:
>
> di questo non ne sono cmq certissimo ma DI CERTO che nè sà lo
> scheduler che la nostra linea è asincrona e con quali parametri ! :)
>
> ad ogni modo su "A Practical Guide to Linux Traffic Control", dice che:
>
>  A variety of methods exist to classify flows. You can use tc to
> classify traffic, but it suffers from being entirely stateless
è maledettamente vero

>
>> Quindi per come ho fatto fin'ora limito solo il traffico in upload
>> giusto? (ho fatto dei test che me lo confermano), volendo sistemare
>> meglio i rate dovrei fare:
>>
>> tc qdisc add dev pppoe-wan root handle 1: htb default 1
>> tc class add dev pppoe-wan parent 1: classid 1:1  htb rate 411kbit
>> tc class add dev pppoe-wan parent 1:1 classid 1:2 htb rate 51kbit
>> iptables -t mangle -A POSTROUTING -o pppoe-wan ! -s 10.87.20.0/24 -j
>> CLASSIFY --set-class 1:2
>>
>> Per limitare il download devo per forza inserire un qdisc sulla vlan di
>> olsr, correggimi se sbaglio, si può fare una roba del genere
> non ci conviene coinvolgere l'eth di Ninux, il QoS meglio tenerlo
> sull'uscita internet (pppoe-wan) così non ti precludi la lan veloce.

Ho tenuto conto di questo infatti limito soltando il flusso wan->ninux

"Linux Advanced Routing & Traffic Control HOWTO" mi da conferma di
quello che ho fatto:

With the way the Internet works, we have no direct control of what
people send us. It's a bit like your (physical!) mailbox at home. There
is no way you can influence the world to modify the amount of mail they
send you, short of contacting everybody.

However, the Internet is mostly based on TCP/IP which has a few features
that help us. TCP/IP has no way of knowing the capacity of the network
between two hosts, so it just starts sending data faster and faster
('slow start') and when packets start getting lost, because there is no
room to send them, it will slow down. In fact it is a bit smarter than
this, but more about that later.

This is the equivalent of not reading half of your mail, and hoping that
people will stop sending it to you. With the difference that it works
for the Internet :-)

If you have a router and wish to prevent certain hosts within your
network from downloading too fast, you need to do your shaping on the
*inner* interface of your router, the one that sends data to your own
computers.


Alla fine me ne sono uscito con uno script che allego

Per eseguirlo su openwrt dovrebbe bastare installare tc e kmod-shed

-- 
Vincenzo Pirrone
Twitter: @spax_arm
PGP Key ID: 5CF5047D

-------------- parte successiva --------------
A non-text attachment was scrubbed...
Name: tc_hfsc.sh
Type: application/x-shellscript
Size: 1216 bytes
Desc: non disponibile
URL: <http://ml.ninux.org/pipermail/calabria/attachments/20140513/f817207b/attachment.bin>
-------------- parte successiva --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 884 bytes
Desc: OpenPGP digital signature
URL: <http://ml.ninux.org/pipermail/calabria/attachments/20140513/f817207b/attachment.pgp>


Maggiori informazioni sulla lista Calabria