-
Notifications
You must be signed in to change notification settings - Fork 16
feat: congestion control for catchunks #132
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
base: main
Are you sure you want to change the base?
Conversation
bc237b7
to
48afe7c
Compare
Introduce "std/object/congestion" subpackage providing a unified interface for windowed congestion control and three window strategies: fixed, AIMD, and CUBIC Introduce a basic interface for RTT estimators
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.
Pull Request Overview
This PR introduces a congestion control mechanism for catchunks by adding multiple congestion window strategies and integrating a retransmission queue. Key changes include:
- Adding a new RTTEstimator interface for RTT measurement.
- Implementing three congestion window strategies: Fixed, AIMD, and CUBIC.
- Refactoring the client consumer to leverage the new congestion control mechanism with retransmission queue support.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
std/object/congestion/rtt_estimator.go | Adds the RTTEstimator interface for RTT estimation. |
std/object/congestion/congestion_window_fixed.go | Introduces a fixed congestion window implementation. |
std/object/congestion/congestion_window_cubic.go | Implements the CUBIC congestion window strategy with updates. |
std/object/congestion/congestion_window_aimd.go | Implements the AIMD congestion control mechanism. |
std/object/congestion/congestion_window.go | Provides the generic CongestionWindow interface. |
std/object/client_consume_seg.go | Refactors client consumption logic to use congestion control. |
rtt = (*cw.rttEstimator).EstimatedRTT().Seconds() // estimated RTT | ||
} | ||
|
||
t := time.Since(cw.lastDecrease).Abs().Seconds() // time since last decrease |
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.
The use of the Abs() method on time.Duration is non-standard as the Go standard library does not provide an Abs() method for time.Duration. Consider implementing a manual absolute value computation to prevent potential issues with negative durations.
t := time.Since(cw.lastDecrease).Abs().Seconds() // time since last decrease | |
duration := time.Since(cw.lastDecrease) | |
if duration < 0 { | |
duration = -duration | |
} | |
t := duration.Seconds() // time since last decrease |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
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.
Wow this is amazing
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.
Abs() was added in go 1.19: https://pkg.go.dev/time#Duration.Abs
It is really cool though, didn't realize copilot has these nice interfaces
Co-authored-by: Copilot <[email protected]>
Related to #97
Summary
This PR introduces congestion control mechanism for catchunks
Improvements
Pending Changes/Additions
TryStore
as in ac07ccaArgument parsing for congestion window parameters(need to changeClient
APIs)