From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 26 07:52:12 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8178916A4CE; Mon, 26 Jan 2004 07:52:12 -0800 (PST) Received: from smtp2.enst.fr (enst.enst.fr [137.194.2.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 641B343D81; Mon, 26 Jan 2004 07:50:26 -0800 (PST) (envelope-from pook@enst.fr) Received: from email.enst.fr (muse.enst.fr [137.194.2.33]) by smtp2.enst.fr (Postfix) with ESMTP id B31B753A42; Mon, 26 Jan 2004 16:47:42 +0100 (CET) Received: from roo (roo-ether.enst.fr [137.194.160.54]) by email.enst.fr (8.9.3/8.9.3) with ESMTP id QAA04459; Mon, 26 Jan 2004 16:47:43 +0100 (CET) Received: from pook (helo=roo) by roo with local-esmtp (Exim 3.36 #1 (Debian)) id 1Al8xj-0002aR-00; Mon, 26 Jan 2004 16:47:43 +0100 To: Don Lewis From: Stuart Pook Organisation: Ecole Nationale Superieure des Telecommunications, Paris, France In-reply-to: Message from truckman@FreeBSD.org of Fri, 23 Jan 2004 18:02:37 -0800. <200401240202.i0O22b7E068823@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Date: Mon, 26 Jan 2004 16:47:43 +0100 Message-Id: Sender: Stuart Pook cc: freebsd-hackers@freebsd.org cc: andre@freebsd.org Subject: Re: send(2) does not block, send(2) man page wrong? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jan 2004 15:52:12 -0000 > On 23 Jan 2004, Don Lewis wrote: > > the send does not give an error: the packet is just thrown away. > > Which is the same result as you would get if the bottleneck is just one > network hop away instead of at the local NIC. But it isn't. I'm broadcasting onto the local network. With Linux and Solaris (which implement what FreeBSD send(2) says), it is so easy: I just send(2) away, and because the send blocks when the kernel buffer space is full, I lose very few packets. With FreeBSD, I lose 60% of the packets. (The aim is to broadcast onto a private 802.11b network.) If I don't want to saturate the network then I will use kernel level traffic shaping to limit the outgoing bandwidth. I have already done this on Linux when I was broadcasting onto my 802.11b network via an access point connected via 100Mbits/s Ethernet. I just used traffic shaping to limit the outgoing traffic on that Ethernet interface to 3Mbits/s. I didn't have to change my program at all. (At one point I did try to put the delays (with nanosleep) into my program but it worked very badly because the scheduling delays were too big. The kernel does it so much better.) Once again it is vital that send blocks. I guess that I'm out of luck with *BSD. I hope that someone will update the send(2) man page so that the next person who wants to do what I'm doing will know that it isn't possible with FreeBSD. Stuart