From owner-freebsd-net Wed Aug 16 21:23:50 2000 Delivered-To: freebsd-net@freebsd.org Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [202.249.10.124]) by hub.freebsd.org (Postfix) with ESMTP id 6D85737B8F6 for ; Wed, 16 Aug 2000 21:23:47 -0700 (PDT) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from localhost ([3ffe:501:100f:13ff::a]) by shuttle.wide.toshiba.co.jp (8.9.1+3.1W/8.9.1) with ESMTP id NAA03972; Thu, 17 Aug 2000 13:09:48 +0900 (JST) Date: Thu, 17 Aug 2000 12:55:16 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: gbnaidu@sasi.com Cc: freebsd-net@FreeBSD.ORG Subject: Re: multicast packets & tcpdump... In-Reply-To: In your message of "Wed, 16 Aug 2000 18:03:09 +0530 (IST)" References: User-Agent: Wanderlust/2.3.0 (Roam) Emacs/20.6 Mule/4.0 (HANANOEN) Organization: Research & Development Center, Toshiba Corp., Kawasaki, Japan. MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu") Content-Type: text/plain; charset=US-ASCII X-Dispatcher: imput version 980905(IM100) Lines: 43 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >>>>> On Wed, 16 Aug 2000 18:03:09 +0530 (IST), >>>>> "G.B.Naidu" said: > I was looking at the tcpdump output while multicast packets are flowing > between two routers, tcpdump shows the source and destination address as > "224.0.0.2". It should show the source address of the multicast packet > rather than the multicast group address. > I found that, when the receiver does the recvfrom(), the address returned > shows the multicast group address. Is this a bug or feature? On linux this > shows the source address. I suspect those two facts means that the source address of the multicast packet was really a multicast address. If you bind a socket to an IPv4 multicast address on a BSD system (including FreeBSD) and try to send a (unicast or multicast) packet via the socket, the source address of the packet is the bound multicast address. For example, if you have the following PCB Proto Recv-Q Send-Q Local Address Foreign Address udp 0 0 224.0.0.2.6666 *.* and send a packet to 224.0.0.5 through the socket, the packet will be as follows: 12:49:49.914187 224.0.0.2.6666 > 224.0.0.5.6666: udp 0 [ttl 1] 4500 001c 2ecb 0000 0111 cafe e000 0002 e000 0005 1a0a 1a0a 0008 0bc2 In this case, of course, the recvfrom() call on the receiver side will retrun the multicast address (224.0.0.5) as the packet's source address. Note that the same thing does not happen for BSD's IPv6 implementation. The IPv6 network layer rejects packets with multicast source addresses to be sent on the wire. I think a similar fix should be implemented for IPv4, too. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message