diff --git a/makefiles/pseudomodules.inc.mk b/makefiles/pseudomodules.inc.mk index 40ad9fa7bfd0..bfe22076e888 100644 --- a/makefiles/pseudomodules.inc.mk +++ b/makefiles/pseudomodules.inc.mk @@ -236,6 +236,14 @@ PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_stats ## @{ ## PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure +## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_abe gnrc_sixlowpan_frag_sfr_congure_abe: TCP Reno with ABE +## @brief Congestion control for SFR using the [TCP Reno congestion control algorithm with ABE](@ref sys_congure_abe) +## +## Provides an Alternative Backoff with Explicit Content Notification (ABE) to TCP-Reno-based congestion +## control +## @{ +PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure_abe +## @} ## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_reno gnrc_sixlowpan_frag_sfr_congure_reno: TCP Reno ## @brief Congestion control for SFR using the [TCP Reno congestion control algorithm](@ref sys_congure_reno) ## @{ diff --git a/sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h b/sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h index 38ebbe24842a..2b768fda78a3 100644 --- a/sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h +++ b/sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h @@ -18,6 +18,7 @@ * - @ref net_gnrc_sixlowpan_frag_sfr_congure_sfr (the default) * - @ref net_gnrc_sixlowpan_frag_sfr_congure_quic * - @ref net_gnrc_sixlowpan_frag_sfr_congure_reno + * - @ref net_gnrc_sixlowpan_frag_sfr_congure_abe * @{ * * @file diff --git a/sys/net/gnrc/Makefile.dep b/sys/net/gnrc/Makefile.dep index dd8e8dc58875..e7e466e16301 100644 --- a/sys/net/gnrc/Makefile.dep +++ b/sys/net/gnrc/Makefile.dep @@ -244,6 +244,11 @@ ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_%,$(USEMODULE))) USEMODULE += gnrc_sixlowpan_frag_sfr_congure endif +ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_abe,$(USEMODULE))) + USEMODULE += gnrc_sixlowpan_frag_sfr_congure_reno + USEMODULE += congure_abe +endif + ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_quic,$(USEMODULE))) USEMODULE += congure_quic endif diff --git a/sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c b/sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c index 6eca41496e16..b4b24958ae78 100644 --- a/sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c +++ b/sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c @@ -14,12 +14,17 @@ */ #include "kernel_defines.h" +#include "congure/abe.h" #include "congure/reno.h" #include "net/gnrc/sixlowpan/config.h" #include "net/gnrc/sixlowpan/frag/sfr/congure.h" +#if IS_USED(MODULE_CONGURE_ABE) +typedef congure_abe_snd_t _sfr_congure_snd_t; +#else typedef congure_reno_snd_t _sfr_congure_snd_t; +#endif #define SFR_CONGURE_RENO_CONSTS { \ .fr = _fr, \ @@ -36,14 +41,27 @@ static void _fr(congure_reno_snd_t *c); static bool _same_wnd_adv(congure_reno_snd_t *c, congure_snd_ack_t *ack); static _sfr_congure_snd_t _sfr_congures[CONFIG_GNRC_SIXLOWPAN_FRAG_FB_SIZE]; +#if IS_USED(MODULE_CONGURE_ABE) +static const congure_abe_snd_consts_t _sfr_congure_abe_consts = { + .reno = SFR_CONGURE_RENO_CONSTS, + .abe_multiplier_numerator = CONFIG_CONGURE_ABE_MULTIPLIER_NUMERATOR_DEFAULT, + .abe_multiplier_denominator = CONFIG_CONGURE_ABE_MULTIPLIER_DENOMINATOR_DEFAULT, +}; +#else static const congure_reno_snd_consts_t _sfr_congure_reno_consts = SFR_CONGURE_RENO_CONSTS; +#endif congure_snd_t *gnrc_sixlowpan_frag_sfr_congure_snd_get(void) { for (unsigned i = 0; i < ARRAY_SIZE(_sfr_congures); i++) { if (_sfr_congures[i].super.driver == NULL) { +#if IS_USED(MODULE_CONGURE_ABE) + congure_abe_snd_setup(&_sfr_congures[i], + &_sfr_congure_abe_consts); +#else congure_reno_snd_setup(&_sfr_congures[i], &_sfr_congure_reno_consts); +#endif return &_sfr_congures[i].super; } } diff --git a/tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile b/tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile index cc65b52781a5..03cecb99a14e 100644 --- a/tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile +++ b/tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile @@ -30,6 +30,9 @@ endif CONGURE_IMPL ?= congure_sfr +ifeq (congure_abe,$(CONGURE_IMPL)) + USEMODULE += gnrc_sixlowpan_frag_sfr_congure_abe +else ifeq (congure_quic,$(CONGURE_IMPL)) USEMODULE += gnrc_sixlowpan_frag_sfr_congure_quic USEMODULE += ztimer_msec @@ -44,6 +47,7 @@ else endif endif endif +endif .PHONY: zep_dispatch