blob: 9da47dbf2462f7b5a40408f576ff37774ba4c7d0 [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
79 ``create <faceUri>``
80
81 ``faceUri``
82 UDP unicast or TCP Face URI::
83
84 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
85 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
86
87 ``destroy``
88 Create an existing UDP unicast or TCP Face.
89
90 ``destroy <faceId | faceUri>``
91
92 ``faceId``
93 An existing NFD Face ID number, which can be obtained, for example, using
94 ``nfd-status`` command.
95
96 ``faceUri``
97 UDP unicast or TCP Face URI::
98
99 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
100 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
101
102 ``set-strategy``
103 Select strategy to be used for the specified namespace
104
105 ``set-strategy <namespace> <strategy-name>``
106
107 ``namespace``
108 Namespace that will use the specified strategy.
109
110 Note that more specific namespace(s) can use different strategy or strategies.
111 For example, if namespace ``/A/B/C`` was using strategy
112 ``ndn:/localhost/nfd/strategy/best-route`` before running ``set-strategy`` on
113 ``/A`` namespace, it will continue using the same strategy no matter which
114 namespace was specified for ``/A``.
115
116 ``strategy-name``
117 Name of one of the available strategies.
118
119 Currently, NFD supports the following strategies::
120
121 ndn:/localhost/nfd/strategy/best-route
122 ndn:/localhost/nfd/strategy/broadcast
123 ndn:/localhost/nfd/strategy/client-control
124 ndn:/localhost/nfd/strategy/ncc
125
126 ``unset-strategy``
127 Unset the strategy for a given ``namespace``.
128
129 Effectively, this command select parent's namespace strategy to be used for the
130 specified ``namespace``.
131
132 ``unset-strategy <namespace>``
133
134 ``namespace``
135 Namespace from which namespace customization should be removed.
136
137 ``add-nexthop``
138 Directly add nexthop entry info NFD's Forwarding Information Base (FIB). This command
139 is intended only for debugging purposes. Normally, prefix-nexhop association should
140 be registered in Routing Information Base using ``register`` command.
141
142 ``add-nexthop [-c <cost>] <prefix> <faceId | faceUri>``
143
144 ``-c <cost>``
145 Cost for the nexthop entry to be inserted (default is 0).
146
147 ``prefix``
148 A prefix of an existing or to be created FIB entry, to which nexthop
149 entry is requested to be added.
150
151 ``faceId``
152 An existing NFD Face ID number, which can be obtained, for example, using
153 ``nfd-status`` command
154
155 ``faceUri``
156 URI of the existing or to be created Face.
157
158 ``remove-nexthop``
159 Directly remove nexthop entry from NFD'S FIB. This command
160 is intended only for debugging purposes. Normally, prefix-nexhop association should
161 be unregistered from Routing Information Base using ``unregister`` command.
162
163 ``remove-nexthop <prefix> <faceId>``
164
165 ``prefix``
166 A prefix of an existing FIB entry, from which nexthop entry is requested to be removed.
167
168 ``faceId``
169 An existing NFD Face ID number, which can be obtained, for example, using
170 ``nfd-status`` command.
171
172 Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
173 the whole FIB entry will be removed.
174
175
176
177Examples
178--------
179
180Add a namespace to a face uri:
181
182::
183
184 nfdc register ndn:/app1/video udp://192.168.1.2
185
186Set strategy to a name:
187
188::
189
190 nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast