summaryrefslogtreecommitdiff
path: root/proto/babel/babel.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-10-25 17:14:08 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commitb47eaefe12d0673af2c7c7ec1a8adff982a958ca (patch)
tree7487751411e61a99948780cbc2a1522abb066ba9 /proto/babel/babel.h
parentf00221fadbb2c85c835cc5e4e69a0d3ce13d31b3 (diff)
Babel: Revamp cost computation and run route selection when cost change
Also fix several minor bugs and add 'limit' option for k-out-of-j link sensing strategy. Change default from 8-of-16 to 12-of-16. Change IHU expiry factor from 1.5 to 3.5 (as in RFC 6126).
Diffstat (limited to 'proto/babel/babel.h')
-rw-r--r--proto/babel/babel.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/proto/babel/babel.h b/proto/babel/babel.h
index d0c159f9..78841254 100644
--- a/proto/babel/babel.h
+++ b/proto/babel/babel.h
@@ -34,9 +34,10 @@
#define BABEL_HELLO_INTERVAL_WIRED (4 S_) /* Default hello intervals in seconds */
#define BABEL_HELLO_INTERVAL_WIRELESS (4 S_)
+#define BABEL_HELLO_LIMIT 12
#define BABEL_UPDATE_INTERVAL_FACTOR 4
#define BABEL_IHU_INTERVAL_FACTOR 3
-#define BABEL_IHU_EXPIRY_FACTOR(X) ((btime)(X)*3/2) /* 1.5 */
+#define BABEL_IHU_EXPIRY_FACTOR(X) ((btime)(X)*7/2) /* 3.5 */
#define BABEL_HELLO_EXPIRY_FACTOR(X) ((btime)(X)*3/2) /* 1.5 */
#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 */
@@ -112,6 +113,7 @@ struct babel_iface_config {
u16 rxcost;
u8 type;
+ u8 limit; /* Minimum number of Hellos to keep link up */
u8 check_link;
uint port;
uint hello_interval; /* Hello interval, in us */
@@ -188,7 +190,10 @@ struct babel_neighbor {
struct babel_iface *ifa;
ip_addr addr;
- u16 txcost;
+ u16 rxcost; /* Sent in last IHU */
+ u16 txcost; /* Received in last IHU */
+ u16 cost; /* Computed neighbor cost */
+ s8 ihu_cnt; /* IHU countdown, 0 to send it */
u8 hello_cnt;
u16 hello_map;
u16 next_hello_seqno;
@@ -218,6 +223,7 @@ struct babel_route {
u16 seqno;
u16 advert_metric;
u16 metric;
+ u16 old_metric;
u64 router_id;
ip_addr next_hop;
btime refresh_time;