proc_net_tcp.rst 2.8 KB

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