public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Hans-Werner Hilse <hilse@web.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Packet Shaping
Date: Sat, 14 Apr 2007 19:07:35 +0200	[thread overview]
Message-ID: <20070414190735.cd7f1b58.hilse@web.de> (raw)
In-Reply-To: <49bf44f10704140837q4cfe2498ie065d7a608023f79@mail.gmail.com>

Hi,

On Sat, 14 Apr 2007 08:37:19 -0700
Grant <emailgrant@gmail.com> wrote:

> After a lot of testing, these numbers seem to give me the best
> performance as far as bittorrent download speed.
> How can that be?  Is DOWNLINK my upload and UPLINK my download?

Hm, usually not. Are you by chance shaping the internal (i.e. LAN)
interface on a router? Then, of course, it would make sense (except
from the fact that shaping your actual bottle neck, i.e. Internet
connection, would make more sense).

> I tried to define the bittorrent ports as a low priority like this:
> NOPRIOPORTSRC=6881:6999
> NOPRIOPORTDST=6881:6999
> 
> but I get this when restarting shorewall:
> Illegal "match"

In the wshaper source, the action happens here (and the same for *DST):
---snip
for a in $NOPRIOPORTSRC
do
        tc filter add dev $DEV parent 1: protocol ip prio 15 u32 \
           match ip sport $a 0xffff flowid 1:30
done
---snip

In this configuration, it expects a shell-separatable list of ports,
i.e. separated by whitespace. It will create a rule for each one.

The dirty, easy way:
| NOPRIOPORTSRC=$(seq 6881 6999)
| NOPRIOPORTDST=$NOPRIOPORTSRC

But I would rather extend wshaper by another (custom) line and dump your
NOPRIOPORT*-settings.

The syntax is "match ip sport PATTERN MASK". The port of an incoming
packet is AND'ed w/ the MASK and compared to the PATTERN.

e.g. "match ip sport 6880 0xffe0" would match 6880-6911, a further
"match ip sport 6912 0xffc0" would match 6912-6975.

The advantage of this is simply speed/CPU cycles. Alternatively, you
could just use iptables to mark your packets (which probably means even
more precious CPU cycles). The wshaper script, however, doesn't use
iptables.

-hwh
-- 
gentoo-user@gentoo.org mailing list



  reply	other threads:[~2007-04-14 17:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 18:24 [gentoo-user] Packet Shaping Grant
2007-04-13 19:04 ` Hans-Werner Hilse
2007-04-14 15:37   ` Grant
2007-04-14 17:07     ` Hans-Werner Hilse [this message]
2007-04-16 16:00       ` Grant
2007-04-16 20:31         ` Hans-Werner Hilse
2007-04-16 22:19           ` Grant
2007-04-17 10:15             ` Hans-Werner Hilse
2007-04-18  0:29               ` Grant
2007-04-18  6:37                 ` Elias Probst
2007-04-18 15:17                   ` Grant

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=20070414190735.cd7f1b58.hilse@web.de \
    --to=hilse@web.de \
    --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