Knowledge (XXG)

TCP tuning

Source 📝

79: 675:, i.e., 5 Gbit of unacknowledged data in flight. Despite having much lower latencies than satellite links, even terrestrial fiber links can have very high BDPs because their link capacity is so large. Operating systems and protocols designed as recently as a few years ago when networks were slower were tuned for BDPs of orders of magnitude smaller, with implications for limited achievable performance. 141: 38: 1003:(RFC 1323) play a double role: they avoid ambiguities due to the 32-bit sequence number field wrapping around, and they allow more precise RTT estimation in the presence of multiple losses per RTT. With those improvements, it becomes reasonable to increase the TCP window beyond 64 kB, which can be done using the 697:
Buffering is used throughout high performance network systems to handle delays in the system. In general, buffer size will need to be scaled proportionally to the amount of data "in flight" at any time. For very high performance applications that are not sensitive to network delays, it is possible to
855:
allocate the same amount of memory as the receive side for good performance. That is because, even after data has been sent on the network, the sending side must hold it in memory until it has been acknowledged as successfully received, just in case it would have to be retransmitted. If the receiver
706:
Maximum achievable throughput for a single TCP connection is determined by different factors. One trivial limitation is the maximum bandwidth of the slowest link in the path. But there are also other, less obvious limits for TCP throughput. Bit errors can create a limitation for the connection as
977: 756:
can limit throughput. Because TCP transmits data up to the window size before waiting for the acknowledgements, the full bandwidth of the network may not always get used. The limitation caused by window size can be calculated as follows:
856:
is far away, acknowledgments will take a long time to arrive. If the send memory is small, it can saturate and block emission. A simple computation gives the same optimal send memory size as for the receive memory size given above.
840: 847:
At any given time, the window advertised by the receive side of TCP corresponds to the amount of free receive memory it has allocated for this connection. Otherwise it would risk dropping received packets due to lack of space.
698:
interpose large end to end buffering delays by putting in intermediate data storage points in an end to end system, and then to use automated and scheduled non-real-time data transfers to get the data to their final endpoints.
1016:
option (SACK, RFC 2018) allows a TCP receiver to precisely inform the TCP sender about which segments have been lost. This increases performance on high-RTT links, when multiple losses per window are possible.
636:
networks. Well-tuned networks can perform up to 10 times faster in some cases. However, blindly following instructions without understanding their real consequences can hurt performance as well.
877: 604: 762: 364: 868:
occurs in the network, an additional limit is imposed on the connection. In the case of light to moderate packet loss when the TCP rate is limited by the
1242: 1190:- Forward RTO-Recovery (F-RTO): An Algorithm for Detecting Spurious Retransmission Timeouts with TCP and the Stream Control Transmission Protocol (SCTP) 694:- 1) bytes, which was adequate for slow links or links with small RTTs. Larger buffers are required by the high performance options described below. 656:
necessary to fill a TCP "path", i.e. it is equal to the maximum number of simultaneous bits in transit between the transmitter and the receiver.
996:
A number of extensions have been made to TCP over the years to increase its performance over fast high-RTT links ("long fat networks" or LFNs).
1270: 988:
is the probability of packet loss. If packet loss is so rare that the TCP window becomes regularly fully extended, this formula doesn't apply.
597: 324: 454: 449: 419: 100: 279: 869: 526: 469: 394: 536: 506: 242: 224: 122: 65: 1111: 1066: 590: 521: 314: 738: 742: 339: 329: 162: 1248: 1221: 1043:
client should be able to transmit a packet every 20 ms. The estimated maximum number of packets in transit would then be:
625: 459: 439: 389: 205: 1275: 621: 379: 374: 369: 177: 556: 516: 384: 158: 51: 93: 87: 1199: 184: 151: 687: 104: 972:{\displaystyle \mathrm {Throughput} \leq {\frac {\mathrm {MSS} }{\mathrm {RTT} {\sqrt {P_{\mathrm {loss} }}}}}} 409: 349: 1039:
having a speed of 20 Mbit/s and an average packet size of 750 byte. How large should the IP queue be? A
716: 660: 659:
High performance networks have very large BDPs. To give a practical example, two nodes communicating over a
649: 576: 566: 359: 274: 258: 191: 737:
can accept without acknowledging the sender. If the sender has not received acknowledgement for the first
444: 294: 664: 633: 629: 571: 344: 173: 354: 726: 1020: 561: 289: 1231: 1213: 746: 720: 489: 265: 1024: 430: 57: 198: 1005: 835:{\displaystyle \mathrm {Throughput} \leq {\frac {\mathrm {RWIN} }{\mathrm {RTT} }}\,\!} 480: 1193: 1119: 1264: 1217: 1040: 753: 741:
it sent, it will stop and wait and if this wait exceeds a certain limit, it may even
1254: 1036: 399: 844:
where RWIN is the TCP Receive Window and RTT is the round-trip time for the path.
652:(BDP) is a term primarily used in conjunction with TCP to refer to the number of 1187: 1180: 1173: 1166: 1159: 1152: 1145: 1061: 865: 140: 1183:- A Conservative Selective Acknowledgment-based Loss Recovery Algorithm for TCP 547: 17: 1035:
The default IP queue length is 1000, which is generally too large. Imagine a
1236: 872:, the limit can be calculated according to the formula (Mathis, et al.): 734: 691: 27:
Techniques to increase throughput over the transmission control protocol
668: 510: 404: 303: 283: 1176:- An Extension to the Selective Acknowledgment (SACK) Option for TCP 1112:"The Macroscopic Behavior of the TCP Congestion Avoidance Algorithm" 1227: 1209: 653: 531: 309: 1169:- Enhancing TCP Over Satellite Channels using Standard Mechanisms 672: 499: 494: 464: 414: 334: 299: 667:(or round-trip time, RTT) of 0.5 seconds and a bandwidth of 10 1086: 319: 134: 72: 31: 1027:, increasing the performance in the presence of packet loss. 1162:- The NewReno Modification to TCP's Fast Recovery Algorithm 1204: 1046:
Estimated buffer size = 20000000 * 0,020 / 8 / 750 = 66
880: 765: 165:. Unsourced material may be challenged and removed. 1255:Pittsburgh Supercomputing Center TCP tuning guide 971: 834: 733:(TCP Receive Window) is the amount of data that a 831: 1245:, Microsoft Windows Server Performance Team Blog 752:Even if there is no packet loss in the network, 1200:The Cable Guy: TCP Receive Window Auto-Tuning 598: 8: 66:Learn how and when to remove these messages 981:where MSS is the maximum segment size and 683:The original TCP configurations supported 605: 591: 254: 948: 947: 941: 930: 918: 916: 881: 879: 830: 817: 803: 801: 766: 764: 243:Learn how and when to remove this message 225:Learn how and when to remove this message 123:Learn how and when to remove this message 1228:Information on 'Tweaking' your TCP stack 86:This article includes a list of general 1224:performance parameters in the registry. 1078: 1052:ifconfig wlan0 mtu 1492 txqueuelen 100 546: 479: 429: 264: 257: 1155:- TCP Selective Acknowledgment Options 1148:- TCP Extensions for High Performance 7: 1243:NTTTCP Network Performance Test Tool 1087:"High Performance SSH/SCP - HPN-SSH" 745:. This is how TCP achieves reliable 163:adding citations to reliable sources 1249:Best Practices for TCP Optimization 958: 955: 952: 949: 937: 934: 931: 925: 922: 919: 909: 906: 903: 900: 897: 894: 891: 888: 885: 882: 824: 821: 818: 813: 810: 807: 804: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 640:Network and system characteristics 92:it lacks sufficient corresponding 25: 1205:The Web100 Data Bandwidth Testing 47:This article has multiple issues. 1067:Explicit Congestion Notification 1049:A better queue length would be: 992:TCP options for high performance 139: 77: 36: 1023:avoids the need for in-network 150:needs additional citations for 55:or discuss these issues on the 870:congestion avoidance algorithm 1: 1271:Transmission Control Protocol 645:Bandwidth-delay product (BDP) 626:Transmission Control Protocol 628:(TCP) connections over high- 622:network congestion avoidance 671:can have up to 0.5×10 1292: 1220:) which can quickly alter 714: 1014:selective acknowledgment 851:The sending side should 1031:Tuning slow connections 717:TCP window scale option 685:TCP receive window size 661:geostationary satellite 650:Bandwidth-delay product 259:Internet protocol suite 107:more precise citations. 973: 836: 620:techniques adjust the 974: 837: 665:round-trip delay time 878: 763: 690:of up to 65,535 (64 159:improve this article 1276:Network performance 1009:option (RFC 1323). 727:computer networking 1037:Wi-Fi base station 1021:Path MTU Discovery 969: 832: 1232:Broadband Reports 1214:Microsoft Windows 967: 964: 828: 747:data transmission 721:Congestion window 615: 614: 266:Application layer 253: 252: 245: 235: 234: 227: 209: 133: 132: 125: 70: 16:(Redirected from 1283: 1239:, speedguide.net 1212:- a utility for 1194:TCP Tuning Guide 1132: 1131: 1129: 1127: 1118:. Archived from 1108: 1102: 1101: 1099: 1097: 1083: 978: 976: 975: 970: 968: 966: 965: 963: 962: 961: 942: 940: 928: 917: 912: 841: 839: 838: 833: 829: 827: 816: 802: 797: 702:TCP speed limits 607: 600: 593: 255: 248: 241: 230: 223: 219: 216: 210: 208: 167: 143: 135: 128: 121: 117: 114: 108: 103:this article by 94:inline citations 81: 80: 73: 62: 40: 39: 32: 21: 1291: 1290: 1286: 1285: 1284: 1282: 1281: 1280: 1261: 1260: 1237:TCP/IP Analyzer 1141: 1136: 1135: 1125: 1123: 1122:on May 11, 2012 1110: 1109: 1105: 1095: 1093: 1085: 1084: 1080: 1075: 1058: 1053: 1047: 1033: 994: 987: 943: 929: 876: 875: 862: 761: 760: 723: 713: 704: 681: 647: 642: 611: 431:Transport layer 249: 238: 237: 236: 231: 220: 214: 211: 168: 166: 156: 144: 129: 118: 112: 109: 99:Please help to 98: 82: 78: 41: 37: 28: 23: 22: 15: 12: 11: 5: 1289: 1287: 1279: 1278: 1273: 1263: 1262: 1259: 1258: 1252: 1246: 1240: 1234: 1225: 1207: 1202: 1197: 1191: 1184: 1177: 1170: 1163: 1156: 1149: 1140: 1139:External links 1137: 1134: 1133: 1103: 1077: 1076: 1074: 1071: 1070: 1069: 1064: 1057: 1054: 1051: 1045: 1032: 1029: 1006:window scaling 993: 990: 985: 960: 957: 954: 951: 946: 939: 936: 933: 927: 924: 921: 915: 911: 908: 905: 902: 899: 896: 893: 890: 887: 884: 861: 858: 826: 823: 820: 815: 812: 809: 806: 800: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 712: 709: 703: 700: 680: 677: 646: 643: 641: 638: 624:parameters of 613: 612: 610: 609: 602: 595: 587: 584: 583: 582: 581: 574: 569: 564: 559: 551: 550: 544: 543: 542: 541: 534: 529: 524: 519: 514: 504: 503: 502: 497: 484: 483: 481:Internet layer 477: 476: 475: 474: 467: 462: 457: 452: 447: 442: 434: 433: 427: 426: 425: 424: 417: 412: 407: 402: 397: 392: 387: 382: 377: 372: 367: 362: 357: 352: 347: 342: 337: 332: 327: 322: 317: 312: 307: 297: 292: 287: 277: 269: 268: 262: 261: 251: 250: 233: 232: 147: 145: 138: 131: 130: 85: 83: 76: 71: 45: 44: 42: 35: 26: 24: 18:Receive window 14: 13: 10: 9: 6: 4: 3: 2: 1288: 1277: 1274: 1272: 1269: 1268: 1266: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1233: 1229: 1226: 1223: 1219: 1215: 1211: 1208: 1206: 1203: 1201: 1198: 1195: 1192: 1189: 1185: 1182: 1178: 1175: 1171: 1168: 1164: 1161: 1157: 1154: 1150: 1147: 1143: 1142: 1138: 1121: 1117: 1113: 1107: 1104: 1092: 1088: 1082: 1079: 1072: 1068: 1065: 1063: 1060: 1059: 1055: 1050: 1044: 1042: 1041:voice over IP 1038: 1030: 1028: 1026: 1025:fragmentation 1022: 1018: 1015: 1010: 1008: 1007: 1002: 997: 991: 989: 984: 979: 944: 913: 873: 871: 867: 859: 857: 854: 849: 845: 842: 798: 758: 755: 750: 748: 744: 740: 736: 732: 728: 722: 718: 710: 708: 707:well as RTT. 701: 699: 695: 693: 689: 686: 678: 676: 674: 670: 666: 662: 657: 655: 651: 644: 639: 637: 635: 631: 627: 623: 619: 608: 603: 601: 596: 594: 589: 588: 586: 585: 580: 579: 575: 573: 570: 568: 565: 563: 560: 558: 555: 554: 553: 552: 549: 545: 540: 539: 535: 533: 530: 528: 525: 523: 520: 518: 515: 512: 508: 505: 501: 498: 496: 493: 492: 491: 488: 487: 486: 485: 482: 478: 473: 472: 468: 466: 463: 461: 458: 456: 453: 451: 448: 446: 443: 441: 438: 437: 436: 435: 432: 428: 423: 422: 418: 416: 413: 411: 408: 406: 403: 401: 398: 396: 393: 391: 388: 386: 383: 381: 378: 376: 373: 371: 368: 366: 363: 361: 358: 356: 353: 351: 348: 346: 343: 341: 338: 336: 333: 331: 328: 326: 323: 321: 318: 316: 313: 311: 308: 305: 301: 298: 296: 293: 291: 288: 285: 281: 278: 276: 273: 272: 271: 270: 267: 263: 260: 256: 247: 244: 229: 226: 218: 207: 204: 200: 197: 193: 190: 186: 183: 179: 176: –  175: 171: 170:Find sources: 164: 160: 154: 153: 148:This article 146: 142: 137: 136: 127: 124: 116: 106: 102: 96: 95: 89: 84: 75: 74: 69: 67: 60: 59: 54: 53: 48: 43: 34: 33: 30: 19: 1124:. Retrieved 1120:the original 1115: 1106: 1094:. Retrieved 1090: 1081: 1048: 1034: 1019: 1013: 1011: 1004: 1000: 998: 995: 982: 980: 874: 863: 852: 850: 846: 843: 759: 751: 730: 724: 705: 696: 684: 682: 663:link with a 658: 648: 617: 616: 577: 537: 470: 420: 239: 221: 215:January 2017 212: 202: 195: 188: 181: 174:"TCP tuning" 169: 157:Please help 152:verification 149: 119: 113:January 2017 110: 91: 63: 56: 50: 49:Please help 46: 29: 1096:January 23, 1062:Bufferbloat 866:packet loss 860:Packet loss 711:Window size 105:introducing 1265:Categories 1251:- ExtraHop 1216:(prior to 1126:January 3, 1073:References 1001:timestamps 743:retransmit 715:See also: 618:TCP tuning 548:Link layer 185:newspapers 88:references 52:improve it 1186:RFC  1179:RFC  1172:RFC  1165:RFC  1158:RFC  1151:RFC  1144:RFC  914:≤ 799:≤ 754:windowing 630:bandwidth 58:talk page 1056:See also 1012:The TCP 735:computer 1257:, - PSC 1196:, ESnet 1116:Psc.edu 1091:Psc.edu 688:buffers 679:Buffers 634:latency 632:, high- 578:more... 562:Tunnels 538:more... 471:more... 421:more... 410:TLS/SSL 365:ONC/RPC 302: ( 199:scholar 101:improve 739:packet 669:Gbit/s 405:Telnet 304:HTTP/3 201:  194:  187:  180:  172:  90:, but 1218:Vista 1210:DrTCP 864:When 673:Gbits 654:bytes 532:IPsec 310:HTTPS 206:JSTOR 192:books 1188:4138 1181:3517 1174:2883 1167:2488 1160:2582 1153:2018 1146:1323 1128:2017 1098:2020 999:TCP 986:loss 853:also 731:RWIN 719:and 527:IGMP 507:ICMP 465:QUIC 460:RSVP 455:SCTP 450:DCCP 415:XMPP 395:SNMP 390:SMTP 375:RTSP 350:OSPF 340:NNTP 335:MQTT 330:MGCP 325:LDAP 315:IMAP 300:HTTP 280:DHCP 178:news 1222:TCP 725:In 692:KiB 572:MAC 567:PPP 557:ARP 522:ECN 517:NDP 445:UDP 440:TCP 400:SSH 385:SIP 380:RIP 370:RTP 360:PTP 355:POP 345:NTP 320:IRC 295:FTP 290:DNS 275:BGP 161:by 1267:: 1230:, 1114:. 1089:. 749:. 729:, 511:v6 500:v6 495:v4 490:IP 284:v6 61:. 1130:. 1100:. 983:P 959:s 956:s 953:o 950:l 945:P 938:T 935:T 932:R 926:S 923:S 920:M 910:t 907:u 904:p 901:h 898:g 895:u 892:o 889:r 886:h 883:T 825:T 822:T 819:R 814:N 811:I 808:W 805:R 795:t 792:u 789:p 786:h 783:g 780:u 777:o 774:r 771:h 768:T 606:e 599:t 592:v 513:) 509:( 306:) 286:) 282:( 246:) 240:( 228:) 222:( 217:) 213:( 203:· 196:· 189:· 182:· 155:. 126:) 120:( 115:) 111:( 97:. 68:) 64:( 20:)

Index

Receive window
improve it
talk page
Learn how and when to remove these messages
references
inline citations
improve
introducing
Learn how and when to remove this message

verification
improve this article
adding citations to reliable sources
"TCP tuning"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
Learn how and when to remove this message
Internet protocol suite
Application layer
BGP
DHCP
v6
DNS
FTP
HTTP
HTTP/3

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.