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_quic support
This commit is contained in:
parent
04ef37274f
commit
d0986caf03
@ -236,6 +236,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)
|
||||
|
@ -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
|
||||
|
@ -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_% congure_mock,$(USEMODULE)))
|
||||
|
52
sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_quic.c
Normal file
52
sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_quic.c
Normal file
@ -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 <m.lenders@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user