BlakeFoster / Arduino-Ping

ICMP ping library for the Arduino
58 stars 44 forks source link

Added functionality to get the mac address as ping-result #8

Open PcTim opened 8 years ago

PcTim commented 8 years ago

I've included a command to get the mac address of the pinged device. I also included this function to the Ping examples.

blfoster commented 8 years ago

MAC addresses are part of the link layer, which means that they are only relevant on your local network. If your ICMP request passes through an IP router*, you'll get the MAC address of the router rather than the MAC address of the destination. IP routing hides the technology used by the destination network interface from you. It could, in theory, not have a MAC address.

* Note: although a residential gateway is often called a router, these devices only use IP routing for destinations outside your network. Everything internal is MAC. It's analogous to an Ethernet switch plugged into a router with only 2 interfaces (with the other interface connected to the outside world).

PcTim commented 8 years ago

You're right. Thank you for your explanation. As you say MAC addresses are relevant on my local network and such this functionality is useful if you want to check which device is assigned to which IP address. In our project we want to scan the local network to create a network statistic for every device. See https://github.com/powtac/Autarc_LAN_User_Stats