Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2025 18:43:13 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 291100] Reduce ARP cache time from 20 minutes to 60 seconds
Message-ID:  <bug-291100-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291100

            Bug ID: 291100
           Summary: Reduce ARP cache time from 20 minutes to 60 seconds
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: misc
          Assignee: bugs@FreeBSD.org
          Reporter: achillesgaikwad@gmail.com

Created attachment 265511
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=265511&action=edit
patch to change arp time from 1200s to 60s

This patch reduces the default ARP cache timeout (arpt_keep) from 1200 seconds
(20 minutes) to 60 seconds to improve network responsiveness in dynamic
environments, particularly cloud deployments.

## issue:
The current 20-minute ARP cache timeout, while appropriate for traditional
stable network environments (Like on-prem systems), causes connectivity issues
in modern cloud environments. It is not common that in on prem the IP pool gets
recycled quickly within 20 minutes. Where as in cloud environments - 

1. Short-lived instances: Client systems may operate for less than 20 minutes
before termination, the IP address that the virtual machines held will be
reused by other virtual machines.
2. Due to [1] when IP addresses are quickly reassigned to new virtual machines,
the OS continues attempting to communicate with the cached (now stale) MAC
address instead of performing a fresh ARP resolution until 20 minutes.

## How are we solving this problem?:
The patch modifies sys/netinet/if_ether.c by changing the arpt_keep variable
initialization:
- Before: VNET_DEFINE_STATIC(int, arpt_keep) = (20*60); (1200 seconds)
- After: VNET_DEFINE_STATIC(int, arpt_keep) = 60; (60 seconds)

## Rationale:

- Better suited for dynamic cloud environments with frequent IP recycling
- Better out of the box experience for users, as users do not have to debug and
edit sysctl in their environment

## Downsides:
- More ARP traffic but this is not going to affect CPU cycles or affect
performance of OS in anyway. I hope!

## Is anyone else doing this already?

- Yes, Linux has a default ARP cache time of 60 seconds. I tried to find issues
that could happen due to arp cache time of 60 seconds but found nothing.

## Request:

Please accept my patch where I make this modification for better out of the box
experience for users.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-291100-227>