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

gnrc_sixlowpan_frag_sfr_congure: add congure_reno support #16170

Merged
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: 5 additions & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_stats
## @{
##
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure
## @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)
## @{
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure_reno
## @}
## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_quic gnrc_sixlowpan_frag_sfr_congure_quic: QUIC CC
## @brief Congestion control for SFR using the [congestion control algorithm of QUIC](@ref sys_congure_quic)
## @{
Expand Down
1 change: 1 addition & 0 deletions sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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
* @{
*
* @file
Expand Down
4 changes: 4 additions & 0 deletions sys/net/gnrc/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_quic,$(USEMODULE)))
USEMODULE += congure_quic
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_reno,$(USEMODULE)))
USEMODULE += congure_reno
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure,$(USEMODULE)))
USEMODULE += gnrc_sixlowpan_frag_sfr
ifeq (,$(filter gnrc_sixlowpan_frag_sfr_congure_% congure_mock,$(USEMODULE)))
Expand Down
69 changes: 69 additions & 0 deletions sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2021 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @{
*
* @file
* @author Martine Lenders <m.lenders@fu-berlin.de>
*/

#include "kernel_defines.h"
#include "congure/reno.h"
#include "net/gnrc/sixlowpan/config.h"

#include "net/gnrc/sixlowpan/frag/sfr/congure.h"

typedef congure_reno_snd_t _sfr_congure_snd_t;

#define SFR_CONGURE_RENO_CONSTS { \
.fr = _fr, \
.same_wnd_adv = _same_wnd_adv, \
.init_mss = 1, \
.cwnd_lower = CONFIG_GNRC_SIXLOWPAN_SFR_MIN_WIN_SIZE, \
.cwnd_upper = CONFIG_GNRC_SIXLOWPAN_SFR_MAX_WIN_SIZE, \
/* TODO make those configurable via Kconfig? */ \
.init_ssthresh = 32U, \
.frthresh = 1U, \
}

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];
static const congure_reno_snd_consts_t _sfr_congure_reno_consts = SFR_CONGURE_RENO_CONSTS;

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) {
congure_reno_snd_setup(&_sfr_congures[i],
&_sfr_congure_reno_consts);
return &_sfr_congures[i].super;
}
}
return NULL;
}

static void _fr(congure_reno_snd_t *c)
{
(void)c;
/* SFR resends when fast retransmits needs to be done anyways so
* do nothing */
return;
}

static bool _same_wnd_adv(congure_reno_snd_t *c, congure_snd_ack_t *ack)
{
(void)c;
(void)ack;
/* Window size is not advertised with SFR, so always true */
return true;
}

/** @} */
4 changes: 4 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ ifeq (congure_quic,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_quic
USEMODULE += ztimer_msec
else
ifeq (congure_reno,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_reno
else
ifeq (congure_sfr,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_sfr
else
$(error "Unknown CongURE implementation `$(CONGURE_IMPL)`")
endif
endif
endif

.PHONY: zep_dispatch

Expand Down