RST 情况1,对端没有侦听端口:
这种情况很常见,比如 web 服务进程挂掉或者未启动,客户端使用 connect 建连,都会出现 "Connection Reset" 或者"Connection refused" 错误。
node2:/root/test#python t13.py
Traceback (most recent call last):
File "t13.py", line 7, in <module>
s.connect(("192.168.137.2",8080))
File "/usr/local/python27/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused
node2:/root#tcpdump -S -i eth1 '((tcp) 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
05:59:17.228142 IP node2.34975 > node1.webcache: Flags [S], seq 1071220156, win 14600, options [mss 1460,sackOK,TS val 263398922 ecr 0,nop,wscale 7], length 0
05:59:17.228584 IP node1.webcache > node2.34975: Flags [R.], seq 0, ack 1071220157, win 0, length 0