Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How Ethernet Device to Find Another One

Status
Not open for further replies.

eepty

Full Member level 2
Joined
Oct 21, 2005
Messages
143
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,611
For example in a home automation system, a home computer need to control others device through ethernet. They are all connected to a router. However the devices are using DHCP to get the IP address, and as I know the IP address will change dynamically.

So for example if the comupter is switched off for a week. After it is switched one, when it wants to send a TCP package to one device, how does it know where to send?

Thank you.
 

As you have correctly pointed out, the IP address is useless in this case. You need to get the computer ID from the local DNS server.
 

Hi,

Is it called with the use of
* MAC address
* IP address
* URL.

..
* Within the network segment (defined by network mask)
* or external network segment

****
If it is accessed with IP address, but the IP addres changed, it will not reach the device.
But the IP address doesn't need to change:
* the device may ask for a specific IP address at the DHCP
* the DHCP may have stored it's (unique) MAC address, and thus give the device allways the same IP address.

Within a network segment you may have a good chance to access the devjce by using the fixed MAC address

Using URL there are DNS that store the actual URL, MAC address and IP address, and on reques they give the data to the client.

Klaus
 

I am thinking that is it a proper way to let the computer stored the MAC address of all other devices, and then the computer can get back the current IP address of each device by querying the router?

Is there a standard protocol to do this? ARP?
 

Don't use MAC for this as it applies only to the local network segment (It does however make a useful unique ID), instead have each device send a broadcast UDP packet once every few seconds announcing its presence, IP address and MAC address.

This way the PC can quickly build a list of devices on the network, and can use the MAC to provide a way to identify known devices (So that you can tell which one you are talking to).

Regards, Dan.
 

The steps are simple:

Broadcast using the suitable mask on the local network.

All the local machines will respond with their IP address (it is possible to configure your PC to ignore broadcast queries)

Using the list of IP address, ask all the machines, one at a time, their ID (computer name, mac address etc)- it is again possible to fake your ID or ignore the query.

Select your machine from the answers received - it is not difficult.

When the server sends a response to the DHCP request, the block will be available in some file (are you using windows or linux?)

You can just scan the file and figure out which machine is which...
 

Actually it is an Android mobile app but not a computer. Sorry if I missleaded.

- - - Updated - - -

The steps are simple:

Broadcast using the suitable mask on the local network.

All the local machines will respond with their IP address (it is possible to configure your PC to ignore broadcast queries)

Using the list of IP address, ask all the machines, one at a time, their ID (computer name, mac address etc)- it is again possible to fake your ID or ignore the query.

Select your machine from the answers received - it is not difficult.

When the server sends a response to the DHCP request, the block will be available in some file (are you using windows or linux?)

You can just scan the file and figure out which machine is which...

The local network may consist of 100 devices. I am worrying if using this method, the network will become too busy. What interval period would you recommend?

- - - Updated - - -

I think that my problem is like how a computer find a local network printer. How do they do that?
 

I would recommend you download Wireshark or a similar program and watch the network traffic to see how its done. It will decode the packet headers and tell you what kind of data it carries and what it's purpose is. Look for the DHCP packets and you will see things like:

"I am 192.168.1.1 tell me who has 192.168.1.22?" followed by " this 192.168.1.22, my name is EpsonPrinter and my MAC is 11:22:33:44:55"

Brian.
 

Windows and Unix does it differently- (not really a great difference) but to do that on a mobile, you need to compile an app - you will need to download the google tools on your desktop.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top