

I appreciate that this was a long-winded intro, but I'd basically like to know whether there is a practical way to implement Option C? Option C: When carrying out the TCP connection itself, check the remote MAC that the client is connecting to (from what I've seen, the ARP cache should have been updated by virtue of connecting) Option B: After the TCP connection and readout, have the client check the ARP table again, in order to make sure the it actually connected to the MAC address it thought it was connected to.

Use that to check that it's about to connect to the right host/MAC. Option A: Just before connecting to a host, have the client ping the IP it thinks it's on, in order to force an ARP refresh. The following three potential approaches have occurred to me: And based on the above approach, the client will still connect to 192.168.1.101 thinking that it's reading Host A's metrics, while it's actually now talking to Host B. At the moment that that happens, the client's ARP cache will be incorrect. But occasionally there will be an IP reassignment as DHCP leases are refreshed, and Host A will end up on 192.168.1.102, with Host B now on 192.168.1.101. Based on the ARP cache and knowledge of their MAC addresses, I can tell which is which and poll accordingly. This works most of the time, but I still encounter occasional issues due to the switching of IP addresses by hosts.įor example, for a while Host A will have IP address 192.168.1.101, and Host B will have IP address 192.168.1.102. If the MAC isn't present in the ARP cache, I force a network re-scan. Before establishing each connection to a server, I look up the MAC->IP mapping in the client's ARP cache (via a method like this).

