detecting new device on the network with an ethernet shield

There will be a software running on a pc. I want to implement functionality where whenever a new device with due and ethernet shield (running my sketch) is connected to the network, and I click on 'search for new devices', it should show me an entry for the newly connected device. I should also be able to take a static ip/netmask/gateway from the user, send it to the new due and set it up and activate it. Any recommendations on how to have this setup. I am thinking along these lines -

  1. the pc can probably use a broadcast message when the user hits the search for new devices.
  2. shield listening on that port, responds to the message with some kind of unique identifier.
  3. pc detects that its a new device by comparing it against the list of already active devices. 4.pc sends the new ip etc to the shield, which reads it and activates it.

Issues: 1. the already connected and configured devices are already listening on a tcp port for its work. It uses the D2 line for interrupts from w5100. These devices will now listen to tcp and udp? 2. How do I get a unique identifier for a due/shield board. 3. where do I save it. microSD card isnt a good idea as then it can be modified. No eeprom on due. I guess I need to add an spi eeprom chip for this.

hello, issue 1 : do you really need tcp ? maybe you could just use UDP unlike xPL xAP protocols. issue 2 : you need a mac address, to run Ethernet shield, why not use it. issue 3 : - have it in code - spi eeprom - if you don't need to keep it against reboots you might generate it randomly.

If you know what you are doing, you could spend weeks or even months designing this protocol and then you will realize you just re-invented DHCP.

Save yourself the trouble and just use DHCP for IP assignment.