Re: Problem sending UDP broadcast on OS/X 10.5 Leopard on MacPro1, 1
Re: Problem sending UDP broadcast on OS/X 10.5 Leopard on MacPro1, 1
- Subject: Re: Problem sending UDP broadcast on OS/X 10.5 Leopard on MacPro1, 1
- From: Peter Sichel <email@hidden>
- Date: Wed, 1 Dec 2010 14:34:32 -0500
On Dec 1, 2010, at 8:22 AM, Eigil Krogh Sørensen wrote:
> · What am I doing wrong?
> · How do I force the UDP package to be sent on a all Ethernet interfaces in OS/X 10.5 Leopard?
> · Can I force the UDP package to be sent on a specific interface?
The BSD network stack on 10.5 uses "directed subnet broadcasts" to broadcast UDP on each interface.
For example, if your interface is 192.168.1.7/24 you would send a packet to subnet broadcast address (192.168.1.255) to have it broadcast from that interface. Sending a packet to the global broadcast address directly (255.255.255.255) will cause it to be sent out the first available broadcast enabled interface which is often unpredictable. To broadcast out every interface, you have to walk the interface list yourself to determine the corresponding subnet broadcast addresses or use a BPF tap to send raw packets directly.
The old Mentat/TCP stack from the Mac OS 9 days would simply replicate a global broadcast packet and send it out every interface which was much more useful. 10 years and several rewrites later, there are still a number of things the Mentat/TCP stack did better. C'est La Vie.
- Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden