ospfd: Fast OSPF convergence
When considering small networks that have extreme requirements on
availability and thus convergence delay, the timers given in the OSPF RFC
seem a little “conservative”, i.e., the delay between accepted LSAs and the
rate at which LSAs are sent. Cisco introduced two commands 'timers throttle
lsa all’ and 'timers lsa arrival’, which allow operators to tune these
parameters.
I have been writing a patch to also support 'timers lsa arrival’ fully and
‘timers throttle lsa all’ (without the throttling part) also in quagga.
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index f584fc7..6428480 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -1331,10 +1331,10 @@
&& oi->t_opaque_lsa_self == NULL)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("Schedule Type-9 Opaque-LSA origination in %d sec later.", delay);
+ zlog_debug ("Schedule Type-9 Opaque-LSA origination in %d ms later.", delay);
oi->t_opaque_lsa_self =
- thread_add_timer (master, ospf_opaque_type9_lsa_originate, oi, delay);
- delay += OSPF_MIN_LS_INTERVAL;
+ thread_add_timer_msec (master, ospf_opaque_type9_lsa_originate, oi, delay);
+ delay += top->min_ls_interval;
}
if (! list_isempty (ospf_opaque_type10_funclist)
@@ -1347,11 +1347,11 @@
* again and again.
*/
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("Schedule Type-10 Opaque-LSA origination in %d sec later.", delay);
+ zlog_debug ("Schedule Type-10 Opaque-LSA origination in %d ms later.", delay);
area->t_opaque_lsa_self =
- thread_add_timer (master, ospf_opaque_type10_lsa_originate,
+ thread_add_timer_msec (master, ospf_opaque_type10_lsa_originate,
area, delay);
- delay += OSPF_MIN_LS_INTERVAL;
+ delay += top->min_ls_interval;
}
if (! list_isempty (ospf_opaque_type11_funclist)
@@ -1364,11 +1364,11 @@
* again and again.
*/
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("Schedule Type-11 Opaque-LSA origination in %d sec later.", delay);
+ zlog_debug ("Schedule Type-11 Opaque-LSA origination in %d ms later.", delay);
top->t_opaque_lsa_self =
- thread_add_timer (master, ospf_opaque_type11_lsa_originate,
+ thread_add_timer_msec (master, ospf_opaque_type11_lsa_originate,
top, delay);
- delay += OSPF_MIN_LS_INTERVAL;
+ delay += top->min_ls_interval;
}
/*
@@ -1646,7 +1646,7 @@
#define OSPF_OPAQUE_TIMER_ON(T,F,L,V) \
if (!(T)) \
- (T) = thread_add_timer (master, (F), (L), (V))
+ (T) = thread_add_timer_msec (master, (F), (L), (V))
static struct ospf_lsa *pseudo_lsa (struct ospf_interface *oi, struct ospf_area *area, u_char lsa_type, u_char opaque_type);
static int ospf_opaque_type9_lsa_reoriginate_timer (struct thread *t);
@@ -1794,11 +1794,11 @@
* it is highly possible that these conditions might not be satisfied
* at the time of re-origination function is to be called.
*/
- delay = OSPF_MIN_LS_INTERVAL; /* XXX */
+ delay = top->min_ls_interval; /* XXX */
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("Schedule Type-%u Opaque-LSA to RE-ORIGINATE in %d"
- " sec later: [opaque-type=%u]",
+ " ms later: [opaque-type=%u]",
lsa_type, delay,
GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)));
@@ -2024,7 +2024,7 @@
zlog_debug ("Schedule Type-%u Opaque-LSA to REFRESH in %d sec later: [opaque-type=%u, opaque-id=%x]", lsa->data->type, delay, GET_OPAQUE_TYPE (ntohl (lsa->data->id.s_addr)), GET_OPAQUE_ID (ntohl (lsa->data->id.s_addr)));
OSPF_OPAQUE_TIMER_ON (oipi->t_opaque_lsa_self,
- ospf_opaque_lsa_refresh_timer, oipi, delay);
+ ospf_opaque_lsa_refresh_timer, oipi, delay * 1000);
out:
return;
}