What we are actually looking to do is to have our program reach out onto the network and communicate with an electronic device we have manufactured. What we are looking for is to take a known Mac Address and find out the device's Dynamically Assigned IP Address. We would like to do this with minimal End User input.
We know that every DHCP network has a DHCP server, and every DHCP server has a lease table. Every DHCP Lease table has a correlation of Mac to IP. We want to be able to access the information in the DHCP Lease Table without shutting down services. The Microsoft DHCP management console can do this, and the W2K3 admin pack (installed on a client computer) allows this to happen from a remote computer, so we know it can be done.
We know that not all DHCP servers are Windows machines, some are Routers, some are Linux, etc.
Keep the items listed above in mind as you consider these questions:
Using Visual C (++ or .net)
1. How do we determine what/where the DHCP server is?
2. How do we access the information in the Lease table, regardless if it is on a Windows server, router, etc.? We could, perhaps, output the information to a .csv file in a temp folder for input/review for our program.
If the above cannot be done, can we send a broadcast to a specific port number requesting an IP address?
For example, our program communicates with our device on a specific port number. Could we then use the program to send a broadcast across the network on this port in a manner that our specific device will respond?
Another thought, is to send a broadcast to a specific Mac Address, and have it respond with its IP information.
We want to handle this in a manner that is simple enough on the End User that a child could do it. The End User has to have minimum requirements made of him.
You need to query the ARP table to find the MAC->IP translatiion. I have developed an embedded ethernet device like your product and have done this before. I cannot put my hands on the C++ code at the moment, it was about 3 years ago. but this will give you a start
If you need more help with it I can possibly go though my old code, the software would basically say GetIPFromMac("00:05:AA:BF:C0") and it would query the networks ARP table.
Also you can send a ethernet frame to the embedded device and have it send a ether frame back to you (safer on any network) but you need to write code into the host embedded device to handle this. My code supported both methods but as I said the NIC controller on my embeeded device was programmed to take advantage of this 'Discovery' mode.
Last edited by Jean-Guy2000; February 14th, 2006 at 03:09 PM.