From owner-freebsd-net@FreeBSD.ORG Fri Dec 12 10:06:49 2014 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73674258 for ; Fri, 12 Dec 2014 10:06:49 +0000 (UTC) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8C6EF0E for ; Fri, 12 Dec 2014 10:06:48 +0000 (UTC) Received: by mail-la0-f42.google.com with SMTP id gd6so5903792lab.1 for ; Fri, 12 Dec 2014 02:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=A68clRybo28fpMDfKqhA5mPKgTf6sHrqUasuAf17aak=; b=Qqar/n+gOIkyADZ/qqabABw4V5w/uyIn7cyipBJnpyrLGNIukwqvlwZTPuWyb1ljG9 XumJqon79D5YhmUZWfEogJoeDqGt9hjXVzJXa7KGh1qKkKzYaD8AfvLiKJ9dRCyeWmUx Rxzm5jBUHYoOoisvvdEkhwooTQ5oRISqfTjtQ6qBGSCWmwXoV4dInEE1PhxaRlRkeUJk Gwc+b63mCXR+a4VpNKzUNaihYKER/isjh7+56NRDEkkD1O5PN5oVFHb0AU8lJgzT1e70 TZwwKCXA9PoFHUB/mr66J9xWeMUF+JQKlM4FbCuUQNlGb4SWynr52EsEW/XhO06uR9jz BYIg== MIME-Version: 1.0 X-Received: by 10.152.87.100 with SMTP id w4mr14581888laz.71.1418378806958; Fri, 12 Dec 2014 02:06:46 -0800 (PST) Sender: rizzo.unipi@gmail.com Received: by 10.114.174.169 with HTTP; Fri, 12 Dec 2014 02:06:46 -0800 (PST) In-Reply-To: <201412120711.AAA00622@mail.lariat.net> References: <201412120711.AAA00622@mail.lariat.net> Date: Fri, 12 Dec 2014 21:06:46 +1100 X-Google-Sender-Auth: zyaIbIPcqzbZhZwmqOLVBwPDamk Message-ID: Subject: Re: Can DUMMYNET handle weighting of traffic according to firewall rules? From: Luigi Rizzo To: Brett Glass Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2014 10:06:49 -0000 you can set the limit for the pipe, create two queues with different weights attached to the pipe, and then schedule. ipfw pipe 12 config bw 3456 Kbit/s ipfw queue 34 config weight 2 pipe 12 ipfw queue 56 config weight 1 pipe 12 ipfw add queue 34 in recv halfduplexlink0 ipfw add queue 56 out xmit halfduplexlink0 that should do the job cheers luigi On Fri, Dec 12, 2014 at 6:10 PM, Brett Glass wrote: > Everyone: > > I have an interesting problem that I'm trying to solve with FreeBSD's IPFW > and DUMMYNET facilities. I have an application in which, due to arbitration > overhead, a half duplex data link has significantly higher costs -- > typically about twice as much -- in one direction than in the other. I'd > therefore like to set up a DUMMYNET pipe in FreeBSD that limits bandwidth > usage so that > > 2*(bandwidth in one direction) + (bandwidth in the other direction <= total > bandwidth limit > > It's easy to set IPFW up to sort the packets by direction, but it does not > seem possible to inject them into the same pipe in such a way that some > packets will count more toward the pipe's bandwidth limit than others. Any > ideas on how I can implement this? Willing to code if I must, but don't want > to reinvent the wheel. > > --Brett Glass > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------