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

Replace magic numbers with constants and define RTT calculations #149

Merged
merged 6 commits into from Jan 13, 2017

Conversation

ianswett
Copy link
Contributor

Defines how variables such as smoothed_rtt and rttvar are calculated, as well as replacing many numbers with constants.

Intends to fix #107

Defines how variables such as smoothed_rtt and rttvar are calculated, as well as replacing many numbers with constants.

Intends to fix #107
Copy link
Contributor

@janaiyengar janaiyengar left a 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.

Copy link
Contributor

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:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "received"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ianswett ianswett added editorial An issue that does not affect the design of the protocol; does not require consensus. -recovery labels Jan 13, 2017
@ianswett ianswett merged commit 1c341bf into master Jan 13, 2017
@MikeBishop MikeBishop deleted the ianswett-lossdetection1 branch January 14, 2017 18:41
if is_retransmittable:
SetLossDetectionAlarm()
# TODO: Clarify the data in sent_packets.
sent_packets[packet_number] = {now}
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

[citation-needed]

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-recovery editorial An issue that does not affect the design of the protocol; does not require consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why is packet_number an argument for OnPacketSent?
3 participants