netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Kierdelewicz <marek@piasta.pl>
To: Landy Landy <landysaccount@yahoo.com>
Cc: netfilter@vger.kernel.org
Subject: Re: traffic shapping with squid in the middle
Date: Thu, 18 Nov 2010 18:46:34 +0100	[thread overview]
Message-ID: <20101118184634.0e423e47@catus> (raw)
In-Reply-To: <423773.22919.qm@web62508.mail.re1.yahoo.com>

>Hello.

Hi,

>I've been experiencing some problems trying to shape our network
>bandwidth. We have a gw with squid doing the contents cache and would
>like to assign each client a fair bw trying to avoid sluggish
>connections. 
>...
>I've been trying to get this working for a while now but, can't get it.
>Please guide me to where I can find a light at the end of the tunnel
>since, that's how I feel: Have no way out.

You can use IFB [1] to shape upload traffic before it's "eaten" by
squid. Do this:

tc qdisc add dev eth1 ingress
tc filter add dev eth1 protocol ip parent ffff: prio 4 u32 match ip \
dst 0.0.0.0/0 flowid :1 action mirred egress redirect dev ifb0

... and now you can shape upload traffic on ifb0. Solution would work
ok with or without squid in the middle.

With this solution you won't be able to use mark based shaping
(prerouting marking is done after ingress shaping). You'll have to use
u32 tc classifier [2].

Good luck!

[1] http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb
[2] http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.adv-filter.u32.html

Best regards,
Marek

      reply	other threads:[~2010-11-18 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 16:14 traffic shapping with squid in the middle Landy Landy
2010-11-18 17:46 ` Marek Kierdelewicz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101118184634.0e423e47@catus \
    --to=marek@piasta.pl \
    --cc=landysaccount@yahoo.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).