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 picoquic ns cc options #1857

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion picoquictest/cc_compete_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,19 @@ int cc_ns_low_and_up_test()
return picoquic_ns(&spec);
}

/* Check that the picoquic_ns simulations can correctly test the low_and_up scenario.
/* Check that the picoquic_ns simulations can correctly test the wifi fade scenario.
* also check the cc options are handled as expected.
*/
int cc_ns_wifi_fade_test()
{
picoquic_ns_spec_t spec = { 0 };
picoquic_connection_id_t icid = { { 0xcc, 0xff, 0xbb, 0, 0, 0, 0, 0}, 8 };
spec.main_cc_algo = picoquic_bbr_algorithm;
spec.main_cc_options = "T50000";
spec.main_start_time = 0;
spec.main_scenario_text = cc_compete_batch_scenario_4M;
spec.background_cc_algo = picoquic_bbr_algorithm;
spec.background_cc_options = "T50000";
spec.background_start_time = 0;
spec.background_scenario_text = cc_compete_batch_scenario_10M;
spec.nb_connections = 1;
Expand Down
9 changes: 6 additions & 3 deletions picoquictest/picoquic_ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
typedef struct st_picoquic_ns_client_t {
uint64_t start_time;
picoquic_cnx_t* cnx;
picoquic_congestion_algorithm_t* cc_algo;
picoquic_congestion_algorithm_t const* cc_algo;
char const* cc_option_string;
quicperf_ctx_t* quicperf_ctx;
picoquic_connection_id_t icid;
} picoquic_ns_client_t;
Expand Down Expand Up @@ -143,7 +144,7 @@ int picoquic_ns_server_callback(picoquic_cnx_t* cnx,
if (cc_ctx->client_ctx[i]->cnx != NULL &&
picoquic_compare_connection_id(&cnx->path[0]->p_remote_cnxid->cnx_id,
&cc_ctx->client_ctx[i]->cnx->path[0]->p_local_cnxid->cnx_id) == 0) {
picoquic_set_congestion_algorithm(cnx, cc_ctx->client_ctx[i]->cc_algo);
picoquic_set_congestion_algorithm_ex(cnx, cc_ctx->client_ctx[i]->cc_algo, cc_ctx->client_ctx[i]->cc_option_string);
ret = 0;
}
}
Expand Down Expand Up @@ -194,11 +195,13 @@ int picoquic_ns_create_client_ctx(picoquic_ns_ctx_t* cc_ctx, picoquic_ns_spec_t*
if (client_id == 0) {
client_ctx->start_time = spec->main_start_time;
client_ctx->cc_algo = spec->main_cc_algo;
client_ctx->cc_option_string = spec->main_cc_options;
scenario_text = spec->main_scenario_text;
}
else {
client_ctx->start_time = spec->background_start_time;
client_ctx->cc_algo = spec->background_cc_algo;
client_ctx->cc_option_string = spec->background_cc_options;
scenario_text = spec->background_scenario_text;
}
if ((client_ctx->quicperf_ctx = quicperf_create_ctx(scenario_text)) == NULL) {
Expand Down Expand Up @@ -584,7 +587,7 @@ int picoquic_ns_start_connection(picoquic_ns_ctx_t* cc_ctx, int cnx_id)
ret = -1;
}
else {
picoquic_set_congestion_algorithm(cc_ctx->client_ctx[cnx_id]->cnx, cc_ctx->client_ctx[cnx_id]->cc_algo);
picoquic_set_congestion_algorithm_ex(cc_ctx->client_ctx[cnx_id]->cnx, cc_ctx->client_ctx[cnx_id]->cc_algo, cc_ctx->client_ctx[cnx_id]->cc_option_string);
picoquic_set_callback(cc_ctx->client_ctx[cnx_id]->cnx, quicperf_callback,
cc_ctx->client_ctx[cnx_id]->quicperf_ctx);
cc_ctx->client_ctx[cnx_id]->cnx->local_parameters.max_datagram_frame_size = 1532;
Expand Down
6 changes: 4 additions & 2 deletions picoquictest/picoquic_ns.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ typedef struct st_picoquic_ns_spec_t {
uint64_t background_start_time;
const char* main_scenario_text;
const char* background_scenario_text;
picoquic_congestion_algorithm_t* main_cc_algo;
picoquic_congestion_algorithm_t* background_cc_algo;
picoquic_congestion_algorithm_t const* main_cc_algo;
char const* main_cc_options;
picoquic_congestion_algorithm_t const* background_cc_algo;
char const* background_cc_options;
int nb_connections;
double data_rate_in_gbps; /* datarate, server to clients, defaults to 10 mbps */
double data_rate_up_in_gbps; /* datarate, server to clients, defaults to data rate */
Expand Down
Loading