Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 1 | \section{Link-State Database} |
| 2 | \label{sec:lsdb} |
| 3 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 4 | The Link-State Database (LSDB) holds LSA information distributed by |
| 5 | other routers in the network. The LSDB stores all types of LSAs and |
| 6 | will trigger events when a new LSA is added, updated, or expires. The |
| 7 | LSDB also handles LSA retrieval, performs LSA builds, and triggers |
| 8 | routing table calculations. |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 9 | |
| 10 | \subsection{Retrieving an LSA} |
| 11 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 12 | The LSDB provides the \texttt{Lsdb::expressInterest()} method as a |
| 13 | public interface to retrieve an LSA from the network. If LSA Data is |
| 14 | returned, the LSDB will validate the Data using the Validator |
| 15 | module. Then, it will perform the necessary LSDB modifications. If |
| 16 | the LSA Interest times out, the LSDB will retry until it reaches a |
| 17 | configurable maximum number of tries, or a configurable deadline |
| 18 | passes. |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 19 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 20 | The LSDB uses the SegmentFetcher system to retrieve LSAs. LSAs very |
| 21 | often will exceed the maximum NDN packet size. In these cases, the LSA |
| 22 | needs to be split into segments to be sent, so the LSDB uses the |
| 23 | SegmentFetcher to send all LSAs. The SegmentFetcher can decide if the |
| 24 | data actually needs to be split. |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 25 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 26 | \subsection{General Procedure} |
| 27 | |
| 28 | The LSDB is responsible for building, installing, and publishing |
| 29 | NLSR's LSAs, as well as for installing and processing LSAs from other |
| 30 | NSLRs. Generally, the functions of the LSDB are: |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 31 | \begin{itemize} |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 32 | \item Schedule the building of an LSA. |
| 33 | \item Building the LSA. |
| 34 | \item Installing the LSA into the LSDB. |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 35 | \end{itemize} |
| 36 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 37 | \subsection{Scheduling LSA Builds} |
| 38 | LSAs need to be rebuilt whenever the routing information NLSR has |
| 39 | changes. This includes events like neighbors becoming active, or when |
| 40 | a prefix for advertisement is inserted by the Prefix Update Processor, |
| 41 | which would cause an adjacency LSA or a name LSA rebuild, |
| 42 | respectively. To improve performance, instead of directly building |
| 43 | adjacency LSAs the first request schedules the build, and build requests |
| 44 | that occur after the scheduling but before the actual event are |
| 45 | aggregated (in other words, ignored), because they will be satisfied |
| 46 | by the already-scheduled build. Some specifics are shown below. |
| 47 | below. |
| 48 | \begin{itemize} |
| 49 | \item \textbf{Adjacency LSAs} -- will only be scheduled if link-state |
| 50 | routing is enabled. In particular, this means Adjacency LSA builds |
| 51 | will \emph{not} occur if hyperbolic routing is enabled. Note that |
| 52 | adjacency LSAs will be built if dry-run hyperbolic routing is |
| 53 | enabled, as the network is still using link-state routing to |
| 54 | calculate paths. |
| 55 | \end{itemize} |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 56 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 57 | \subsection{Building LSAs} |
| 58 | Building LSAs has a part common to all LSAs and a part specific to |
| 59 | each LSA type. For example, all LSA types increment sequence number |
| 60 | and have the same expiration length, and of course come from the same |
| 61 | router. Additionally, all LSA builds cause a sync update |
| 62 | publishing. However, each type of LSA includes different data, to |
| 63 | represent different kinds of information that NLSR |
| 64 | has. (Section~\ref{sec:lsas}) In particular: |
| 65 | \begin{itemize} |
| 66 | \item \textbf{Adjacency LSAs} -- the number and a list of active |
| 67 | neighbors is included. |
| 68 | \item \textbf{Coordinate LSAs} -- the hyperbolic radius and all |
| 69 | hyperbolic angles are included. |
| 70 | \item \textbf{Name LSAs} -- the list of name prefixes that are |
| 71 | accessible at this router is included. |
| 72 | \end{itemize} |
| 73 | |
| 74 | \subsection{Installing and Processing LSAs} |
| 75 | LSA installation procedure is mostly the same across any type of LSA, |
| 76 | but each type also has installation behavior specific to that type, |
| 77 | too. For any LSA type, we need to schedule an expiration event, and we |
| 78 | need to update several fields in the LSA. However, installing an |
| 79 | adjacency or coordinate LSA causes a Routing Table calculation, but a |
| 80 | name LSA does not, for example. |
| 81 | %%| Not yet true, but it should be true! |
| 82 | Additionally, the name of the origin router is added as a ``routable prefix'' in the NPT. (Section~\ref{sec:npt}). |
| 83 | \begin{itemize} |
| 84 | \item \textbf{Adjacency LSAs} -- each adjacency in the LSA will be |
| 85 | added as a ``routable prefix'' to the NPT. If the adjacencies have |
| 86 | changed since the last version of this LSA, a Routing Table |
| 87 | calculation needs to be scheduled, because the state of the |
| 88 | network has changed. Of course, this is necessarily true if the |
| 89 | LSA is new to us. Important to note is that we will also install |
| 90 | and process \emph{our own} adjacency LSA in this way. |
| 91 | \item \textbf{Coordinate LSAs} -- the router that the LSA is from |
| 92 | will be added as a ``routable prefix'' to the NPT. If the radius |
| 93 | and coordinates have changed since the last version of this LSA, a |
| 94 | Routing Table calculation needs to be scheduled, because the state |
| 95 | of the network has changed. As above, this is true for a new |
| 96 | LSA. This is only done if the LSA is from a foreign router. |
| 97 | \item \textbf{Name LSAs} -- each name prefix in the LSA will be |
| 98 | added to our NPT. This is only done if the LSA is from a foreign |
| 99 | router. |
| 100 | \end{itemize} |
| 101 | |
| 102 | \subsection{LSA Expiration} |
| 103 | LSAs expire so that the network can clean up when a router |
| 104 | crashes. The amount of time an LSA lasts is configurable. When an LSA |
| 105 | expires, we refresh it if it's our LSA, and remove it from the LSDB if |
| 106 | not. There is a ``grace period'' window that is appended to the end of |
| 107 | the expiration period of all LSAs, to provide time for the originating |
| 108 | router to refresh the LSA and for it to propagate back to us. In all |
| 109 | expiration cases, the name of the origin router will be removed from |
| 110 | the NPT. What happens when an LSA is removed from the LSDB differs |
| 111 | based on the type of LSA: |
| 112 | \begin{itemize} |
| 113 | \item \textbf{Adjacency LSAs} -- a Routing Table calculation needs to occur, |
| 114 | since the state of the network has changed, at least from our |
| 115 | perspective. |
| 116 | \item \textbf{Coordinate LSAs} -- a Routing Table calculation needs to occur, |
| 117 | since the state of the network has changed, at least from our |
| 118 | perspective. |
| 119 | \item \textbf{Name LSAs} -- the name prefixes in the LSA are removed from the |
| 120 | NPT. |
| 121 | \end{itemize} |
| 122 | |
| 123 | \subsection{LSA Refreshment} |
| 124 | NLSR will only refresh its own LSAs. Additionally, the procedure for refreshing an LSA is the same for all types: |
| 125 | \begin{itemize} |
| 126 | \item Increment the LSA sequence number |
| 127 | \item Schedule another expiration event. The length of time to wait |
| 128 | until refreshing is configurable, but it should probably be lower |
| 129 | than the expiration time that was set when building the LSA |
| 130 | initially. This prevents other routers from deleting our LSAs |
| 131 | because the network is slow, for instance. The length of time is set |
| 132 | by \texttt{lsa-refresh-time} in the configuration file. |
| 133 | \item Publish an update to sync |
| 134 | \end{itemize} |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 135 | |
Nick Gordon | eafb2a2 | 2017-01-24 14:55:56 -0600 | [diff] [blame] | 136 | \begin{figure}[h] |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 137 | \center |
| 138 | \includegraphics[width=0.5\linewidth]{figures/generic-lsdb-flow} |
| 139 | \label{fig:generic-lsdb-flow} |
| 140 | \caption{The general LSDB logic for each LSA type} |
| 141 | \end{figure} |