Skip to content

Commit

Permalink
gnrc_sixlowpan_frag_sfr_congure: add congure_quic support
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Oct 25, 2022
1 parent 510fbe3 commit a5541ee
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
5 changes: 5 additions & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_stats
## @{
##
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure
## @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)
## @{
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure_quic
## @}
## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_sfr gnrc_sixlowpan_frag_sfr_congure_sfr: Appendix C
## @brief Basic congestion control for 6LoWPAN SFR as proposed in Appendix C of RFC 8931
## @see [RFC 8931, Appendix C](https://tools.ietf.org/html/rfc8931#section-appendix.c)
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 @@ -16,6 +16,7 @@
* (SFR). The flavor of congestion control can be selected using the following sub-modules:
*
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_sfr (the default)
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_quic
* @{
*
* @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 @@ -244,6 +244,10 @@ ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_%,$(USEMODULE)))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_quic,$(USEMODULE)))
USEMODULE += congure_quic
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure,$(USEMODULE)))
USEMODULE += gnrc_sixlowpan_frag_sfr
ifeq (,$(filter gnrc_sixlowpan_frag_sfr_congure_%,$(USEMODULE)))
Expand Down
52 changes: 52 additions & 0 deletions sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_quic.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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 <[email protected]>
*/

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

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

static congure_quic_snd_t _sfr_congures_quic[CONFIG_GNRC_SIXLOWPAN_FRAG_FB_SIZE];
static const congure_quic_snd_consts_t _sfr_congure_quic_consts = {
/* cong_event_cb to resend a fragment is not needed since SFR always
* resends fragments lost or timed out immediately. In case of a reported
* ECN, it will also continue with the remaining fragments */
.init_wnd = CONFIG_GNRC_SIXLOWPAN_SFR_OPT_WIN_SIZE,
.min_wnd = CONFIG_GNRC_SIXLOWPAN_SFR_MIN_WIN_SIZE,
/* TODO make those configurable via Kconfig? */
.init_rtt = 333U,
.max_msg_size = 1,
.pc_thresh = 3000,
.granularity = 1,
.loss_reduction_numerator = 1,
.loss_reduction_denominator = 2,
.inter_msg_interval_numerator = 5,
.inter_msg_interval_denominator = 4,
};

congure_snd_t *gnrc_sixlowpan_frag_sfr_congure_snd_get(void)
{
for (unsigned i = 0; i < ARRAY_SIZE(_sfr_congures_quic); i++) {
if (_sfr_congures_quic[i].super.driver == NULL) {
congure_quic_snd_setup(&_sfr_congures_quic[i],
&_sfr_congure_quic_consts);
return &_sfr_congures_quic[i].super;
}
}
return NULL;
}

/** @} */

0 comments on commit a5541ee

Please sign in to comment.