hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 1 | nfdc |
| 2 | ==== |
| 3 | |
| 4 | Usage |
| 5 | ----- |
| 6 | |
| 7 | :: |
| 8 | |
| 9 | nfdc [-h] COMMAND [<command options>] |
| 10 | |
| 11 | |
| 12 | Description |
| 13 | ----------- |
| 14 | |
| 15 | ``nfdc`` is a tool to manipulate routing information base (RIB), forwarding information |
| 16 | base (FIB), and StrategyChoices table (i.e., which strategy should be used by which |
| 17 | namespaces). |
| 18 | |
| 19 | Options |
| 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 Obaid | 4ae0ce3 | 2014-06-17 13:59:20 -0500 | [diff] [blame] | 30 | ``register [-I] [-C] [-c <cost>] [-e expiration time] [-o origin] <prefix> <faceId | faceUri>`` |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 31 | |
| 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 Obaid | 4ae0ce3 | 2014-06-17 13:59:20 -0500 | [diff] [blame] | 41 | ``-e <expiration time>`` |
Syed Obaid | 818e8a6 | 2014-07-02 18:24:11 -0500 | [diff] [blame] | 42 | 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 Obaid | 4ae0ce3 | 2014-06-17 13:59:20 -0500 | [diff] [blame] | 44 | |
Joao Pereira | 5b6deae | 2015-06-30 13:59:58 -0400 | [diff] [blame] | 45 | ``-o <origin>`` |
Syed Obaid | 4ae0ce3 | 2014-06-17 13:59:20 -0500 | [diff] [blame] | 46 | Origin of the registration request (default is 255). |
| 47 | 0 for Local producer applications, 128 for NLSR, 255 for static routes. |
| 48 | |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 49 | ``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 Obaid | f93f9d9 | 2014-06-22 13:50:48 -0500 | [diff] [blame] | 63 | ``unregister [-o origin] <prefix> <faceId>`` |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 64 | |
Joao Pereira | 5b6deae | 2015-06-30 13:59:58 -0400 | [diff] [blame] | 65 | ``-o <origin>`` |
Syed Obaid | f93f9d9 | 2014-06-22 13:50:48 -0500 | [diff] [blame] | 66 | Origin of the unregistration request (default is 255). |
| 67 | |
Joao Pereira | 5b6deae | 2015-06-30 13:59:58 -0400 | [diff] [blame] | 68 | ``prefix`` |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 69 | 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 Pereira | c6184cd | 2015-09-03 15:27:29 -0400 | [diff] [blame] | 79 | ``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. |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 88 | |
| 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 Shi | 67ba8d2 | 2015-08-21 21:21:28 -0700 | [diff] [blame] | 130 | ndn:/localhost/nfd/strategy/multicast |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 131 | ndn:/localhost/nfd/strategy/client-control |
| 132 | ndn:/localhost/nfd/strategy/ncc |
Junxiao Shi | 67ba8d2 | 2015-08-21 21:21:28 -0700 | [diff] [blame] | 133 | ndn:/localhost/nfd/strategy/access |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 134 | |
| 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 Shi | bf6acd5 | 2016-09-14 03:57:57 +0000 | [diff] [blame] | 184 | Exit Codes |
| 185 | ---------- |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 186 | |
Junxiao Shi | bf6acd5 | 2016-09-14 03:57:57 +0000 | [diff] [blame] | 187 | 0: Success |
| 188 | |
| 189 | 1: An unspecified error occurred |
| 190 | |
| 191 | 2: Malformed command line |
hilata | 6ee6e07 | 2014-04-20 17:10:18 -0500 | [diff] [blame] | 192 | |
| 193 | Examples |
| 194 | -------- |
| 195 | |
| 196 | Add a namespace to a face uri: |
| 197 | |
| 198 | :: |
| 199 | |
| 200 | nfdc register ndn:/app1/video udp://192.168.1.2 |
| 201 | |
| 202 | Set strategy to a name: |
| 203 | |
| 204 | :: |
| 205 | |
| 206 | nfdc set-strategy ndn:/app1/video ndn:/localhost/nfd/strategy/broadcast |