blob: fd08cb6c675a1e393086993cb00424640f8d0810 [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
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070038Step 1. Ensuring nfd is running
Vince Lehmanb722b102014-08-24 16:33:49 -050039-------------------------------
40
akmhoquecc827532014-07-09 08:48:49 -050041Type the following in the terminal:
42
Vince Lehmanb722b102014-08-24 16:33:49 -050043::
akmhoquecc827532014-07-09 08:48:49 -050044
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -050045 nfd-status
akmhoquecc827532014-07-09 08:48:49 -050046
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -050047If you see ``error while connecting to the forwarder (No such file or directory)``,
Vince Lehmanb722b102014-08-24 16:33:49 -050048``nfd`` is not running. Follow the instructions in `Getting started with NFD
49<http://named-data.net/doc/NFD/current/INSTALL.html>`_ to run nfd.
akmhoquecc827532014-07-09 08:48:49 -050050
Vince Lehmanb722b102014-08-24 16:33:49 -050051Step 2. Determining FaceUri
52---------------------------
akmhoquecc827532014-07-09 08:48:49 -050053
Junxiao Shif09e2632015-01-02 18:15:01 -070054Assume that ``/ndn/edu/arizona/%C1.Router/router3`` has hostname ``router3.arizona.edu`` and
55``/ndn/edu/colostate/%C1.Router/router2`` has IP address ``79.123.10.145``.
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070056``/ndn/edu/memphis/%C1.Router/router1`` will consider FaceUri
Junxiao Shif09e2632015-01-02 18:15:01 -070057``udp4://router3.arizona.edu`` for router ``/ndn/edu/arizona/%C1.Router/router3`` and
58FaceUri ``udp4://79.123.10.145`` for router ``/ndn/edu/colostate/%C1.Router/router2``.
Vince Lehmanb722b102014-08-24 16:33:49 -050059
60Step 3: Creating configuration file
61-----------------------------------
62
63Now, assume that ``/ndn/memphis.edu/router1`` wants to advertise three name prefixes
64(``/ndn/memphis/sports/basketball/grizzlies``, ``/ndn/memphis/entertainment/blues``,
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070065``/ndn/news/memphis/politics/lutherking``). The configuration file with the necessary
Vince Lehmanb722b102014-08-24 16:33:49 -050066configuration commands follows:
67
68::
akmhoquecc827532014-07-09 08:48:49 -050069
70 ; nlsr.conf starts here
71 ; the general section contains all the general settings for router
72
73 general
74 {
75 ; mandatory configuration command section network, site and router
akmhoquecc827532014-07-09 08:48:49 -050076 network /ndn/ ; name of the network the router belongs to in ndn URI format
77 site /edu/memphis/ ; name of the site the router belongs to in ndn URI format
78 router /%C1.Router/router1 ; name of the network the router belongs to in ndn URI format
79
80 ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
akmhoquecc827532014-07-09 08:48:49 -050081 lsa-refresh-time 1800 ; default value 1800. Valid values 240-7200
82
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070083 ; InterestLifetime (in seconds) for LSA fetching
84 lsa-interest-lifetime 4 ; default value 4. Valid values 1-60
akmhoquecc827532014-07-09 08:48:49 -050085
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070086 ; log-level is to set the levels of log for NLSR
akmhoquecc827532014-07-09 08:48:49 -050087 log-level INFO ; default value INFO, valid value DEBUG, INFO
88 log-dir /var/log/nlsr/
89 seq-dir /var/lib/nlsr/
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -050090 ; log4cxx-conf /path/to/log4cxx-conf
akmhoquecc827532014-07-09 08:48:49 -050091 }
92
93 ; the neighbors section contains the configuration for router's neighbors and hello's behavior
94
95 neighbors
96 {
97 ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out'
98 ; seconds interval before giving up for any neighbors (deciding link is down)
99
100 hello-retries 3 ; interest retries number in integer. Default value 3
101 ; valid values 1-10
102
103 hello-timeout 1 ; interest time out value in integer. Default value 1
104 ; Valid values 1-15
105
106 hello-interval 60 ; interest sending interval in seconds. Default value 60
107 ; valid values 30-90
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500108
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500109 ; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA
110 ; build is scheduled before actually building the Adjacency LSA
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500111
112 adj-lsa-build-interval 5 ; default value 5. Valid values 0-5. It is recommended that
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500113 ; adj-lsa-build-interval have a lower value than
114 ; routing-calc-interval
Muktadir R Chowdhury800833b2016-07-29 13:43:59 -0500115
116 ; first-hello-interval is the time to wait in seconds before sending the first Hello Interest
117
118 first-hello-interval 10 ; Default value 10. Valid values 0-10
119
akmhoquecc827532014-07-09 08:48:49 -0500120 ; neighbor command is used to configure router's neighbor. Each neighbor will need
121 ; one block of neighbor command
122
123 neighbor
124 {
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500125 name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists
126 ; of network, site-name and router-name
akmhoquecc827532014-07-09 08:48:49 -0500127
128 face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor
129 link-cost 25 ; cost of the connecting link to neighbor
130 }
131
132 neighbor
133 {
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500134 name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists
akmhoquecc827532014-07-09 08:48:49 -0500135 ; of network, site-name and router-name
136
137 face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor
138 link-cost 30 ; cost of the connecting link to neighbor
139 }
140 }
141
Vince Lehmanb722b102014-08-24 16:33:49 -0500142 ; the hyperbolic section contains the configuration settings of enabling
143 a router to calculate ; routing table using `hyperbolic routing table
144 calculation`_ method
akmhoquecc827532014-07-09 08:48:49 -0500145
146 hyperbolic
147 {
148 ; commands in this section follows a strict order
149 ; the switch is used to set hyperbolic routing calculation in NLSR
150
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500151 state off ; default value 'off', set value 'on' to enable hyperbolic routing table
152 ; calculation which turns link state routing 'off'. set value to 'dry-run'
153 ; to test hyperbolic routing and compare with link state routing.
akmhoquecc827532014-07-09 08:48:49 -0500154
155
156 radius 123.456 ; radius of the router in hyperbolic coordinate system
157 angle 1.45 ; angle of the router in hyperbolic coordinate system
158 }
159
160
161 ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR
162
163 fib
164 {
165 ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
166 ; by NLSR in ndn FIB
167
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500168 max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
169 ; all available faces for each reachable name prefixes in NDN FIB
akmhoquecc827532014-07-09 08:48:49 -0500170
171 }
172
Vince Lehmanb722b102014-08-24 16:33:49 -0500173 ; the advertising section contains the configuration settings of the
174 name prefixes ; hosted by this router
akmhoquecc827532014-07-09 08:48:49 -0500175
176 advertising
177 {
178 ; the ndnname is used to advertised name from the router. To advertise each name prefix
179 ; configure one block of ndnname configuration command for every name prefix.
180
181 prefix /ndn/memphis/sports/basketball/grizzlies
182 prefix /ndn/memphis/entertainment/blues
183 prefix /ndn/news/memphis/politics/lutherking
184 }
185
akmhoquecc827532014-07-09 08:48:49 -0500186
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500187NLSR will have the following error if ``log-dir`` does not exist:
188
189::
190
191 Provided log directory </var/log/nlsr/> does not exist
192 Error in configuration file processing! Exiting from NLSR
193
194By default ``/var/log/nlsr/`` is set to be NLSR's log directory and ``/var/lib/nlsr/`` is set to be
195NLSR's sequence file directory. They do not exist and will need to be created.
196Also, since these are system directories it will require the user to run NLSR as root.
197If one does not have permission to write to the specified directory,
198then NLSR will produce the following error:
199
200::
201
202 User does not have read and write permission on the directory
203 Error in configuration file processing! Exiting from NLSR
204
205To avoid this, the directories can be set in a user owned directory.
206The directories for log and sequence file can be same.
207For example:
208
209::
210
211 general
212 {
213 ...
214
215 log-dir /home/username/nlsr/log ; path for log directory (Absolute path)
216 seq-dir /home/username/nlsr/log ; path for sequence directory (Absolute path)
217
218 }
219 ...
220
221The user will encounter errors such as the following if security is not configured:
222
223::
224
225 Cannot read certificate from file: /home/username/NLSR/root.cert
226
227To get rid of this and similar errors relating to security one has to configure security
228as described in :doc:`SECURITY-CONFIG`. Security can be disabled for testing purposes as follows:
229
230::
231
232 ...
233 trust-anchor
234 {
235 type any
236 ;file-name "root.cert"
237 }
238 ...
239 trust-anchor
240 {
241 type any
242 ;file-name "site.cert"
243 }
244 ; cert-to-publish "root.cert"
245 ; cert-to-publish "router.cert"
246 ; cert-to-publish "site.cert"
247 ; cert-to-publish "router.cert"
248
249Or by simply replacing the whole security section with:
250
251::
252
253 security
254 {
255 validator
256 {
257 trust-anchor
258 {
259 type any
260 }
261 }
262 prefix-update-validator
263 {
264 trust-anchor
265 {
266 type any
267 }
268 }
269 }
Vince Lehmanb722b102014-08-24 16:33:49 -0500270
271Step 4: Running NLSR on /ndn/memphis.edu/router1
akmhoquecc827532014-07-09 08:48:49 -0500272-------------------------------------------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500273
274Assuming the configuration file is saved as ``nlsr.conf``, type the following to run nlsr:
275
276::
akmhoquecc827532014-07-09 08:48:49 -0500277
278 $ nlsr -f nlsr.conf
279
Vince Lehmanb722b102014-08-24 16:33:49 -0500280NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in the current
281directory, please provide the absolute path with the file name as the value. If
282``nlsr.conf`` resides in ``/home/ndnuser/configuration`` directory, type ``nlsr -f
283/home/ndnuser/configuration/nlsr.conf`` to run nlsr.
akmhoquecc827532014-07-09 08:48:49 -0500284
Vince Lehmanb722b102014-08-24 16:33:49 -0500285The same process needs to be followed for ``/ndn/arizona.edu/router3`` and
286``/ndn/colostate.edu/router2`` to run NLSR on these routers.
akmhoquecc827532014-07-09 08:48:49 -0500287
Vince Lehmanb722b102014-08-24 16:33:49 -0500288Expected Output
akmhoquecc827532014-07-09 08:48:49 -0500289----------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500290
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500291Assuming that all three routers are configured correctly and routing has converged,
292``nfd-status`` in ``/ndn/edu/colostate/%C1.Router/router2`` will have the following (or similar)
293entries for the name advertised by ``/ndn/edu/memphis/%C1.Router/router1``:
akmhoquecc827532014-07-09 08:48:49 -0500294
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700295RIB:
akmhoquecc827532014-07-09 08:48:49 -0500296
Vince Lehmanb722b102014-08-24 16:33:49 -0500297::
298
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700299 /ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
300 /ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
301 /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 -0500302
Ashlesh Gawandeb4567f42017-04-28 14:40:39 -0500303This output can be seen by typing ``nfdc route list`` in the terminal. Please refer to the
Vince Lehmanb722b102014-08-24 16:33:49 -0500304network figure for face IDs.
305
306.. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266