From owner-freebsd-net@FreeBSD.ORG Thu Jan 11 08:37:56 2007 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CDCE16A47E for ; Thu, 11 Jan 2007 08:37:56 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out5.smtp.messagingengine.com (out5.smtp.messagingengine.com [66.111.4.29]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD3D13C428 for ; Thu, 11 Jan 2007 08:37:56 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id C9BD679BFB; Thu, 11 Jan 2007 03:33:58 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by out1.internal (MEProxy); Thu, 11 Jan 2007 03:33:58 -0500 X-Sasl-enc: uLzGfplQHedP5FIXEZtWklYhNaJARYr68sa6GJF6Xwfw 1168504438 Received: from [192.168.123.18] (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTP id E063B19D5E; Thu, 11 Jan 2007 03:33:56 -0500 (EST) Message-ID: <45A5F75F.8080404@FreeBSD.org> Date: Thu, 11 Jan 2007 08:37:51 +0000 From: "Bruce M. Simpson" User-Agent: Thunderbird 1.5.0.5 (X11/20060825) MIME-Version: 1.0 To: Eygene Ryabinkin References: <459D4D88.2030708@delphij.net> <459FEDBC.4070008@FreeBSD.org> <20070107115158.GA63854@codelabs.ru> <45A54119.20809@FreeBSD.org> <20070111063715.GL14822@codelabs.ru> In-Reply-To: <20070111063715.GL14822@codelabs.ru> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Tadaaki Nagao , andre@freebsd.org, LI Xin Subject: Re: Different behavior of ping'ing INADDR_BROADCAST? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jan 2007 08:37:56 -0000 Eygene Ryabinkin wrote: > Do you (or anyone else reading this post) have access to the different > IP stack realisations at hosts with multiple broadcast-able interfaces? > If yes, wouldn't you all be so kind to try to ping the broadcast address > and report the behaviour? > Windows deals with this by assigning each interface an 'interface metric', which is a default metric that a route is tagged with if it traverses a particular interface, and adding a unicast route to its FIB to INADDR_BROADCAST via each IFF_BROADCAST interface configured and running in the system. You can see this in the output of 'route print'. Selection of the next-hop is then done as in the same way for any other unicast destination with an assigned metric. The Windows FIB supports equal cost multipath; ours doesn't at the present time. The Windows approach seems much cleaner, as it simply reuses the existing unicast FIB lookup, although it involves adding additional routes to the FIB; systems with hundreds of VPN interfaces would therefore spam the FIB with such routes if we used this approach, potentially causing problems similar to those which were part of the reason behind the removal of PRCLONING in the FreeBSD 5.x era. Given that these routes would normally never be exchanged with any peers (and the FIB is not the most appropriate place for route redistribution anyway), it may be preferable and acceptable to put the next-hop selection logic for INADDR_BROADCAST into the stack itself. I'm personally not in favour of sending a single broadcast packet to multiple interfaces as it has potential for denial of service, and doesn't seem to be consistent with the behaviour of other systems, or the most common use-case for undirected broadcast, which is early boot and/or DHCP. Applications such as ISC DHCP work around the traditional BSD behaviour by using BPF to inject and receive IP broadcasts. The MROUTING code can potentially copy mbuf chains for each interface, though it tries to avoid making such copies. Regards, BMS