Project

General

Profile

ConfigFileFormat » History » Version 18

Davide Pesavento, 02/08/2021 10:26 AM

1 15 Davide Pesavento
# Configuration file format
2 1 Alex Afanasyev
3 17 Davide Pesavento
The initial state of NFD is configured using a textual file in [Boost INFO](https://www.boost.org/doc/libs/1_65_1/doc/html/property_tree/parsers.html#property_tree.parsers.info_parser) format.
4 1 Alex Afanasyev
5 11 Alex Afanasyev
    ; The general section contains settings of nfd process.
6 1 Alex Afanasyev
    general
7
    {
8 11 Alex Afanasyev
      ; Specify a user and/or group for NFD to drop privileges to
9
      ; when not performing privileged tasks. NFD does not drop
10
      ; privileges by default.
11
    
12
      ; user ndn-user
13
      ; group ndn-user
14 1 Alex Afanasyev
    }
15
    
16
    log
17
    {
18 11 Alex Afanasyev
      ; default_level specifies the logging level for modules
19
      ; that are not explicitly named. All debugging levels
20
      ; listed above the selected value are enabled.
21
      ;
22
      ; Valid values:
23
      ;
24
      ;  NONE ; no messages
25
      ;  ERROR ; error messages
26
      ;  WARN ; warning messages
27
      ;  INFO ; informational messages (default)
28
      ;  DEBUG ; debugging messages
29
      ;  TRACE ; trace messages (most verbose)
30
      ;  ALL ; all messages
31
    
32
      default_level INFO
33
    
34
      ; You may override default_level by assigning a logging level
35
      ; to the desired module name. Module names can be found in two ways:
36
      ;
37
      ; Run:
38
      ;   nfd --modules
39
      ;
40 18 Davide Pesavento
      ; Or look for NFD_LOG_INIT(<module name>) statements in source files.
41
      ; Note that the "nfd." prefix can be omitted.
42 1 Alex Afanasyev
      ;
43
      ; Example module-level settings:
44
      ;
45
      ; FibManager DEBUG
46
      ; Forwarder INFO
47
    }
48
    
49
    ; The tables section configures the CS, PIT, FIB, Strategy Choice, and Measurements
50
    tables
51
    {
52
      ; ContentStore size limit in number of packets
53
      ; default is 65536, about 500MB with 8KB packet size
54
      cs_max_packets 65536
55 16 Davide Pesavento
    
56 1 Alex Afanasyev
      ; Set the CS replacement policy.
57 16 Davide Pesavento
      ; Available policies are: priority_fifo, lru
58 18 Davide Pesavento
      cs_policy lru
59 16 Davide Pesavento
    
60
      ; Set a policy to decide whether to cache or drop unsolicited Data.
61
      ; Available policies are: drop-all, admit-local, admit-network, admit-all
62
      cs_unsolicited_policy drop-all
63
    
64
      ; Set the forwarding strategy for the specified prefixes:
65
      ;   <prefix> <strategy>
66
      strategy_choice
67
      {
68
        /               /localhost/nfd/strategy/best-route
69
        /localhost      /localhost/nfd/strategy/multicast
70
        /localhost/nfd  /localhost/nfd/strategy/best-route
71
        /ndn/broadcast  /localhost/nfd/strategy/multicast
72
      }
73
    
74
      ; Declare network region names
75
      ; These are used for mobility support.  An Interest carrying a Link object is
76
      ; assumed to have reached the producer region if any delegation name in the
77
      ; Link object is a prefix of any region name.
78
      network_region
79
      {
80
        ; /example/region1
81
        ; /example/region2
82
      }
83 11 Alex Afanasyev
    }
84
    
85 1 Alex Afanasyev
    ; The face_system section defines what faces and channels are created.
86
    face_system
87
    {
88 18 Davide Pesavento
      ; This section contains options that apply to multiple face protocols.
89
      general
90
      {
91
        enable_congestion_marking yes ; set to 'no' to disable congestion marking on supported faces, default 'yes'
92
      }
93
    
94
      ; The unix section contains settings for Unix stream faces and channels.
95 16 Davide Pesavento
      ; A Unix channel is always listening; delete the unix section to disable
96 1 Alex Afanasyev
      ; Unix stream faces and channels.
97 16 Davide Pesavento
      unix
98
      {
99 18 Davide Pesavento
        ; The default transport is unix:///run/nfd.sock (on Linux) or unix:///var/run/nfd.sock (on
100
        ; other platforms). This should match the "transport" field in client.conf for ndn-cxx. If you
101
        ; wish to use TCP instead of Unix sockets with ndn-cxx, change "transport" to an appropriate
102
        ; TCP FaceUri.
103
        path /run/nfd.sock ; Unix stream listener path
104 1 Alex Afanasyev
      }
105
    
106 18 Davide Pesavento
      ; The tcp section contains settings for TCP faces and channels.
107 1 Alex Afanasyev
      tcp
108
      {
109
        listen yes ; set to 'no' to disable TCP listener, default 'yes'
110
        port 6363 ; TCP listener port number
111
        enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
112
        enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
113 18 Davide Pesavento
    
114
        ; A TCP face has local scope if the local and remote IP addresses match the whitelist but not the blacklist
115
        local
116
        {
117
          whitelist
118
          {
119
            subnet 127.0.0.0/8
120
            subnet ::1/128
121
          }
122
          blacklist
123
          {
124
          }
125
        }
126 1 Alex Afanasyev
      }
127
    
128 18 Davide Pesavento
      ; The udp section contains settings for UDP faces and channels.
129 1 Alex Afanasyev
      udp
130 16 Davide Pesavento
      {
131
        ; UDP unicast settings.
132 18 Davide Pesavento
        listen yes ; set to 'no' to disable UDP listener, default 'yes'
133
        port 6363 ; UDP listener port number
134 16 Davide Pesavento
        enable_v4 yes ; set to 'no' to disable IPv4 channels, default 'yes'
135
        enable_v6 yes ; set to 'no' to disable IPv6 channels, default 'yes'
136 1 Alex Afanasyev
    
137
        ; Time (in seconds) before closing an idle UDP unicast face.
138 16 Davide Pesavento
        ; The actual timeout will occur anytime between idle_timeout and 2*idle_timeout.
139 1 Alex Afanasyev
        ; The default is 600 (10 minutes).
140 11 Alex Afanasyev
        idle_timeout 600
141 16 Davide Pesavento
    
142 1 Alex Afanasyev
        ; UDP multicast settings.
143
        ; By default, NFD creates one UDP multicast face per NIC.
144
        ;
145
        ; In multi-homed Linux machines these settings will NOT work without
146 16 Davide Pesavento
        ; root or setting the appropriate permissions:
147 1 Alex Afanasyev
        ;
148 16 Davide Pesavento
        ;    sudo setcap cap_net_raw=eip /path/to/nfd
149
        ;
150
        mcast yes ; set to 'no' to disable UDP multicast, default 'yes'
151
        mcast_group 224.0.23.170 ; UDP multicast group (IPv4)
152
        mcast_port 56363 ; UDP multicast port number (IPv4)
153
        mcast_group_v6 ff02::1234 ; UDP multicast group (IPv6)
154
        mcast_port_v6 56363 ; UDP multicast port number (IPv6)
155 1 Alex Afanasyev
        mcast_ad_hoc no ; set to 'yes' to make all UDP multicast faces "ad hoc", default 'no'
156 16 Davide Pesavento
    
157
        ; Whitelist and blacklist can contain, in no particular order:
158
        ; - interface names, including wildcard patterns (e.g., 'ifname eth0', 'ifname en*', 'ifname wlp?s0')
159 18 Davide Pesavento
        ; - MAC addresses (e.g., 'ether 85:3b:4d:d3:5f:c2')
160
        ; - IPv4 subnets (e.g., 'subnet 192.0.2.0/24')
161
        ; - IPv6 subnets (e.g., 'subnet 2001:db8::/32')
162 16 Davide Pesavento
        ; - a single asterisk ('*') that matches all interfaces
163
        ; By default, all interfaces are whitelisted.
164 1 Alex Afanasyev
        whitelist
165 16 Davide Pesavento
        {
166
          *
167
        }
168
        blacklist
169 11 Alex Afanasyev
        {
170 1 Alex Afanasyev
        }
171
      }
172
    
173 18 Davide Pesavento
      ; The ether section contains settings for Ethernet faces and channels.
174 1 Alex Afanasyev
      ; These settings will NOT work without root or setting the appropriate
175 16 Davide Pesavento
      ; permissions:
176 1 Alex Afanasyev
      ;
177
      ;    sudo setcap cap_net_raw,cap_net_admin=eip /path/to/nfd
178
      ;
179
      ; You may need to install a package to use setcap:
180
      ;
181
      ; **Ubuntu:**
182
      ;
183 18 Davide Pesavento
      ;    sudo apt install libcap2-bin
184 1 Alex Afanasyev
      ;
185
      ; **Mac OS X:**
186
      ;
187
      ;    curl https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3373 -o ChmodBPF.tar.gz
188
      ;    tar zxvf ChmodBPF.tar.gz
189
      ;    open ChmodBPF/Install\ ChmodBPF.app
190 16 Davide Pesavento
      ;
191 11 Alex Afanasyev
      ; or manually:
192
      ;
193 1 Alex Afanasyev
      ;    sudo chgrp admin /dev/bpf*
194
      ;    sudo chmod g+rw /dev/bpf*
195
      ;
196 16 Davide Pesavento
      ether
197
      {
198 11 Alex Afanasyev
        ; Ethernet unicast settings.
199 16 Davide Pesavento
        listen yes ; set to 'no' to disable Ethernet listener, default 'yes'
200
      
201
        ; Time (in seconds) before closing an idle Ethernet unicast face.
202
        ; The actual timeout will occur anytime between idle_timeout and 2*idle_timeout.
203
        ; The default is 600 (10 minutes).
204
        idle_timeout 600
205
      
206 1 Alex Afanasyev
        ; Ethernet multicast settings.
207 11 Alex Afanasyev
        ; By default, NFD creates one Ethernet multicast face per NIC.
208
        mcast yes ; set to 'no' to disable Ethernet multicast, default 'yes'
209 16 Davide Pesavento
        mcast_group 01:00:5E:00:17:AA ; Ethernet multicast group
210
        mcast_ad_hoc no ; set to 'yes' to make all Ethernet multicast faces "ad hoc", default 'no'
211
      
212
        ; Whitelist and blacklist can contain, in no particular order:
213
        ; - interface names, including wildcard patterns (e.g., 'ifname eth0', 'ifname en*', 'ifname wlp?s0')
214 18 Davide Pesavento
        ; - MAC addresses (e.g., 'ether 85:3b:4d:d3:5f:c2')
215
        ; - IPv4 subnets (e.g., 'subnet 192.0.2.0/24')
216
        ; - IPv6 subnets (e.g., 'subnet 2001:db8::/32')
217 1 Alex Afanasyev
        ; - a single asterisk ('*') that matches all interfaces
218
        ; By default, all interfaces are whitelisted.
219
        whitelist
220
        {
221
          *
222
        }
223
        blacklist
224
        {
225
        }
226
      }
227
    
228 18 Davide Pesavento
      ; The websocket section contains settings for WebSocket faces and channels.
229 1 Alex Afanasyev
      websocket
230
      {
231
        listen yes ; set to 'no' to disable WebSocket listener, default 'yes'
232
        port 9696 ; WebSocket listener port number
233
        enable_v4 yes ; set to 'no' to disable listening on IPv4 socket, default 'yes'
234
        enable_v6 yes ; set to 'no' to disable listening on IPv6 socket, default 'yes'
235
      }
236 18 Davide Pesavento
    
237
      ; The netdev_bound section defines faces bound to netdevices.
238
      netdev_bound
239
      {
240
        ; A rule consists of a whitelist, a blacklist, and a set of remote FaceUris, and will cause the
241
        ; creation of zero or more faces bound to netdevices. One face will be created per accepted
242
        ; netdev per remote. There can be any number of rules in the netdev_bound section.
243
    
244
        ; rule
245
        ; {
246
        ;   ; Remote FaceUri to which the netdev-bound faces will connect.
247
        ;   ; Rule can contain multiple remotes. One face will be created for each remote.
248
        ;   ; All FaceUris must be in canonical form. Currently only udp4 and udp6 are supported.
249
        ;   remote udp4://192.0.2.1:6363
250
        ;
251
        ;   ; Whitelist and blacklist can contain, in no particular order:
252
        ;   ; - interface names, including wildcard patterns (e.g., 'ifname eth0', 'ifname en*', 'ifname wlp?s0')
253
        ;   ; - MAC addresses (e.g., 'ether 85:3b:4d:d3:5f:c2')
254
        ;   ; - IPv4 subnets (e.g., 'subnet 192.0.2.0/24')
255
        ;   ; - IPv6 subnets (e.g., 'subnet 2001:db8::/32')
256
        ;   ; - a single asterisk ('*') that matches all interfaces
257
        ;   ; By default, all interfaces are whitelisted.
258
        ;   whitelist
259
        ;   {
260
        ;     *
261
        ;   }
262
        ;   blacklist
263
        ;   {
264
        ;   }
265
        ; }
266
      }
267 11 Alex Afanasyev
    }
268
    
269
    ; The authorizations section grants privileges to authorized keys.
270
    authorizations
271
    {
272
      ; An authorize section grants privileges to a NDN certificate.
273
      authorize
274
      {
275
        ; If you do not already have NDN certificate, you can generate
276
        ; one with the following commands.
277
        ;
278
        ; 1. Generate and install a self-signed identity certificate:
279
        ;
280
        ;      ndnsec-keygen /`whoami` | ndnsec-install-cert -
281
        ;
282 1 Alex Afanasyev
        ; Note that the argument to ndnsec-key will be the identity name of the
283 11 Alex Afanasyev
        ; new key (in this case, /your-username). Identities are hierarchical NDN
284
        ; names and may have multiple components (e.g. `/ndn/ucla/edu/alice`).
285
        ; You may create additional keys and identities as you see fit.
286
        ;
287
        ; 2. Dump the NDN certificate to a file:
288
        ;
289 10 Alex Afanasyev
        ;      sudo mkdir -p /usr/local/etc/ndn/keys/
290
        ;      ndnsec-cert-dump -i /`whoami` >  default.ndncert
291 11 Alex Afanasyev
        ;      sudo mv default.ndncert /usr/local/etc/ndn/keys/default.ndncert
292 10 Alex Afanasyev
        ;
293
        ; The "certfile" field below specifies the default key directory for
294 11 Alex Afanasyev
        ; your machine. You may move your newly created key to the location it
295
        ; specifies or path.
296
    
297
        ; certfile keys/default.ndncert ; NDN identity certificate file
298
        certfile any ; "any" authorizes command interests signed under any certificate,
299 1 Alex Afanasyev
                     ; i.e., no actual validation.
300
        privileges ; set of privileges granted to this identity
301 11 Alex Afanasyev
        {
302
          faces
303
          fib
304 18 Davide Pesavento
          cs
305 11 Alex Afanasyev
          strategy-choice
306
        }
307
      }
308
    
309
      ; You may have multiple authorize sections that specify additional
310
      ; certificates and their privileges.
311
    
312 1 Alex Afanasyev
      ; authorize
313 11 Alex Afanasyev
      ; {
314
      ;   certfile keys/this_cert_does_not_exist.ndncert
315
      ;   authorize
316 16 Davide Pesavento
      ;   privileges
317 11 Alex Afanasyev
      ;   {
318 16 Davide Pesavento
      ;     faces
319 11 Alex Afanasyev
      ;   }
320
      ; }
321
    }
322
    
323
    rib
324
    {
325
      ; The following localhost_security allows anyone to register routing entries in local RIB
326 1 Alex Afanasyev
      localhost_security
327 11 Alex Afanasyev
      {
328
        trust-anchor
329
        {
330
          type any
331
        }
332
      }
333
    
334
      ; localhop_security should be enabled when NFD runs on a hub.
335
      ; "/localhop/nfd/fib" command prefix will be disabled when localhop_security section is missing.
336
      ; localhop_security
337
      ; {
338 1 Alex Afanasyev
      ;   ; This section defines the trust model for NFD RIB Management. It consists of rules and
339
      ;   ; trust-anchors, which are briefly defined in this file.  For more information refer to
340
      ;   ; validator configuration file format documentation:
341
      ;   ;
342
      ;   ;    https://named-data.net/doc/ndn-cxx/current/tutorials/security-validator-config.html
343
      ;   ;
344
      ;   ; A trust-anchor is a pre-trusted certificate.  This can be any certificate that is the
345 16 Davide Pesavento
      ;   ; root of certification chain (e.g., NDN testbed root certificate) or an existing
346 11 Alex Afanasyev
      ;   ; default system certificate `default.ndncert`.
347
      ;   ;
348 1 Alex Afanasyev
      ;   ; A rule defines conditions a valid packet MUST have. A packet must satisfy one of the
349
      ;   ; rules defined here. A rule can be broken into two parts: matching & checking. A packet
350
      ;   ; will be matched against rules from the first to the last until a matched rule is
351 11 Alex Afanasyev
      ;   ; encountered. The matched rule will be used to check the packet. If a packet does not
352 16 Davide Pesavento
      ;   ; match any rule, it will be treated as invalid.  The matching part of a rule consists
353
      ;   ; of `for` and `filter` sections. They collectively define which packets can be checked
354 1 Alex Afanasyev
      ;   ; with this rule. `for` defines packet type (data or interest) and `filter` defines
355
      ;   ; conditions on other properties of a packet. Right now, you can only define conditions
356
      ;   ; on packet name, and you can only specify ONLY ONE filter for packet name.  The
357
      ;   ; checking part of a rule consists of `checker`, which defines the conditions that a
358
      ;   ; VALID packet MUST have. See comments in checker section for more details.
359
      ;
360
      ;   rule
361
      ;   {
362 18 Davide Pesavento
      ;     id "RIB Command Interest"
363
      ;     for interest
364
      ;     ; match Commmand Interest name
365
      ;     ; last three components are ControlParameters, timestamp, and random-value
366
      ;     ; SignatureInfo and SignatureValue are stripped before passing to the filter
367 1 Alex Afanasyev
      ;     filter
368
      ;     {
369 18 Davide Pesavento
      ;       type name
370
      ;       regex ^<localhop><nfd><rib>[<register><unregister>]<>{3}$
371 1 Alex Afanasyev
      ;     }
372
      ;     checker
373
      ;     {
374 11 Alex Afanasyev
      ;       type customized
375 18 Davide Pesavento
      ;       sig-type ecdsa-sha256
376
      ;       ; KeyLocator must be either a key name or a certificate name
377 1 Alex Afanasyev
      ;       key-locator
378
      ;       {
379 18 Davide Pesavento
      ;         type name
380
      ;         regex ^<>*<KEY><>{1,3}$
381 1 Alex Afanasyev
      ;       }
382
      ;     }
383
      ;   }
384
      ;   rule
385
      ;   {
386 18 Davide Pesavento
      ;     id "NDN Testbed Certificate Hierarchy"
387
      ;     for data
388
      ;     ; match certificate name only
389 1 Alex Afanasyev
      ;     filter
390
      ;     {
391 18 Davide Pesavento
      ;       type name
392
      ;       regex ^<>*<KEY><>{3}$
393 1 Alex Afanasyev
      ;     }
394
      ;     checker
395
      ;     {
396 18 Davide Pesavento
      ;       type customized
397
      ;       sig-type ecdsa-sha256
398
      ;       key-locator
399
      ;       {
400
      ;         type name
401
      ;         ; issuer subject name must be a prefix of issued certificate name
402
      ;         hyper-relation
403
      ;         {
404
      ;           k-regex ^(<>*)<KEY><>{1,3}$
405
      ;           k-expand \\1
406
      ;           h-relation is-prefix-of
407
      ;           p-regex ^(<>*)$
408
      ;           p-expand \\1
409
      ;         }
410
      ;       }
411 11 Alex Afanasyev
      ;     }
412
      ;   }
413
      ;   trust-anchor
414
      ;   {
415
      ;     type file
416 18 Davide Pesavento
      ;     ; certificate path, relative to this config file
417
      ;     file-name keys/default.ndncert
418 11 Alex Afanasyev
      ;   }
419 18 Davide Pesavento
      ;   ; trust-anchor entry may be repeated to specify multiple trust anchors
420 11 Alex Afanasyev
      ; }
421
    
422
      ; The following localhop_security should be enabled when NFD runs on a hub,
423
      ; which accepts all remote registrations and is a short-term solution.
424
      ; localhop_security
425
      ; {
426
      ;   trust-anchor
427 16 Davide Pesavento
      ;   {
428
      ;     type any
429
      ;   }
430
      ; }
431 18 Davide Pesavento
    
432
      ; The following prefix_announcement_validation accepts any prefix announcement
433
      prefix_announcement_validation
434
      {
435
        trust-anchor
436
        {
437
          type any
438
        }
439
      }
440 16 Davide Pesavento
    
441
      auto_prefix_propagate
442
      {
443
        cost 15 ; forwarding cost of prefix registered on remote router
444
        timeout 10000 ; timeout (in milliseconds) of prefix registration command for propagation
445
    
446
        refresh_interval 300 ; interval (in seconds) before refreshing the propagation
447
        ; This setting should be less than face_system.udp.idle_time,
448
        ; so that the face is kept alive on the remote router.
449
    
450
        base_retry_wait 50 ; base wait time (in seconds) before retrying propagation
451
        max_retry_wait 3600 ; maximum wait time (in seconds) before retrying propagation
452 1 Alex Afanasyev
        ; for consequent retries, the wait time before each retry is calculated based on the back-off
453 16 Davide Pesavento
        ; policy. Initially, the wait time is set to base_retry_wait, then it will be doubled for every
454
        ; retry unless beyond the max_retry_wait, in which case max_retry_wait is set as the wait time.
455
      }
456
    
457 1 Alex Afanasyev
      ; If enabled, routes registered with origin=client (typically from auto_prefix_propagate)
458
      ; will be readvertised into local NLSR daemon.
459
      readvertise_nlsr no
460
    }