blob: da3ec0624326ebe397cf82e3384b5c9f89591db7 [file] [log] [blame]
Nick Gordonf3a9ecb2017-01-24 13:55:14 -06001\section{FIB Interaction}
2\label{sec:fib}
3
Nick Gordon221531c2017-06-08 11:44:45 -05004The FIB module interacts with NFD to perform registrations and
5unregistrations of routes. By registration, what is meant is the
6submission of a RIB route to the local NFD, which includes a name
7prefix, the Face ID of the nexthop, an expiration time, and the
8calculated cost from the Routing Table calculation. Additionally, NLSR
9sets a field to tell NFD that the route originates from NLSR, and sets
10a route inheritance flag.
11
12The expiration time for a route is pegged at double the value of the
13LSA refresh time, which is defined by \texttt{lsa-refresh-time} in the
14configuration file. The route inheritance flag is set to capture,
15which forbids NFD from using a shorter prefix of the name prefix for
16forwarding.
17
18More information about NFD's RIB can be found on the
19\href{https://redmine.named-data.net/projects/nfd/wiki/RibMgmt}{Redmine
20 wiki}. An important thing to note is that NFD has a module called
21the FIB. Anywhere in this guide, the word ``FIB'' refers to the NLSR
22FIB, which models NLSR's expectation of how NFD would forward packets.
23
24The FIB is directed by the Name Prefix Table, which registers and
25unregisters routes based on calculations by the Routing Table and
26advertisements from LSAs. The connection between the FIB and the NPT
27is through the \texttt{Fib::update()} method.
Nick Gordonf3a9ecb2017-01-24 13:55:14 -060028
29\subsection{Updating the FIB}
Nick Gordon221531c2017-06-08 11:44:45 -050030Generally, updating the FIB looks like this:
31\begin{itemize}
32\item Sort the list of next hops for the prefix, by cost.
33\item Take the cheapest \texttt{max-faces-per-prefix} hops. This can be set to have no limit, so all next hops are registered.
34\item Send a RIB route registration command for each next hop.
35\item Send a RIB route unregistration command for any next hops that
36 have dropped out of the list. This includes next hops that became
37 invalid since the last Routing Table calculation, as well as valid
38 hops that are no longer in the top \texttt{max-faces-per-prefix}
39 next hops.
40\end{itemize}
Nick Gordonf3a9ecb2017-01-24 13:55:14 -060041
Nick Gordon221531c2017-06-08 11:44:45 -050042If there are more passed next hops than the
43\texttt{max-faces-per-prefix}, the FIB module will only use the first
44\texttt{max-faces-per-prefix} number of next hops from the sorted
45list. If there are less passed next hops than
46\texttt{max-faces-per-prefix}, the FIB module will use all of the next hops.
47Specifically, when the NPT updates the FIB, the FIB creates entries so
48that it can compute the difference between the set of new next hops,
49and the set of old next hops that were registered at the last update.
50These entries are unique on the destination name prefix. The FIB will
51update an existing entry instead of creating a new one, which may
52involve unregistering old next hops, as mentioned above.