Task #4127
open
Added by Nicholas Gordon over 7 years ago.
Updated almost 4 years ago.
Estimated time:
(Total: 0.00 h)
Description
The LSDB is verbose and repetitive, and it can be better designed to be more concise and readable.
Files
- Target version changed from v0.5.0 to Minor release 0.4.1
- Parent task deleted (
#2741)
- Blocked by Task #2741: Create proposal to redesign a more generic LSDB added
- Target version changed from Minor release 0.4.1 to v0.5.0
- Assignee changed from Nicholas Gordon to Saurab Dulal
- Target version changed from v0.5.0 to v0.6.0
- Assignee changed from Saurab Dulal to Ashlesh Gawande
https://gerrit.named-data.net/c/NLSR/+/4749 patch-set 11 makes minimum changes to replace the three std::list used for Lsas with the proposed boost::multi_index container in previous patch-sets. Although it does not separate LsaFetcher and LsaPublisher as the previous patch-sets, it still reduces the Lsdb from ~1300 lines to ~630 lines with templating and polymorphism. Changes outside the Lsdb are kept to a minimum for easier review and have all the tests be passed w/ minimum modifications.
Other refactoring can follow as desired after the basic premise of this change of using a single multi_index container for Lsdb is achieved.
Some highlights that may need explicit review:
- Block m_wire is eliminated from child LSA classes and now resides in LSA base class (replacing the m_baseWire). These were introduced in #4787
- LSA base class has a public pure virtual wireEncode() - this maybe not desired in a library, but I think having it in NLSR is perfectly fine. wireEncode(block) and wireDecode(block) are protected, to be used by child classes.
- Target version changed from v0.6.0 to 0.7.0
https://gerrit.named-data.net/c/NLSR/+/6217 makes the following changes to simplify Lsdb further:
- Lsdb emits a signal containing a pointer to Lsa, an update type (Inserted, Updated, Removed), and two lists of Names
- List of Names are only relevant to NameLsa update - Names to be removed and Names to be added.
- Lsa base class now has a pure virtual update function so that Lsdb does not need to cast the pointer and then call functions according to each Lsa
- RoutingTable consumes the Lsdb signal
- Behaviours which were in Lsdb such as removing routing table if own Adjacency Lsa is removed are moved to RoutingTable
- Resets wire when routing table is updated (seems like current code does not - so will return old routing table once calculated)
- calculate function in RoutingTable is simplified
- NamePrefixTable consumes the Lsdb signal
- Adds/Removes origin router of LSAs
- Adds/Removes updates from NameLsa
Unit tests are added to test that the behavior upon signal emission/consumption is correct in Lsdb, RoutingTable and NamePrefixTable
Also available in: Atom
PDF