Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | ============================================ |
| 4 | The proc/net/tcp and proc/net/tcp6 variables |
| 5 | ============================================ |
| 6 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | This document describes the interfaces /proc/net/tcp and /proc/net/tcp6. |
Jean Delvare | d603d0ab | 2007-10-15 12:58:35 -0700 | [diff] [blame] | 8 | Note that these interfaces are deprecated in favor of tcp_diag. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 10 | These /proc interfaces provide information about currently active TCP |
Jean Delvare | d603d0ab | 2007-10-15 12:58:35 -0700 | [diff] [blame] | 11 | connections, and are implemented by tcp4_seq_show() in net/ipv4/tcp_ipv4.c |
| 12 | and tcp6_seq_show() in net/ipv6/tcp_ipv6.c, respectively. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
| 14 | It will first list all listening TCP sockets, and next list all established |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 15 | TCP connections. A typical entry of /proc/net/tcp would look like this (split |
| 16 | up into 3 parts because of the length of the line):: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 18 | 46: 010310AC:9C4C 030310AC:1770 01 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | | | | | | |--> connection state |
| 20 | | | | | |------> remote TCP port number |
| 21 | | | | |-------------> remote IPv4 address |
| 22 | | | |--------------------> local TCP port number |
| 23 | | |---------------------------> local IPv4 address |
| 24 | |----------------------------------> number of entry |
| 25 | |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 26 | 00000150:00000000 01:00000019 00000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | | | | | |--> number of unrecovered RTO timeouts |
| 28 | | | | |----------> number of jiffies until timer expires |
| 29 | | | |----------------> timer_active (see below) |
| 30 | | |----------------------> receive-queue |
| 31 | |-------------------------------> transmit-queue |
| 32 | |
| 33 | 1000 0 54165785 4 cd1e6040 25 4 27 3 -1 |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 34 | | | | | | | | | | |--> slow start size threshold, |
Matt LaPlante | fa00e7e | 2006-11-30 04:55:36 +0100 | [diff] [blame] | 35 | | | | | | | | | | or -1 if the threshold |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | | | | | | | | | | is >= 0xFFFF |
| 37 | | | | | | | | | |----> sending congestion window |
| 38 | | | | | | | | |-------> (ack.quick<<1)|ack.pingpong |
| 39 | | | | | | | |---------> Predicted tick of soft clock |
| 40 | | | | | | | (delayed ACK control data) |
| 41 | | | | | | |------------> retransmit timeout |
| 42 | | | | | |------------------> location of socket in memory |
| 43 | | | | |-----------------------> socket reference count |
| 44 | | | |-----------------------------> inode |
| 45 | | |----------------------------------> unanswered 0-window probes |
| 46 | |---------------------------------------------> uid |
| 47 | |
| 48 | timer_active: |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 49 | |
| 50 | == ================================================================ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | 0 no timer is pending |
| 52 | 1 retransmit-timer is pending |
| 53 | 2 another timer (e.g. delayed ack or keepalive) is pending |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 54 | 3 this is a socket in TIME_WAIT state. Not all fields will contain |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | data (or even exist) |
| 56 | 4 zero window probe timer is pending |
Mauro Carvalho Chehab | 8326190 | 2020-04-30 18:04:16 +0200 | [diff] [blame] | 57 | == ================================================================ |