summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2019-02-08 10:47:42 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2019-02-08 12:39:23 +0100
commite00c9b13acad23e14df9d5cf4c7868dfd6e1bc55 (patch)
tree1447e0402a78b79edd03cd8f72bc6c236df81a4c /include
parent5dd086aa679e3e05d20ef6a19f3fefbe46ffe40e (diff)
downloadouroboros-e00c9b13acad23e14df9d5cf4c7868dfd6e1bc55.tar.gz
ouroboros-e00c9b13acad23e14df9d5cf4c7868dfd6e1bc55.zip
lib: Add initial rtt estimator to FRCT
This adds a simple round-trip time estimator to FRCT. The estimate is a weighted average with deviation. The retransmission is scheduled after rtt + 2 times the deviation. A retransmit doubles the rtt estimate to avoid the no-update case when rtt suddenly increases. The rtt is estimated in microseconds and the granularity for retransmits is 256 microseconds. Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h
index f5b6686f..d40a1783 100644
--- a/include/ouroboros/utils.h
+++ b/include/ouroboros/utils.h
@@ -28,6 +28,7 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+#define ABS(a) ((a) > 0 ? (a) : -(a))
typedef struct {
uint8_t * data;