Go Down

Topic: Arp and Ping (Read 730 times) previous topic - next topic

robyf1

Apr 18, 2013, 08:40 am Last Edit: Apr 19, 2013, 05:01 pm by robyf1 Reason: 1
Hello everyone, sorry for my english, I have the following problem, I have to, send the command arp (to know the IP) and ping (to start the test) (the purpose is to test the connection to a given ip and release a report type sent 4 received 4 (failure ok)), but going from serial to Ethernet port (see:  http://www.robot-italy.com/it/arduino-ethernet-w-o-poe-module.html ) . Someone has already tried his hand?

pylon

Why do you have to do the ARP yourself? The WizNet5100 onboard the Arduino Ethernet does that itself and BTW, the ARP is used to get the MAC address of the machine with a known IP address and not the other way around.

robyf1

#2
Apr 19, 2013, 08:44 am Last Edit: Apr 19, 2013, 09:14 am by robyf1 Reason: 1
Arp or Netstat in cmd windows, I return the ip of the devices. I have to use Arduino as a client. But to know (different each time) the ip of the device (Sever). I need to give these commands:

pylon

ARP (Address resolution protocol) is used to get the MAC address (Ethernet address) for a given IP address by using broadcasts, the other way around does not work with this protocol. Usually you don't know the MAC address of a server but it's host name. To get the IP for a given hostname, DNS (Domain Name System) is used.

Ping (or better a Echo Request and Echo Reply ICMP messages) are used to check the routing path between two IP endpoints.

Quote
But to know (different each time) the ip of the device (Sever). I need to give these commands:


I cannot see the commands. Did you forget them to post?

robyf1

The arp command you would use to find out who is connected. Then I program the Arduino to do the ping on the only ip found.

In the meantime I did some tests (also in windows) is not until I discovered that the server is pinged, Arp does not show its ip

pylon

Quote
The arp command you would use to find out who is connected.


Wrong. It shows the ARP cache of this host. If there wasn't a reason to resolve the IP to a MAC address the table will not show an entry although the device might be connected.

Quote
In the meantime I did some tests (also in windows) is not until I discovered that the server is pinged, Arp does not show its ip


The reason for this is found in the above answer.

What do you have from the server if you don't know the IP address? Is only the IP changing or is the MAC address changing too? The former case can be fixed by setting a fixed IP for the MAC address in the router's DHCP configuration.

Go Up