forked from h2o/quicly
-
Notifications
You must be signed in to change notification settings - Fork 1
Merge Amber Cronin's changes into Project-Faster (viasat) #1
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
Closed
funglee2k22
wants to merge
16
commits into
Project-Faster:master
from
funglee2k22:add-generic-slowstart
Closed
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
698e798
Merge Amber Cronin's changes into Project-Faster (viasat)
funglee2k22 6df6c13
change the tests to make it pass
funglee2k22 f77c814
adding copyright info for files created by viasat.
funglee2k22 0122046
debug in progress
funglee2k22 9e8bbb0
adding comments
funglee2k22 1252f10
streamline structures, removed additional algorithms not to be includ…
parvit 4acb608
updated for search2.0, naming review
parvit 5d685e4
Merge branch 'master' into add-generic-slowstart
parvit 23f142e
fix callback initial setup
parvit 017d65d
test fixes
parvit 1d81126
adding one line comment for slow-start-search testcase
funglee2k22 418154a
disable is a better name
funglee2k22 0a02db5
test fixes
parvit 597499e
removed MIN and MAX macros
parvit a788381
added more recent reference to search paper
parvit fac6f40
fixed issue with manual expanded macro
parvit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule picotls
updated
31 files
| +2 −2 | .github/workflows/ci.yml | |
| +23 −0 | CMakeLists.txt | |
| +48 −0 | cmake/FindMbedTLS.cmake | |
| +1 −0 | cmake/fusion.cmake | |
| +1 −1 | deps/picotest | |
| +131 −17 | include/picotls.h | |
| +69 −0 | include/picotls/mbedtls.h | |
| +2 −2 | include/picotls/minicrypto.h | |
| +1 −1 | include/picotls/openssl.h | |
| +1 −1 | lib/chacha20poly1305.h | |
| +10 −14 | lib/cifra.c | |
| +5 −0 | lib/cifra/aes256.c | |
| +6 −8 | lib/cifra/libaegis.c | |
| +8 −4 | lib/libaegis.h | |
| +641 −0 | lib/mbedtls.c | |
| +703 −0 | lib/mbedtls_sign.c | |
| +38 −37 | lib/openssl.c | |
| +359 −168 | lib/picotls.c | |
| +14 −8 | picotls.xcodeproj/project.pbxproj | |
| +16 −0 | t/assets/rsa-pkcs8/key.pem | |
| +16 −0 | t/assets/rsa-pkcs8/keypair.pem | |
| +15 −0 | t/assets/secp256r1-pkcs8/cert.pem | |
| +5 −0 | t/assets/secp256r1-pkcs8/key.pem | |
| +4 −0 | t/assets/secp256r1-pkcs8/pub.pem | |
| +53 −25 | t/cli.c | |
| +320 −0 | t/mbedtls.c | |
| +6 −9 | t/minicrypto.c | |
| +8 −10 | t/openssl.c | |
| +349 −59 | t/picotls.c | |
| +29 −1 | t/ptlsbench.c | |
| +15 −6 | t/util.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #ifndef quicly_ss_h | ||
| #define quicly_ss_h | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #include "quicly/cc.h" | ||
| #include "quicly/constants.h" | ||
| #include <stdint.h> | ||
| #include <stdbool.h> | ||
|
|
||
| extern bool search_exit; | ||
|
|
||
| #define MIN(x,y) ((x > y) ? (y) : (x)) | ||
| #define MAX(x,y) ((x < y) ? (y) : (x)) | ||
|
parvit marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| * Holds pointers to concrete congestion control implementation functions. | ||
| */ | ||
| typedef const struct st_quicly_ss_type_t quicly_ss_type_t; | ||
|
|
||
| struct st_quicly_ss_type_t { | ||
| const char* name; | ||
| void (*ss)(quicly_cc_t *cc, const quicly_loss_t *loss, uint32_t bytes, uint64_t largest_acked, uint32_t inflight, | ||
| uint64_t next_pn, int64_t now, uint32_t max_udp_payload_size); | ||
| }; | ||
|
|
||
| extern quicly_ss_type_t quicly_ss_type_rfc2001, quicly_ss_type_hybla, quicly_ss_type_hystart, quicly_ss_type_search; | ||
|
|
||
| extern quicly_ss_type_t* quicly_ss_all_types[]; | ||
|
|
||
| void ss_rfc2001(quicly_cc_t *cc, const quicly_loss_t *loss, uint32_t bytes, uint64_t largest_acked, uint32_t inflight, | ||
| uint64_t next_pn, int64_t now, uint32_t max_udp_payload_size); | ||
|
|
||
| struct st_quicly_variable_ss { | ||
|
parvit marked this conversation as resolved.
Outdated
|
||
| quicly_ss_type_t* slowstart; | ||
| }; | ||
|
|
||
| extern struct st_quicly_variable_ss active_slowstart; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #include "quicly/ss.h" | ||
| #include <stdint.h> | ||
| #include <math.h> | ||
|
|
||
| static void recalc_rho(quicly_cc_t *cc, const quicly_loss_t *loss) { | ||
| // RTT in msec | ||
| // Linux here uses us instead of ms for their rho calculations, which gives them more accurate information about | ||
| // the bandwidth of the connection. Here, we only have ms level measurements from loss, and so all of our | ||
| // measurements are only up to that level of precision. It cleans the code up a little bit though from the kernel. | ||
| // we have changed this to use doubles for more accuracy and ease of writing code. | ||
| double rho = (double) loss->rtt.minimum / QUICLY_HYBLA_RTT0; | ||
| // don't allow the ratio to be less than one for faster connections than reference. | ||
| cc->ss_state.hybla.rho = MAX(rho, 1); | ||
| } | ||
|
|
||
| void ss_hybla(quicly_cc_t *cc, const quicly_loss_t *loss, uint32_t bytes, uint64_t largest_acked, uint32_t inflight, | ||
|
parvit marked this conversation as resolved.
Outdated
|
||
| uint64_t next_pn, int64_t now, uint32_t max_udp_payload_size) | ||
| { | ||
| recalc_rho(cc, loss); | ||
|
|
||
| cc->cwnd += (uint32_t)round(pow(2, MIN(cc->ss_state.hybla.rho, QUICLY_HYBLA_RHO_LIM))); | ||
|
|
||
| if (cc->cwnd_maximum < cc->cwnd) | ||
| cc->cwnd_maximum = cc->cwnd; | ||
| } | ||
|
|
||
| quicly_ss_type_t quicly_ss_type_hybla = { "hybla", ss_hybla }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| #include "quicly/ss.h" | ||
| #include <stdint.h> | ||
|
|
||
| #define QUICLY_HYSTART_MIN_SAMPLES (8) | ||
| #define QUICLY_HYSTART_MIN_SSTHRESH (16) | ||
| #define QUICLY_HYSTART_ACK_DELTA_MS (2) | ||
| #define QUICLY_HYSTART_DELAY_MIN (4) | ||
| #define QUICLY_HYSTART_DELAY_MAX (16) | ||
| #define QUICLY_HYSTART_LOW_WINDOW (16) | ||
|
|
||
|
|
||
| static void ss_hystart_reset(quicly_cc_t *cc, int64_t now, uint64_t next_pn) { | ||
| cc->ss_state.hystart.round_start = cc->ss_state.hystart.last_ack = now; // we only have ms resolution | ||
| cc->ss_state.hystart.end_seq = next_pn; // next packet we will send | ||
| cc->ss_state.hystart.min_round_rtt = ~0U; // max uint32_t | ||
| cc->ss_state.hystart.samples = 0; | ||
| } | ||
|
|
||
| // This code is heavily based on Linux's CUBIC/HyStart implementation with several functional differences to make it | ||
| // work with the constraints we've been given by Quicly. | ||
|
parvit marked this conversation as resolved.
Outdated
|
||
| void ss_hystart(quicly_cc_t *cc, const quicly_loss_t *loss, uint32_t bytes, uint64_t largest_acked, uint32_t inflight, | ||
| uint64_t next_pn, int64_t now, uint32_t max_udp_payload_size) | ||
| { | ||
| // RTT available at loss->rtt.latest | ||
| // dMin (min observed RTT) available at loss->rtt.minimum | ||
| // this isn't exactly sequence number comparison, but it also ain't exactly NOT sequence number comparison... | ||
| if (largest_acked > cc->ss_state.hystart.end_seq) { | ||
| ss_hystart_reset(cc, now, next_pn); | ||
| } | ||
|
|
||
|
|
||
| // check for ACK train | ||
| // Linux does this in usec, but we aren't so lucky | ||
| if (now - cc->ss_state.hystart.last_ack <= QUICLY_HYSTART_ACK_DELTA_MS) { | ||
| cc->ss_state.hystart.last_ack = now; | ||
|
|
||
| // Kernel defines threshold as `ca->delay_min + hystart_ack_delay(sk);` | ||
| // hystart_ack_delay(sk) maxes at 1ms if there is packet spacing happening | ||
| // but we don't have usec so i dont know how much it matters | ||
| uint32_t threshold = loss->rtt.minimum >> 1; | ||
|
|
||
| if (now - cc->ss_state.hystart.round_start > threshold) { | ||
| cc->ss_state.hystart.found = 1; | ||
| cc->ssthresh = cc->cwnd; | ||
| } | ||
| } | ||
|
|
||
| // HyStart Delay exit point | ||
| if (cc->ss_state.hystart.min_round_rtt > loss->rtt.latest) { | ||
| cc->ss_state.hystart.min_round_rtt = loss->rtt.latest; | ||
| } | ||
| if (cc->ss_state.hystart.samples < QUICLY_HYSTART_MIN_SAMPLES) { | ||
| cc->ss_state.hystart.samples += 1; | ||
| } | ||
| else { | ||
| uint32_t threshold = loss->rtt.minimum + MIN(QUICLY_HYSTART_DELAY_MAX, MAX(QUICLY_HYSTART_DELAY_MIN, loss->rtt.minimum >> 3)); | ||
|
|
||
| if (cc->ss_state.hystart.min_round_rtt > threshold) { | ||
| cc->ss_state.hystart.found = 1; | ||
| cc->ssthresh = cc->cwnd; | ||
| } | ||
| } | ||
|
|
||
| if (cc->ss_state.hystart.found == 0) { | ||
| cc->cwnd += bytes; | ||
| if (cc->cwnd_maximum < cc->cwnd) | ||
| cc->cwnd_maximum = cc->cwnd; | ||
| } | ||
| } | ||
|
|
||
| quicly_ss_type_t quicly_ss_type_hystart = { "hystart", ss_hystart }; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.