Skip to content

Commit ef7af05

Browse files
committed
Tune default of BBR Experiments flags.
1 parent 46729c1 commit ef7af05

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

picoquic/bbr.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "picoquic_utils.h"
2727

2828
#ifdef BBRExperiment
29-
#define BBRExpGate(ctx, test, action) { if (ctx->exp_flags.test) action; }
29+
#define BBRExpGate(ctx, test, action) { if (!ctx->exp_flags.test) action; }
3030
#define BBRExpTest(ctx, test) ( (ctx)->exp_flags.test )
3131
#else
3232
#define BBRExpGate(ctx, test, action) {}
@@ -440,7 +440,7 @@ static void BBRInitFullPipe(picoquic_bbr_state_t* bbr_state)
440440

441441
/* Initialization of optional variables defined in text string
442442
* Syntax:
443-
* - Single letter options, all optional:
443+
* - Single letter options that control the "BBR Experiment"
444444
* E: do_early_exit
445445
* R: do_rapid_start
446446
* H: do_handle_suspension
@@ -451,10 +451,23 @@ static void BBRInitFullPipe(picoquic_bbr_state_t* bbr_state)
451451
* T999999999: wifi_shadow_rtt, microseconds
452452
* Q99999.999: quantum_ratio, %
453453
*
454+
* The "BBR Experiment" is an attempt to improve behavior of BBR for
455+
* realtime support on some networks, mostly Wi-Fi. The experiment was a
456+
* success, and the corresponding support is on by default, The individual
457+
* option flags can be used to turn off some parts of the experiment,
458+
* for example when doing before/after measurements.
454459
*/
455460
static void BBRSetOptions(picoquic_bbr_state_t* bbr_state)
456461
{
457462
const char* x = bbr_state->option_string;
463+
#ifdef BBRExperiment
464+
bbr_state->exp_flags.do_early_exit = 1;
465+
bbr_state->exp_flags.do_rapid_start = 1;
466+
bbr_state->exp_flags.do_handle_suspension = 1;
467+
bbr_state->exp_flags.do_control_lost = 1;
468+
bbr_state->exp_flags.do_exit_probeBW_up_on_delay = 1;
469+
bbr_state->exp_flags.do_enter_probeBW_after_limited = 1;
470+
#endif
458471

459472
if (x != NULL) {
460473
char c;
@@ -463,22 +476,22 @@ static void BBRSetOptions(picoquic_bbr_state_t* bbr_state)
463476
switch (c) {
464477
#ifdef BBRExperiment
465478
case 'E':
466-
bbr_state->exp_flags.do_early_exit = 1;
479+
bbr_state->exp_flags.do_early_exit = 0;
467480
break;
468481
case 'R':
469-
bbr_state->exp_flags.do_rapid_start = 1;
482+
bbr_state->exp_flags.do_rapid_start = 0;
470483
break;
471484
case 'H':
472-
bbr_state->exp_flags.do_handle_suspension = 1;
485+
bbr_state->exp_flags.do_handle_suspension = 0;
473486
break;
474487
case 'L':
475-
bbr_state->exp_flags.do_control_lost = 1;
488+
bbr_state->exp_flags.do_control_lost = 0;
476489
break;
477490
case 'D':
478-
bbr_state->exp_flags.do_exit_probeBW_up_on_delay = 1;
491+
bbr_state->exp_flags.do_exit_probeBW_up_on_delay = 0;
479492
break;
480493
case 'A':
481-
bbr_state->exp_flags.do_enter_probeBW_after_limited = 1;
494+
bbr_state->exp_flags.do_enter_probeBW_after_limited = 0;
482495
break;
483496
#endif
484497
case 'T': {
@@ -550,6 +563,7 @@ static void BBROnInit(picoquic_bbr_state_t* bbr_state, picoquic_path_t* path_x,
550563
*/
551564
memset(bbr_state, 0, sizeof(picoquic_bbr_state_t));
552565
bbr_state->option_string = option_string;
566+
553567
BBRInitRandom(bbr_state, path_x, current_time);
554568
/* If RTT was already sampled, use it, other wise set min RTT to infinity */
555569
if (path_x->smoothed_rtt == PICOQUIC_INITIAL_RTT

0 commit comments

Comments
 (0)