blob: 9de9e0cf9b2938cebb12443c89568979c4f8d6a4 [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>``
42 Expiration time of the RIB entry in milliseconds (default is 3600000).
43
44 ``-o <origin>``
45 Origin of the registration request (default is 255).
46 0 for Local producer applications, 128 for NLSR, 255 for static routes.
47
hilata6ee6e072014-04-20 17:10:18 -050048 ``prefix``
49 A prefix of an existing or to be created RIB entry, for which routing entry is
50 requested to be added or updated.
51
52 ``faceId``
53 An existing NFD Face ID number, which can be obtained, for example, using
54 ``nfd-status`` command.
55
56 ``faceUri``
57 URI of the existing or to be created Face.
58
59 ``unregister``
60 Unregister an existing routing entry from Routing Information Base (RIB).
61
Syed Obaidf93f9d92014-06-22 13:50:48 -050062 ``unregister [-o origin] <prefix> <faceId>``
hilata6ee6e072014-04-20 17:10:18 -050063
Syed Obaidf93f9d92014-06-22 13:50:48 -050064 ``-o <origin>``
65 Origin of the unregistration request (default is 255).
66
67 ``prefix``
hilata6ee6e072014-04-20 17:10:18 -050068 A prefix of an existing RIB entry, from which routing entry is requested to be
69 removed.
70
71 ``faceId``
72 An existing NFD Face ID number, which can be obtained, for example, using
73 ``nfd-status`` command.
74
75 ``create``
76 Create a UDP unicast or TCP Face
77
78 ``create <faceUri>``
79
80 ``faceUri``
81 UDP unicast or TCP Face URI::
82
83 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
84 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
85
86 ``destroy``
87 Create an existing UDP unicast or TCP Face.
88
89 ``destroy <faceId | faceUri>``
90
91 ``faceId``
92 An existing NFD Face ID number, which can be obtained, for example, using
93 ``nfd-status`` command.
94
95 ``faceUri``
96 UDP unicast or TCP Face URI::
97
98 UDP unicast: udp[4|6]://<remote-IP-or-host>[:<remote-port>]
99 TCP: tcp[4|6]://<remote-IP-or-host>[:<remote-port>]
100
101 ``set-strategy``
102 Select strategy to be used for the specified namespace
103
104 ``set-strategy <namespace> <strategy-name>``
105
106 ``namespace``
107 Namespace that will use the specified strategy.
108
109 Note that more specific namespace(s) can use different strategy or strategies.
110 For example, if namespace ``/A/B/C`` was using strategy
111 ``ndn:/localhost/nfd/strategy/best-route`` before running ``set-strategy`` on
112 ``/A`` namespace, it will continue using the same strategy no matter which
113 namespace was specified for ``/A``.
114
115 ``strategy-name``
116 Name of one of the available strategies.
117
118 Currently, NFD supports the following strategies::
119
120 ndn:/localhost/nfd/strategy/best-route
121 ndn:/localhost/nfd/strategy/broadcast
122 ndn:/localhost/nfd/strategy/client-control
123 ndn:/localhost/nfd/strategy/ncc
124
125 ``unset-strategy``
126 Unset the strategy for a given ``namespace``.
127
128 Effectively, this command select parent's namespace strategy to be used for the
129 specified ``namespace``.
130
131 ``unset-strategy <namespace>``
132
133 ``namespace``
134 Namespace from which namespace customization should be removed.
135
136 ``add-nexthop``
137 Directly add nexthop entry info NFD's Forwarding Information Base (FIB). This command
138 is intended only for debugging purposes. Normally, prefix-nexhop association should
139 be registered in Routing Information Base using ``register`` command.
140
141 ``add-nexthop [-c <cost>] <prefix> <faceId | faceUri>``
142
143 ``-c <cost>``
144 Cost for the nexthop entry to be inserted (default is 0).
145
146 ``prefix``
147 A prefix of an existing or to be created FIB entry, to which nexthop
148 entry is requested to be added.
149
150 ``faceId``
151 An existing NFD Face ID number, which can be obtained, for example, using
152 ``nfd-status`` command
153
154 ``faceUri``
155 URI of the existing or to be created Face.
156
157 ``remove-nexthop``
158 Directly remove nexthop entry from NFD'S FIB. This command
159 is intended only for debugging purposes. Normally, prefix-nexhop association should
160 be unregistered from Routing Information Base using ``unregister`` command.
161
162 ``remove-nexthop <prefix> <faceId>``
163
164 ``prefix``
165 A prefix of an existing FIB entry, from which nexthop entry is requested to be removed.
166
167 ``faceId``
168 An existing NFD Face ID number, which can be obtained, for example, using
169 ``nfd-status`` command.
170
171 Note that when ``faceId`` is the last Face associated with ``prefix`` FIB entry,
172 the whole FIB entry will be removed.
173
174
175
176Examples
177--------
178
179Add a namespace to a face uri:
180
181::
182
183 nfdc register ndn:/app1/video udp://192.168.1.2
184
185Set strategy to a name:
186
187::
188
189 nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast