summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2012-07-08 18:54:07 +0200
committerMichael Brown2012-07-09 11:15:24 +0200
commit07bc73e0872730d1e6784c7460f12b836c77838d (patch)
treea9f10d2d0ab536a72e589a3003bba5d42b4dd800 /src
parent[malloc] Increase heap size to 512kB (diff)
downloadipxe-07bc73e0872730d1e6784c7460f12b836c77838d.tar.gz
ipxe-07bc73e0872730d1e6784c7460f12b836c77838d.tar.xz
ipxe-07bc73e0872730d1e6784c7460f12b836c77838d.zip
[tcp] Increase maximum window size to 256kB
A window size of 256kB should be sufficient to allow for full-bandwidth transfers over a Gigabit LAN, and for acceptable transfer speeds over other typical links. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/include/ipxe/tcp.h46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/include/ipxe/tcp.h b/src/include/ipxe/tcp.h
index cb3309f2f..6b6691175 100644
--- a/src/include/ipxe/tcp.h
+++ b/src/include/ipxe/tcp.h
@@ -287,29 +287,31 @@ struct tcp_options {
/**
* Maxmimum advertised TCP window size
*
- * We estimate the TCP window size as the amount of free memory we
- * have. This is not strictly accurate (since it ignores any space
- * already allocated as RX buffers), but it will do for now.
- *
- * Since we don't store out-of-order received packets, the
- * retransmission penalty is that the whole window contents must be
- * resent. This suggests keeping the window size small, but bear in
- * mind that the maximum bandwidth on any link is limited to
- *
- * max_bandwidth = ( tcp_window / round_trip_time )
- *
- * With a 48kB window, which probably accurately reflects our amount
- * of free memory, and a WAN RTT of say 200ms, this gives a maximum
- * bandwidth of 240kB/s. This is sufficiently close to realistic that
- * we will need to be careful that our advertised window doesn't end
- * up limiting WAN download speeds.
- *
- * Finally, since the window goes into a 16-bit field and we cannot
- * actually use 65536, we use a window size of (65536-4) to ensure
- * that payloads remain dword-aligned.
+ * The maximum bandwidth on any link is limited by
+ *
+ * max_bandwidth * round_trip_time = tcp_window
+ *
+ * Some rough expectations for achievable bandwidths over various
+ * links are:
+ *
+ * a) Gigabit LAN: expected bandwidth 125MB/s, typical RTT 0.5ms,
+ * minimum required window 64kB
+ *
+ * b) Home Internet connection: expected bandwidth 10MB/s, typical
+ * RTT 25ms, minimum required window 256kB
+ *
+ * c) WAN: expected bandwidth 2MB/s, typical RTT 100ms, minimum
+ * required window 200kB.
+ *
+ * The maximum possible value for the TCP window size is 1GB (using
+ * the maximum window scale of 2**14). However, it is advisable to
+ * keep the window size as small as possible (without limiting
+ * bandwidth), since in the event of a lost packet the window size
+ * represents the maximum amount that will need to be retransmitted.
+ *
+ * We therefore choose a maximum window size of 256kB.
*/
-//#define TCP_MAX_WINDOW_SIZE ( 65536 - 4 )
-#define TCP_MAX_WINDOW_SIZE 8192
+#define TCP_MAX_WINDOW_SIZE ( 256 * 1024 )
/**
* Path MTU