Skip to content

Commit d7fc0a0

Browse files
committed
Added UNP ch7
1 parent 163c1b1 commit d7fc0a0

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

docs/unp/ch7.md

+20
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,30 @@ When the keep-alive option is set for a TCP socket and no data has been exchange
123123
* Network failure.
124124
* <u>The remote host has crashed and the last-hop router has detected the crash.</u>
125125
126+
##### **Changing the inactivity time** *
127+
128+
A common question regarding this option is about modifying the timing parameters (usually to reduce the two-hour period of inactivity to some shorter value). Appendix E of TCPv1 discusses how to change these timing parameters for various kernels, but be aware that most kernels maintain these parameters on a per-kernel basis, not on a per-socket basis. For example, changing the inactivity period from 2 hours to 15 minutes will affect all sockets on the host that enables this option. However, such questions usually result from a misunderstanding of the purpose of this option, as discussed below.
129+
130+
##### **Misunderstanding of the purpose** *
131+
132+
<u>The purpose of this option is to detect if the peer *host* crashes or becomes unreachable</u> (e.g., dial-up modem connection drops, power fails, etc.). If the *peer* process crashes, its TCP will send a FIN across the connection, which we can easily detect with `select`, which was why we used `select` in [Section 6.4](ch6.md#str_cli-function-revisited). If there is no response to any of the keep-alive probes (scenario 3), we are not guaranteed that the peer host has crashed, and TCP may well terminate a valid connection. It could be that some intermediate router has crashed for 15 minutes, and that period of time just happens to completely overlap our host's 11-minute and 15-second keep-alive probe period. In fact, this function might more properly be called "make-dead" rather than "keep-alive" since it can terminate live connections.
133+
134+
126135
#### `SO_LINGER` Socket Option
127136
128137
### ICMPv6 Socket Option
129138
130139
### IPv6 Socket Options
131140
132141
### TCP Socket Options
142+
143+
144+
### Doubts and Solutions
145+
146+
#### Verbatim
147+
148+
Section 7.5 on `SO_KEEPALIVE` Socket Option.
149+
150+
> Appendix E of TCPv1 discusses how to change these timing parameters for various kernels, ...
151+
152+
I did not find Appendix E (actually no appendix at all) in TCPv1 (3rd Edition).

0 commit comments

Comments
 (0)