From owner-freebsd-net@freebsd.org Thu Nov 5 14:51:37 2015 Return-Path: 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 86778A26FB9 for ; Thu, 5 Nov 2015 14:51:37 +0000 (UTC) (envelope-from elof2@sentor.se) Received: from smtp-out.sentor.se (smtp-out.sentor.se [176.124.225.2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 474211536; Thu, 5 Nov 2015 14:51:37 +0000 (UTC) (envelope-from elof2@sentor.se) Received: from localhost (localhost [127.0.0.1]) by farmermaggot.shire.sentor.se (Postfix) with ESMTP id 55AC0B61D235; Thu, 5 Nov 2015 15:51:33 +0100 (CET) Date: Thu, 5 Nov 2015 15:51:33 +0100 (CET) From: "elof2@sentor.se" To: "Alexander V. Chernikov" cc: freebsd-net Subject: Re: netstat -B "Recv" In-Reply-To: <111891446726660@web29h.yandex.ru> Message-ID: References: null <111891446726660@web29h.yandex.ru> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-ID: Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 14:51:37 -0000 On Thu, 5 Nov 2015, Alexander V. Chernikov wrote: > > > 04.11.2015, 19:55, "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 0c:c4:7a:58:e2:3c 0 0 0 0 >> 0 0 >> ix1 1500 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 0c:c4:7a:58:e2:3c 0 0 0 0 >> 0 0 >> ix1 1500 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: 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 ; 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 To: Andriy Gapon Cc: Ben Woods , "freebsd-net@freebsd.org" Subject: Re: who uses this port? Message-ID: <20151105150046.GA69422@pit.databus.com> References: <563A5F39.7010906@FreeBSD.org> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 > > 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.