From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1HcloL-0004u7-Gg for garchives@archives.gentoo.org; Sat, 14 Apr 2007 17:13:17 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l3EHBwIf032699; Sat, 14 Apr 2007 17:11:58 GMT Received: from gabriel.sub.uni-goettingen.de (gabriel.sub.uni-goettingen.de [134.76.163.126]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l3EH7dWt027923 for ; Sat, 14 Apr 2007 17:07:40 GMT Received: by gabriel.sub.uni-goettingen.de (Postfix, from userid 8) id C043810A095; Sat, 14 Apr 2007 19:07:39 +0200 (CEST) Received: from localhost (dslc-082-082-173-027.pools.arcor-ip.net [82.82.173.27]) by gabriel.sub.uni-goettingen.de (Postfix) with ESMTP id 24BEF10A093 for ; Sat, 14 Apr 2007 19:07:36 +0200 (CEST) Date: Sat, 14 Apr 2007 19:07:35 +0200 From: Hans-Werner Hilse To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Packet Shaping Message-Id: <20070414190735.cd7f1b58.hilse@web.de> In-Reply-To: <49bf44f10704140837q4cfe2498ie065d7a608023f79@mail.gmail.com> References: <49bf44f10704131124o33353cc6xa5de097eba5fb052@mail.gmail.com> <20070413210444.acbef9ac.hilse@web.de> <49bf44f10704140837q4cfe2498ie065d7a608023f79@mail.gmail.com> X-Mailer: Sylpheed 2.3.1 (GTK+ 2.10.9; i586-pc-linux-gnu) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Details: No, hits=1.8 required=5.0 tests=AWL,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=2.64 X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on gabriel.sub.uni-goettingen.de X-Archives-Salt: 6a5941be-8bcc-40e6-b36e-6a917782f6de X-Archives-Hash: a39260c9c3e29fd4c69ed75c4553caa0 Hi, On Sat, 14 Apr 2007 08:37:19 -0700 Grant 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