xref: /OK3568_Linux_fs/kernel/Documentation/networking/proc_net_tcp.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun============================================
4*4882a593SmuzhiyunThe proc/net/tcp and proc/net/tcp6 variables
5*4882a593Smuzhiyun============================================
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunThis document describes the interfaces /proc/net/tcp and /proc/net/tcp6.
8*4882a593SmuzhiyunNote that these interfaces are deprecated in favor of tcp_diag.
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunThese /proc interfaces provide information about currently active TCP
11*4882a593Smuzhiyunconnections, and are implemented by tcp4_seq_show() in net/ipv4/tcp_ipv4.c
12*4882a593Smuzhiyunand tcp6_seq_show() in net/ipv6/tcp_ipv6.c, respectively.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunIt will first list all listening TCP sockets, and next list all established
15*4882a593SmuzhiyunTCP connections. A typical entry of /proc/net/tcp would look like this (split
16*4882a593Smuzhiyunup into 3 parts because of the length of the line)::
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun   46: 010310AC:9C4C 030310AC:1770 01
19*4882a593Smuzhiyun   |      |      |      |      |   |--> connection state
20*4882a593Smuzhiyun   |      |      |      |      |------> remote TCP port number
21*4882a593Smuzhiyun   |      |      |      |-------------> remote IPv4 address
22*4882a593Smuzhiyun   |      |      |--------------------> local TCP port number
23*4882a593Smuzhiyun   |      |---------------------------> local IPv4 address
24*4882a593Smuzhiyun   |----------------------------------> number of entry
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun   00000150:00000000 01:00000019 00000000
27*4882a593Smuzhiyun      |        |     |     |       |--> number of unrecovered RTO timeouts
28*4882a593Smuzhiyun      |        |     |     |----------> number of jiffies until timer expires
29*4882a593Smuzhiyun      |        |     |----------------> timer_active (see below)
30*4882a593Smuzhiyun      |        |----------------------> receive-queue
31*4882a593Smuzhiyun      |-------------------------------> transmit-queue
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun   1000        0 54165785 4 cd1e6040 25 4 27 3 -1
34*4882a593Smuzhiyun    |          |    |     |    |     |  | |  | |--> slow start size threshold,
35*4882a593Smuzhiyun    |          |    |     |    |     |  | |  |      or -1 if the threshold
36*4882a593Smuzhiyun    |          |    |     |    |     |  | |  |      is >= 0xFFFF
37*4882a593Smuzhiyun    |          |    |     |    |     |  | |  |----> sending congestion window
38*4882a593Smuzhiyun    |          |    |     |    |     |  | |-------> (ack.quick<<1)|ack.pingpong
39*4882a593Smuzhiyun    |          |    |     |    |     |  |---------> Predicted tick of soft clock
40*4882a593Smuzhiyun    |          |    |     |    |     |              (delayed ACK control data)
41*4882a593Smuzhiyun    |          |    |     |    |     |------------> retransmit timeout
42*4882a593Smuzhiyun    |          |    |     |    |------------------> location of socket in memory
43*4882a593Smuzhiyun    |          |    |     |-----------------------> socket reference count
44*4882a593Smuzhiyun    |          |    |-----------------------------> inode
45*4882a593Smuzhiyun    |          |----------------------------------> unanswered 0-window probes
46*4882a593Smuzhiyun    |---------------------------------------------> uid
47*4882a593Smuzhiyun
48*4882a593Smuzhiyuntimer_active:
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun ==  ================================================================
51*4882a593Smuzhiyun  0  no timer is pending
52*4882a593Smuzhiyun  1  retransmit-timer is pending
53*4882a593Smuzhiyun  2  another timer (e.g. delayed ack or keepalive) is pending
54*4882a593Smuzhiyun  3  this is a socket in TIME_WAIT state. Not all fields will contain
55*4882a593Smuzhiyun     data (or even exist)
56*4882a593Smuzhiyun  4  zero window probe timer is pending
57*4882a593Smuzhiyun ==  ================================================================
58