26
26
#include "picoquic_utils.h"
27
27
28
28
#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; }
30
30
#define BBRExpTest (ctx , test ) ( (ctx)->exp_flags.test )
31
31
#else
32
32
#define BBRExpGate (ctx , test , action ) {}
@@ -440,7 +440,7 @@ static void BBRInitFullPipe(picoquic_bbr_state_t* bbr_state)
440
440
441
441
/* Initialization of optional variables defined in text string
442
442
* Syntax:
443
- * - Single letter options, all optional:
443
+ * - Single letter options that control the "BBR Experiment"
444
444
* E: do_early_exit
445
445
* R: do_rapid_start
446
446
* H: do_handle_suspension
@@ -451,10 +451,23 @@ static void BBRInitFullPipe(picoquic_bbr_state_t* bbr_state)
451
451
* T999999999: wifi_shadow_rtt, microseconds
452
452
* Q99999.999: quantum_ratio, %
453
453
*
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.
454
459
*/
455
460
static void BBRSetOptions (picoquic_bbr_state_t * bbr_state )
456
461
{
457
462
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
458
471
459
472
if (x != NULL ) {
460
473
char c ;
@@ -463,22 +476,22 @@ static void BBRSetOptions(picoquic_bbr_state_t* bbr_state)
463
476
switch (c ) {
464
477
#ifdef BBRExperiment
465
478
case 'E' :
466
- bbr_state -> exp_flags .do_early_exit = 1 ;
479
+ bbr_state -> exp_flags .do_early_exit = 0 ;
467
480
break ;
468
481
case 'R' :
469
- bbr_state -> exp_flags .do_rapid_start = 1 ;
482
+ bbr_state -> exp_flags .do_rapid_start = 0 ;
470
483
break ;
471
484
case 'H' :
472
- bbr_state -> exp_flags .do_handle_suspension = 1 ;
485
+ bbr_state -> exp_flags .do_handle_suspension = 0 ;
473
486
break ;
474
487
case 'L' :
475
- bbr_state -> exp_flags .do_control_lost = 1 ;
488
+ bbr_state -> exp_flags .do_control_lost = 0 ;
476
489
break ;
477
490
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 ;
479
492
break ;
480
493
case 'A' :
481
- bbr_state -> exp_flags .do_enter_probeBW_after_limited = 1 ;
494
+ bbr_state -> exp_flags .do_enter_probeBW_after_limited = 0 ;
482
495
break ;
483
496
#endif
484
497
case 'T' : {
@@ -550,6 +563,7 @@ static void BBROnInit(picoquic_bbr_state_t* bbr_state, picoquic_path_t* path_x,
550
563
*/
551
564
memset (bbr_state , 0 , sizeof (picoquic_bbr_state_t ));
552
565
bbr_state -> option_string = option_string ;
566
+
553
567
BBRInitRandom (bbr_state , path_x , current_time );
554
568
/* If RTT was already sampled, use it, other wise set min RTT to infinity */
555
569
if (path_x -> smoothed_rtt == PICOQUIC_INITIAL_RTT
0 commit comments