From owner-freebsd-net@freebsd.org Fri Mar 16 11:47:50 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57920F41DB7 for ; Fri, 16 Mar 2018 11:47:50 +0000 (UTC) (envelope-from sthaug@nethelp.no) Received: from bizet.nethelp.no (bizet.nethelp.no [IPv6:2001:8c0:9e04:500::1]) by mx1.freebsd.org (Postfix) with ESMTP id DD1BF7A87E for ; Fri, 16 Mar 2018 11:47:49 +0000 (UTC) (envelope-from sthaug@nethelp.no) Received: from localhost (bizet.nethelp.no [IPv6:2001:8c0:9e04:500::1]) by bizet.nethelp.no (Postfix) with ESMTP id 0BC2BE6047; Fri, 16 Mar 2018 12:47:49 +0100 (CET) Date: Fri, 16 Mar 2018 12:47:48 +0100 (CET) Message-Id: <20180316.124748.104098359.sthaug@nethelp.no> To: Alexander V. Chernikov Cc: freebsd-net@freebsd.org Subject: Re: Does FreeBSD do proactive ARP refresh? From: sthaug@nethelp.no In-Reply-To: <20180316.122720.71152047.sthaug@nethelp.no> References: <8530131521193098@web19g.yandex.ru> <20180316.110054.74682026.sthaug@nethelp.no> <20180316.122720.71152047.sthaug@nethelp.no> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 11:47:50 -0000 > > > > I have a reproducible problem on 11.1-STABLE where, during a longterm > > > > iperf3 session, some packets are lost every time ARP is refreshed (every > > > > net.link.ether.inet.max_age seconds). Checking with tcpdump, I can > > > > indeed see that the packet loss is happening as the hosts are doing > > > > ARP request/reply. > > > I'll take a look. Indeed, the intended behaviour is to proactively refresh the record. > > > Is the situation the same with forwarding and locally-originated traffic? > > > With local TCP socket inpcb route caching might come into play. > > > > My testing is with locally-originated UDP traffic (iperf3 -u). Haven't > > tested what happens if the box is forwarding the traffic - however, I > > believe TCP socket inpcb route caching should not be relevant for the > > UDP traffic? (But there is also a TCP transaction between the iperf3 > > sender and the iperf3 receiver at the *start* of the iperf3 session.) > > > > In any case, I will also test what happens if the box is forwarding > > the traffic. > > And thank you for that suggestion! The packet loss during ARP refresh > (of the destination address connected to the output interface) does > *not* happen when the box is forwarding! It only happens with locally > generated traffic. Checking once per second with "arp -n " I can see the following behavior with net.link.ether.inet.max_age=120: - Locally generated traffic: The ARP entry is refreshed after net.link.ether.inet.max_age seconds - which presumably means it actually expires first. And there is some packet loss. - Transit traffic (the box is forwarding): The ARP entry is refreshed 5 seconds *before* net.link.ether.inet.max_age has passed, and there is no packet loss. Steinar Haug, Nethelp consulting, sthaug@nethelp.no