summaryrefslogtreecommitdiff
path: root/proto/babel/babel.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-11-08 14:35:52 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commitdbf1ed263c1c15f79fb200b4dfe3bffea231f4e4 (patch)
treee3755ad6832486a02f1d5acc80ba6c44083cbec0 /proto/babel/babel.h
parent672fb78e1272bb49cc2521176effe75e3cb22460 (diff)
Babel: Fix handling of seqno requests
Old behavior has several deficiencies compared to standard behavior (no triggered updates for replies, no retransmissions, ...).
Diffstat (limited to 'proto/babel/babel.h')
-rw-r--r--proto/babel/babel.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/proto/babel/babel.h b/proto/babel/babel.h
index ccd3479e..3ea21269 100644
--- a/proto/babel/babel.h
+++ b/proto/babel/babel.h
@@ -42,7 +42,8 @@
#define BABEL_ROUTE_EXPIRY_FACTOR(X) ((btime)(X)*7/2) /* 3.5 */
#define BABEL_ROUTE_REFRESH_INTERVAL (2 S_) /* Time before route expiry to send route request */
#define BABEL_HOLD_TIME (10 S_) /* Expiry time for our own routes */
-#define BABEL_SEQNO_REQUEST_EXPIRY (60 S_)
+#define BABEL_SEQNO_REQUEST_RETRY 4
+#define BABEL_SEQNO_REQUEST_EXPIRY (2 S_)
#define BABEL_GARBAGE_INTERVAL (300 S_)
#define BABEL_RXCOST_WIRED 96
#define BABEL_RXCOST_WIRELESS 256
@@ -147,9 +148,7 @@ struct babel_proto {
slab *route_slab;
slab *source_slab;
slab *msg_slab;
-
slab *seqno_slab;
- list seqno_cache; /* Seqno requests in the cache (struct babel_seqno_request) */
struct tbf log_pkt_tbf; /* TBF for packet messages */
};
@@ -190,6 +189,7 @@ struct babel_neighbor {
struct babel_iface *ifa;
ip_addr addr;
+ uint uc; /* Reference counter for seqno requests */
u16 rxcost; /* Sent in last IHU */
u16 txcost; /* Received in last IHU */
u16 cost; /* Computed neighbor cost */
@@ -231,12 +231,23 @@ struct babel_route {
btime expiry_interval;
};
+struct babel_seqno_request {
+ node n;
+ u64 router_id;
+ u16 seqno;
+ u8 hop_count;
+ u8 count;
+ btime expires;
+ struct babel_neighbor *nbr;
+};
+
struct babel_entry {
struct babel_route *selected_in;
struct babel_route *selected_out;
btime updated;
+ list requests;
list sources; /* Source entries for this prefix (struct babel_source). */
list routes; /* Routes for this prefix (struct babel_route) */
@@ -244,13 +255,6 @@ struct babel_entry {
};
/* Stores forwarded seqno requests for duplicate suppression. */
-struct babel_seqno_request {
- node n;
- net_addr net;
- u64 router_id;
- u16 seqno;
- btime updated;
-};
/*