comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Broadcasting UDP
Date: Mon, 25 Apr 2016 16:51:05 +0200
Date: 2016-04-25T16:51:05+02:00	[thread overview]
Message-ID: <nflatj$la3$1@gioia.aioe.org> (raw)
In-Reply-To: 0ea06785-65e5-4c33-b8b1-1fc6e7e66740@googlegroups.com

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


  reply	other threads:[~2016-04-25 14:51 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 [this message]
2016-04-25 17:11       ` ahlan.marriott
2016-04-26 16:21         ` ahlan
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