Suppose I have a set of machines whose ip addresses are changing, say every 10 mins, then before making the tcp connect call (from a client) how do I make sure all the switches and routers have updated their mac Address and Ip Address mapping correctly and that it is latest and correct?

Since I need to make sure the tcp connects to the machine which is having a particular Ip Address,Can I send some application oriented tcp packet which broadcasts in the network and let the switches and routers update their mac Address and Ip Address mapping so that I am able to connect to a particular Ip (which may not be on the same machine every 10mins, but assume that a server is listening on all these machines, maybe on a different NIC card than the one for which the Ip Addresses are changing).

Is there a way I can achieve this?

Its a well known fact that,When you implement a switch in a network, it will update its switch table with the ip address respective to its MAC address. So there is no need for a seperate system to moniter these events. The switch will forward or accept packet only after the updation of switch table is done completely. So dont worry.

Hope this helps u my friend...:-D

If the switching of ip Addresses happens faster then how long does it take for the switch or router to detect it.
Also I am facing this problem already in a lan network.
After switching of Ip Address happens, I am able to ping the Ip Address for the new machine but the tcp connect call is not succeeding.

1) I think that in a switch if the network discovers any change it automatically starts updating it.
It will take only few seconds to flood ICMP packets to get the changes in the network and update it.

2)In router, the same happens, but the difference is that, it will update its routing table in a frequent interval.

So, my point is that your problem is not related to the table updation. There is some other problem. Sort that out my friend...

Hope this helps u...:-D

ok.
If the server is running in the same machine as the client, client is connected to the server through tcp connection. now the switching happens.
Now the tcp connection breaks and I am retrying on the connect call continuously, some other machine gets that ip. so my client tries to connect to it, but since the "machine" knew that the ip address is existing "inside itself" does it try to reRoute it back to itself? or does it discard the message for some other reason.

I can ping that new machine's IP but that tcp connect call doesnt happen.

can u able to ping the other clients in your network from the server?

1) switches are layer2 devices. No IPs come into play. they forward based on MAC. If you have a layer 3 switch for routing or ACLs, this still doesn't come into play when forwarding packets.

2) Routers are not usually connected to enduser systems.

3) PCs use ARP to resolve IPs to MAC. Most will cache ARP entries for a 10 minute timeout. Layer 3 switches and routers also cache ARP entries (usually a 4 hour timeout).

4) A 10 minute DHCP lease is crazy short. To adjust for that, you need to change the ARP timeout values across the board to something very low. Like 2 minutes. Thissetup going to increase ARP and GARP traffic as well as crazy amounts of DHCP traffic. All of that is broadcast traffic BTW.

IMHO, change dhcp to at least 8 hours. AFAIK, you can't change the windows 10 minute ARP timeout (someone check me on that if wrong). Switch and router timeouts will depend on the vendor. You can do it on Ciscos for example.

Is possible anyway to refresh the ARP entries by just pumping in some additional packets into the network. Actually the 10 min switching is just hypothetical case I was presenting, I am using more of a redundant server setup and the switching of Ip indicates a fault in one of the servers.

Each ARP entry in the windows ARP table is good for 10 minutes. IF you add new entries, those new entries are good for 10 while the older ones are still good for 9 or less.

Once the entry is in the ARP table, the only way to hange it is to clear the ARP entry manually and let the machine re-discover the other endpoint via arp broadcast.

Also keep in mind that any time a Windows system has a change on the NIC (such as with a new IP), a gratuitous ARP packet will be broadcasted on the subnet. Meaning that it will send out a special ARP packet even though no other host is requesting it. All hosts on the subnet will receive this packet and should update their ARP entries. You dont have to worry about the switch ports since the computer has not been moved to another port and the MAC has remained the same.

JorgeM, IIRC the GARP packet is the check for any other Machines answering on the same IP address... It's used to detect duplicate IPs on the network. A GARP packet is simply an ARP with the originator's IP. IF any other machines answers the GARP, then a dupe IP exists in the subnet.

Yes, thanks for the clarification...definately mistaken on my last post.

"the only way to hange it is to clear the ARP entry manually"

How do I clear it manually??
btw im using fedora.

I dont know for sure...

FWIR , this may work

You need the "arp -d hostname' repeatedly to accomplish this.

If you wish to automate this using a scheduler

try watching this video.

Click Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.