comp.lang.ada
 help / color / mirror / Atom feed
From: ahlan@marriott.org
Subject: Re: Broadcasting UDP
Date: Tue, 26 Apr 2016 09:21:07 -0700 (PDT)
Date: 2016-04-26T09:21:07-07:00	[thread overview]
Message-ID: <02a5abd1-1a88-4782-8a39-23e3ff3a61e2@googlegroups.com> (raw)
In-Reply-To: <9e724e15-9566-4405-89f7-ec5a49406593@googlegroups.com>

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

  reply	other threads:[~2016-04-26 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-24 16:31 Broadcasting UDP ahlan.marriott
2016-04-24 17:22 ` Dmitry A. Kazakov
2016-04-25 14:18   ` ahlan
2016-04-25 14:51     ` Dmitry A. Kazakov
2016-04-25 17:11       ` ahlan.marriott
2016-04-26 16:21         ` ahlan [this message]
2016-04-29 23:35 ` douty.chris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox