user3742046
user3742046

Reputation: 181

Two devices with the same IP delay when working non-simultaneously

I am working on automating my production process. I have two devices in a small LAN, they are stock so they both share the same IP address. The idea is to power up one device upload data via Modbus TCP/IP then Power it down. Wait like 10 seconds. Next power up the other device and do the same plus change its IP address.

Everything works fine but every time I switch TCP/IP connection from one device to the other it takes about one minute to establish the connection. When their IPs are set it works normally, it is only the first switchover when the IPs are the same that makes that long delay.

Why is that?

Upvotes: 0

Views: 47

Answers (1)

SciFiDryer
SciFiDryer

Reputation: 106

If you have 2 devices sharing the same IP address you might be hitting the ARP table limits. The ARP table is responsible for translating IP addresses to MAC addresses, and has a lifetime of a few minutes. When your computer opens communication with a never seen IP, it caches a MAC entry to the ARP table so that it doesn't need to look up the Ethernet device every time.

With 2 devices sharing an IP, your computer might be caching the MAC of the first until the entry expires.

On most OSs you can run arp -a to see the ARP table and arp -d to clear it. If you clear the ARP table after the switchover and it starts communicating right away that is your culprit.

Upvotes: 1

Related Questions