Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Nov 2015 15:51:33 +0100 (CET)
From:      "elof2@sentor.se" <elof2@sentor.se>
To:        "Alexander V. Chernikov" <melifaro@freebsd.org>
Cc:        freebsd-net <freebsd-net@freebsd.org>
Subject:   Re: netstat -B "Recv"
Message-ID:  <alpine.BSF.2.00.1511051518330.49057@farmermaggot.shire.sentor.se>
In-Reply-To: <111891446726660@web29h.yandex.ru>
References:  null <alpine.BSF.2.00.1511041736240.49057@farmermaggot.shire.sentor.se> <111891446726660@web29h.yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 5 Nov 2015, Alexander V. Chernikov wrote:

>
>
> 04.11.2015, 19:55, "elof2@sentor.se" <elof2@sentor.se>:
>> Hi!
>>
>> Question:
>> What do the Recv column in 'netstat -B' show?
>>
>> I thought it was tha amount of packets received, but appaently not so.
>>
>> I send 2000000 packets from a tcpreplay machine to a receiving machine.
>> I do it a few times.
>>
>> On the receiver I see:
>> netstat -in
>> Name Mtu Network Address Ipkts Ierrs Idrop Opkts
>> Oerrs Coll
>> ix0 1500 <Link#1> 0c:c4:7a:58:e2:3c 0 0 0 0
>> 0 0
>> ix1 1500 <Link#2> 0c:c4:7a:58:e2:3d 6000000 0 0 0
>> 0 0
>>
>> and then
>> netstat -in
>> Name Mtu Network Address Ipkts Ierrs Idrop Opkts
>> Oerrs Coll
>> ix0 1500 <Link#1> 0c:c4:7a:58:e2:3c 0 0 0 0
>> 0 0
>> ix1 1500 <Link#2> 0c:c4:7a:58:e2:3d 8000000 0 0 0
>> 0 0
>>
>> So 6000000 has increased to 8000000. Good.
>>
>> However, 'netstat -B' show:
>>    Pid Netif Flags Recv Drop Match Sblen Hblen Command
>> 25553 mon0 p--s--- 1996862 0 2000000 0 0 tcpdump
>>
>> How can the "Recv" be *lower* than "Match"?
>> 1996862 < 2000000.
>>
>> For every new run (fast and slow) I get the same results, slightly less
>> than 2000000 Recv.
>>
>> What am I missing?
> Well, "Recv" is read from d->bd_rcount which is not per-cpu counter and is incrementing unlocked.
> On the other hand, "Match" increases when filter returned match condition and we (w)locked bpf descriptor, so this one is accurate.

Ah. Thanks.


Will you make a bugzilla out of this? Or should I? Or is it not 
interesting enough to fix?

/Elof
From owner-freebsd-net@freebsd.org  Thu Nov  5 15:00:48 2015
Return-Path: <owner-freebsd-net@freebsd.org>
Delivered-To: freebsd-net@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 892A7A2707A
 for <freebsd-net@mailman.ysv.freebsd.org>;
 Thu,  5 Nov 2015 15:00:48 +0000 (UTC)
 (envelope-from barney@databus.com)
Received: from pit.databus.com (Databus-1-pt.tunnel.tserv4.nyc4.ipv6.he.net
 [IPv6:2001:470:1f06:80b::2])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 532AB1A90;
 Thu,  5 Nov 2015 15:00:48 +0000 (UTC)
 (envelope-from barney@databus.com)
Received: by pit.databus.com (Postfix, from userid 202)
 id 965B65AC0; Thu,  5 Nov 2015 10:00:46 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=databus.com;
 s=20140217; t=1446735646;
 bh=iTSPnlhTZ4bqKcpISfRInXX4/UH5/rPvoVUZiyTrpjw=; l=938;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=L5VODmSl48d17/D054AzEglHpkvfRzvL6Kk+4qZLauU4ZrTO6pPm1bA9DYuVKVsap
 yMFBqL1UE02/hDPhd3e8PM+mMW2foZ9/EUzTUNfKYrbJUsTmPEPk37mu5axWaMgNnk
 bqzW2MH30LH9b+4NB5qTztE8iWLko8J7WrjLjjQf5Jey9cZKPa4RjqkZTmZ2HDG5l5
 9bQpap2iF0SJgNwaLcg97ouGygYFswOND3QKJhi2j9wzDxG7tznPA/hX0WMqo7L5FW
 vFS3cHtS2qNRvJwTV0kWzYAM0Jh8Buc/hRQ/6bLLmEPtOfnSmWz7znoF62LbTv1Jsc
 04z9IVuuatePw==
Date: Thu, 5 Nov 2015 10:00:46 -0500
From: Barney Wolff <barney@databus.com>
To: Andriy Gapon <avg@FreeBSD.org>
Cc: Ben Woods <woodsb02@gmail.com>,
 "freebsd-net@freebsd.org" <freebsd-net@FreeBSD.org>
Subject: Re: who uses this port?
Message-ID: <20151105150046.GA69422@pit.databus.com>
References: <563A5F39.7010906@FreeBSD.org>
 <CAOc73CD82vkCHzT1S+e1VV1b1RN14K3WeqYuF1PA=fStc6iU3g@mail.gmail.com>
 <563B0922.9030805@FreeBSD.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <563B0922.9030805@FreeBSD.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-BeenThere: freebsd-net@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: Networking and TCP/IP with FreeBSD <freebsd-net.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-net>,
 <mailto:freebsd-net-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-net/>;
List-Post: <mailto:freebsd-net@freebsd.org>
List-Help: <mailto:freebsd-net-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-net>,
 <mailto:freebsd-net-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Nov 2015 15:00:48 -0000

On Thu, Nov 05, 2015 at 09:45:38AM +0200, Andriy Gapon wrote:
> On 05/11/2015 09:20, Ben Woods wrote:
> > On Wednesday, 4 November 2015, Andriy Gapon <avg@freebsd.org
> > <mailto:avg@freebsd.org>> wrote:
> > 
> >     $ sockstat -l | fgrep 631
> >     ?        ?          ?     ?  tcp4   127.0.0.1:631   
> >          *:*
> > 
> >     $ nc -l 127.0.0.1 631
> >     nc: Address already in use
> > 
> > 
> > 
> > I'm more curious as to why sockstat gives you question marks instead of the
> > proper process details. Any ideas?
> 
> Yeah, I should have stated my question more accurately.  What you are asking is
> what I actually intended to ask.
> 
> I was debugging a problem of cupsd not being able to bind to its port after a
> restart.  Eventually I had to reboot the affected system.

Might be mountd.  I once saw it bind to the imaps port, also not good.
Forcing it on a port I don't use cured that, but I have a suspicion that
the real solution lies in the rc order.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1511051518330.49057>