blob: da3ec0624326ebe397cf82e3384b5c9f89591db7 [file] [log] [blame]
\section{FIB Interaction}
\label{sec:fib}
The FIB module interacts with NFD to perform registrations and
unregistrations of routes. By registration, what is meant is the
submission of a RIB route to the local NFD, which includes a name
prefix, the Face ID of the nexthop, an expiration time, and the
calculated cost from the Routing Table calculation. Additionally, NLSR
sets a field to tell NFD that the route originates from NLSR, and sets
a route inheritance flag.
The expiration time for a route is pegged at double the value of the
LSA refresh time, which is defined by \texttt{lsa-refresh-time} in the
configuration file. The route inheritance flag is set to capture,
which forbids NFD from using a shorter prefix of the name prefix for
forwarding.
More information about NFD's RIB can be found on the
\href{https://redmine.named-data.net/projects/nfd/wiki/RibMgmt}{Redmine
wiki}. An important thing to note is that NFD has a module called
the FIB. Anywhere in this guide, the word ``FIB'' refers to the NLSR
FIB, which models NLSR's expectation of how NFD would forward packets.
The FIB is directed by the Name Prefix Table, which registers and
unregisters routes based on calculations by the Routing Table and
advertisements from LSAs. The connection between the FIB and the NPT
is through the \texttt{Fib::update()} method.
\subsection{Updating the FIB}
Generally, updating the FIB looks like this:
\begin{itemize}
\item Sort the list of next hops for the prefix, by cost.
\item Take the cheapest \texttt{max-faces-per-prefix} hops. This can be set to have no limit, so all next hops are registered.
\item Send a RIB route registration command for each next hop.
\item Send a RIB route unregistration command for any next hops that
have dropped out of the list. This includes next hops that became
invalid since the last Routing Table calculation, as well as valid
hops that are no longer in the top \texttt{max-faces-per-prefix}
next hops.
\end{itemize}
If there are more passed next hops than the
\texttt{max-faces-per-prefix}, the FIB module will only use the first
\texttt{max-faces-per-prefix} number of next hops from the sorted
list. If there are less passed next hops than
\texttt{max-faces-per-prefix}, the FIB module will use all of the next hops.
Specifically, when the NPT updates the FIB, the FIB creates entries so
that it can compute the difference between the set of new next hops,
and the set of old next hops that were registered at the last update.
These entries are unique on the destination name prefix. The FIB will
update an existing entry instead of creating a new one, which may
involve unregistering old next hops, as mentioned above.