大网数据广告活动
服务器运维问答

Continue sending packets after send FIN

· 52CE 我爱测

My wireshark had captured following packets: 2009 773 src dst TCP 1514 [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448 2010 775 src dst TCP 1514 [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=55…

问题原文

原帖链接 · Barathrum · CC BY-SA 3.0

My wireshark had captured following packets:

2009    773 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448
2010    775 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK]  Seq=11680 Ack=559 Win=3847 Len=1448
2011    779 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448
2012    781 src dst TCP 66  51940 > http [FIN, ACK] Seq=15579 Ack=559 Win=3847 Len=0 <====FIN
2013    786 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448 
2014    802 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448 
2029    833 src dst TCP 1514    [TCP Retransmission] 51940 > http [ACK] Seq=11680 Ack=559 Win=3847 Len=1448

So I have some questions, when app sends a FIN, does the TCP connection state turn to fin_wait_1? Then why it is still sending packets?

Or do I misunderstand fin_wait_1?

Thanks.

已采纳解答

原帖链接 · Mark Riddell · CC BY-SA 3.0

An interesting question. First of all, you are correct that when an application calls close() on a socket, a FIN is sent and the socket enters the FIN-WAIT-1 state. No further send calls will be accepted by the socket in this state however packets which were send before the FIN and have yet to be acknowledged, will continue to be retransmitted. This appears to be what is happening in your case.

Source: https://www.rfc-editor.org/rfc/rfc793#section-3.5

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-12-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。