blob: c6fb3b897bdd1947187ddb8eb061b8ebbe48099a [file] [log] [blame]
hilata6ee6e072014-04-20 17:10:18 -05001nfdc
2====
3
4Usage
5-----
6
7::
8
9 nfdc [-h] COMMAND [<command options>]
10
11
12Description
13-----------
14
15``nfdc`` is a tool to manipulate routing information base (RIB), forwarding information
16base (FIB), and StrategyChoices table (i.e., which strategy should be used by which
17namespaces).
18
19Options
20-------
21
22``-h``
23 Print usage information.
24
25``COMMAND``
26
27 ``register``
28 Register a new or update existing routing entry in Routing Information Base (RIB).
29
Syed Obaid4ae0ce32014-06-17 13:59:20 -050030 ``register [-I] [-C] [-c <cost>] [-e expiration time] [-o origin] <prefix> <faceId | faceUri>``
hilata6ee6e072014-04-20 17:10:18 -050031
32 ``-I``
33 Unset CHILD_INHERIT flag from the routing entry.
34
35 ``-C``
36 Set CAPTURE flag in the routing entry.
37
38 ``-c <cost>``
39 Cost for the RIB entry (default is 0).
40
Syed Obaid4ae0ce32014-06-17 13:59:20 -050041 ``-e <expiration time>``
Syed Obaid818e8a62014-07-02 18:24:11 -050042 Expiration time of the RIB entry in milliseconds. If not specified, the entry remains in FIB
43 for the lifetime of the associated face.
Syed Obaid4ae0ce32014-06-17 13:59:20 -050044
Joao Pereira5b6deae2015-06-30 13:59:58 -040045 ``-o <origin>``
Syed Obaid4ae0ce32014-06-17 13:59:20 -050046 Origin of the registration request (default is 255).
47 0 for Local producer applications, 128 for NLSR, 255 for static routes.
48
hilata6ee6e072014-04-20 17:10:18 -050049 ``prefix``
50 A prefix of an existing or to be created RIB entry, for which routing entry is
51 requested to be added or updated.
52
53 ``faceId``
54 An existing NFD Face ID number, which can be obtained, for example, using
55 ``nfd-status`` command.
56
57 ``faceUri``
58 URI of the existing or to be created Face.
59
60 ``unregister``
61 Unregister an existing routing entry from Routing Information Base (RIB).
62
Syed Obaidf93f9d92014-06-22 13:50:48 -050063 ``unregister [-o origin] <prefix> <faceId>``
hilata6ee6e072014-04-20 17:10:18 -050064
Joao Pereira5b6deae2015-06-30 13:59:58 -040065 ``-o <origin>``
Syed Obaidf93f9d92014-06-22 13:50:48 -050066 Origin of the unregistration request (default is 255).
67
Joao Pereira5b6deae2015-06-30 13:59:58 -040068 ``prefix``
hilata6ee6e072014-04-20 17:10:18 -050069 A prefix of an existing RIB entry, from which routing entry is requested to be
70 removed.
71
72 ``faceId``
73 An existing NFD Face ID number, which can be obtained, for example, using
74 ``nfd-status`` command.
75
76 ``create``
77 Create a UDP unicast or TCP Face
78
Joao Pereirac6184cd2015-09-03 15:27:29 -040079 ``create [-P] <faceUri>``
80
81 ``-P``
82 create permanent (instead of persistent) face:
83
84 .. note::
85 Persistent (default) faces remain open until they are explicitly destroyed or
86 there is a transport failure. Permanent faces remain open until they are
87 explicitly destroyed; any transport failures will be recovered internally.
hilata6ee6e072014-04-20 17:10:18 -050088
89 ``faceUri``
90 UDP unicast or TCP Face URI::
91
92 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
93 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
94
95 ``destroy``
96 Create an existing UDP unicast or TCP Face.
97
98 ``destroy <faceId | faceUri>``
99
100 ``faceId``
101 An existing NFD Face ID number, which can be obtained, for example, using
102 ``nfd-status`` command.
103
104 ``faceUri``
105 UDP unicast or TCP Face URI::
106
107 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
108 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
109
110 ``set-strategy``
111 Select strategy to be used for the specified namespace
112
113 ``set-strategy <namespace> <strategy-name>``
114
115 ``namespace``
116 Namespace that will use the specified strategy.
117
118 Note that more specific namespace(s) can use different strategy or strategies.
119 For example, if namespace ``/A/B/C`` was using strategy
120 ``ndn:/localhost/nfd/strategy/best-route`` before running ``set-strategy`` on
121 ``/A`` namespace, it will continue using the same strategy no matter which
122 namespace was specified for ``/A``.
123
124 ``strategy-name``
125 Name of one of the available strategies.
126
127 Currently, NFD supports the following strategies::
128
129 ndn:/localhost/nfd/strategy/best-route
Junxiao Shi67ba8d22015-08-21 21:21:28 -0700130 ndn:/localhost/nfd/strategy/multicast
hilata6ee6e072014-04-20 17:10:18 -0500131 ndn:/localhost/nfd/strategy/client-control
132 ndn:/localhost/nfd/strategy/ncc
Junxiao Shi67ba8d22015-08-21 21:21:28 -0700133 ndn:/localhost/nfd/strategy/access
hilata6ee6e072014-04-20 17:10:18 -0500134
135 ``unset-strategy``
136 Unset the strategy for a given ``namespace``.
137
138 Effectively, this command select parent's namespace strategy to be used for the
139 specified ``namespace``.
140
141 ``unset-strategy <namespace>``
142
143 ``namespace``
144 Namespace from which namespace customization should be removed.
145
146 ``add-nexthop``
147 Directly add nexthop entry info NFD's Forwarding Information Base (FIB). This command
148 is intended only for debugging purposes. Normally, prefix-nexhop association should
149 be registered in Routing Information Base using ``register`` command.
150
151 ``add-nexthop [-c <cost>] <prefix> <faceId | faceUri>``
152
153 ``-c <cost>``
154 Cost for the nexthop entry to be inserted (default is 0).
155
156 ``prefix``
157 A prefix of an existing or to be created FIB entry, to which nexthop
158 entry is requested to be added.
159
160 ``faceId``
161 An existing NFD Face ID number, which can be obtained, for example, using
162 ``nfd-status`` command
163
164 ``faceUri``
165 URI of the existing or to be created Face.
166
167 ``remove-nexthop``
168 Directly remove nexthop entry from NFD'S FIB. This command
169 is intended only for debugging purposes. Normally, prefix-nexhop association should
170 be unregistered from Routing Information Base using ``unregister`` command.
171
172 ``remove-nexthop <prefix> <faceId>``
173
174 ``prefix``
175 A prefix of an existing FIB entry, from which nexthop entry is requested to be removed.
176
177 ``faceId``
178 An existing NFD Face ID number, which can be obtained, for example, using
179 ``nfd-status`` command.
180
181 Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
182 the whole FIB entry will be removed.
183
Junxiao Shibf6acd52016-09-14 03:57:57 +0000184Exit Codes
185----------
hilata6ee6e072014-04-20 17:10:18 -0500186
Junxiao Shibf6acd52016-09-14 03:57:57 +00001870: Success
188
1891: An unspecified error occurred
190
1912: Malformed command line
hilata6ee6e072014-04-20 17:10:18 -0500192
193Examples
194--------
195
196Add a namespace to a face uri:
197
198::
199
200 nfdc register ndn:/app1/video udp://192.168.1.2
201
202Set strategy to a name:
203
204::
205
206 nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast