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
Replace magic numbers with constants and define RTT calculations #149
Conversation
Defines how variables such as smoothed_rtt and rttvar are calculated, as well as replacing many numbers with constants. Intends to fix #107
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit, but LGTM
Constants used in loss recovery and congestion control are based on a combination | ||
of RFCs, papers, and common practice. Some may need to be changed or negotiated | ||
in order to better suit a variety of environments. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also justify these constants. I'll create an issue to do this.
|
||
When an ack is received, it may acknowledge 0 or more packets. | ||
|
||
Pseudocode for OnAckReceied and UpdateRtt follow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "received"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if is_retransmittable: | ||
SetLossDetectionAlarm() | ||
# TODO: Clarify the data in sent_packets. | ||
sent_packets[packet_number] = {now} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why braces here, but not below (Line 341)?
rttvar = rtt_sample / 2 | ||
else: | ||
rttvar = 3/4 * rttvar + 1/4 * (smoothed_rtt - rtt_sample) | ||
smoothed_rtt = 7/8 * smoothed_rtt + 1/8 * rtt_sample |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[citation-needed]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see that this is just RFC 6298 directly implemented. Might pay to be more direct about that. Only the smoothed_rtt value contains the reference.
Defines how variables such as smoothed_rtt and rttvar are calculated, as well as replacing many numbers with constants.
Intends to fix #107