[ospfd] draft-ogier-ospf-dbex-opt DB-exchange optimisation

2006-08-03 Paul Jakma <paul.jakma@sun.com>

	* ospf_packet.c: (ospf_make_db_desc) Implement
	  draft-ogier-ospf-dbex-opt DB-exchange optimisation.
This commit is contained in:
Paul Jakma 2006-08-27 06:40:04 +00:00
parent 8dd24ee6d7
commit f0894cf8c3
2 changed files with 35 additions and 14 deletions

View file

@ -15,6 +15,7 @@
before deciding whether both sides are done, avoids a before deciding whether both sides are done, avoids a
needless round of empty DD packet exchanges at the end of needless round of empty DD packet exchanges at the end of
Exchange, hence speeding up ExchangeDone. Exchange, hence speeding up ExchangeDone.
Implement draft-ogier-ospf-dbex-opt DB-exchange optimisation.
(ospf_db_desc) use UNSET_FLAG macro. (ospf_db_desc) use UNSET_FLAG macro.
2006-07-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu> 2006-07-27 Andrew J. Schorr <ajschorr@alumni.princeton.edu>

View file

@ -1035,19 +1035,39 @@ ospf_db_desc_proc (struct stream *s, struct ospf_interface *oi,
/* Lookup received LSA, then add LS request list. */ /* Lookup received LSA, then add LS request list. */
find = ospf_lsa_lookup_by_header (oi->area, lsah); find = ospf_lsa_lookup_by_header (oi->area, lsah);
if (!find || ospf_lsa_more_recent (find, new) < 0)
/* ospf_lsa_more_recent is fine with NULL pointers */
switch (ospf_lsa_more_recent (find, new))
{ {
case -1:
/* Neighbour has a more recent LSA, we must request it */
ospf_ls_request_add (nbr, new); ospf_ls_request_add (nbr, new);
case 0:
/* If we have a copy of this LSA, it's either less recent
* and we're requesting it from neighbour (the case above), or
* it's as recent and we both have same copy (this case).
*
* In neither of these two cases is there any point in
* describing our copy of the LSA to the neighbour in a
* DB-Summary packet, if we're still intending to do so.
*
* See: draft-ogier-ospf-dbex-opt-00.txt, describing the
* backward compatible optimisation to OSPF DB Exchange /
* DB Description process implemented here.
*/
if (find)
ospf_lsdb_delete (&nbr->db_sum, find);
ospf_lsa_discard (new); ospf_lsa_discard (new);
} break;
else default:
{ /* We have the more recent copy, nothing specific to do:
/* Received LSA is not recent. */ * - no need to request neighbours stale copy
* - must leave DB summary list copy alone
*/
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("Packet [DD:RECV]: LSA received Type %d, " zlog_debug ("Packet [DD:RECV]: LSA received Type %d, "
"ID %s is not recent.", lsah->type, inet_ntoa (lsah->id)); "ID %s is not recent.", lsah->type, inet_ntoa (lsah->id));
ospf_lsa_discard (new); ospf_lsa_discard (new);
continue;
} }
} }