Re: How do I set the TCP Initial Window size to 10-50KB? (i.e. how configure TCP Slow-Start/Anti-Congestion to burst 10-50KB w.o. interference)
On 2015-03-29 16:59, Stuart Henderson wrote: On 2015/03/29 14:45, Tinker wrote: On 2015-03-29 13:50, Stuart Henderson wrote: On 2015-03-29, Tinker ti...@openmailbox.org wrote: How do I make TCP stack's initial window 10-50KB, so that I can burst that amount of data without any interference from the TCP slow-start/RFC 3390 anti-congestion whatsoever? OpenBSD already starts with 14600, see around line 3140 in tcp_input.c if you'd like to experiment. Stuart, Thank you a lot for your response. Wait, what line exactly at http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/netinet/tcp_input.c?annotate=1.287 is it that sets the initial window size? (3145 and 3148 seem to refer to that it's already set.. and 3130-3142 too?) And, could I conveniently set this to 50KB via some sysctl setting? (It seems to me that the mssdflt is used as step size when the anticongestion increases and decreases the window size, so I guess just increasing it by a multiple of 10 would be a very bad idea.) Thanks! Tinker By default tcp_do_rfc3390=2, so the usual case is this: 1.252 claudio 3143:} else if (tcp_do_rfc3390 == 2) { 3144:/* increase initial window */ 3145:tp-snd_cwnd = ulmin(10 * mss, ulmax(2 * mss, 14600)); There is no existing sysctl to allow fine tuning, just the IW4, max 4380 and IW10, max 14600 switch of net.inet.tcp.rfc3390. But you could easily locally extend that variable if you want to experiment with changing the multiplier and max value (or something else). Aha, thanks for clarifying and for clarifying my reading mistake! If I set both MTU and mssdflt to 15000, would that mean that row 3145 would execute as tp-snd_cwnd = ulmin(10 * 15000, ulmax(2 * 15000, 14600)); so that is that the initial congestion window would be 150 KB? How to get mss set to 15000: ifconfig reports that my NIC has an MTU of 1500 and ifconfig nic hwfeatures tells that the hardmtu i.e. max configurable mtu size, is 16000. The sourcecode says that for IPv4, if automtu is set, then it will use the MTU as mss variable. I have no idea of if automtu is set, however, if I just both set the NIC's MTU *and* the mssdflt sysctl setting, then that way the mss value should guaranteedly be set to that, to the best of my understanding. Thanks! Tinker
Re: How do I set the TCP Initial Window size to 10-50KB? (i.e. how configure TCP Slow-Start/Anti-Congestion to burst 10-50KB w.o. interference)
On 2015-03-29 16:59, Stuart Henderson wrote: By default tcp_do_rfc3390=2, so the usual case is this: 1.252 claudio 3143:} else if (tcp_do_rfc3390 == 2) { 3144:/* increase initial window */ 3145:tp-snd_cwnd = ulmin(10 * mss, ulmax(2 * mss, 14600)); There is no existing sysctl to allow fine tuning, just the IW4, max 4380 and IW10, max 14600 switch of net.inet.tcp.rfc3390. But you could easily locally extend that variable if you want to experiment with changing the multiplier and max value (or something else). Ah now I finally got what you meant. Thank you very much for your clarifications. I guess also this means that all values 2 for this sysctl are unclaimed and free to play with. Last question now just to get the whole picture: (This is slightly OT as it's a general anti-congestion question, however you have the specific stack sourcecode at hand so have authoritative answer.) An incoming connection comes in. The initial [congestion] window is 14600. 4600 bytes are sent at time 0, 123 bytes are received at time X, and then another 1 bytes are sent at time Y. The RTT is such that ACK:s confirming reception come in within 3 seconds. All packets go through. In this usecase, is there any risk (because of some timeout constraint or alike) that the anti-congestion or slow-start would reduce the initial window size that hasn't been used yet, under any circumstance, so that the send at Y would be speed-capped/blocked? Thanks, Tinker
Re: How do I set the TCP Initial Window size to 10-50KB? (i.e. how configure TCP Slow-Start/Anti-Congestion to burst 10-50KB w.o. interference)
On 2015-03-29, Tinker ti...@openmailbox.org wrote: How do I make TCP stack's initial window 10-50KB, so that I can burst that amount of data without any interference from the TCP slow-start/RFC 3390 anti-congestion whatsoever? OpenBSD already starts with 14600, see around line 3140 in tcp_input.c if you'd like to experiment.
Re: How do I set the TCP Initial Window size to 10-50KB? (i.e. how configure TCP Slow-Start/Anti-Congestion to burst 10-50KB w.o. interference)
On 2015-03-29 13:50, Stuart Henderson wrote: On 2015-03-29, Tinker ti...@openmailbox.org wrote: How do I make TCP stack's initial window 10-50KB, so that I can burst that amount of data without any interference from the TCP slow-start/RFC 3390 anti-congestion whatsoever? OpenBSD already starts with 14600, see around line 3140 in tcp_input.c if you'd like to experiment. Stuart, Thank you a lot for your response. Wait, what line exactly at http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/netinet/tcp_input.c?annotate=1.287 is it that sets the initial window size? (3145 and 3148 seem to refer to that it's already set.. and 3130-3142 too?) And, could I conveniently set this to 50KB via some sysctl setting? (It seems to me that the mssdflt is used as step size when the anticongestion increases and decreases the window size, so I guess just increasing it by a multiple of 10 would be a very bad idea.) Thanks! Tinker
Re: How do I set the TCP Initial Window size to 10-50KB? (i.e. how configure TCP Slow-Start/Anti-Congestion to burst 10-50KB w.o. interference)
On 2015/03/29 14:45, Tinker wrote: On 2015-03-29 13:50, Stuart Henderson wrote: On 2015-03-29, Tinker ti...@openmailbox.org wrote: How do I make TCP stack's initial window 10-50KB, so that I can burst that amount of data without any interference from the TCP slow-start/RFC 3390 anti-congestion whatsoever? OpenBSD already starts with 14600, see around line 3140 in tcp_input.c if you'd like to experiment. Stuart, Thank you a lot for your response. Wait, what line exactly at http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/netinet/tcp_input.c?annotate=1.287 is it that sets the initial window size? (3145 and 3148 seem to refer to that it's already set.. and 3130-3142 too?) And, could I conveniently set this to 50KB via some sysctl setting? (It seems to me that the mssdflt is used as step size when the anticongestion increases and decreases the window size, so I guess just increasing it by a multiple of 10 would be a very bad idea.) Thanks! Tinker By default tcp_do_rfc3390=2, so the usual case is this: 1.252 claudio 3143:} else if (tcp_do_rfc3390 == 2) { 3144:/* increase initial window */ 3145:tp-snd_cwnd = ulmin(10 * mss, ulmax(2 * mss, 14600)); There is no existing sysctl to allow fine tuning, just the IW4, max 4380 and IW10, max 14600 switch of net.inet.tcp.rfc3390. But you could easily locally extend that variable if you want to experiment with changing the multiplier and max value (or something else).