nlsr.conf

Description

NLSR config file

Example

  1; the general section contains all the general settings for router
  2
  3general
  4{
  5  ; mandatory configuration command section network, site and router
  6
  7  network /ndn         ; name of the network the router belongs to in ndn URI format
  8  site /edu/memphis    ; name of the site the router belongs to in ndn URI format
  9  router /%C1.Router/cs/pollux    ; name of the router in ndn URI format
 10
 11  ; lsa-refresh-time is the time in seconds, after which router will refresh its LSAs
 12  lsa-refresh-time 1800      ; default value 1800. Valid values 240-7200
 13
 14  ; router-dead-interval is the time in seconds after which an inactive routers
 15  ; LSAs are removed
 16  ;router-dead-interval 3600 ; default value: 2*lsa-refresh-time. Value must be larger
 17                             ; than lsa-refresh-time
 18
 19  ; InterestLifetime (in seconds) for LSA fetching
 20  lsa-interest-lifetime 4    ; default value 4. Valid values 1-60
 21
 22  ; select sync protocol: chronosync / psync / svs
 23  sync-protocol psync
 24
 25  ; sync interest lifetime of ChronoSync/PSync in milliseconds
 26  sync-interest-lifetime 60000  ; default value 60000. Valid values 1000-120,000
 27
 28  state-dir       /var/lib/nlsr        ; path for intermediate state files including sequence directory (Absolute path)
 29}
 30
 31; the neighbors section contains the configuration for router's neighbors and hello protocol behavior
 32
 33neighbors
 34{
 35  ; in case hello interest timed out, router will try 'hello-retries' times at 'hello-timeout'
 36  ; seconds interval before giving up for any neighbors (deciding link is down)
 37
 38   hello-retries 3                     ; interest retries number in integer. Default value 3
 39                                       ; valid values 1-10
 40
 41   hello-timeout 1                     ; interest time out value in seconds. Default value 1
 42                                       ; Valid values 1-15
 43
 44   hello-interval  60                  ; interest sending interval in seconds. Default value 60
 45                                       ; valid values 30-90
 46
 47  ; adj-lsa-build-interval is the time to wait in seconds after an Adjacency LSA build is scheduled
 48  ; before actually building the Adjacency LSA
 49
 50  adj-lsa-build-interval 10   ; default value 10. Valid values 5-30.
 51
 52  face-dataset-fetch-tries 3 ; default is 3. Valid values 1-10. The FaceDataset is
 53                             ; gotten from NFD, and is needed to configure NLSR
 54                             ; correctly. It is recommended not to set this
 55                             ; variable too high, because it could cause
 56                             ; congestion for NFD.
 57
 58  face-dataset-fetch-interval 3600 ; default is 3600. Valid values 1800-5400.
 59                                   ; This controls how often (in seconds) NLSR will attempt to
 60                                   ; fetch a FaceStatus dataset from NFD.
 61
 62  ; neighbor command is used to configure router's neighbor. Each neighbor will need
 63  ; one block of neighbor command
 64
 65  neighbor
 66  {
 67    name /ndn/edu/memphis/%C1.Router/cs/castor  ; name prefix of the neighbor router consists
 68                                                ; of network, site-name and router-name
 69
 70    face-uri  udp://castor.cs.memphis.edu       ; face uri of the face connected to the neighbor
 71    link-cost 25                                ; cost of the connecting link to neighbor
 72  }
 73
 74  neighbor
 75  {
 76    name /ndn/edu/memphis/%C1.Router/cs/mira  ; name prefix of the neighbor router consists
 77                                              ; of network, site-name and router-name
 78
 79    face-uri  udp://mira.cs.memphis.edu       ; face uri of the face connected to the neighbor
 80    link-cost 30                              ; cost of the connecting link to neighbor
 81  }
 82}
 83
 84; the hyperbolic section contains the configuration settings of enabling a router to calculate
 85; routing table using [hyperbolic routing table calculation](http://arxiv.org/abs/0805.1266) method
 86
 87hyperbolic
 88{
 89  ; commands in this section follows a strict order
 90  ; the switch is used to set hyperbolic routing calculation in NLSR
 91
 92  state off             ; default value 'off', set value 'on' to enable hyperbolic routing table
 93                        ; calculation which turns link state routing 'off'. set value to 'dry-run'
 94                        ; to test hyperbolic routing and compare with link state routing.
 95
 96
 97  radius   123.456      ; radius of the router in hyperbolic coordinate system
 98  angle    1.45,2.36    ; angle of the router in hyperbolic coordinate system
 99}
100
101
102; the fib section is used to configure fib entrys type to ndn FIB updated by NLSR
103
104fib
105{
106  ; the max-faces-per-prefix is used to limit the number of faces for each name prefixes
107  ; by NLSR in ndn FIB
108
109  max-faces-per-prefix 3   ; default value 0. Valid value 0-60. By default (value 0) NLSR adds
110                           ; all available faces for each reachable name prefixes in NDN FIB
111
112  ; routing-calc-interval is the time to wait in seconds after a routing table calculation is
113  ; scheduled before actually performing the routing table calculation
114
115  routing-calc-interval 15   ; default value 15. Valid values 0-15. It is recommended that
116                             ; routing-calc-interval have a higher value than adj-lsa-build-interval
117}
118
119; the advertising section contains the configuration settings of the name prefixes
120; hosted by this router
121
122advertising
123{
124  ; the ndnname is used to advertised name from the router. To advertise each name prefix
125  ; configure one block of ndnname configuration command for every name prefix.
126
127  prefix /ndn/edu/memphis/cs/netlab           ; name in ndn URI format
128  prefix /ndn/edu/memphis/sports/basketball
129}
130
131security
132{
133  validator
134  {
135    rule
136    {
137      id "NLSR Hello Rule"
138      for data
139      filter
140      {
141        type name
142        regex ^[^<nlsr><INFO>]*<nlsr><INFO><><>$
143      }
144      checker
145      {
146        type customized
147        sig-type ecdsa-sha256
148        key-locator
149        {
150          type name
151          hyper-relation
152          {
153            k-regex ^([^<KEY><nlsr>]*)<nlsr><KEY><>{1,3}$
154            k-expand \\1
155            h-relation equal
156            p-regex ^([^<nlsr><INFO>]*)<nlsr><INFO><><>$
157            p-expand \\1
158          }
159        }
160      }
161    }
162
163    rule
164    {
165      id "NLSR LSA Rule"
166      for data
167      filter
168      {
169        type name
170        regex ^[^<nlsr><LSA>]*<nlsr><LSA>
171      }
172      checker
173      {
174        type customized
175        sig-type ecdsa-sha256
176        key-locator
177        {
178          type name
179          hyper-relation
180          {
181            k-regex ^([^<KEY><nlsr>]*)<nlsr><KEY><>{1,3}$
182            k-expand \\1
183            h-relation equal
184            ; the last four components in the prefix should be <lsaType><seqNo><version><segmentNo>
185            p-regex ^<localhop>([^<nlsr><LSA>]*)<nlsr><LSA>(<>*)<><><><>$
186            p-expand \\1\\2
187          }
188        }
189      }
190    }
191
192    rule
193    {
194      id "NLSR datasets"
195      for data
196      filter
197      {
198        type name
199        regex ^[^<nlsr>]*<nlsr>[<lsdb><routing-table>]
200      }
201      checker
202      {
203        type customized
204        sig-type ecdsa-sha256
205        key-locator
206        {
207          type name
208          hyper-relation
209          {
210            k-regex ^([^<KEY>]*)<KEY><>{1,3}$ ; router key or certificate
211            k-expand \\1
212            h-relation equal
213            p-regex ^([^<nlsr>]*)<nlsr>[<lsdb><routing-table>]
214            p-expand \\1
215          }
216        }
217      }
218    }
219
220    rule
221    {
222      id "NLSR Hierarchy Exception Rule"
223      for data
224      filter
225      {
226        type name
227        regex ^[^<KEY><%C1.Router>]*<%C1.Router>[^<KEY><nlsr>]*<KEY><><><>$
228      }
229      checker
230      {
231        type customized
232        sig-type ecdsa-sha256
233        key-locator
234        {
235          type name
236          hyper-relation
237          {
238            k-regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>{1,3}$
239            k-expand \\1
240            h-relation equal
241            p-regex ^([^<KEY><%C1.Router>]*)<%C1.Router>[^<KEY>]*<KEY><><><>$
242            p-expand \\1
243          }
244        }
245      }
246    }
247
248    rule
249    {
250      id "NLSR Hierarchical Rule"
251      for data
252      filter
253      {
254        type name
255        regex ^[^<KEY>]*<KEY><><><>$
256      }
257      checker
258      {
259        type hierarchical
260        sig-type ecdsa-sha256
261      }
262    }
263
264    trust-anchor
265    {
266      type file
267      file-name "root.cert"
268    }
269  }
270
271  prefix-update-validator
272  {
273    rule
274    {
275      id "NLSR ControlCommand Rule"
276      for interest
277      filter
278      {
279        type name
280        ; /<prefix>/<management-module>/<command-verb>/<control-parameters>
281        ; /<timestamp>/<random-value>/<signed-interests-components>
282        regex ^<localhost><nlsr><prefix-update>[<advertise><withdraw>]<><><>$
283      }
284      checker
285      {
286        type customized
287        sig-type ecdsa-sha256
288        key-locator
289        {
290          type name
291          regex ^([^<KEY><%C1.Operator>]*)<%C1.Operator>[^<KEY>]*<KEY><>{1,3}$
292        }
293      }
294    }
295
296    rule
297    {
298      id "NLSR Hierarchy Rule"
299      for data
300      filter
301      {
302        type name
303        regex ^[^<KEY>]*<KEY><><><>$
304      }
305      checker
306      {
307        type hierarchical
308        sig-type ecdsa-sha256
309      }
310    }
311
312    trust-anchor
313    {
314      type file
315      file-name "site.cert"
316    }
317  }
318
319  ; cert-to-publish "root.cert"  ; optional, a file containing the root certificate
320                                 ; Only the router that is designated to publish the root cert
321                                 ; needs to specify this
322
323  ; cert-to-publish "site.cert"  ; optional, a file containing the site certificate
324                                 ; Only the router that is designated to publish the site cert
325                                 ; needs to specify this
326
327  ; cert-to-publish "operator.cert" ; optional, a file containing the operator certificate
328                                    ; Only the router that is designated to publish the operator
329                                    ; cert needs to specify this
330
331  cert-to-publish "router.cert"  ; required, a file containing the router certificate.
332}