TCP: m_retrans not being decremented on retransmitted packet's ack
If a retransmitted packet is lost, and TCP retransmits a packet above that sequence number, when it gets sacked then m_retrans is not decremented and this gives a false view of the bytesInFlight.
Reason why this occurs is because m_retrans is only decremented after a cumulative acknowledgment (https://gitlab.com/nsnam/ns-3-dev/-/blob/master/src/internet/model/tcp-socket-base.cc#L1890)
This is an issue because if there are several retransmissions and the difference grows per ack of a retransmitted packet and the cwnd is fixed because its in recovery, then it can stop transmitted packets until the RTO of the dropped retransmitted packet
can be reproduced under the following
it produces the logfile
pcap file:
If you look at 0.782921937s (one of a few cases) where it acks a retransmitted packet, you'll notice that m_retrans does not change and the bytesInFlight does not change even though it just acked the segment