Re: Using the broadcast address
Re: Using the broadcast address
- Subject: Re: Using the broadcast address
- From: Joel Bender <email@hidden>
- Date: Thu, 16 May 2002 12:07:16 -0400
It *appears* from what I have been able to gather that there is a
broadcast address that I can send to, consisting of the highest IP
number in the allowable range, ie, 192.168.1.255 for that ip range.
You may recall that IP addresses are split into two parts, the
'network' and the 'host' and the split between the two is determined
by the network 'mask'.
The host number can be zero or all 1's, both are valid broadcast
addresses, but zero is no longer used (very old BSD thing I
understand).
Does anyone know of any documentation I can get to find out more about this?
<
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc0950.html>
Specifically, how do I connect and send to the broadcast address,
and how can I receive packets addressed to the same.
Open a datagram socket, using the port number that will be shared by
all of the cooperating applications.
Take your network mask and invert it. This is the host number. Or
it with your IP address and you'll get the destination address for
your broadcast.
Alternatively, just send your messages to 255.255.255.255, which will
also get to everybody.
Note that UDP broadcasts are not forwarded by routers. They may also
be blocked by other intervening equipment like cable modems. You
could 'flood' the network by sending your message to every valid host
in the range, but that it not recommended (network traffic analyzers
will flag this as a 'service scan attack' and you'll get some angry
calls from network admins).
Joel
--
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.