From owner-freebsd-net@FreeBSD.ORG Fri Jul 16 02:58:06 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 3546416A4CE for ; Fri, 16 Jul 2004 02:58:06 +0000 (GMT) Received: from smtp.netli.com (ip2-pal-focal.netli.com [66.243.52.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id E861343D49 for ; Fri, 16 Jul 2004 02:58:05 +0000 (GMT) (envelope-from vlm@netli.com) Received: (qmail 9969 invoked by uid 84); 16 Jul 2004 02:58:05 -0000 Received: from vlm@netli.com by l3-1 with qmail-scanner-0.96 (uvscan: v4.1.40/v4121. . Clean. Processed in 0.18507 secs); 16 Jul 2004 02:58:05 -0000 Received: from unknown (HELO ?172.17.1.12?) (172.17.1.12) by mx01-pal-lan.netli.lan with SMTP; 16 Jul 2004 02:58:05 -0000 Message-ID: <40F74447.9080306@netli.com> Date: Thu, 15 Jul 2004 19:58:15 -0700 From: Lev Walkin Organization: Netli, Inc. User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040630 X-Accept-Language: ru, en-us, en MIME-Version: 1.0 To: josh References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org Subject: Re: Large delays (2 minute) with dummynet 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: Fri, 16 Jul 2004 02:58:06 -0000 josh wrote: > I hope this is the right list to post to. > > I'd like to delay a shoutcast stream by around 2 minutes. This > shoutcast server is used to broadcast commentary on live games and > the delay is needed so teams can't gain an advantage by hearing the > commentary to learn where/what the other team is doing. I've > checked the shoutcast forums and it seems there's nothing I can do > to the shoutcast daemon to get this delay. Shoutcast listens on > tcp/8001 for an input stream, and tcp/8000 for listeners to connect > to. > > With 100 streams each using 48kbps, how practical is it to put them > all through a dummynet pipe with a delay of 120000ms? I figure > that'll require 100 * 48 / 8 * 120 / 1024 = 70MB of buffering in > dummynet. That's heaps! Is that possible? Is that using mbufs? > What would have to be tweaked up? > > I guess it'd be better if I could just add the 2mins of delay to > the input stream so the delay buffer is smaller and fixed, but I > don't know how the shoutcast protocol would like that or how the > different TCP implementations would like it. Would ACKs be coming > back to the shoutcaster 2 minutes late? > > Ideally it'd be best to have all this buffering happen intelligently > in userland, but I can't find anything to do that. Am I barking up > the wrong tree by looking at dummynet? Yes, you most certainly are. The problem with TCP is that using the standard window sizes (~32-64k) on the client side and the RTT of two minutes, the transfer speed will naturally be, literally, couple of hundred bytes per second. You'll not be able to squeeze 48kbps into this pipe. Moreover, as the reaction time is slow, there will be various timeout-related glitches, stopping the transfer periodically and restarting it minutes later. The network-related delays can offer you no more than several seconds delay. The best approach is, indeed, a buffering application-level daemon. -- Lev Walkin vlm@netli.com