1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_sixlowpan_frag_sfr_congure: add congure_reno support

This commit is contained in:
Martine Lenders 2021-03-09 10:54:47 +01:00
parent 4e646feb0b
commit 33402296d3
No known key found for this signature in database
GPG Key ID: 2134D77A5336DD80
4 changed files with 79 additions and 0 deletions

View File

@ -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)
## @{

View File

@ -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

View File

@ -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)))

View File

@ -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;
}
/** @} */