Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 1 | Router Configuration |
| 2 | ==================== |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 3 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 4 | .. toctree:: |
| 5 | .. |
| 6 | |
| 7 | Example network and sample configuration |
| 8 | ---------------------------------------- |
| 9 | |
| 10 | Assume that three routers in the same network, but at three different sites |
| 11 | (``memphis.edu``, ``arizona.edu``, and ``colostate.edu``), are connected to each other to |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 12 | construct the following topology: |
| 13 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 14 | :: |
| 15 | |
| 16 | +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 17 | | /ndn/edu/memphis/%C1.Router/router1 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 18 | +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 19 | / 11 12\ |
| 20 | / \ |
| 21 | route-cost = 25 / \ route-cost = 30 |
| 22 | / \ |
| 23 | 17 / \ 13 |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 24 | +-----------------------------------+ 7 10 +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 25 | |/ndn/edu/arizona/%C1.Router/router3|-------------------|/ndn/edu/colostate/%C1.Router/router2| |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 26 | +-----------------------------------+ route-cost = 28 +-------------------------------------+ |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 27 | |
| 28 | Figure: Network Topology |
| 29 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 30 | The number represents the connecting face id. For example, |
| 31 | ``/ndn/edu/memphis/%C1.Router/router1`` is connected to |
| 32 | ``/ndn/edu/arizona/%C1.Router/router3`` via face 11 and the route cost is 25. To reach |
| 33 | ``/ndn/edu/colostate/%C1.Router/router2`` via face 12, the route cost is 30. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 34 | |
| 35 | We will walk through setting up the faces and creating the configuration file for |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 36 | ``/ndn/edu/memphis/%C1.Router/router1``. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 37 | |
David Arjona | 2fa23ea | 2018-11-28 11:50:38 -0600 | [diff] [blame] | 38 | It is recommended to configure security as described at :doc:`SECURITY-CONFIG`, before |
| 39 | starting router configuration. |
| 40 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 41 | Step 1. Ensuring nfd is running |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 42 | ------------------------------- |
| 43 | |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 44 | Type the following in the terminal: |
| 45 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 46 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 47 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 48 | nfd-status |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 49 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 50 | If you see ``error while connecting to the forwarder (No such file or directory)``, |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 51 | ``nfd`` is not running. Follow the instructions in `Getting started with NFD |
Davide Pesavento | 1e9faf1 | 2023-01-21 16:04:50 -0500 | [diff] [blame] | 52 | <https://docs.named-data.net/NFD/current/INSTALL.html>`_ to run nfd. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 53 | |
David Arjona | 2fa23ea | 2018-11-28 11:50:38 -0600 | [diff] [blame] | 54 | Since v0.4.0, NLSR no longer creates Faces for the neighbors that are |
| 55 | specified in ``nlsr.conf``. Instead, it relies on the pre-existence of |
| 56 | the Faces in NFD. NLSR will obtain this information from NFD, and |
| 57 | configure its neighbors using this information. |
| 58 | |
Davide Pesavento | 1e9faf1 | 2023-01-21 16:04:50 -0500 | [diff] [blame] | 59 | To create faces it is now necessary to use the ``nfdc`` command. See ``man nfdc`` for |
| 60 | its documentation (`online version <https://docs.named-data.net/NFD/current/manpages/nfdc.html>`__). |
David Arjona | 2fa23ea | 2018-11-28 11:50:38 -0600 | [diff] [blame] | 61 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 62 | Step 2. Determining FaceUri |
| 63 | --------------------------- |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 64 | |
Junxiao Shi | f09e263 | 2015-01-02 18:15:01 -0700 | [diff] [blame] | 65 | Assume that ``/ndn/edu/arizona/%C1.Router/router3`` has hostname ``router3.arizona.edu`` and |
| 66 | ``/ndn/edu/colostate/%C1.Router/router2`` has IP address ``79.123.10.145``. |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 67 | ``/ndn/edu/memphis/%C1.Router/router1`` will consider FaceUri |
Junxiao Shi | f09e263 | 2015-01-02 18:15:01 -0700 | [diff] [blame] | 68 | ``udp4://router3.arizona.edu`` for router ``/ndn/edu/arizona/%C1.Router/router3`` and |
| 69 | FaceUri ``udp4://79.123.10.145`` for router ``/ndn/edu/colostate/%C1.Router/router2``. |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 70 | |
| 71 | Step 3: Creating configuration file |
| 72 | ----------------------------------- |
| 73 | |
| 74 | Now, assume that ``/ndn/memphis.edu/router1`` wants to advertise three name prefixes |
| 75 | (``/ndn/memphis/sports/basketball/grizzlies``, ``/ndn/memphis/entertainment/blues``, |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 76 | ``/ndn/news/memphis/politics/lutherking``). The configuration file with the necessary |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 77 | configuration commands follows: |
| 78 | |
| 79 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 80 | |
| 81 | ; nlsr.conf starts here |
| 82 | ; the general section contains all the general settings for router |
| 83 | |
| 84 | general |
| 85 | { |
| 86 | ; mandatory configuration command section network, site and router |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 87 | network /ndn/ ; name of the network the router belongs to in ndn URI format |
| 88 | site /edu/memphis/ ; name of the site the router belongs to in ndn URI format |
| 89 | router /%C1.Router/router1 ; name of the network the router belongs to in ndn URI format |
| 90 | |
| 91 | ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 92 | lsa-refresh-time 1800 ; default value 1800. Valid values 240-7200 |
| 93 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 94 | ; InterestLifetime (in seconds) for LSA fetching |
| 95 | lsa-interest-lifetime 4 ; default value 4. Valid values 1-60 |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 96 | |
dulalsaurab | 82a34c2 | 2019-02-04 17:31:21 +0000 | [diff] [blame] | 97 | state-dir /var/lib/nlsr/ ; state directory to store all dynamic changes to NLSR |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | ; the neighbors section contains the configuration for router's neighbors and hello's behavior |
| 101 | |
| 102 | neighbors |
| 103 | { |
| 104 | ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out' |
| 105 | ; seconds interval before giving up for any neighbors (deciding link is down) |
| 106 | |
| 107 | hello-retries 3 ; interest retries number in integer. Default value 3 |
| 108 | ; valid values 1-10 |
| 109 | |
| 110 | hello-timeout 1 ; interest time out value in integer. Default value 1 |
| 111 | ; Valid values 1-15 |
| 112 | |
| 113 | hello-interval 60 ; interest sending interval in seconds. Default value 60 |
| 114 | ; valid values 30-90 |
Muktadir R Chowdhury | 800833b | 2016-07-29 13:43:59 -0500 | [diff] [blame] | 115 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 116 | ; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA |
| 117 | ; build is scheduled before actually building the Adjacency LSA |
Muktadir R Chowdhury | 800833b | 2016-07-29 13:43:59 -0500 | [diff] [blame] | 118 | |
| 119 | adj-lsa-build-interval 5 ; default value 5. Valid values 0-5. It is recommended that |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 120 | ; adj-lsa-build-interval have a lower value than |
| 121 | ; routing-calc-interval |
Muktadir R Chowdhury | 800833b | 2016-07-29 13:43:59 -0500 | [diff] [blame] | 122 | |
| 123 | ; first-hello-interval is the time to wait in seconds before sending the first Hello Interest |
| 124 | |
| 125 | first-hello-interval 10 ; Default value 10. Valid values 0-10 |
| 126 | |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 127 | ; neighbor command is used to configure router's neighbor. Each neighbor will need |
| 128 | ; one block of neighbor command |
| 129 | |
| 130 | neighbor |
| 131 | { |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 132 | name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists |
| 133 | ; of network, site-name and router-name |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 134 | |
| 135 | face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor |
| 136 | link-cost 25 ; cost of the connecting link to neighbor |
| 137 | } |
| 138 | |
| 139 | neighbor |
| 140 | { |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 141 | name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 142 | ; of network, site-name and router-name |
| 143 | |
| 144 | face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor |
| 145 | link-cost 30 ; cost of the connecting link to neighbor |
| 146 | } |
| 147 | } |
| 148 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 149 | ; the hyperbolic section contains the configuration settings of enabling |
| 150 | a router to calculate ; routing table using `hyperbolic routing table |
| 151 | calculation`_ method |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 152 | |
| 153 | hyperbolic |
| 154 | { |
| 155 | ; commands in this section follows a strict order |
| 156 | ; the switch is used to set hyperbolic routing calculation in NLSR |
| 157 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 158 | state off ; default value 'off', set value 'on' to enable hyperbolic routing table |
| 159 | ; calculation which turns link state routing 'off'. set value to 'dry-run' |
| 160 | ; to test hyperbolic routing and compare with link state routing. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 161 | |
| 162 | |
| 163 | radius 123.456 ; radius of the router in hyperbolic coordinate system |
| 164 | angle 1.45 ; angle of the router in hyperbolic coordinate system |
| 165 | } |
| 166 | |
| 167 | |
| 168 | ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR |
| 169 | |
| 170 | fib |
| 171 | { |
| 172 | ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes |
| 173 | ; by NLSR in ndn FIB |
| 174 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 175 | max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds |
| 176 | ; all available faces for each reachable name prefixes in NDN FIB |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 177 | |
| 178 | } |
| 179 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 180 | ; the advertising section contains the configuration settings of the |
| 181 | name prefixes ; hosted by this router |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 182 | |
| 183 | advertising |
| 184 | { |
| 185 | ; the ndnname is used to advertised name from the router. To advertise each name prefix |
| 186 | ; configure one block of ndnname configuration command for every name prefix. |
| 187 | |
| 188 | prefix /ndn/memphis/sports/basketball/grizzlies |
| 189 | prefix /ndn/memphis/entertainment/blues |
| 190 | prefix /ndn/news/memphis/politics/lutherking |
| 191 | } |
| 192 | |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 193 | By default NLSR's sequence file directory is set to ``/var/lib/nlsr/``. User must create this |
| 194 | directory before starting NLSR. Since this is a system directory, NLSR must either be executed |
| 195 | as root, or NLSR can be run as user "nlsr" after configuring the filesystem to grant "nlsr" |
| 196 | read and write permissions. If user lacks permissions, the following error will occur: |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 197 | |
| 198 | :: |
| 199 | |
| 200 | User does not have read and write permission on the directory |
| 201 | Error in configuration file processing! Exiting from NLSR |
| 202 | |
dmcoomes | cf8d0ed | 2017-02-21 11:39:01 -0600 | [diff] [blame] | 203 | To avoid this, the directory can be set in a user-owned directory. For example: |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 204 | |
| 205 | :: |
| 206 | |
| 207 | general |
| 208 | { |
| 209 | ... |
| 210 | |
dulalsaurab | 82a34c2 | 2019-02-04 17:31:21 +0000 | [diff] [blame] | 211 | state-dir /home/username/nlsr/log ; path for sequence directory and other dynamic changes (Absolute path) |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 212 | |
| 213 | } |
| 214 | ... |
| 215 | |
| 216 | The user will encounter errors such as the following if security is not configured: |
| 217 | |
| 218 | :: |
| 219 | |
| 220 | Cannot read certificate from file: /home/username/NLSR/root.cert |
| 221 | |
| 222 | To get rid of this and similar errors relating to security one has to configure security |
| 223 | as described in :doc:`SECURITY-CONFIG`. Security can be disabled for testing purposes as follows: |
| 224 | |
| 225 | :: |
| 226 | |
| 227 | ... |
| 228 | trust-anchor |
| 229 | { |
| 230 | type any |
| 231 | ;file-name "root.cert" |
| 232 | } |
| 233 | ... |
| 234 | trust-anchor |
| 235 | { |
| 236 | type any |
| 237 | ;file-name "site.cert" |
| 238 | } |
| 239 | ; cert-to-publish "root.cert" |
| 240 | ; cert-to-publish "router.cert" |
| 241 | ; cert-to-publish "site.cert" |
| 242 | ; cert-to-publish "router.cert" |
| 243 | |
| 244 | Or by simply replacing the whole security section with: |
| 245 | |
| 246 | :: |
| 247 | |
| 248 | security |
| 249 | { |
| 250 | validator |
| 251 | { |
| 252 | trust-anchor |
| 253 | { |
| 254 | type any |
| 255 | } |
| 256 | } |
| 257 | prefix-update-validator |
| 258 | { |
| 259 | trust-anchor |
| 260 | { |
| 261 | type any |
| 262 | } |
| 263 | } |
| 264 | } |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 265 | |
| 266 | Step 4: Running NLSR on /ndn/memphis.edu/router1 |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 267 | ------------------------------------------------- |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 268 | |
| 269 | Assuming the configuration file is saved as ``nlsr.conf``, type the following to run nlsr: |
| 270 | |
| 271 | :: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 272 | |
| 273 | $ nlsr -f nlsr.conf |
| 274 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 275 | NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in the current |
| 276 | directory, please provide the absolute path with the file name as the value. If |
| 277 | ``nlsr.conf`` resides in ``/home/ndnuser/configuration`` directory, type ``nlsr -f |
| 278 | /home/ndnuser/configuration/nlsr.conf`` to run nlsr. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 279 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 280 | The same process needs to be followed for ``/ndn/arizona.edu/router3`` and |
| 281 | ``/ndn/colostate.edu/router2`` to run NLSR on these routers. |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 282 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 283 | Expected Output |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 284 | ---------------- |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 285 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 286 | Assuming that all three routers are configured correctly and routing has converged, |
| 287 | ``nfd-status`` in ``/ndn/edu/colostate/%C1.Router/router2`` will have the following (or similar) |
| 288 | entries for the name advertised by ``/ndn/edu/memphis/%C1.Router/router1``: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 289 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 290 | RIB: |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 291 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 292 | :: |
| 293 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 294 | /ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)} |
| 295 | /ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)} |
| 296 | /ndn/news/memphis/politics/lutherking route={faceid=17 (origin=128 cost=25 ChildInherit, faceid=7 (origin=128 cost=58 ChildInherit)} |
akmhoque | cc82753 | 2014-07-09 08:48:49 -0500 | [diff] [blame] | 297 | |
Ashlesh Gawande | b4567f4 | 2017-04-28 14:40:39 -0500 | [diff] [blame] | 298 | This output can be seen by typing ``nfdc route list`` in the terminal. Please refer to the |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 299 | network figure for face IDs. |
| 300 | |
| 301 | .. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266 |