Search network device from LAN through my C++ application and change the IP address

Posted by Arun Kumar K S on Programmers See other posts from Programmers or by Arun Kumar K S
Published on 2013-10-22T07:01:09Z Indexed on 2013/10/22 10:13 UTC
Read the original article Hit count: 323

Filed under:
|

I am developing an application in C++ to communicate with my network device. I used UDP classes to search the device from the network.

I done the code in such a way that from my application a broadcast message will send to the local network. The device will respond to the broadcast message and the application will get the IP address from that response. After establishing a network communication send a message to the device for changing the IP address. That worked fine if my devices IP address is correct.

But when I set a wrong IP address and subnet to the device. My application will never get any messages from the device. So I can't able communicate to the device and not able get the device and unable to change the IP address etc.

Say example
IP address of the device 20.1.1.1
Subnet Mask 255.0.0.0

And in my system that runs the application
IP address 192.168.1.23
Subnet Mask 255.255.255.0

I tried the Lantronix device installation software with their Lantronix device in network. It listed the device from the network and I am able to change the IP address from their software.

Any one know how this is done in this type of software? How I can search in network to find the device and change the IP address when its IP address is not in range? Which protocol they used to find the device?

Lantronix Search Option screenshot

© Programmers or respective owner

Related posts about c++

Related posts about networking