public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael Mol <mikemol@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Traffic shaping - downstream data
Date: Tue, 12 Jun 2012 09:21:29 -0400	[thread overview]
Message-ID: <CA+czFiC7oKYhW5MhMP7CteoJeXzPBofTaeUerSaHFPMEBsNTpg@mail.gmail.com> (raw)
In-Reply-To: <CAG+b7UV1FiMqzOUB9Wtfo+RcVBng+KL5aRCB4R-Y-QjyVU2f9g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3529 bytes --]

More detail later...but make sure your vpn link is not TCP. UDP, fine,
IP-IP, fine, but not TCP. TCP transport for a VPN tunnel leads to ugly
traffic problems.
On Jun 12, 2012 8:59 AM, "Datty" <datty.wtb@gmail.com> wrote:

>
> On Tue, Jun 12, 2012 at 9:58 AM, J. Roeleveld <joost@antarean.org> wrote:
>
>> On Mon, June 11, 2012 5:27 pm, Datty wrote:
>> > Hi all
>> >
>> > I'm looking for some help setting up traffic shaping on my internet
>> > connection. I have a bit of an odd setup in that I run a remote VPN
>> server
>> > that all of my traffic is pushed through and out on to the internet. As
>> I
>> > understand generally it isn't possible to shape incoming traffic but as
>> I
>> > have control of the VPN server which pushes the traffic to me I wondered
>> > if
>> > it was possible to implement something on that side? No traffic other
>> than
>> > the VPN tunnel goes out of my home connection.
>> >
>> > I'm trying to do this because I have a service running on one of my home
>> > machines that requires around 5kbps constantly with low latency
>> (<200ms),
>> > but as my home connection is 750kbps it gets saturated very quickly
>> > causing
>> > huge spikes in latency. Does anyone have any ideas as to how I could
>> > achieve this? Generally any pointers at all would be greatly
>> appreciated.
>>
>> If VPN is the only traffic to/from your home, eg. using your internet
>> connection and you control the VPN-server on the other side, you could
>> limit the "upstream" of the remote server to your home.
>>
>> > Thanks for your time
>> >
>> > Oliver
>> >
>>
>>
>> --
>> Joost
>>
>>
>> Thanks that makes total sense. I was looking at it backwards, not
> thinking that I could apply the same upstream limit to my VPN server.
> A bit of background/my aims - The vpn interface is 100mbps, I want
> everybody but me on the VPN to be able to use up to that speed, but for
> traffic sent to 192.168.50.0/24 to be limited to 750kbps, with 700kbps of
> that for normal traffic and 50kbps for my tcp traffic from port 9999.
>
> Based on that do the following rules make sense?
>
> tc qdisc add dev tap0 root handle 1: htb default 12 -- Set the interface
> to be handle 1 and default traffic to be in class 1:12
> tc class add dev tap0 parent 1: classid 1:1 htb rate 100mbps ceil 100mbps
> -- Set 100mbps to be available to all classes overall
> tc class add dev tap0 parent 1:1 classid 1:12 htb rate 100mbps ceil
> 100mbps -- Set 100mbps to be available to all people on the vpn
> tc class add dev tap0 parent 1:1 classid 1:15 htb rate 750kbps ceil
> 750kbps -- To be applied to all traffic from my home network
> tc class add dev tap0 parent 1:15 classid 1:16 htb rate 700kbps ceil
> 700kbps -- To be applied to all traffic other than special on home network
> tc class add dev tap0 parent 1:15 classid 1:17 htb rate 50kbps ceil 50kbps
> -- To be applied to special traffic on home network
> tc qdisc add dev $modemif parent 1:15 handle 20: sfq perturb 10 -- I
> understand this to prevent high bandwidth traffic in a class from filling
> up the whole of the class bandwidth and allow fair sharing. Is this
> right/needed?
> tc qdisc add dev $modemif parent 1:12 handle 20: sfq perturb 10
>
> iptables -t mangle -A POSTROUTING -o tap0 -d 192.168.50.0/24 -p tcp
> --sport 9999 -j CLASSIFY --set-class 1:17
> iptables -t mangle -A POSTROUTING -o tap0 -d 192.168.50.4/24 -j CLASSIFY
> --set-class 1:16
> iptables -t mangle -A POSTROUTING -o tap0 -j CLASSIFY --set-class 1:12
>
>
> Thanks again for your help
>
> Oliver
>

[-- Attachment #2: Type: text/html, Size: 4620 bytes --]

  reply	other threads:[~2012-06-12 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 15:27 [gentoo-user] Traffic shaping - downstream data Datty
2012-06-12  8:58 ` J. Roeleveld
2012-06-12 12:54   ` Datty
2012-06-12 13:21     ` Michael Mol [this message]
2012-06-12 13:37       ` Datty
2012-06-12 15:06         ` Michael Mol
2012-06-12 16:05           ` Michael Mol
2012-06-12 20:43             ` Datty
2012-06-12 20:57               ` Michael Mol

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=CA+czFiC7oKYhW5MhMP7CteoJeXzPBofTaeUerSaHFPMEBsNTpg@mail.gmail.com \
    --to=mikemol@gmail.com \
    --cc=gentoo-user@lists.gentoo.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