summaryrefslogtreecommitdiff
path: root/proto/babel/babel.h
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@toke.dk>2022-12-24 15:47:11 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2022-12-24 15:52:12 +0100
commit8b06a4d8af46511f0f8dbb8905afa88590a831b6 (patch)
treeb2b3048c84185161759332776a95b3ebbf1ec9c7 /proto/babel/babel.h
parent2b7643e1f8ecb0bd4cf9af4183b4fd53b655d19c (diff)
Babel: Rework seqno request handling
The seqno request retransmission handling was tracking the destination that a forwarded request was being sent to and always retransmitting to that same destination. This is unnecessary because we only need to retransmit requests we originate ourselves, not those we forward on behalf of others; in fact retransmitting on behalf of others can lead to exponential multiplication of requests, which would be bad. So rework the seqno request tracking so that instead of storing the destination of a request, we just track whether it was a request that we forwarded on behalf of another node, or if it was a request we originated ourselves. Forwarded requests are not retransmitted, they are only used for duplicate suppression, and for triggering an update when satisfied. If we end up originating a request that we previously forwarded, we "upgrade" the old request and restart the retransmit counter. One complication with this is that requests sent in response to unfeasible updates (section 3.8.2.2 of the RFC) have to be sent as unicast to a particular peer. However, we don't really need to retransmit those as there's no starvation when sending such a request; so we just change such requests to be one-off unicast requests that are not subject to retransmission or duplicate suppression. This is the same behaviour as babeld has for such requests. Minor changes from committer.
Diffstat (limited to 'proto/babel/babel.h')
-rw-r--r--proto/babel/babel.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/proto/babel/babel.h b/proto/babel/babel.h
index 8b6da3c8..da8386b3 100644
--- a/proto/babel/babel.h
+++ b/proto/babel/babel.h
@@ -48,6 +48,8 @@
#define BABEL_ROUTE_REFRESH_FACTOR(X) ((btime)(X)*5/2) /* 2.5 */
#define BABEL_SEQNO_REQUEST_RETRY 4
#define BABEL_SEQNO_REQUEST_EXPIRY (2 S_)
+#define BABEL_SEQNO_FORWARD_EXPIRY (10 S_)
+#define BABEL_SEQNO_DUP_SUPPRESS_TIME (1 S_)
#define BABEL_GARBAGE_INTERVAL (300 S_)
#define BABEL_RXCOST_WIRED 96
#define BABEL_RXCOST_WIRELESS 256
@@ -240,7 +242,6 @@ struct babel_neighbor {
btime init_expiry;
list routes; /* Routes this neighbour has sent us (struct babel_route) */
- list requests; /* Seqno requests bound to this neighbor */
};
struct babel_source {
@@ -270,13 +271,13 @@ struct babel_route {
struct babel_seqno_request {
node n;
- node nbr_node;
u64 router_id;
u16 seqno;
+ u8 forwarded;
u8 hop_count;
u8 count;
btime expires;
- struct babel_neighbor *nbr;
+ btime dup_suppress_time;
};
struct babel_entry {