From owner-freebsd-net@freebsd.org Thu Jun 20 20:33:01 2019 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 2AE1E15C745F for ; Thu, 20 Jun 2019 20:33:01 +0000 (UTC) (envelope-from marco@tols.org) Received: from tolstoy.tols.org (tolstoy-a1.tols.org [IPv6:2a02:898:57:3::1]) (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 0684395B4F for ; Thu, 20 Jun 2019 20:32:59 +0000 (UTC) (envelope-from marco@tols.org) Received: from 82-217-131-200.cable.dynamic.v4.ziggo.nl ([82.217.131.200] helo=[192.168.178.123]) by tolstoy.tols.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1he3jr-0005M3-5v; Thu, 20 Jun 2019 22:32:56 +0200 From: Marco van Tol Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: net.inet.ip.stats - struct ipstat.ips_total - appears to be double the actual number Message-Id: <7861F570-6FD2-4BD0-B33B-D7F90BE44B77@tols.org> Date: Thu, 20 Jun 2019 22:32:49 +0200 Cc: Marco van Tol To: freebsd-net@freebsd.org X-Mailer: Apple Mail (2.3445.104.11) X-Tolsorg-Spam-Score: -1.0 (-) X-Rspamd-Queue-Id: 0684395B4F X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of marco@tols.org designates 2a02:898:57:3::1 as permitted sender) smtp.mailfrom=marco@tols.org X-Spamd-Result: default: False [-4.49 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:tolstoy-a1.tols.org]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tols.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mickey.tols.org]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; IP_SCORE(-1.74)[ipnet: 2a02:898::/32(-4.84), asn: 8283(-3.85), country: NL(0.01)]; RECEIVED_SPAMHAUS_PBL(0.00)[200.131.217.82.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8283, ipnet:2a02:898::/32, country:NL]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 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, 20 Jun 2019 20:33:01 -0000 Hi there, I'm trying to write a patch for collectd to generate trend graphs on = ipv4 and ipv6 statistics. I use the sysctls net.inet.ip.stats and net.inet6.ip6.stats for this. The structs I use to parse these sysctls are "struct ipstat" and "struct = ip6stat". While doing this, I keep running into the fact that the "struct = ipstat.ips_total" count seems to be twice the number of ipv4 packets = that actually got received on a host. Does this make any sense at all? So, in other words, if I call "sysctls net.inet.ip.stats", and do = another call 1 second later, I can deduce a per-second incoming ipv4 = packet rate. This seems to be twice as high as actually happening. The number reported in struct ip6stat.ip6s_total seems to be correct. Is there any reason for the ips_total to be twice the number of ipv4 = packets that actually got received? Another way to witness these counts is by doing: netstat -s -p ip, and = then checkout "total packets received" on a per-second basis. Thank you very much in advance! Marco van Tol=