aboutsummaryrefslogtreecommitdiffstats
path: root/man7/tcp.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2008-11-21 16:24:05 -0500
committerMichael Kerrisk <mtk.manpages@gmail.com>2008-11-25 20:54:18 -0500
commit412a6fd9249f72ca0113960b6f60bdeba516c9ff (patch)
tree6874a3311cb4e8d1c229ba2a973e13de93f1ab16 /man7/tcp.7
parenta93868fd3bb1d4b58c9ca20e3d24498d27bf6b42 (diff)
downloadman-pages-412a6fd9249f72ca0113960b6f60bdeba516c9ff.tar.gz
tcp.7: srcfix: Join short source lines into single lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/tcp.7')
-rw-r--r--man7/tcp.7206
1 files changed, 69 insertions, 137 deletions
diff --git a/man7/tcp.7 b/man7/tcp.7
index b0f715c369..118f813b5d 100644
--- a/man7/tcp.7
+++ b/man7/tcp.7
@@ -46,29 +46,23 @@ To receive new incoming connections, first
the socket to a local address and port and then call
.BR listen (2)
to put the socket into the listening state.
-After that a new
-socket for each incoming connection can be accepted
-using
+After that a new socket for each incoming connection can be accepted using
.BR accept (2).
A socket which has had
.BR accept (2)
or
.BR connect (2)
-successfully called on it is fully specified and may
-transmit data.
-Data cannot be transmitted on listening or
-not yet connected sockets.
+successfully called on it is fully specified and may transmit data.
+Data cannot be transmitted on listening or not yet connected sockets.
Linux supports RFC\ 1323 TCP high performance
extensions.
These include Protection Against Wrapped
-Sequence Numbers (PAWS), Window Scaling and
-Timestamps.
+Sequence Numbers (PAWS), Window Scaling and Timestamps.
Window scaling allows the use
of large (> 64K) TCP windows in order to support links with high
latency or bandwidth.
-To make use of them, the send and
-receive buffer sizes must be increased.
+To make use of them, the send and receive buffer sizes must be increased.
They can be set globally with the
.I /proc/sys/net/ipv4/tcp_wmem
and
@@ -95,17 +89,15 @@ the buffer requested in the
.BR setsockopt (2)
call, and so a succeeding
.BR getsockopt (2)
-call will not return the same size of buffer as requested
-in the
+call will not return the same size of buffer as requested in the
.BR setsockopt (2)
call.
TCP uses the extra space for administrative purposes and internal
kernel structures, and the
-/proc
+.I /proc
file values reflect the
larger sizes compared to the actual TCP windows.
-On individual connections, the socket buffer size must be
-set prior to the
+On individual connections, the socket buffer size must be set prior to the
.BR listen (2)
or
.BR connect (2)
@@ -208,8 +200,7 @@ Enable this option
.I only
if you are really sure that the listening daemon
cannot be tuned to accept connections faster.
-Enabling this
-option can harm the clients of your server.
+Enabling this option can harm the clients of your server.
.TP
.IR tcp_adv_win_scale " (integer; default: 2; since Linux 2.4)"
.\" Since 2.4.0-test7
@@ -234,8 +225,7 @@ from scheduling and application latencies.
The
.I tcp_adv_win_scale
default value of 2 implies that the space
-used for the application buffer is one fourth that of the
-total.
+used for the application buffer is one fourth that of the total.
.TP
.IR tcp_allowed_congestion_control " (String; default: see text; since Linux 2.4.20)"
.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt
@@ -262,21 +252,18 @@ but not loaded.
.IR tcp_app_win " (integer; default: 31; since Linux 2.4)"
.\" Since 2.4.0-test7
This variable defines how many
-bytes of the TCP window are reserved for buffering
-overhead.
+bytes of the TCP window are reserved for buffering overhead.
A maximum of (\fIwindow/2^tcp_app_win\fP, mss) bytes in the window
are reserved for the application buffer.
-A value of 0
-implies that no amount is reserved.
+A value of 0 implies that no amount is reserved.
.\"
.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt
.TP
.IR tcp_base_mss " (Integer; default: 512; since Linux 2.6.17)
The initial value of
.I search_low
-to be used by the packetization layer
-Path MTU discovery (MTU probing).
+to be used by the packetization layer Path MTU discovery (MTU probing).
If MTU probing is enabled,
this is the initial MSS used by the connection.
.\"
@@ -289,10 +276,8 @@ fairness under large windows while offering both scalability and
bounded TCP-friendliness.
The protocol combines two schemes
called additive increase and binary search increase.
-When the
-congestion window is large, additive increase with a large
-increment ensures linear RTT fairness as well as good
-scalability.
+When the congestion window is large, additive increase with a large
+increment ensures linear RTT fairness as well as good scalability.
Under small congestion windows, binary search
increase provides TCP friendliness.
.\"
@@ -301,16 +286,13 @@ increase provides TCP friendliness.
.IR tcp_bic_low_window " (integer; default: 14; Linux 2.4.27/2.6.6 to 2.6.13)"
Sets the threshold window (in packets) where BIC TCP starts to
adjust the congestion window.
-Below this threshold BIC TCP behaves
-the same as the default TCP Reno.
+Below this threshold BIC TCP behaves the same as the default TCP Reno.
.\"
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
.TP
.IR tcp_bic_fast_convergence " (Boolean; default: enabled; Linux 2.4.27/2.6.6 to 2.6.13)"
-Forces BIC TCP to more quickly respond to changes in congestion
-window.
-Allows two flows sharing the same connection to converge
-more rapidly.
+Forces BIC TCP to more quickly respond to changes in congestion window.
+Allows two flows sharing the same connection to converge more rapidly.
.TP
.IR tcp_congestion_control " (String; default: enabled; since Linux 2.4.13)"
.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt
@@ -345,9 +327,8 @@ Enable TCP Forward Acknowledgement support.
.\" Since 2.1.53
This specifies how many seconds to wait for a final FIN packet before the
socket is forcibly closed.
-This is strictly a violation of
-the TCP specification, but required to prevent
-denial-of-service attacks.
+This is strictly a violation of the TCP specification,
+but required to prevent denial-of-service attacks.
In Linux 2.2, the default value was 180.
.\"
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
@@ -393,8 +374,7 @@ and slow-start threshold
after one RTT.
.IP 1
Very conservative response; not recommended because even
-though being valid, it interacts poorly with the rest of
-Linux TCP; halves
+though being valid, it interacts poorly with the rest of Linux TCP; halves
.I cwnd
and
.I ssthresh
@@ -449,16 +429,14 @@ changed would be a Beowulf compute cluster.
.\" Since 2.3.41
The maximum number of orphaned (not attached to any user file
handle) TCP sockets allowed in the system.
-When this number
-is exceeded, the orphaned connection is reset and a warning
-is printed.
+When this number is exceeded,
+the orphaned connection is reset and a warning is printed.
This limit exists only to prevent simple denial-of-service attacks.
Lowering this limit is not recommended.
Network conditions might require you to increase the number of
orphans allowed, but note that each orphan can eat up to ~64K
of unswappable memory.
-The default initial value is set
-equal to the kernel parameter NR_FILE.
+The default initial value is set equal to the kernel parameter NR_FILE.
This initial default is adjusted depending on the memory in the system.
.TP
.IR tcp_max_syn_backlog " (integer; default: see below; since Linux 2.2)"
@@ -482,8 +460,7 @@ recompiled.
.\" Since 2.3.41
The maximum number of sockets in TIME_WAIT state allowed in
the system.
-This limit exists only to prevent simple denial-of-service
-attacks.
+This limit exists only to prevent simple denial-of-service attacks.
The default value of NR_FILE*2 is adjusted
depending on the memory in the system.
If this number is
@@ -500,8 +477,7 @@ to match the size required by the path for full throughput.
.\" Since 2.4.0-test7
This is a vector of 3 integers: [low, pressure, high].
These bounds are used by TCP to track its memory usage.
-The
-defaults are calculated at boot time from the amount of
+The defaults are calculated at boot time from the amount of
available memory.
(TCP can only use
.I "low memory"
@@ -522,10 +498,8 @@ the
mark.
.I high
-- the maximum number of pages, globally, that TCP
-will allocate.
-This value overrides any other limits
-imposed by the kernel.
+- the maximum number of pages, globally, that TCP will allocate.
+This value overrides any other limits imposed by the kernel.
.TP
.IR tcp_mtu_probing " (integer; default: 0; since Linux 2.6.17)"
.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt
@@ -574,8 +548,7 @@ Try to send full-sized packets during retransmit.
.\" Since 2.1.43
The number of times TCP will attempt to retransmit a
packet on an established connection normally,
-without the extra effort of getting the network
-layers involved.
+without the extra effort of getting the network layers involved.
Once we exceed this number of
retransmits, we first have the network layer
update the route if possible before each new retransmit.
@@ -585,13 +558,11 @@ The default is the RFC specified minimum of 3.
.\" Since 2.1.43
The maximum number of times a TCP packet is retransmitted
in established state before giving up.
-The default
-value is 15, which corresponds to a duration of
+The default value is 15, which corresponds to a duration of
approximately between 13 to 30 minutes, depending
on the retransmission timeout.
The RFC\ 1122 specified
-minimum limit of 100 seconds is typically deemed too
-short.
+minimum limit of 100 seconds is typically deemed too short.
.TP
.IR tcp_rfc1337 " (Boolean; default: disabled; since Linux 2.2)"
.\" Since 2.1.90
@@ -603,14 +574,11 @@ of the TIME_WAIT period.
.TP
.IR tcp_rmem " (since Linux 2.4)"
.\" Since 2.4.0-test7
-This is a vector of 3 integers: [min, default,
-max].
-These parameters are used by TCP to regulate receive
-buffer sizes.
+This is a vector of 3 integers: [min, default, max].
+These parameters are used by TCP to regulate receive buffer sizes.
TCP dynamically adjusts the size of the
receive buffer from the defaults listed below, in the range
-of these values, depending on memory available
-in the system.
+of these values, depending on memory available in the system.
.RS
.TP 9
.I min
@@ -637,18 +605,15 @@ The default value is 87380
bytes, and is lowered to 43689 in low-memory systems.
If larger receive buffer sizes are desired, this value should
be increased (to affect all sockets).
-To employ large TCP
-windows, the
+To employ large TCP windows, the
.I net.ipv4.tcp_window_scaling
must be enabled (default).
.TP
.I max
-the maximum size of the receive buffer used by
-each TCP socket.
+the maximum size of the receive buffer used by each TCP socket.
This value does not override the global
.IR net.core.rmem_max .
-This is not used to limit the size of the receive buffer
-declared using
+This is not used to limit the size of the receive buffer declared using
.B SO_RCVBUF
on a socket.
The default value of 87380*2 bytes is lowered to 87380
@@ -663,8 +628,7 @@ Enable RFC\ 2018 TCP Selective Acknowledgements.
.\" The following is from 2.6.28-rc4: Documentation/networking/ip-sysctl.txt
If enabled, provide RFC 2861 behavior and time out the congestion
window after an idle period.
-An idle period is defined as
-the current RTO (retransmission timeout).
+An idle period is defined as the current RTO (retransmission timeout).
If disabled, the congestion window will not
be timed out after an idle period.
.TP
@@ -686,10 +650,8 @@ Enabling this option may lead to interoperability problems.
.\" Since 2.1.38
The maximum number of times initial SYNs for an active TCP
connection attempt will be retransmitted.
-This value should
-not be higher than 255.
-The default value is 5, which
-corresponds to approximately 180 seconds.
+This value should not be higher than 255.
+The default value is 5, which corresponds to approximately 180 seconds.
.TP
.IR tcp_synack_retries " (integer; default: 5; since Linux 2.2)"
.\" Since 2.1.38
@@ -702,19 +664,15 @@ This number should not be higher than 255.
Enable TCP syncookies.
The kernel must be compiled with
.BR CONFIG_SYN_COOKIES .
-Send out syncookies when the syn backlog queue of a socket
-overflows.
+Send out syncookies when the syn backlog queue of a socket overflows.
The syncookies feature attempts to protect a
socket from a SYN flood attack.
-This should be used as a
-last resort, if at all.
-This is a violation of the TCP
-protocol, and conflicts with other areas of TCP such as TCP
-extensions.
+This should be used as a last resort, if at all.
+This is a violation of the TCP protocol,
+and conflicts with other areas of TCP such as TCP extensions.
It can cause problems for clients and relays.
It is not recommended as a tuning mechanism for heavily
-loaded servers to help with overloaded or misconfigured
-conditions.
+loaded servers to help with overloaded or misconfigured conditions.
For recommended alternatives see
.IR tcp_max_syn_backlog ,
.IR tcp_synack_retries ,
@@ -744,8 +702,7 @@ with NAT (Network Address Translation).
.\" Since 2.4.19/2.5.43
Allow to reuse TIME_WAIT sockets for new connections when it is
safe from protocol viewpoint.
-It should not be changed without advice/request of technical
-experts.
+It should not be changed without advice/request of technical experts.
.\"
.\" The following is from 2.6.12: Documentation/networking/ip-sysctl.txt
.TP
@@ -754,9 +711,7 @@ experts.
Enable TCP Vegas congestion avoidance algorithm.
TCP Vegas is a sender-side only change to TCP that anticipates
the onset of congestion by estimating the bandwidth.
-TCP Vegas
-adjusts the sending rate by modifying the congestion
-window.
+TCP Vegas adjusts the sending rate by modifying the congestion window.
TCP Vegas should provide less packet loss, but it is
not as aggressive as TCP Reno.
.\"
@@ -765,11 +720,9 @@ not as aggressive as TCP Reno.
.IR tcp_westwood " (Boolean; default: disabled; Linux 2.4.26/2.6.3 to 2.6.13)"
Enable TCP Westwood+ congestion control algorithm.
TCP Westwood+ is a sender-side only modification of the TCP Reno
-protocol stack that optimizes the performance of TCP congestion
-control.
+protocol stack that optimizes the performance of TCP congestion control.
It is based on end-to-end bandwidth estimation to set
-congestion window and slow start threshold after a congestion
-episode.
+congestion window and slow start threshold after a congestion episode.
Using this estimation, TCP Westwood+ adaptively sets a
slow start threshold and a congestion window which takes into
account the bandwidth used at the time congestion is experienced.
@@ -783,10 +736,8 @@ This feature allows the use of a large window
(> 64K) on a TCP connection, should the other end support it.
Normally, the 16 bit window length field in the TCP header
limits the window size to less than 64K bytes.
-If larger
-windows are desired, applications can increase the size of
-their socket buffers and the window scaling option will be
-employed.
+If larger windows are desired, applications can increase the size of
+their socket buffers and the window scaling option will be employed.
If
.I tcp_window_scaling
is disabled, TCP will not negotiate the use of window
@@ -805,9 +756,7 @@ depending on memory available.
The default value is 4K bytes.
This value is used to ensure that in memory pressure mode,
allocations below this size will still succeed.
-This is not
-used to bound the size of the send buffer declared
-using
+This is not used to bound the size of the send buffer declared using
.B SO_SNDBUF
on a socket.
@@ -825,17 +774,14 @@ To employ large TCP windows, the
must be set to a non-zero value (default).
.I max
-- the maximum size of the send buffer used by
-each TCP socket.
+- the maximum size of the send buffer used by each TCP socket.
This value does not override the value in
.IR /proc/sys/net/core/wmem_max .
-This is not used to limit the size of the send buffer
-declared using
+This is not used to limit the size of the send buffer declared using
.B SO_SNDBUF
on a socket.
The default value is 128K bytes.
-It is lowered to 64K
-depending on the memory available in the system.
+It is lowered to 64K depending on the memory available in the system.
.TP
.IR tcp_workaround_signed_windows " (Boolean; default: disabled; since Linux 2.6.26)"
If enabled, assume that no receipt of a window-scaling option means that the
@@ -861,8 +807,7 @@ For more information see
.BR TCP_CORK " (since Linux 2.2)"
.\" precisely: since 2.1.127
If set, don't send out partial frames.
-All queued
-partial frames are sent when the option is cleared again.
+All queued partial frames are sent when the option is cleared again.
This is useful for prepending headers before calling
.BR sendfile (2),
or for throughput optimization.
@@ -870,22 +815,18 @@ As currently implemented, there is a 200 millisecond ceiling on the time
for which output is corked by
.BR TCP_CORK .
If this ceiling is reached, then queued data is automatically transmitted.
-This option can be
-combined with
+This option can be combined with
.B TCP_NODELAY
only since Linux 2.5.71.
-This option should not be used in code intended to be
-portable.
+This option should not be used in code intended to be portable.
.TP
.BR TCP_DEFER_ACCEPT " (since Linux 2.4)"
.\" Precisely: since 2.3.38
-Allows a listener to be awakened only when data arrives on
-the socket.
+Allows a listener to be awakened only when data arrives on the socket.
Takes an integer value (seconds), this can
bound the maximum number of attempts TCP will make to
complete the connection.
-This option should not be used in
-code intended to be portable.
+This option should not be used in code intended to be portable.
.TP
.BR TCP_INFO " (since Linux 2.4)"
Used to collect information about this socket.
@@ -912,8 +853,7 @@ This option should not be used in code intended to be portable.
.BR TCP_KEEPINTVL " (since Linux 2.4)"
.\" Precisely: since 2.3.18
The time (in seconds) between individual keepalive probes.
-This option should not be used in code intended to be
-portable.
+This option should not be used in code intended to be portable.
.TP
.BR TCP_LINGER2 " (since Linux 2.4)"
.\" Precisely: since 2.3.41
@@ -925,15 +865,13 @@ This is not to be confused with the
.BR socket (7)
level option
.BR SO_LINGER .
-This option should not be used in code intended to be
-portable.
+This option should not be used in code intended to be portable.
.TP
.B TCP_MAXSEG
.\" Present in Linux 1.0
The maximum segment size for outgoing TCP packets.
If this option is set before connection establishment, it also
-changes the MSS value announced to the other end in the
-initial packet.
+changes the MSS value announced to the other end in the initial packet.
Values greater than the (eventual) interface MTU have no effect.
TCP will also impose
its minimum and maximum bounds over the value provided.
@@ -990,8 +928,7 @@ portable.
Set the number of SYN retransmits that TCP should send before
aborting the attempt to connect.
It cannot exceed 255.
-This option should not be used in code intended to be
-portable.
+This option should not be used in code intended to be portable.
.TP
.BR TCP_WINDOW_CLAMP " (since Linux 2.4)"
.\" Precisely: since 2.3.41
@@ -1076,8 +1013,7 @@ level
socket option.
When this option is enabled, all incoming
errors are immediately passed to the user program.
-Use this
-option with care \(em it makes TCP less tolerant to routing
+Use this option with care \(em it makes TCP less tolerant to routing
changes and other normal network conditions.
.SH ERRORS
.TP
@@ -1092,8 +1028,7 @@ The other end closed the socket unexpectedly or a read is
executed on a shut down socket.
.TP
.B ETIMEDOUT
-The other end didn't acknowledge retransmitted data after
-some time.
+The other end didn't acknowledge retransmitted data after some time.
.PP
Any errors defined for
.BR ip (7)
@@ -1147,16 +1082,13 @@ IPv6 is not described.
.sp
RFC\ 793 for the TCP specification.
.br
-RFC\ 1122 for the TCP requirements and a description
-of the Nagle algorithm.
+RFC\ 1122 for the TCP requirements and a description of the Nagle algorithm.
.br
RFC\ 1323 for TCP timestamp and window scaling options.
.br
-RFC\ 1644 for a description of TIME_WAIT assassination
-hazards.
+RFC\ 1644 for a description of TIME_WAIT assassination hazards.
.br
-RFC\ 3168 for a description of Explicit Congestion
-Notification.
+RFC\ 3168 for a description of Explicit Congestion Notification.
.br
RFC\ 2581 for TCP congestion control algorithms.
.br