From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.232.227 with SMTP id tr3mr2159080pac.45.1461687668050; Tue, 26 Apr 2016 09:21:08 -0700 (PDT) X-Received: by 10.182.27.8 with SMTP id p8mr39350obg.19.1461687667972; Tue, 26 Apr 2016 09:21:07 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!g8no6886199igr.0!news-out.google.com!k10ni411igv.0!nntp.google.com!g8no6886192igr.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 26 Apr 2016 09:21:07 -0700 (PDT) In-Reply-To: <9e724e15-9566-4405-89f7-ec5a49406593@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:120b:7f3:dcd0:f806:212b:2dfc:b2eb; posting-account=DQbqYQoAAACn8hHn2LmG2aF7Mhbxl_Lf NNTP-Posting-Host: 2a02:120b:7f3:dcd0:f806:212b:2dfc:b2eb References: <276b8c43-7280-48ad-94be-c8324c6ae326@googlegroups.com> <0ea06785-65e5-4c33-b8b1-1fc6e7e66740@googlegroups.com> <9e724e15-9566-4405-89f7-ec5a49406593@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <02a5abd1-1a88-4782-8a39-23e3ff3a61e2@googlegroups.com> Subject: Re: Broadcasting UDP From: ahlan@marriott.org Injection-Date: Tue, 26 Apr 2016 16:21:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30290 Date: 2016-04-26T09:21:07-07:00 List-Id: On Monday, April 25, 2016 at 7:11:37 PM UTC+2, ahlan.m...@gmail.com wrote: > On Monday, 25 April 2016 16:51:36 UTC+2, Dmitry A. Kazakov wrote: > > On 25/04/2016 16:18, ahlan@marriott.org wrote: > > > > > This of course works but by using Broadcast_Inet_Addr > > > (255.255.255.255) then we actually transmit more UDP messages than is > > > strictly necessary. > > > > > > For example if I have two adapters one with 100.13.5.200 and the > > > other 169.254.7.7 and I send a UDP broadcast on each adapter then four UDP > > > messages are actually transmitted. > > > 1) Src=100.13.5.200 Dest=255.255.255.255 on adapter 1 > > > 2) Src=100.13.5.200 Dest=255.255.255.255 on adapter 2 > > > 3) Src=169.254.7.7 Dest=255.255.255.255 on adapter 1 > > > 4) Src=169.254.7.7 Dest=255.255.255.255 on adapter 2 > > > > > > This is because the destination address 255.255.255.255 is for all adapters. > > > > But the socket is bound to the address of a concrete adapter. > > Send_Socket should not leak through another adapter. It does not look right. > > > > > If I could find out the subnet masks I could derive the subnet > > > directed broadcast addresses and use these as the destination addresses > > > and thereby reduce the traffic. > > > > AFAIK there is no means for that in the Berkeley sockets. > > > > > Not by much I grant you but every little helps and besides it would > > > be a little more elegant than using the crude broadcast to all on all > > > adapters approach. > > > > Broadcasts with alien source address is not a big problem. I hope you > > are not doing anything but network discovery over broadcast. > > > > > Any ideas? > > > > Maybe, there is something with network settings (bridging etc). > > Broadcast packets should not cross segment boundaries. > > > > -- > > Regards, > > Dmitry A. Kazakov > > http://www.dmitry-kazakov.de > > Dear Dmitry, > > We are indeed only doing network discovery so these superfluous broadcasts with alien source addresses shouldn't be a problem - just not very nice ;-) > It seems that under Windows-Xp (my test machines) the adapter is selected according to the destination address and adapter subnet mask and not on source address. > I'll try it out on a Win10 machine tomorrow to check whether this is a Windows issue or a legacy issue. > Either way it isn't terribly important especially if there isn't an easy way to get the adapter subnet masks. > > I just thought I'd ask the experts before giving up. > Many thanks, > MfG > Ahlan FYI, Using the destination address to select the adapter or adapters seems to be a feature of Win-Xp. The production of broadcast messages with alien sources addresses does not occur with Win-10 and according to my colleagues does not occur with Win7-64. So it looks like Microsoft fixed this problem many years ago. Those of us that insist that things never got better than Win-2000 will have to live with a few bad packets ;-) MfG Ahlan