blob: 0b7083183b3cddd9df5ee06f38fb2bb5dc4b986e [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
Vince Lehmanb722b102014-08-24 16:33:49 -050045 nfd-status -f
akmhoquecc827532014-07-09 08:48:49 -050046
Vince Lehmanb722b102014-08-24 16:33:49 -050047If you see ``ERROR: error while connecting to the forwarder (No such file or directory)``,
48``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/
90 }
91
92 ; the neighbors section contains the configuration for router's neighbors and hello's behavior
93
94 neighbors
95 {
96 ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-time-out'
97 ; seconds interval before giving up for any neighbors (deciding link is down)
98
99 hello-retries 3 ; interest retries number in integer. Default value 3
100 ; valid values 1-10
101
102 hello-timeout 1 ; interest time out value in integer. Default value 1
103 ; Valid values 1-15
104
105 hello-interval 60 ; interest sending interval in seconds. Default value 60
106 ; valid values 30-90
107 ; neighbor command is used to configure router's neighbor. Each neighbor will need
108 ; one block of neighbor command
109
110 neighbor
111 {
112 name /ndn/edu/arizona/%C1.Router/router3 ; name prefix of the neighbor router consists
113 ; of network, site-name and router-name
114
115 face-uri udp4://router3.arizona.edu ; face uri of the face connected to the neighbor
116 link-cost 25 ; cost of the connecting link to neighbor
117 }
118
119 neighbor
120 {
121 name /ndn/edu/colostate/%C1.Router/router2 ; name prefix of the neighbor router consists
122 ; of network, site-name and router-name
123
124 face-uri udp4://79.123.10.145 ; face uri of the face connected to the neighbor
125 link-cost 30 ; cost of the connecting link to neighbor
126 }
127 }
128
Vince Lehmanb722b102014-08-24 16:33:49 -0500129 ; the hyperbolic section contains the configuration settings of enabling
130 a router to calculate ; routing table using `hyperbolic routing table
131 calculation`_ method
akmhoquecc827532014-07-09 08:48:49 -0500132
133 hyperbolic
134 {
135 ; commands in this section follows a strict order
136 ; the switch is used to set hyperbolic routing calculation in NLSR
137
138 state off ; default value 'off', set value 'on' to enable hyperbolic routing table
Junxiao Shif09e2632015-01-02 18:15:01 -0700139 ; calculation which turns link state routing 'off'. set value to 'dry-run'
akmhoquecc827532014-07-09 08:48:49 -0500140 ; to test hyperbolic routing and compare with link state routing.
141
142
143 radius 123.456 ; radius of the router in hyperbolic coordinate system
144 angle 1.45 ; angle of the router in hyperbolic coordinate system
145 }
146
147
148 ; the fib section is used to configure fib entry's type to ndn FIB updated by NLSR
149
150 fib
151 {
152 ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
153 ; by NLSR in ndn FIB
154
155 max-faces-per-prefix 3 ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
156 ; all available faces for each reachable name prefixes in NDN FIB
157
158 }
159
Vince Lehmanb722b102014-08-24 16:33:49 -0500160 ; the advertising section contains the configuration settings of the
161 name prefixes ; hosted by this router
akmhoquecc827532014-07-09 08:48:49 -0500162
163 advertising
164 {
165 ; the ndnname is used to advertised name from the router. To advertise each name prefix
166 ; configure one block of ndnname configuration command for every name prefix.
167
168 prefix /ndn/memphis/sports/basketball/grizzlies
169 prefix /ndn/memphis/entertainment/blues
170 prefix /ndn/news/memphis/politics/lutherking
171 }
172
Vince Lehmanb722b102014-08-24 16:33:49 -0500173.. note::
akmhoquecc827532014-07-09 08:48:49 -0500174
Vince Lehmanb722b102014-08-24 16:33:49 -0500175 Security configuration is discussed in :doc:`SECURITY-CONFIG`, which will be also part
176 of this configuration file
177
178Step 4: Running NLSR on /ndn/memphis.edu/router1
akmhoquecc827532014-07-09 08:48:49 -0500179-------------------------------------------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500180
181Assuming the configuration file is saved as ``nlsr.conf``, type the following to run nlsr:
182
183::
akmhoquecc827532014-07-09 08:48:49 -0500184
185 $ nlsr -f nlsr.conf
186
Vince Lehmanb722b102014-08-24 16:33:49 -0500187NLSR will look for nlsr.conf in the current directory. If nlsr.conf is not in the current
188directory, please provide the absolute path with the file name as the value. If
189``nlsr.conf`` resides in ``/home/ndnuser/configuration`` directory, type ``nlsr -f
190/home/ndnuser/configuration/nlsr.conf`` to run nlsr.
akmhoquecc827532014-07-09 08:48:49 -0500191
Vince Lehmanb722b102014-08-24 16:33:49 -0500192The same process needs to be followed for ``/ndn/arizona.edu/router3`` and
193``/ndn/colostate.edu/router2`` to run NLSR on these routers.
akmhoquecc827532014-07-09 08:48:49 -0500194
Vince Lehmanb722b102014-08-24 16:33:49 -0500195Expected Output
akmhoquecc827532014-07-09 08:48:49 -0500196----------------
Vince Lehmanb722b102014-08-24 16:33:49 -0500197
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700198Assuming that all three routers are configured correctly and routing has converged, ``nfd-status`` in
Vince Lehmanb722b102014-08-24 16:33:49 -0500199``/ndn/edu/colostate/%C1.Router/router2`` will have the following entries for the name
200advertised by ``/ndn/edu/memphis/%C1.Router/router1``:
akmhoquecc827532014-07-09 08:48:49 -0500201
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700202RIB:
akmhoquecc827532014-07-09 08:48:49 -0500203
Vince Lehmanb722b102014-08-24 16:33:49 -0500204::
205
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700206 /ndn/memphis/entertainment/blues route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
207 /ndn/memphis/sports/basketball/grizzlies route={faceid=17 (origin=128 cost=25 ChildInherit), faceid=7 (origin=128 cost=58 ChildInherit)}
208 /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 -0500209
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -0700210This output can be seen by typing ``nfd-status -r`` in the terminal. Please refer to the
Vince Lehmanb722b102014-08-24 16:33:49 -0500211network figure for face IDs.
212
213.. _hyperbolic routing table calculation: http://arxiv.org/abs/0805.1266