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

optimize transport performance in some extreme scenarios #392

Merged
merged 3 commits into from
Dec 26, 2023
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
13 changes: 12 additions & 1 deletion demo/demo_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ typedef struct xqc_demo_cli_quic_config_s {

uint64_t least_available_cid_count;

size_t max_pkt_sz;

} xqc_demo_cli_quic_config_t;


Expand Down Expand Up @@ -1643,6 +1645,8 @@ xqc_demo_cli_init_conneciton_settings(xqc_conn_settings_t* settings,
settings->multipath_version = args->quic_cfg.mp_version;
settings->mp_ping_on = 1;
settings->is_interop_mode = args->quic_cfg.is_interop_mode;
settings->max_pkt_out_size = args->quic_cfg.max_pkt_sz;
settings->adaptive_ack_frequency = 1;
if (args->req_cfg.throttled_req != -1) {
settings->enable_stream_rate_limit = 1;
settings->recv_rate_bytes_per_sec = 0;
Expand Down Expand Up @@ -1672,6 +1676,7 @@ xqc_demo_cli_init_args(xqc_demo_cli_client_args_t *args)
args->quic_cfg.keyupdate_pkt_threshold = UINT64_MAX;
/* default 04 */
args->quic_cfg.mp_version = XQC_MULTIPATH_04;
args->quic_cfg.max_pkt_sz = 1200;

args->req_cfg.throttled_req = -1;

Expand Down Expand Up @@ -1791,14 +1796,15 @@ xqc_demo_cli_usage(int argc, char *argv[])
" -n Throttling the {1,2,...}xn-th requests\n"
" -e NAT rebinding on path 0\n"
" -E NAT rebinding on path 1\n"
" -F MTU size (default: 1200)\n"
, prog);
}

void
xqc_demo_cli_parse_args(int argc, char *argv[], xqc_demo_cli_client_args_t *args)
{
int ch = 0;
while ((ch = getopt(argc, argv, "a:p:c:Ct:S:0m:A:D:l:L:k:K:U:u:dMoi:w:Ps:bZ:NQT:R:V:B:I:n:eE")) != -1) {
while ((ch = getopt(argc, argv, "a:p:c:Ct:S:0m:A:D:l:L:k:K:U:u:dMoi:w:Ps:bZ:NQT:R:V:B:I:n:eEF:")) != -1) {
switch (ch) {
/* server ip */
case 'a':
Expand Down Expand Up @@ -2033,6 +2039,11 @@ xqc_demo_cli_parse_args(int argc, char *argv[], xqc_demo_cli_client_args_t *args
args->net_cfg.rebind_p1 = 1;
break;

case 'F':
printf("MTU size: %s\n", optarg);
args->quic_cfg.max_pkt_sz = atoi(optarg);
break;

default:
printf("other option :%c\n", ch);
xqc_demo_cli_usage(argc, argv);
Expand Down
14 changes: 13 additions & 1 deletion demo/demo_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ typedef struct xqc_demo_svr_quic_config_s {

uint64_t keyupdate_pkt_threshold;
uint64_t least_available_cid_count;

size_t max_pkt_sz;
} xqc_demo_svr_quic_config_t;


Expand Down Expand Up @@ -1215,6 +1217,7 @@ xqc_demo_svr_usage(int argc, char *argv[])
" -s multipath scheduler (interop, minrtt, backup), default: interop\n"
" -R Reinjection (1,2,4) \n"
" -u Keyupdate packet threshold\n"
" -F MTU size (default: 1200)\n"
, prog);
}

Expand Down Expand Up @@ -1253,13 +1256,14 @@ xqc_demo_svr_init_args(xqc_demo_svr_args_t *args)

args->quic_cfg.keyupdate_pkt_threshold = UINT64_MAX;
args->quic_cfg.least_available_cid_count = 1;
args->quic_cfg.max_pkt_sz = 1200;
}

void
xqc_demo_svr_parse_args(int argc, char *argv[], xqc_demo_svr_args_t *args)
{
int ch = 0;
while ((ch = getopt(argc, argv, "p:c:CD:l:L:6k:rdMiPs:R:u:a:")) != -1) {
while ((ch = getopt(argc, argv, "p:c:CD:l:L:6k:rdMiPs:R:u:a:F:")) != -1) {
switch (ch) {
/* listen port */
case 'p':
Expand Down Expand Up @@ -1377,6 +1381,11 @@ xqc_demo_svr_parse_args(int argc, char *argv[], xqc_demo_svr_args_t *args)
args->quic_cfg.least_available_cid_count = atoi(optarg);
break;

case 'F':
printf("MTU size: %s\n", optarg);
args->quic_cfg.max_pkt_sz = atoi(optarg);
break;

default:
printf("other option :%c\n", ch);
xqc_demo_svr_usage(argc, argv);
Expand Down Expand Up @@ -1485,6 +1494,7 @@ xqc_demo_svr_init_conn_settings(xqc_demo_svr_args_t *args)
.cc_params = {
.customize_on = 1,
.init_cwnd = 32,
.bbr_enable_lt_bw = 1,
},
.spurious_loss_detect_on = 1,
.init_idle_time_out = 60000,
Expand All @@ -1498,6 +1508,8 @@ xqc_demo_svr_init_conn_settings(xqc_demo_svr_args_t *args)
.keyupdate_pkt_threshold = args->quic_cfg.keyupdate_pkt_threshold,
.least_available_cid_count = args->quic_cfg.least_available_cid_count,
.is_interop_mode = args->quic_cfg.is_interop_mode,
.max_pkt_out_size = args->quic_cfg.max_pkt_sz,
.adaptive_ack_frequency = 1,
};

xqc_server_set_conn_settings(&conn_settings);
Expand Down
2 changes: 2 additions & 0 deletions include/xquic/xquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ typedef struct xqc_cc_params_s {
uint32_t min_cwnd;
uint32_t expect_bw;
uint32_t max_expect_bw;
uint8_t bbr_enable_lt_bw;
uint32_t cc_optimization_flags;
/* 0 < delta <= delta_max, default 0.05, ->0 = more throughput-oriented */
double copa_delta_base;
Expand Down Expand Up @@ -1217,6 +1218,7 @@ typedef struct xqc_conn_settings_s {
uint32_t max_ack_delay;
/* generate an ACK if received ack-eliciting pkts >= ack_frequency */
uint32_t ack_frequency;
uint8_t adaptive_ack_frequency;
uint64_t loss_detection_pkt_thresh;
double pto_backoff_factor;

Expand Down
Loading