一方突然断电重启,之前建立的连接信息丢失,另一方并不知道

一方突然断电重启,之前建立的连接信息丢失,另一方并不知道
这个场景在前面 keepalive 那里介绍过。客户端和服务器一开始三次握手建立连接,中间没有数据传输进入空闲状态。这时候服务器突然断电重启,之前主机上所有的 TCP 连接都丢失了,但是客户端完全不知晓这个情况。等客户端有数据有数据要发送给服务端时,服务端这边并没有这条连接的信息,发送 RST 给客户端,告知客户端自己无法处理,你趁早死了这条心吧。
node2:/root#tcpdump -S -i eth1 '((tcp) and  (host 192.168.137.3) and (port 8080) )'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
23:57:52.342969 IP node2.56878 > node1.webcache: Flags [S], seq 3563017210, win 14600, options [mss 1460,sackOK,TS val 9787280 ecr 0,nop,wscale 7], length 0
23:57:52.343386 IP node1.webcache > node2.56878: Flags [S.], seq 1139378110, ack 3563017211, win 14480, options [mss 1460,sackOK,TS val 970406 ecr 9787280,nop,wscale 6], length 0
23:57:52.343534 IP node2.56878 > node1.webcache: Flags [.], ack 1139378111, win 115, options [nop,nop,TS val 9787282 ecr 970406], length 0
23:57:52.343582 IP node2.56878 > node1.webcache: Flags [P.], seq 3563017211:3563017220, ack 1139378111, win 115, options [nop,nop,TS val 9787282 ecr 970406], length 9
23:57:52.343730 IP node1.webcache > node2.56878: Flags [.], ack 3563017220, win 227, options [nop,nop,TS val 970406 ecr 9787282], length 0
23:57:52.348343 IP node1.webcache > node2.56878: Flags [P.], seq 1139378111:1139378129, ack 3563017220, win 227, options [nop,nop,TS val 970412 ecr 9787282], length 18
23:57:52.348359 IP node2.56878 > node1.webcache: Flags [.], ack 1139378129, win 115, options [nop,nop,TS val 9787283 ecr 970412], length 0




23:59:52.443925 IP node2.56878 > node1.webcache: Flags [P.], seq 3563017220:3563017229, ack 1139378129, win 115, options [nop,nop,TS val 9907382 ecr 970412], length 9
23:59:52.444270 IP node1.webcache > node2.56878: Flags [R], seq 1139378129, win 0, length 0
23:59:52.444279 IP node2.56878 > node1.webcache: Flags [R.], seq 3563017229, ack 1139378129, win 115, options [nop,nop,TS val 9907383 ecr 970412], length 0
原文地址:https://www.cnblogs.com/hzcya1995/p/13348456.html