Unabke to read UDP broadcast with destination address of 0.0.0.0

I am trying to read a UDP broadcast from an application using windows sockets.The broadcast messages are from a network device. WireShark confirms that the windows computer is receiving the UDP packets. The socket application does not receive any messages. WireShark indicates that the udp destination is 0.0.0.0. If I generate a UDP packet with with a destination address of 255.255.255.255 the socket application sees it. The UDP is using port 67, the messages are BootP. Code is similar to bootp server example in  "the code project" site.
bmark_caAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
The requirement for bootb/dhcp (port 68/67 depending on client/server resp.) is that the target is the broadcast address for a discovery packet. So a target address of 0.0.0.0 is incorrect.
That wireshark sees the packet just means that wireshark puts the interface in promiscous mode (i.e. receive anything) ==> sees anything that lands on your cable or switch/hub-port, including packets like Bridge PDU's etc. that are filtered by the interface.
While an application requests for specific addresses (see bind() socket API call), the IP stack filters "invalid" packets too.

A broadcast is either: 255.255.255.255 or the highest address in your network... say your network is 192.168.111.0/24 broadcast 192.168.111.255
this causes the IP stack to use the FF:FF:FF:FF:FF:FF (or Broadcast MAC-address to be used).
A broadcast with 0.0.0.0 "shouldn't happen", at least not for bootp/dhcp.
0
bmark_caAuthor Commented:
The device I am trying to communicate with is a ptototype and the destination address "0.0.0.0" must be an error. I have an email out to the makers. Thanks for the confirmation.
0
nociSoftware EngineerCommented:
Yes, indeed. As a bootp/dhcp client doesn't know it address/network etc. It has to assume the all networks broadcast  (255.255.255.255).

The RFC (description of DHCP is:)
http://www.faqs.org/rfcs/rfc2131.html

Which for a client request refers to the BOOTP rfc:
http://www.faqs.org/rfcs/rfc951.html

Which in chapter 3 specifies that for the DHCPDISCOVER packet from client to server the sourceadress must be 0.0.0.0 and that the server address if unknown must be 255.255.255.255.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bmark_caAuthor Commented:
Addition of reference makes solution even better
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.