Solved

How do I make ARP cache age in 30 seconds?

Posted on 1998-09-09
4
428 Views
Last Modified: 2011-10-03
How can I get an ARP cache to age in, say, 30 seconds.  What I've got is the following:

A device with a given IP, say IP1, has a MAC address, say MAC1.  During a short time interval, this device gets a new MAC address, MAC2.  While IP1 has MAC1, it does a tftp transfer of a file from the tftp server.  After IP1 gets MAC2, it tries to do another tftp, but tftp times out since the tftp server still sees MAC1 mapped to IP1.

I can manually intervene and do an "arp -d IP1" to clear the ARP entry, and then try the tftp transfer again with IP1+MAC2, which updates the ARP cache, and everything's fine.

Anyone have good ideas how to manage this without manual intervention?

What would happen if something were running on the tftp server to periodically clear the ARP entry for IP1, and this entry got cleared DURING a tftp transfer?  Would it barf completely and stop, or just recover with a new ARP and be basically invisible?
0
Comment
Question by:mruddick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:JYoungman
ID: 2006918
It would depend on the quality of implementation of
the TFTP requestor.  Most will work fine.

However, when a device changes its *IP* address, it issues a "gratuitous ARP" packet, saying
      IP1 is-at MAC1
This is how you detect IP address clashes.   So if you can get the device which is changing its MAC address to issue a gratuitous ARP when its MAC changes, everything should work seamlessly.

Failing that, depending again on the TCPIP implementation of the TFTPing device, you may be able to put the interface in promiscuous mode and so catch packets intended for IP1 no matter if they're sent to MAC1 or MAC2.  

This often won't work because ethernet drivers check that the packet sent to them really is directed at them -- in this way they can support IP multicast when the ethernet card has no packet-filtering logic at all - they just put the interface into promisc mode and do the checks in software.

Can I ask *why* you're changing MAC?

0
 

Author Comment

by:mruddick
ID: 2006919
Jyoungman -

Yes, changing MACs seems like a strange thing to do, but it's in a product test environment, so it's not like it's the only *weird* thing I'm doing to the product.  I'm trying to automate some testing tasks, but was having trouble with this particular bit.
0
 

Accepted Solution

by:
bknowles earned 100 total points
ID: 2006920
Flushing the ARP cache during a connection (either the entire cache or just the one entry) should have no permanent long-term effects, just perhaps delay the tftp for a fraction of a second as the machine where the cache got flushed re-acquires the MAC address.
0
 

Expert Comment

by:laustjensen
ID: 3754534
The MAC of a LAN-machine can be found using the function GetMacAddresses(const Machine: string; const Addresses: TStrings): Integer; found in the JEDI Code Library (JCL). This can be fetched from http://www.delphi-jedi.org. It is free, it works and it doesn't spawn external processes to resolve the MAC.

What it exactly does, I don't know, but it works :o)

Hope any of you can use it. Enjoy :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question