Skip to content
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

[core] Extended logs for negative or zero RTT estimate on the receiver side #1876

Merged

Conversation

mbakholdina
Copy link
Collaborator

@mbakholdina mbakholdina commented Mar 19, 2021

(1) - This PR provides extended logs for negative or zero RTT estimate on the receiver side, former "IPE: ACK node overwritten message". See issue #253 for details.

The logs are now splitted into two cases:

  • When the record about ACK is not found in the buffer,
  • When the RTT estimate obtained by the receiver based on ACK/ACKACK pair is negative or zero.

This check happens upon ACKACK reception by the receiver.

The logs format is the following:

12:40:38.677155/SRT:RcvQ:w1*E:SRT.in: @577838857:IPE: The record about ACK is not found, RTT estimate at the receiver side can not be calculated (ACK number: 113, last ACK sent: 115, oldest ACK record: not yet available, RTT (EWMA): 21052)
12:40:38.677194/SRT:RcvQ:w1*E:SRT.in: @577838857:IPE: RTT estimate obtained by the receiver is negative or zero, there may have been a time shift (current time: 18705D 11:40:38.677154 [STDY], the time of sending ACK: not yet available, RTT estimate: 21015). The usage of monotonic clocks is recommended.

(2) - Additionally, the current time of ACKACK packet reception currtime is now passed to the acknowledge function (window.cpp) as an argument to make the RTT estimate calculation more precise.

The change has been tested in the following way.

TODO

  • In the first log, oldest ACK record: not yet available.
  • In the second log, the time of sending ACK: not yet available. The redesign of acknowledge function (window.cpp) is required to be able to extract this value from the buffer with ACK records.
  • Is there a need to rename currtime argument in acknowledge function to something like ACKACKReceptionTime?
  • The arguments names seq and ack used in store and acknowledge functions are difficult to read. I would suggest proper renaming: seq -> ACKSeqNo (as per Seq structure, meaning ACK packet Seq. No.), ack -> AckPktSeqNo (meaning acknowledged packet Seq. No.). In the Seq structure the renaming is also required: iACK -> iAckPktSeqNo.
  • The function int32_t CPacket::getAckSeqNo() const (packet.cpp) probably needs renaming to int32_t CPacket::getAckPktSeqNo() const.

@mbakholdina mbakholdina self-assigned this Mar 19, 2021
@mbakholdina mbakholdina added [core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code labels Mar 19, 2021
@mbakholdina mbakholdina added this to the v1.4.3 milestone Mar 19, 2021
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

  • Provide a way to identify clock type (@maxsharabayko - a separate PR to be created)

srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
@mbakholdina mbakholdina force-pushed the mbakholdina/extended-log-issue-253 branch from 48f9685 to d9f8415 Compare March 25, 2021 12:30
@mbakholdina mbakholdina force-pushed the mbakholdina/extended-log-issue-253 branch from 5b9e62e to 7e99954 Compare March 25, 2021 16:05
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds reading m_iAckSeqNo in CUDT::processCtrl(..) function.
Another place this variable is accessed is in the CUDT::sendCtrl(..) function.
Both m_iAckSeqNo and m_ACKWindow are not protected from simultaneous access from different threads.
However, both are accessed from the CRcvQueue worker thread. ACK is sent from this thread from checkTimers(..) function.

Therefore, adding m_iAckSeqNo should be ok.

srtcore/core.cpp Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko merged commit 5a46839 into Haivision:master Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants