From nobody@FreeBSD.org  Sat May 12 06:18:24 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 5E3AE37B43E
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 May 2001 06:18:24 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f4CDIOs04554;
	Sat, 12 May 2001 06:18:24 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200105121318.f4CDIOs04554@freefall.freebsd.org>
Date: Sat, 12 May 2001 06:18:24 -0700 (PDT)
From: bill@springwoodsys.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: netstat -i missing IPv4 input packet count for tun interface
X-Send-Pr-Version: www-1.0

>Number:         27283
>Category:       bin
>Synopsis:       netstat -i missing IPv4 input packet count for tun interface
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 12 06:20:01 PDT 2001
>Closed-Date:    Tue Jun 29 10:00:12 GMT 2004
>Last-Modified:  Tue Jun 29 10:00:12 GMT 2004
>Originator:     Bill O'Connell
>Release:        4.3-RELEASE
>Organization:
>Environment:
FreeBSD tan.[sld.tld] 4.3-RELEASE FreeBSD 4.3-RELEASE #0:
Tue May  1 10:03:50 EDT 2001
admin@tan.[sld.tld]:/usr/src/sys/compile/TAN  i386
>Description:
The output of netstat -i shows zero for IPv4 Ipkts on tun interface:

tan:/etc/periodic/daily# netstat -in
Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
sis0  1500  <Link#1>    00:a0:cc:a1:2e:03   974724     0   944427     0     0
sis0  1500  192.168.15    192.168.15.1      149067     -    13257     -     -
sis0  1500  fe80:1::2a0 fe80:1::2a0:ccff:        0     -        0     -     -
sis1  1500  <Link#2>    00:a0:cc:a1:2d:e6  1356902     0   837296     0   557
sis1  1500  [IPv4 pub/26   IPv4 pub]        284980     -   836577     -     -
sis1  1500  [IPv6 pub]                           0     -        0     -     -
sis1  1500  [IPv4 pub alias0]                    0     -        0     -     -
sis1  1500  [IPv4 pub alias1]                    0     -        0     -     -
ppp0* 1500  <Link#3>                             0     0        0     0     0
sl0*  552   <Link#4>                             0     0        0     0     0
faith 1500  <Link#5>                             0     0        0     0     0
gif0* 1280  <Link#6>                             0     0        0     0     0
gif1* 1280  <Link#7>                             0     0        0     0     0
gif2* 1280  <Link#8>                             0     0        0     0     0
gif3* 1280  <Link#9>                             0     0        0     0     0
lo0   16384 <Link#10>                         2558     0     2558     0     0
lo0   16384 fe80:a::1/6 fe80:a::1                0     -        0     -     -
lo0   16384 ::1/128     ::1                      0     -        0     -     -
lo0   16384 127           127.0.0.1           2548     -     2548     -     -
tun1  1440  <Link#11>                       259503     0   243854     0     0
tun1  1440  192.168.250.1 192.168.250.14         0     -     1962     -     -
tun1  1440  fe80:b::2a0 fe80:b::2a0:ccff:        0     -        0     -     -

>How-To-Repeat:
rerun netstat -i
>Fix:
unknown, sorry
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: brian 
State-Changed-When: Wed May 23 08:14:20 PDT 2001 
State-Changed-Why:  
Ipkts seems to be incrementing ok on my -stable machine. 
Can the submitter confirm that the link was actually functional 
when the netstat -i was done ?  Opkts seems very low.... 


Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: brian 
Responsible-Changed-When: Wed May 23 08:14:20 PDT 2001 
Responsible-Changed-Why:  
I'll look after this 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27283 

From: Brian Somers <brian@Awfulhak.org>
To: "Bill O'Connell" <bill@springwoodsys.com>
Cc: brian@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG,
	"Josef L. Karthauser" <joe@tao.org.uk>,
	freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/27283: netstat -i missing IPv4 input packet count for tu 
Date: Thu, 24 May 2001 18:06:29 +0100

 Hmm, I think I know what the problem is.
 
 Recently, the network traffic counters were changed so that they 
 count things on a per-ip basis.  I'd guess that your tun interface 
 changed IP number and therefore lost all of the old packet counts.
 
 WRT the other interfaces, I can't say for sure.  Maybe Joe (cc'd) can 
 comment on this - he did the changes :)  Perhaps this is also due to 
 an IP number change....  I've just done some quick tests here, and it 
 looks as if just ifconfig'ing the interface with the same IP number 
 that it currently has will reset the traffic counts.  This doesn't 
 sound good...
 
 Comments Joe ?
 
 > Yes, the link was definitely functional. And yes, now that you
 > mention it, the IPv4 opkts -- as well as almost all of the IPv4
 > counts -- are too low. The only IPv4 count that could possibly be
 > accurate is sis1 opkts, but all of the link-layer counts look good.
 > 
 > As an aside, all of my other systems, from 3.2-RELEASE through
 > 4.2-STABLE, have the same count for the link-layer and IPv4 rows
 > under each column. Starting with 4.3, the code appears to have
 > changed in terms of how packets are classified. I see the same thing
 > on one of my 5.0-CURRENT boxes.
 
 -- 
 Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
       <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
 Don't _EVER_ lose your sense of humour !
 
 

From: "Bill O'Connell" <bill@springwoodsys.com>
To: Brian Somers <brian@Awfulhak.org>
Cc: freebsd-gnats-submit@FreeBSD.ORG,
	"Josef L. Karthauser" <joe@tao.org.uk>, freebsd-bugs@FreeBSD.ORG,
	brian@FreeBSD.ORG
Subject: Re: bin/27283: netstat -i missing IPv4 input packet count for tu
Date: Thu, 24 May 2001 22:02:08 -0400 (EDT)

 No, the IP address has not changed on any of the interfaces.
 And that wouldn't explain why ipkts is always zero for IPv4
 on the tun interface.
 
 The tun interface is used by pipsecd, by the way.
 
 Bill
 
 On 24-May-01 Brian Somers wrote:
 > Hmm, I think I know what the problem is.
 > 
 > Recently, the network traffic counters were changed so that they 
 > count things on a per-ip basis.  I'd guess that your tun interface 
 > changed IP number and therefore lost all of the old packet counts.
 > 
 > WRT the other interfaces, I can't say for sure.  Maybe Joe (cc'd) can 
 > comment on this - he did the changes :)  Perhaps this is also due to 
 > an IP number change....  I've just done some quick tests here, and it 
 > looks as if just ifconfig'ing the interface with the same IP number 
 > that it currently has will reset the traffic counts.  This doesn't 
 > sound good...
 > 
 > Comments Joe ?
 > 
 >> Yes, the link was definitely functional. And yes, now that you
 >> mention it, the IPv4 opkts -- as well as almost all of the IPv4
 >> counts -- are too low. The only IPv4 count that could possibly be
 >> accurate is sis1 opkts, but all of the link-layer counts look good.
 >> 
 >> As an aside, all of my other systems, from 3.2-RELEASE through
 >> 4.2-STABLE, have the same count for the link-layer and IPv4 rows
 >> under each column. Starting with 4.3, the code appears to have
 >> changed in terms of how packets are classified. I see the same thing
 >> on one of my 5.0-CURRENT boxes.
 > 
 > -- 
 > Brian <brian@Awfulhak.org>                        <brian@[uk.]FreeBSD.org>
 >       <http://www.Awfulhak.org>                   <brian@[uk.]OpenBSD.org>
 > Don't _EVER_ lose your sense of humour !
 > 
 > 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: brian 
State-Changed-When: Tue Jun 29 09:25:50 GMT 2004 
State-Changed-Why:  
After testing the current behaviour, I conclude that the netstat -i output 
is correct, and corresponds exactly to ``show ipcp'' from the ppp prompt. 

I would observe that when you ``close; open'' from the ppp prompt, ppp 
doesn't clear the interface counters, however because it modifies the 
inteface addresses (even if it gets the same one again when the interface 
comes up), the kernel counters are reset.  This behaviour was changed 
shortly before this bug was originally raised in 2001. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=27283 
>Unformatted:
