All of lore.kernel.org
 help / color / mirror / Atom feed
* /proc/net/tcp documentation
@ 2004-09-14 17:10 Arnout Engelen
  2004-09-14 19:47 ` Willy Tarreau
  0 siblings, 1 reply; 2+ messages in thread
From: Arnout Engelen @ 2004-09-14 17:10 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

Hi,

I noticed there doesn't seem to be any documentation for /proc/net/tcp,
so i whipped up the attached description. 

Maybe someone could add this to /Documentation/networking? I wrote it
for 2.4.26, but the code doesn't seem to have changed relevantly since
then.


(please cc me in replies as i won't be constantly monitoring the list)

Kind regards,

-- 
Arnout Engelen <arnouten@bzzt.net>

  "If it sounds good, it /is/ good."
          -- Duke Ellington

[-- Attachment #2: procnettcp --]
[-- Type: text/plain, Size: 2518 bytes --]

/proc/net/tcp and /proc/net/tcp6

These /proc interfaces provide information about currently active TCP 
connections, and are implemented by tcp_get_info() in net/ipv4/tcp_ipv4.c and
tcp6_get_info() in net/ipv6/tcp_ipv6.c, respectively.

It will first list all listening TCP sockets, and next list all established
TCP connections. A typical entry of /proc/net/tcp would look like this (split 
up into 3 parts because of the length of the line):

   46: 010310AC:9C4C 030310AC:1770 01 
   |      |      |      |      |   |--> connection state
   |      |      |      |      |------> remote TCP port number
   |      |      |      |-------------> remote IPv4 address
   |      |      |--------------------> local TCP port number
   |      |---------------------------> local IPv4 address
   |----------------------------------> number of entry

   00000150:00000000 01:00000019 00000000  
      |        |     |     |       |--> number of unrecovered RTO timeouts
      |        |     |     |----------> number of jiffies until timer expires
      |        |     |----------------> timer_active (see below)
      |        |----------------------> receive-queue
      |-------------------------------> transmit-queue

   1000        0 54165785 4 cd1e6040 25 4 27 3 -1
    |          |    |     |    |     |  | |  | |--> slow start size threshold, 
    |          |    |     |    |     |  | |  |      or -1 if the treshold
    |          |    |     |    |     |  | |  |      is >= 0xFFFF
    |          |    |     |    |     |  | |  |----> sending congestion window
    |          |    |     |    |     |  | |-------> (ack.quick<<1)|ack.pingpong
    |          |    |     |    |     |  |---------> Predicted tick of soft clock
    |          |    |     |    |     |              (delayed ACK control data)
    |          |    |     |    |     |------------> retransmit timeout
    |          |    |     |    |------------------> location of socket in memory
    |          |    |     |-----------------------> socket reference count
    |          |    |-----------------------------> inode
    |          |----------------------------------> unanswered 0-window probes
    |---------------------------------------------> uid

timer_active:
  0  no timer is pending
  1  retransmit-timer is pending
  2  another timer (e.g. delayed ack or keepalive) is pending
  3  this is a socket in TIME_WAIT state. Not all field will contain data.
  4  zero window probe timer is pending

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: /proc/net/tcp documentation
  2004-09-14 17:10 /proc/net/tcp documentation Arnout Engelen
@ 2004-09-14 19:47 ` Willy Tarreau
  0 siblings, 0 replies; 2+ messages in thread
From: Willy Tarreau @ 2004-09-14 19:47 UTC (permalink / raw)
  To: Arnout Engelen; +Cc: linux-kernel

Hi,

This is a useful document.

Would you mind resending it to maintainers (and here) as a patch against
recent kernels (2.4 and 2.6), so that they may consider its inclusion ?
For example, put it in Documentation/networking/proc_net_tcp, or with
the rest of /proc description.

Thanks,
Willy

On Tue, Sep 14, 2004 at 07:10:57PM +0200, Arnout Engelen wrote:
> /proc/net/tcp and /proc/net/tcp6
> 
> These /proc interfaces provide information about currently active TCP 
> connections, and are implemented by tcp_get_info() in net/ipv4/tcp_ipv4.c and
> tcp6_get_info() in net/ipv6/tcp_ipv6.c, respectively.
> 
> It will first list all listening TCP sockets, and next list all established
> TCP connections. A typical entry of /proc/net/tcp would look like this (split 
> up into 3 parts because of the length of the line):
> 
>    46: 010310AC:9C4C 030310AC:1770 01 
>    |      |      |      |      |   |--> connection state
>    |      |      |      |      |------> remote TCP port number
>    |      |      |      |-------------> remote IPv4 address
>    |      |      |--------------------> local TCP port number
>    |      |---------------------------> local IPv4 address
>    |----------------------------------> number of entry
> 
>    00000150:00000000 01:00000019 00000000  
>       |        |     |     |       |--> number of unrecovered RTO timeouts
>       |        |     |     |----------> number of jiffies until timer expires
>       |        |     |----------------> timer_active (see below)
>       |        |----------------------> receive-queue
>       |-------------------------------> transmit-queue
> 
>    1000        0 54165785 4 cd1e6040 25 4 27 3 -1
>     |          |    |     |    |     |  | |  | |--> slow start size threshold, 
>     |          |    |     |    |     |  | |  |      or -1 if the treshold
>     |          |    |     |    |     |  | |  |      is >= 0xFFFF
>     |          |    |     |    |     |  | |  |----> sending congestion window
>     |          |    |     |    |     |  | |-------> (ack.quick<<1)|ack.pingpong
>     |          |    |     |    |     |  |---------> Predicted tick of soft clock
>     |          |    |     |    |     |              (delayed ACK control data)
>     |          |    |     |    |     |------------> retransmit timeout
>     |          |    |     |    |------------------> location of socket in memory
>     |          |    |     |-----------------------> socket reference count
>     |          |    |-----------------------------> inode
>     |          |----------------------------------> unanswered 0-window probes
>     |---------------------------------------------> uid
> 
> timer_active:
>   0  no timer is pending
>   1  retransmit-timer is pending
>   2  another timer (e.g. delayed ack or keepalive) is pending
>   3  this is a socket in TIME_WAIT state. Not all field will contain data.
>   4  zero window probe timer is pending


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-14 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-14 17:10 /proc/net/tcp documentation Arnout Engelen
2004-09-14 19:47 ` Willy Tarreau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.