aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/tcp.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2016-06-10 17:27:06 +0100
committerMichael Brown <mcb30@ipxe.org>2016-06-13 09:58:32 +0100
commit188789eb3cb83496bd48847da59c74e3f06d413e (patch)
treedd8a3c84cee64fdf783664f4824a5455fa73a4f7 /src/include/ipxe/tcp.h
parent5c2a959a72e999b5aedf34b416960260d272a9df (diff)
downloadipxe-188789eb3cb83496bd48847da59c74e3f06d413e.tar.gz
[tcp] Send TCP keepalives on idle established connections
In some circumstances, intermediate devices may lose state in a way that temporarily prevents the successful delivery of packets from a TCP peer. For example, a firewall may drop a NAT forwarding table entry. Since iPXE spends most of its time downloading files (and hence purely receiving data, sending only TCP ACKs), this can easily happen in a situation in which there is no reason for iPXE's TCP stack to generate any retransmissions. The temporary loss of connectivity can therefore effectively become permanent. Work around this problem by sending TCP keepalives after a period of inactivity on an established connection. TCP keepalives usually send a single garbage byte in sequence number space that has already been ACKed by the peer. Since we do not need to elicit a response from the peer, we instead send pure ACKs (with no garbage data) in order to keep the transmit code path simple. Originally-implemented-by: Ladi Prosek <lprosek@redhat.com> Debugged-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/tcp.h')
-rw-r--r--src/include/ipxe/tcp.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/ipxe/tcp.h b/src/include/ipxe/tcp.h
index 9d9aecd07..21be3ca8a 100644
--- a/src/include/ipxe/tcp.h
+++ b/src/include/ipxe/tcp.h
@@ -379,6 +379,14 @@ struct tcp_options {
#define TCP_MSL ( 2 * 60 * TICKS_PER_SEC )
/**
+ * TCP keepalive period
+ *
+ * We send keepalive ACKs after this period of inactivity has elapsed
+ * on an established connection.
+ */
+#define TCP_KEEPALIVE_DELAY ( 15 * TICKS_PER_SEC )
+
+/**
* TCP maximum header length
*
*/