congure.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2021 Freie Universität Berlin
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
20 #include <stdint.h>
21 
22 #include "clist.h"
23 #include "ztimer.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define CONGURE_WND_SIZE_MAX (UINT16_MAX)
33 
38 typedef uint16_t congure_wnd_size_t;
39 
44 
48 typedef struct {
58  void *ctx;
61 
65 typedef struct {
77  uint8_t resends;
79 
83 typedef struct {
88  uint32_t id;
104  uint16_t clean;
110  uint16_t delay;
112 
125  void (*init)(congure_snd_t *c, void *ctx);
126 
139  int32_t (*inter_msg_interval)(congure_snd_t *c, unsigned msg_size);
140 
147  void (*report_msg_sent)(congure_snd_t *c, unsigned msg_size);
148 
159  void (*report_msg_discarded)(congure_snd_t *c, unsigned msg_size);
160 
175 
194 
203  congure_snd_ack_t *ack);
204 
215 };
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
Circular linked list.
uint16_t congure_wnd_size_t
Define type for window size to allow for possible window size scaling.
Definition: congure.h:38
uint32_t ztimer_now_t
type for ztimer_now() result
Definition: ztimer.h:308
Object to represent an ACK to a message.
Definition: congure.h:83
congure_wnd_size_t wnd
the peer-reported window size in caller defined units.
Definition: congure.h:97
ztimer_now_t recv_time
Timestamp in milliseconds of when the ACK was received.
Definition: congure.h:87
uint16_t delay
the peer-reported time in milliseconds the ACK was delayed since message reception.
Definition: congure.h:110
uint32_t id
ID of the message the ACK is for.
Definition: congure.h:88
uint16_t clean
true, if ACK only contains an ACK, false if not
Definition: congure.h:104
congure_wnd_size_t size
size of the ACK in initiator-defined units
Definition: congure.h:92
Driver for CongURE objects.
Definition: congure.h:116
void(* report_msg_sent)(congure_snd_t *c, unsigned msg_size)
Report that a message was sent.
Definition: congure.h:147
void(* report_msgs_lost)(congure_snd_t *c, congure_snd_msg_t *msgs)
Report that a collection of messages that is known to be lost.
Definition: congure.h:193
void(* init)(congure_snd_t *c, void *ctx)
Initializes a CongURE object.
Definition: congure.h:125
void(* report_ecn_ce)(congure_snd_t *c, ztimer_now_t time)
Report that "congestion encountered" CE signals were received for a message by means of explicit cong...
Definition: congure.h:214
void(* report_msgs_timeout)(congure_snd_t *c, congure_snd_msg_t *msgs)
Report that the ACKs for a collection of messages timed out.
Definition: congure.h:174
int32_t(* inter_msg_interval)(congure_snd_t *c, unsigned msg_size)
Get current interval between messages for pacing.
Definition: congure.h:139
void(* report_msg_discarded)(congure_snd_t *c, unsigned msg_size)
Report message as discarded.
Definition: congure.h:159
void(* report_msg_acked)(congure_snd_t *c, congure_snd_msg_t *msg, congure_snd_ack_t *ack)
Report that the ACK for a message was received.
Definition: congure.h:202
Object to represent a collection of sent messages.
Definition: congure.h:65
congure_wnd_size_t size
size in initiator-defined units
Definition: congure.h:71
clist_node_t super
see clist_node_t
Definition: congure.h:66
ztimer_now_t send_time
timestamp in milliseconds of when the message was sent.
Definition: congure.h:70
uint8_t resends
number of times the message has already been resent.
Definition: congure.h:77
Base state object for CongURE implementations.
Definition: congure.h:48
const congure_snd_driver_t * driver
Driver for the state object.
Definition: congure.h:52
void * ctx
Context for callbacks specific to the congestion control.
Definition: congure.h:58
congure_wnd_size_t cwnd
Congestion window size.
Definition: congure.h:59
List node structure.
Definition: list.h:36
ztimer API