summaryrefslogtreecommitdiff
path: root/ospfd/ospf_lsdb.h
diff options
context:
space:
mode:
authorAcee Lindem <acee@lindem.com>2024-05-31 14:08:04 +0000
committerAcee Lindem <acee@lindem.com>2024-06-20 15:31:07 +0000
commitc494702929d15141e8f3fd4a1d9f85095076a4b7 (patch)
treee8d790d16fef1d0a0cf83975b04c1a2aa5b7f208 /ospfd/ospf_lsdb.h
parenta1b21f526ad5d6807b39d3569845b0cb25b4d1bf (diff)
ospfd: Improve OSPF neighbor retransmission list granularity and precision
The current OSPF neighbor retransmission operates on a single per-neighbor periodic timer that sends all LSAs on the list when it expires. Additionally, since it skips the first retransmission of received LSAs so that at least the retransmission interval (resulting in a delay of between the retransmission interval and twice the interval. In environments where the links are lossy on P2MP networks with "delay-reflood" configured (which relies on neighbor retransmission in partial meshs), the implementation is sub-optimal (to say the least). This commit reimplements OSPF neighbor retransmission as follows: 1. A new data structure making use the application managed typesafe.h doubly linked list implements an OSPF LSA list where each node includes a timestamp. 2. The existing neighbor LS retransmission LSDB data structure is augmented with a pointer to the list node on the LSA list to faciliate O(1) removal when the LSA is acknowledged. 3. The neighbor LS retransmission timer is set to the expiration timer of the LSA at the top of the list. 4. When the timer expires, LSAs are retransmitted that within the window of the current time and a small delta (50 milli-secs default). The LSAs that are retransmited are given an updated retransmission time and moved to the end of the LSA list. 5. Configuration is added to set the "retransmission-window" to a value other than 50 milliseconds. 6. Neighbor and interface LSA retransmission counters are added to provide insight into the lossiness of the links. However, these will increment quickly on non-fully meshed P2MP networks with "delay-reflood" configured. 7. Added a topotest to exercise the implementation on a non-fully meshed P2MP network with "delay-reflood" configured. The alternative was to use existing mechanisms to instroduce loss but these seem less determistic in a topotest. Signed-off-by: Acee Lindem <acee@lindem.com>
Diffstat (limited to 'ospfd/ospf_lsdb.h')
-rw-r--r--ospfd/ospf_lsdb.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/ospfd/ospf_lsdb.h b/ospfd/ospf_lsdb.h
index bf295ca830..e5e3be8baa 100644
--- a/ospfd/ospf_lsdb.h
+++ b/ospfd/ospf_lsdb.h
@@ -7,6 +7,9 @@
#ifndef _ZEBRA_OSPF_LSDB_H
#define _ZEBRA_OSPF_LSDB_H
+#include "prefix.h"
+#include "table.h"
+
/* OSPF LSDB structure. */
struct ospf_lsdb {
struct {
@@ -43,9 +46,29 @@ struct ospf_lsdb {
#define AREA_LSDB(A,T) ((A)->lsdb->type[(T)].db)
#define AS_LSDB(O,T) ((O)->lsdb->type[(T)].db)
+/*
+ * Alternate route node structure for LSDB nodes linked to
+ * list elements.
+ */
+struct ospf_lsdb_linked_node {
+ /*
+ * Caution these must be the very first fields
+ */
+ ROUTE_NODE_FIELDS
+
+ /*
+ * List entry on an LSA list, e.g., a neighbor
+ * retransmission list.
+ */
+ struct ospf_lsa_list_entry *lsa_list_entry;
+};
+
/* OSPF LSDB related functions. */
extern struct ospf_lsdb *ospf_lsdb_new(void);
extern void ospf_lsdb_init(struct ospf_lsdb *);
+extern void ospf_lsdb_linked_init(struct ospf_lsdb *lsdb);
+extern struct ospf_lsdb_linked_node *
+ospf_lsdb_linked_lookup(struct ospf_lsdb *lsdb, struct ospf_lsa *lsa);
extern void ospf_lsdb_free(struct ospf_lsdb *);
extern void ospf_lsdb_cleanup(struct ospf_lsdb *);
extern void ls_prefix_set(struct prefix_ls *lp, struct ospf_lsa *lsa);