-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LATEREXMIT now uses LastACK timer, instead of connection expiration timer #741
Conversation
SRM_LATEREXMIT moved out from connection expiration timer check.
The UDT Draft Section 4. Timers.
UDT logic for the connection expiration is the following. Note. |
98a8cf8
to
6440f71
Compare
Another option is to keep EXP event triggering LATEREXMIT, and to additionally trigger a LATEREXMIT upon receiving a KEEPALIVE message if LastRspAck time is updated when SRT socket is created, when a connection is established (since PR #745), an ACK packet for yet unacknowledged packet is received, and also if the sender's buffer has no unacknowledged packets on the new data submitted by srt_sendmsg(). In case the sending is resumed after an idle period, a keepalive message might be already underway from the receiver to the sender, while sender sends a new DATA packet. After sending a DATA packet, LastRspAck is updated by the sender (because there were no data in the sender's buffer), and thus we should expect some response after ~RTT period. It a keepalive message is received after (RTT + 4 × RTTVar + SYN), then it is likely the DATA packet was lost during transmission and LATEREXMIT should be triggered. |
6440f71
to
0299ee0
Compare
0299ee0
to
eee7352
Compare
Validation tests to do.
|
The hardcoded changes to force loosing certain packets.
|
Retransmission tests1.1 File mode NAK report ON ✔️RTT=90ms RTTVar=17ms ExpInt=187ms 1.2 File mode NAK report OFF ✔️RTT=94ms RTTVar=13ms ExpInt=178ms 1.3. Live NAK report ON ✔️Retransmission does not happen. 1.4. Live NAK report OFF ✔️Link properies: RTT=98443, RTTVar=31238, ExpInt=253395. |
As reported by a user, there is an issue in the file mode. When transfering a big file via SRT file mode, the connection may be idle forever before all data have been transferred.
In the method
CUDT::checkTimers()
, for the file mode, the loss packets retransmission will be delayed by the time calculated by the following:exp_int_tk = (m_iEXPCount * (m_iRTT + 4 * m_iRTTVar) + COMM_SYN_INTERVAL_US) * m_ullCPUFrequency;
The loss packets will be retransmitted at the time:
next_exp_time_tk = m_ullLastRspTime_tk + exp_int_tk;
This time will never be reached if
exp_int_tk > (COMM_KEEPALIVE_PERIOD_US * m_ullCPUFrequency)
. Becausem_ullLastRspTime_tk
may be updated by keepalive packets everyCOMM_KEEPALIVE_PERIOD_US
microseconds.Further investigation showed, LATEREXMIT packet retransmission logic relies on connection expiration timer (
m_ullLastRspTime_tk
), instead of lastACK
timer (m_ullLastRspAckTime_tk
). And the connection expiration timer is updated with every incoming KEEPALIVE packet, therefore under certain conditions the retransmission will never happen and the connection remains idle.This PR fixes the above issue by moving the LATEREXMIT logic together with FASTREXMIT into a separate function
checkRexmitTimer
, that shares the same timeout value for retransmission.Expiration timer used by LATE_REXMIT:
New time value
This change basically makes the logic of
FAST_REXMIT
andLATE_REXMIT
almost similar, except forFAST_REXMIT
will not work if the receiver is expected to send NAK reports (m_bPeerNakReport
).Also might be worth adding
m_ullMinNakInt_tk
as the minimum time before retransmission.