Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 1 | \section{FIB Interaction} |
| 2 | \label{sec:fib} |
| 3 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 4 | The FIB module interacts with NFD to perform registrations and |
| 5 | unregistrations of routes. By registration, what is meant is the |
| 6 | submission of a RIB route to the local NFD, which includes a name |
| 7 | prefix, the Face ID of the nexthop, an expiration time, and the |
| 8 | calculated cost from the Routing Table calculation. Additionally, NLSR |
| 9 | sets a field to tell NFD that the route originates from NLSR, and sets |
| 10 | a route inheritance flag. |
| 11 | |
| 12 | The expiration time for a route is pegged at double the value of the |
| 13 | LSA refresh time, which is defined by \texttt{lsa-refresh-time} in the |
| 14 | configuration file. The route inheritance flag is set to capture, |
| 15 | which forbids NFD from using a shorter prefix of the name prefix for |
| 16 | forwarding. |
| 17 | |
| 18 | More 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 |
| 21 | the FIB. Anywhere in this guide, the word ``FIB'' refers to the NLSR |
| 22 | FIB, which models NLSR's expectation of how NFD would forward packets. |
| 23 | |
| 24 | The FIB is directed by the Name Prefix Table, which registers and |
| 25 | unregisters routes based on calculations by the Routing Table and |
| 26 | advertisements from LSAs. The connection between the FIB and the NPT |
| 27 | is through the \texttt{Fib::update()} method. |
Nick Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 28 | |
| 29 | \subsection{Updating the FIB} |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 30 | Generally, 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 Gordon | f3a9ecb | 2017-01-24 13:55:14 -0600 | [diff] [blame] | 41 | |
Nick Gordon | 221531c | 2017-06-08 11:44:45 -0500 | [diff] [blame] | 42 | If 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 |
| 45 | list. If there are less passed next hops than |
| 46 | \texttt{max-faces-per-prefix}, the FIB module will use all of the next hops. |
| 47 | Specifically, when the NPT updates the FIB, the FIB creates entries so |
| 48 | that it can compute the difference between the set of new next hops, |
| 49 | and the set of old next hops that were registered at the last update. |
| 50 | These entries are unique on the destination name prefix. The FIB will |
| 51 | update an existing entry instead of creating a new one, which may |
| 52 | involve unregistering old next hops, as mentioned above. |