From owner-freebsd-net@FreeBSD.ORG Wed Jun 23 03:55:53 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25B5C16A4CE for ; Wed, 23 Jun 2004 03:55:53 +0000 (GMT) Received: from speedbuggy.telerama.com (speedbuggy.telerama.com [205.201.1.216]) by mx1.FreeBSD.org (Postfix) with SMTP id A22AB43D1D for ; Wed, 23 Jun 2004 03:55:52 +0000 (GMT) (envelope-from taka@cs.pitt.edu) Received: (qmail 14803 invoked from network); 23 Jun 2004 03:55:46 -0000 Received: from unknown (HELO cs.pitt.edu) (205.201.14.34) by speedbuggy.telerama.com with SMTP; 23 Jun 2004 03:55:46 -0000 Message-ID: <40D8FF41.6392C8F7@cs.pitt.edu> Date: Tue, 22 Jun 2004 23:55:45 -0400 From: Takashi Okumura Organization: University of Pittsburgh X-Mailer: Mozilla 4.06 [ja] (WinNT; I) MIME-Version: 1.0 To: Paul Querna Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: Rate Limiting Per-Socket X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.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: Wed, 23 Jun 2004 03:55:53 -0000 hi, please take a look at mod_netnice. it uses netnice, another in-kernel traffic control primitive on the platform. since you can control each socket with netnice, i think it's easy to extend the module to meet your needs. http://www.netnice.org/app_modnetnice.html thanks, -- taka > Hello, > I am looking at methods to rate limit a single socket to a specific > pipe or rate with FreeBSD. I would like to make an Apache module that > could do its outgoing rate limit *in* kernel, making the module very > simple, and more accurate by using the kernel todo the rate limiting. > > I have been looking at Dummynet and pfil_hooks, but these seem to > operate only on an entire interface. I would like to have these operate > only on a socket fd that I designate. Ie a special setsockopt() would > put socket x into pipe a. This pipe 'a' was setup ahead of time to only > allow 512 kb/s. > > Is this possible with FreeBSD? Do you have any suggestions on the best > way to proceed? > > Thank you, > -Paul Querna >