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

Add RTT tests to BBRv3 #1634

Merged
merged 11 commits into from
Feb 22, 2024
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ Release
*.b
/picoquic/qlogger.c
/picohttp_t/h3-m-www
/enc_temp_folder/b4cf614ae2082c1d235e80918228e6
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else()
endif()

project(picoquic
VERSION 1.1.19.0
VERSION 1.1.19.1
DESCRIPTION "picoquic library"
LANGUAGES C CXX)

Expand Down
6 changes: 6 additions & 0 deletions UnitTest1/unittest1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,12 @@ namespace UnitTest1
Assert::AreEqual(ret, 0);
}

TEST_METHOD(mediatest_wifi) {
int ret = mediatest_wifi_test();

Assert::AreEqual(ret, 0);
}

TEST_METHOD(mediatest_worst) {
int ret = mediatest_worst_test();

Expand Down
8 changes: 5 additions & 3 deletions loglib/csv.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ int picoquic_cc_bin_to_csv(FILE * f_binlog, FILE * f_csvlog)
ret |= fprintf(f_csvlog, "cwin blkd, ") <= 0;
ret |= fprintf(f_csvlog, "flow blkd, ") <= 0;
ret |= fprintf(f_csvlog, "stream blkd, ") <= 0;
ret |= fprintf(f_csvlog, "app limited, ") <= 0;
ret |= fprintf(f_csvlog, "cc_state, ") <= 0;
ret |= fprintf(f_csvlog, "cc_param, ") <= 0;
ret |= fprintf(f_csvlog, "bw_max, ") <= 0;
Expand Down Expand Up @@ -126,7 +127,6 @@ int csv_cb(bytestream * s, void * ptr)
time -= data->starttime;

if (ret == 0 && id == picoquic_log_event_cc_update) {

uint64_t sequence = 0;
uint64_t packet_rcvd = 0;
uint64_t highest_ack = UINT64_MAX;
Expand All @@ -150,6 +150,7 @@ int csv_cb(bytestream * s, void * ptr)
uint64_t cc_param = 0;
uint64_t bw_max = 0;
uint64_t bytes_in_transit = 0;
uint64_t app_limited = 0;

ret |= byteread_vint(s, &sequence);
ret |= byteread_vint(s, &packet_rcvd);
Expand Down Expand Up @@ -177,11 +178,12 @@ int csv_cb(bytestream * s, void * ptr)
(void)byteread_vint(s, &cc_param);
(void)byteread_vint(s, &bw_max);
(void)byteread_vint(s, &bytes_in_transit);
(void)byteread_vint(s, &app_limited);

if (ret != 0 || fprintf(f_csvlog, "%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRId64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ",",
if (ret != 0 || fprintf(f_csvlog, "%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRId64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ",",
time, path_id, sequence, (int64_t)highest_ack, high_ack_time, last_time_ack,
cwin, one_way_delay, rtt_sample, SRTT, RTT_min, bandwidth_estimate, receive_rate_estimate, Send_MTU, pacing_packet_time,
nb_retrans, nb_spurious, cwin_blkd, flow_blkd, stream_blkd, cc_state, cc_param, bw_max, bytes_in_transit) <= 0) {
nb_retrans, nb_spurious, cwin_blkd, flow_blkd, stream_blkd, app_limited, cc_state, cc_param, bw_max, bytes_in_transit) <= 0) {
ret = -1;
}
if (ret != 0 || fprintf(f_csvlog, "\n") <= 0) {
Expand Down
10 changes: 10 additions & 0 deletions loglib/qlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ typedef struct qlog_context_st {
unsigned int key_phase_received : 1;
unsigned int spin_bit_sent_last : 1;
unsigned int spin_bit_sent : 1;
unsigned int app_limited : 1;

int state;
} qlog_context_t;
Expand Down Expand Up @@ -1312,6 +1313,7 @@ int qlog_cc_update(uint64_t time, uint64_t path_id, bytestream* s, void* ptr)
uint64_t cc_param = 0;
uint64_t bw_max = 0;
uint64_t bytes_in_transit = 0;
uint64_t app_limited = 0;
qlog_context_t* ctx = (qlog_context_t*)ptr;
FILE* f = ctx->f_txtlog;

Expand Down Expand Up @@ -1341,6 +1343,8 @@ int qlog_cc_update(uint64_t time, uint64_t path_id, bytestream* s, void* ptr)
ret |= byteread_vint(s, &cc_param);
ret |= byteread_vint(s, &bw_max);
ret |= byteread_vint(s, &bytes_in_transit);
/* Not checking the app limited return, because it is not present in old bin logs */
(void) byteread_vint(s, &app_limited);

if (ret == 0 &&
(cwin != ctx->cwin || rtt_sample != ctx->rtt_sample || SRTT != ctx->SRTT ||
Expand Down Expand Up @@ -1393,6 +1397,12 @@ int qlog_cc_update(uint64_t time, uint64_t path_id, bytestream* s, void* ptr)
if (rtt_sample != ctx->rtt_sample) {
fprintf(f, "%s\"latest_rtt\": %" PRIu64, comma, rtt_sample);
ctx->rtt_sample = rtt_sample;
comma = ",";
}

if (app_limited != ctx->app_limited) {
fprintf(f, "%s\"app_limited\": %" PRIu64, comma, app_limited);
ctx->app_limited = (app_limited != 0);
/* comma = ","; (not useful since last block of function) */
}

Expand Down
Loading
Loading