Dear ns-3 experts,
I've also observed a behavior which leads to endless sending of FIN packets, because the ACK response got lost (packet nr. 7 in the attached Wireshark screenshot). I was able to create a minimum working example based on tcp-bulk-send, see diff file.
./waf --run "tcp-bulk-send --tracing=true --maxBytes=123
Tested today on ns-3-dev commit b98955f20a5ff44b855c9a925c28b2b486bcae6a.
What I saw in the debugger:
/*
###CLIENT### ###SERVER###
Closes socket, sends FIN without data ---> Receives FIN, changes from ESTABLISHED to CLOSE_WAIT
ACK gets lost <-x- //respond with FIN,ACK
Retransmit FIN ---> TcpSocketBase::DoForwardUp() calls TcpSocketBase::ProcessWait()
which does not trigger a retransmission
Retransmit FIN ---> ...
Retransmit FIN continues forever, ---> ...
because non-data packet does not have
something like m_dataRetrCount
(TcpSocketBase::ReTxTimeout() Line 3453)
*/
I did neither check RFCs nor any other implementations. In other pcap traces, ACKs are retransmitted and a RST is sent after a specified number of FIN retransmission. There is also a related but rather old
post about this problem which points to
bugzilla.
Best regards
Joerg