Re: "netstat o": networking timer interpretation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-07-14 at 10:45 -0700, Robinson Tiemuqinke wrote:

>  Anyone can shed a light on the output of "netstat
> -o"? the manual of netstat(8) says the following:
> 
>    -o, --timers
>        Include information related to networking
> timers.
> 
> And the output is a three values tuple like
> (0.19/0/0). Full output is attached below:
> 
> Active Internet connections (w/o servers)
> Proto Recv-Q Send-Q Local Address              Foreign Address             State       Timer
> tcp        0      0 client.foo.com:914    mainserver.foo.com:798          TIME_WAIT   timewait (57.51/0/0)
> tcp        0      0 client.foo.com:42593  mainserver.foo.com:sunrpc       TIME_WAIT   timewait (59.97/0/0)
> tcp        0    720 client.foo.com:ssh    server1.foo.com:49333           ESTABLISHED on (0.19/0/0)

I presume you can see the difference between adding the -o option and
not (as below):

[tim@localhost ~]$ netstat -nt
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 192.168.1.4:49059           66.102.7.99:80              ESTABLISHED
tcp        0      0 192.168.1.4:47080           192.168.1.2:80              TIME_WAIT
tcp        0      0 192.168.1.2:2049            192.168.1.4:1023            ESTABLISHED
tcp        0      0 ::ffff:192.168.1.2:22       ::ffff:192.168.1.4:48309    ESTABLISHED
tcp        0      0 ::ffff:192.168.1.2:143      ::ffff:192.168.1.4:55733    ESTABLISHED

[tim@localhost ~]$ netstat -nto
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       Timer
tcp        0      0 192.168.1.4:49059           66.102.7.99:80              ESTABLISHED off (0.00/0/0)
tcp        0      0 192.168.1.4:47080           192.168.1.2:80              TIME_WAIT   timewait (51.53/0/0)
tcp        0      0 192.168.1.2:2049            192.168.1.4:1023            ESTABLISHED off (0.00/0/0)
tcp        0      0 ::ffff:192.168.1.2:22       ::ffff:192.168.1.4:48309    ESTABLISHED keepalive (6499.95/0/0)
tcp        0      0 ::ffff:192.168.1.2:143      ::ffff:192.168.1.4:55733    ESTABLISHED keepalive (4374.99/0/0)

It's showing that you've got a connection that has a certain amount of
time left on it (it's going to linger for a while), and how much that
time is.  Certain connections are persistent, and will be maintained so
long as there is some activity on them, with the timer counting down the
waiting period (e.g. the keepalive ones to my SSH and IMAP server).
Some transient ones will drop off a few moments after they've been
finished with (the timewait ones to my webserver, where it's waiting; or
"off" ones to the google webserver where it's over and done with and
will disconnect soon).

If you issue the command a few times, you can see the counter
decrementing.  You should be able to work out that it's counting in
seconds.

-- 
(Currently running FC4, occasionally trying FC5.)

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux