[Eug-lug] arp kernel voodoo question for the gurus.

Mike Cherba mike.cherba at caviumnetworks.com
Fri Aug 17 19:26:31 PDT 2007


What that setting will do is force a ARP request 5 seconds after the
entry has "gone stale"

After a little examination of the  net/core/neighbour.c file it appears
that the relevant function here is: neigh_periodic_timer

There is a comment on line 691 in this file which states:

       /* Cycle through all hash buckets every base_reachable_time/2 ticks.
         * ARP entry timeouts range from 1/2 base_reachable_time to 3/2
         * base_reachable_time.
         */
        expire = tbl->parms.base_reachable_time >> 1;
        expire /= (tbl->hash_mask + 1);
        if (!expire)
                expire = 1;

        mod_timer(&tbl->gc_timer, now + expire);

        write_unlock(&tbl->lock);

By my reading this means that
proc/sys/net/ipv4/neigh/[interface]/base_reachable_time
is the parameter which controls how fast the entries age out of the
table.  It defaults to 30 seconds, which means that arp reaffirmation
can take anywhere from ~15-45 seconds between passes.  When I shorten
this to 10 I see the arps happen between 5 and 15 seconds.
			-Mike



We shall do a much better programming job, provided we approach the task
with a full appreciation of its tremendous difficulty, provided that we
respect the intrinsic limitations of the human mind and approach the
task as very humble programmers. --- Alan Turing


On Fri, 2007-08-17 at 18:02 -0700, larry price wrote:
> On 8/17/07, Mike Cherba <mike.cherba at caviumnetworks.com> wrote:
> > Larry,
> >         I did a little digging and I finally found something that appears to
> > confirm my idea that gc_stale_time is the answer.
> > http://linux-ip.net/html/ether-arp.html
> > you will  want to change this for the interface in question, as the
> > default values only get used when creating new interfaces.
> 
> setting
> net.ipv4.neigh.eth0.gc_stale_time = 5  //a ridiculously low value
> 
> and watching the interface with
> tcpdump -i eth0 arp
> 
> does not force arp requests every 5 seconds as you might expect.
> 
> reading through /net/core/neighbour.c doesn't really give me any ideas
> as to what's going on.
> 
> net/ipv4/arp.c has the functions for creating and sending arp packets,
> but I'm missing the governing logic.
> _______________________________________________
> EUGLUG mailing list
> euglug at euglug.org
> http://www.euglug.org/mailman/listinfo/euglug



More information about the EUGLUG mailing list