Check out my first novel, midnight's simulacra!
TCP: Difference between revisions
From dankwiki
m (1 revision) |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
== Portable APIs == | == Portable APIs == | ||
* TCP_NODELAY: Disable [[Nagle's algorithm]] (coalescing of small packets until an ACK is received or a retransmission triggered). See the [[Linux APIs#IPPROTO_TCP|Linux APIs]] page for interactions with TCP_CORK on that platform. | * TCP_NODELAY: Disable [[Nagle's algorithm]] (coalescing of small packets until an ACK is received or a retransmission triggered). See the [[Linux APIs#IPPROTO_TCP|Linux APIs]] page for interactions with TCP_CORK on that platform. | ||
==Offloading/Coalescing== | |||
LRO/TSO are safe to use on routers and bridges so long as all interfaces involved support the technique. | |||
===LRO=== | |||
Large receive offload. Cannot guarantee refragmentation, and thus ought not generally be used on bridges or routers. | |||
===GRO=== | |||
Generic receive offload. Generalizes LRO to guarantee possibility of refragmentation, but coalesces a proper subset of packets suitable for LRO. | |||
===TSO=== | |||
TCP segmentation offload, also known as TCP Large Send. | |||
===GSO=== | |||
Generic segmentation offload, introduced in Linux 2.6.18. Generalizes TSO to guarantee possibility of refragmentation. | |||
==Tuning== | |||
===TCP auto-tuning on Linux=== | |||
* netdev 2009-03-11, "[http://patchwork.ozlabs.org/patch/24296/ TCP rx window autotuning harmful at LAN context]" | |||
* The Pittsburgh Supercomputing Center's [http://www.psc.edu/networking/projects/tcptune/#Linux Linux TCP notes] | |||
===TCP auto-tuning on FreeBSD=== | |||
* Finally introduced in [FreeBSD 7.2] by [http://people.freebsd.org/~andre/ Andre Oppermann]: | |||
<pre>With TCP send buffer auto scaling and the default values below it supports 20Mbit/s at 100ms and 10Mbit/s at 200ms. Both read and write buffer are auto-sized.</pre> | |||
== See also == | == See also == | ||
* [[Linux APIs#IPPROTO_TCP|Linux's]] TCP socket options | * [[Linux APIs#IPPROTO_TCP|Linux's]] TCP socket options | ||
* [[FreeBSD APIs#IPPROTO_TCP|FreeBSD's]] TCP socket options | * [[FreeBSD APIs#IPPROTO_TCP|FreeBSD's]] TCP socket options | ||
* [http://linuxgazette.net/135/pfeiffer.html TCP and Linux' Pluggable Congestion Control Algorithms], a 2007 Linux Gazette article by René Pfeiffer | |||
* [http://thread.gmane.org/gmane.linux.network/114003 'net: Generic Receive Offload], Herbert Xu 2008-12-12 linux-net post | |||
* [http://www.linuxfoundation.org/collaborate/workgroups/networking/gso GSO], The Linux Foundation | |||
* [http://kerneltrap.org/node/397 Linux: TCP Segmentation Offload], KernelTrap 2002-09-03 | |||
[[CATEGORY: Networking]] |
Latest revision as of 10:01, 12 July 2011
- http://articles.techrepublic.com.com/5100-10878_11-1050878.html -- "TCP/IP options for high-performance data transmission"
- http://www.ussg.iu.edu/hypermail/linux/kernel/0102.0/0943.html -- LKML thread, "TCP_NOPUSH on FreeBSD, TCP_CORK on Linux"
- http://www.irbs.net/internet/postfix/0707/1097.html -- postfix thread, "dkim-milter signing terribly slow with Postfix, but not with sendmail"
- This becomes: "TCP_NODELAY, TCP_CORK, TCP_NOPUSH, etc (was: dkim-milter signing terribly slow...)"
Portable APIs
- TCP_NODELAY: Disable Nagle's algorithm (coalescing of small packets until an ACK is received or a retransmission triggered). See the Linux APIs page for interactions with TCP_CORK on that platform.
Offloading/Coalescing
LRO/TSO are safe to use on routers and bridges so long as all interfaces involved support the technique.
LRO
Large receive offload. Cannot guarantee refragmentation, and thus ought not generally be used on bridges or routers.
GRO
Generic receive offload. Generalizes LRO to guarantee possibility of refragmentation, but coalesces a proper subset of packets suitable for LRO.
TSO
TCP segmentation offload, also known as TCP Large Send.
GSO
Generic segmentation offload, introduced in Linux 2.6.18. Generalizes TSO to guarantee possibility of refragmentation.
Tuning
TCP auto-tuning on Linux
- netdev 2009-03-11, "TCP rx window autotuning harmful at LAN context"
- The Pittsburgh Supercomputing Center's Linux TCP notes
TCP auto-tuning on FreeBSD
- Finally introduced in [FreeBSD 7.2] by Andre Oppermann:
With TCP send buffer auto scaling and the default values below it supports 20Mbit/s at 100ms and 10Mbit/s at 200ms. Both read and write buffer are auto-sized.
See also
- Linux's TCP socket options
- FreeBSD's TCP socket options
- TCP and Linux' Pluggable Congestion Control Algorithms, a 2007 Linux Gazette article by René Pfeiffer
- 'net: Generic Receive Offload, Herbert Xu 2008-12-12 linux-net post
- GSO, The Linux Foundation
- Linux: TCP Segmentation Offload, KernelTrap 2002-09-03