Solved

How do I make ARP cache age in 30 seconds?

Posted on 1998-09-09
4
422 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
4 Comments
 
LVL 2

Expert Comment

by:JYoungman
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now