blob: 89ac3f5a05b738a8278318638c6a71a12dec4755 [file] [log] [blame]
Vince Lehmanb722b102014-08-24 16:33:49 -05001Router Configuration
2====================
akmhoquecc827532014-07-09 08:48:49 -05003
Vince Lehmanb722b102014-08-24 16:33:49 -05004.. toctree::
5..
6
7Example network and sample configuration
8----------------------------------------
9
10Assume 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
akmhoquecc827532014-07-09 08:48:49 -050012construct the following topology:
13
Vince Lehmanb722b102014-08-24 16:33:49 -050014::
15
16 +-------------------------------------+
akmhoquecc827532014-07-09 08:48:49 -050017 | /ndn/edu/memphis/%C1.Router/router1 |
Vince Lehmanb722b102014-08-24 16:33:49 -050018 +-------------------------------------+
akmhoquecc827532014-07-09 08:48:49 -050019 / 11 12\
20 / \
21 route-cost = 25 / \ route-cost = 30
22 / \
23 17 / \ 13
Vince Lehmanb722b102014-08-24 16:33:49 -050024 +-----------------------------------+ 7 10 +-------------------------------------+
akmhoquecc827532014-07-09 08:48:49 -050025 |/ndn/edu/arizona/%C1.Router/router3|-------------------|/ndn/edu/colostate/%C1.Router/router2|
Vince Lehmanb722b102014-08-24 16:33:49 -050026 +-----------------------------------+ route-cost = 28 +-------------------------------------+
akmhoquecc827532014-07-09 08:48:49 -050027
28 Figure: Network Topology
29
Vince Lehmanb722b102014-08-24 16:33:49 -050030The 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.
akmhoquecc827532014-07-09 08:48:49 -050034
35We will walk through setting up the faces and creating the configuration file for
Vince Lehmanb722b102014-08-24 16:33:49 -050036``/ndn/edu/memphis/%C1.Router/router1``.
akmhoquecc827532014-07-09 08:48:49 -050037
David Arjona2fa23ea2018-11-28 11:50:38 -060038It is recommended to configure security as described at :doc:`SECURITY-CONFIG`, before
39starting router configuration.
40
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070041Step 1. Ensuring nfd is running
Vince Lehmanb722b102014-08-24 16:33:49 -050042-------------------------------
43
akmhoquecc827532014-07-09 08:48:49 -050044Type the following in the terminal:
45
Vince Lehmanb722b102014-08-24 16:33:49 -050046::
akmhoquecc827532014-07-09 08:48:49 -050047
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -050048 nfd-status
akmhoquecc827532014-07-09 08:48:49 -050049
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -050050If you see ``error while connecting to the forwarder (No such file or directory)``,
Vince Lehmanb722b102014-08-24 16:33:49 -050051``nfd`` is not running. Follow the instructions in `Getting started with NFD
52<http://named-data.net/doc/NFD/current/INSTALL.html>`_ to run nfd.
akmhoquecc827532014-07-09 08:48:49 -050053
David Arjona2fa23ea2018-11-28 11:50:38 -060054Since v0.4.0, NLSR no longer creates Faces for the neighbors that are
55specified in ``nlsr.conf``. Instead, it relies on the pre-existence of
56the Faces in NFD. NLSR will obtain this information from NFD, and
57configure its neighbors using this information.
58
59To create faces it is now necessary to use the ``nfdc`` command. Its documentation can
60be found `here
61<https://named-data.net/doc/NFD/current/manpages/nfdc.html>`_
62
Vince Lehmanb722b102014-08-24 16:33:49 -050063Step 2. Determining FaceUri
64---------------------------
akmhoquecc827532014-07-09 08:48:49 -050065
Junxiao Shif09e2632015-01-02 18:15:01 -070066Assume that ``/ndn/edu/arizona/%C1.Router/router3`` has hostname ``router3.arizona.edu`` and
67``/ndn/edu/colostate/%C1.Router/router2`` has IP address ``79.123.10.145``.
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070068``/ndn/edu/memphis/%C1.Router/router1`` will consider FaceUri
Junxiao Shif09e2632015-01-02 18:15:01 -070069``udp4://router3.arizona.edu`` for router ``/ndn/edu/arizona/%C1.Router/router3`` and
70FaceUri ``udp4://79.123.10.145`` for router ``/ndn/edu/colostate/%C1.Router/router2``.
Vince Lehmanb722b102014-08-24 16:33:49 -050071
72Step 3: Creating configuration file
73-----------------------------------
74
75Now, assume that ``/ndn/memphis.edu/router1`` wants to advertise three name prefixes
76(``/ndn/memphis/sports/basketball/grizzlies``, ``/ndn/memphis/entertainment/blues``,
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070077``/ndn/news/memphis/politics/lutherking``). The configuration file with the necessary
Vince Lehmanb722b102014-08-24 16:33:49 -050078configuration commands follows:
79
80::
akmhoquecc827532014-07-09 08:48:49 -050081
82 ; nlsr.conf starts here
83 ; the general section contains all the general settings for router
84
85 general
86 {
87 ; mandatory configuration command section network, site and router
akmhoquecc827532014-07-09 08:48:49 -050088 network /ndn/ ; name of the network the router belongs to in ndn URI format
89 site /edu/memphis/ ; name of the site the router belongs to in ndn URI format
90 router /%C1.Router/router1 ; name of the network the router belongs to in ndn URI format
91
92 ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
akmhoquecc827532014-07-09 08:48:49 -050093 lsa-refresh-time 1800 ; default value 1800. Valid values 240-7200
94
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070095 ; InterestLifetime (in seconds) for LSA fetching
96 lsa-interest-lifetime 4 ; default value 4. Valid values 1-60
akmhoquecc827532014-07-09 08:48:49 -050097
dulalsaurab82a34c22019-02-04 17:31:21 +000098 state-dir /var/lib/nlsr/ ; state directory to store all dynamic changes to NLSR
akmhoquecc827532014-07-09 08:48:49 -050099 }
100
101 ; the neighbors section contains the configuration for router's neighbors and hello's behavior
102
103 neighbors
104 {
105 ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out'
106 ; seconds interval before giving up for any neighbors (deciding link is down)
107
108 hello-retries 3 ; interest retries number in integer. Default value 3
109 ; valid values 1-10
110
111 hello-timeout 1 ; interest time out value in integer. Default value 1
112 ; Valid values 1-15
113
114 hello-interval 60 ; interest sending interval in seconds. Default value 60
115 ; valid values 30-90
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500116
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500117 ; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA
118 ; build is scheduled before actually building the Adjacency LSA
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500119
120 adj-lsa-build-interval 5 ; default value 5. Valid values 0-5. It is recommended that
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500121 ; adj-lsa-build-interval have a lower value than
122 ; routing-calc-interval
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500123
124 ; first-hello-interval is the time to wait in seconds before sending the first Hello Interest
125
126 first-hello-interval 10 ; Default value 10. Valid values 0-10
127
akmhoquecc827532014-07-09 08:48:49 -0500128 ; neighbor command is used to configure router's neighbor. Each neighbor will need
129 ; one block of neighbor command
130
131 neighbor
132 {
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500133 name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists
134 ; of network, site-name and router-name
akmhoquecc827532014-07-09 08:48:49 -0500135
136 face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor
137 link-cost 25 ; cost of the connecting link to neighbor
138 }
139
140 neighbor
141 {
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500142 name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists
akmhoquecc827532014-07-09 08:48:49 -0500143 ; of network, site-name and router-name
144
145 face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor
146 link-cost 30 ; cost of the connecting link to neighbor
147 }
148 }
149
Vince Lehmanb722b102014-08-24 16:33:49 -0500150 ; the hyperbolic section contains the configuration settings of enabling
151 a router to calculate ; routing table using `hyperbolic routing table
152 calculation`_ method
akmhoquecc827532014-07-09 08:48:49 -0500153
154 hyperbolic
155 {
156 ; commands in this section follows a strict order
157 ; the switch is used to set hyperbolic routing calculation in NLSR
158
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500159 state off ; default value 'off', set value 'on' to enable hyperbolic routing table
160 ; calculation which turns link state routing 'off'. set value to 'dry-run'
161 ; to test hyperbolic routing and compare with link state routing.
akmhoquecc827532014-07-09 08:48:49 -0500162
163
164 radius 123.456 ; radius of the router in hyperbolic coordinate system
165 angle 1.45 ; angle of the router in hyperbolic coordinate system
166 }
167
168
169 ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR
170
171 fib
172 {
173 ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
174 ; by NLSR in ndn FIB
175
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500176 max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
177 ; all available faces for each reachable name prefixes in NDN FIB
akmhoquecc827532014-07-09 08:48:49 -0500178
179 }
180
Vince Lehmanb722b102014-08-24 16:33:49 -0500181 ; the advertising section contains the configuration settings of the
182 name prefixes ; hosted by this router
akmhoquecc827532014-07-09 08:48:49 -0500183
184 advertising
185 {
186 ; the ndnname is used to advertised name from the router. To advertise each name prefix
187 ; configure one block of ndnname configuration command for every name prefix.
188
189 prefix /ndn/memphis/sports/basketball/grizzlies
190 prefix /ndn/memphis/entertainment/blues
191 prefix /ndn/news/memphis/politics/lutherking
192 }
193
dmcoomescf8d0ed2017-02-21 11:39:01 -0600194By default NLSR's sequence file directory is set to ``/var/lib/nlsr/``. User must create this
195directory before starting NLSR. Since this is a system directory, NLSR must either be executed
196as root, or NLSR can be run as user "nlsr" after configuring the filesystem to grant "nlsr"
197read and write permissions. If user lacks permissions, the following error will occur:
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500198
199::
200
201 User does not have read and write permission on the directory
202 Error in configuration file processing! Exiting from NLSR
203
dmcoomescf8d0ed2017-02-21 11:39:01 -0600204To avoid this, the directory can be set in a user-owned directory. For example:
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500205
206::
207
208 general
209 {
210 ...
211
dulalsaurab82a34c22019-02-04 17:31:21 +0000212 state-dir /home/username/nlsr/log ; path for sequence directory and other dynamic changes (Absolute path)
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500213
214 }
215 ...
216
217The user will encounter errors such as the following if security is not configured:
218
219::
220
221 Cannot read certificate from file: /home/username/NLSR/root.cert
222
223To get rid of this and similar errors relating to security one has to configure security
224as described in :doc:`SECURITY-CONFIG`. Security can be disabled for testing purposes as follows:
225
226::
227
228 ...
229 trust-anchor
230 {
231 type any
232 ;file-name "root.cert"
233 }
234 ...
235 trust-anchor
236 {
237 type any
238 ;file-name "site.cert"
239 }
240 ; cert-to-publish "root.cert"
241 ; cert-to-publish "router.cert"
242 ; cert-to-publish "site.cert"
243 ; cert-to-publish "router.cert"
244
245Or by simply replacing the whole security section with:
246
247::
248
249 security
250 {
251 validator
252 {
253 trust-anchor
254 {
255 type any
256 }
257 }
258 prefix-update-validator
259 {
260 trust-anchor
261 {
262 type any
263 }
264 }
265 }
Vince Lehmanb722b102014-08-24 16:33:49 -0500266
267Step 4: Running NLSR on /ndn/memphis.edu/router1
akmhoquecc827532014-07-09 08:48:49 -0500268-------------------------------------------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500269
270Assuming the configuration file is saved as ``nlsr.conf``, type the following to run nlsr:
271
272::
akmhoquecc827532014-07-09 08:48:49 -0500273
274 $ nlsr -f nlsr.conf
275
Vince Lehmanb722b102014-08-24 16:33:49 -0500276NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in the current
277directory, please provide the absolute path with the file name as the value. If
278``nlsr.conf`` resides in ``/home/ndnuser/configuration`` directory, type ``nlsr -f
279/home/ndnuser/configuration/nlsr.conf`` to run nlsr.
akmhoquecc827532014-07-09 08:48:49 -0500280
Vince Lehmanb722b102014-08-24 16:33:49 -0500281The same process needs to be followed for ``/ndn/arizona.edu/router3`` and
282``/ndn/colostate.edu/router2`` to run NLSR on these routers.
akmhoquecc827532014-07-09 08:48:49 -0500283
Vince Lehmanb722b102014-08-24 16:33:49 -0500284Expected Output
akmhoquecc827532014-07-09 08:48:49 -0500285----------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500286
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500287Assuming that all three routers are configured correctly and routing has converged,
288``nfd-status`` in ``/ndn/edu/colostate/%C1.Router/router2`` will have the following (or similar)
289entries for the name advertised by ``/ndn/edu/memphis/%C1.Router/router1``:
akmhoquecc827532014-07-09 08:48:49 -0500290
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700291RIB:
akmhoquecc827532014-07-09 08:48:49 -0500292
Vince Lehmanb722b102014-08-24 16:33:49 -0500293::
294
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700295 /ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
296 /ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
297 /ndn/news/memphis/politics/lutherking route={faceid=17 (origin=128 cost=25 ChildInherit, faceid=7 (origin=128 cost=58 ChildInherit)}
akmhoquecc827532014-07-09 08:48:49 -0500298
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500299This output can be seen by typing ``nfdc route list`` in the terminal. Please refer to the
Vince Lehmanb722b102014-08-24 16:33:49 -0500300network figure for face IDs.
301
302.. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266