Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 1 | nfdc-route |
| 2 | ========== |
| 3 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 4 | Synopsis |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 5 | -------- |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 6 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 7 | | **nfdc route** [**list** [[**nexthop**] *FACEID*\|\ *FACEURI*] [**origin** *ORIGIN*]] |
| 8 | | **nfdc route** **show** [**prefix**] *PREFIX* |
| 9 | | **nfdc route** **add** [**prefix**] *PREFIX* [**nexthop**] *FACEID*\|\ *FACEURI* [**origin** *ORIGIN*] \ |
| 10 | [**cost** *COST*] [**no-inherit**] [**capture**] [**expires** *EXPIRATION*] |
| 11 | | **nfdc route** **remove** [**prefix**] *PREFIX* [**nexthop**] *FACEID*\|\ *FACEURI* [**origin** *ORIGIN*] |
| 12 | | **nfdc fib** [**list**] |
| 13 | |
| 14 | Description |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 15 | ----------- |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 16 | |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 17 | In NFD, the routing information base (RIB) stores static or dynamic routing information |
| 18 | registered by applications, operators, and NFD itself. |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 19 | Each route in the RIB indicates that contents under a name prefix may be available via a nexthop. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 20 | A route contains a name prefix, a nexthop face, the origin, a cost, and a set of route inheritance flags; |
| 21 | refer to NFD Management protocol for more information. |
| 22 | |
Junxiao Shi | 1d62e62 | 2017-03-08 22:39:28 +0000 | [diff] [blame] | 23 | The **nfdc route list** command lists RIB routes, optionally filtered by nexthop and origin. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 24 | |
Junxiao Shi | 1d62e62 | 2017-03-08 22:39:28 +0000 | [diff] [blame] | 25 | The **nfdc route show** command shows RIB routes at a specified name prefix. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 26 | |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 27 | The **nfdc route add** command requests to add a route. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 28 | If a route with the same prefix, nexthop, and origin already exists, |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 29 | it is updated with the specified cost, route inheritance flags, and expiration period. |
| 30 | This command returns when the request has been accepted, but does not wait for RIB update completion. |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 31 | If no face matching the specified URI is found, :program:`nfdc` will attempt to implicitly create a face |
| 32 | with this URI before adding the route. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 33 | |
Junxiao Shi | 084b795 | 2017-02-26 22:00:53 +0000 | [diff] [blame] | 34 | The **nfdc route remove** command removes a route with matching prefix, nexthop, and origin. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 35 | |
Junxiao Shi | 1d62e62 | 2017-03-08 22:39:28 +0000 | [diff] [blame] | 36 | The **nfdc fib list** command shows the forwarding information base (FIB), |
| 37 | which is calculated from RIB routes and used directly by NFD forwarding. |
| 38 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 39 | Options |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 40 | ------- |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 41 | |
| 42 | .. option:: <PREFIX> |
| 43 | |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 44 | Name prefix of the route. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 45 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 46 | .. option:: <FACEID> |
| 47 | |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 48 | Numerical identifier of the face. |
| 49 | It is displayed in the output of **nfdc face list** and **nfdc face create** commands. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 50 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 51 | .. option:: <FACEURI> |
| 52 | |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 53 | An URI representing the remote endpoint of a face. |
Junxiao Shi | 084b795 | 2017-02-26 22:00:53 +0000 | [diff] [blame] | 54 | In **nfdc route add** command, it must uniquely match an existing face. |
| 55 | In **nfdc route remove** command, it must match one or more existing faces. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 56 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 57 | See the `FaceUri section <https://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#FaceUri>`__ |
| 58 | of the NFD Face Management protocol for more details on the syntax. |
| 59 | |
| 60 | .. option:: <ORIGIN> |
| 61 | |
| 62 | Origin of the route, i.e., who is announcing the route. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 63 | The default is 255, indicating a static route. |
| 64 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 65 | .. option:: <COST> |
| 66 | |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 67 | The administrative cost of the route. |
| 68 | The default is 0. |
| 69 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 70 | .. option:: no-inherit |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 71 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 72 | Unset ``CHILD_INHERIT`` flag in the route. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 73 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 74 | .. option:: capture |
| 75 | |
| 76 | Set ``CAPTURE`` flag in the route. |
| 77 | |
| 78 | .. option:: <EXPIRATION> |
| 79 | |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 80 | Expiration time of the route, in milliseconds. |
| 81 | When the route expires, NFD removes it from the RIB. |
| 82 | The default is infinite, which keeps the route active until the nexthop face is destroyed. |
| 83 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 84 | Exit Status |
| 85 | ----------- |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 86 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 87 | 0 |
| 88 | Success. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 89 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 90 | 1 |
| 91 | An unspecified error occurred. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 92 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 93 | 2 |
| 94 | Malformed command line. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 95 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 96 | 3 |
| 97 | Face not found. |
Junxiao Shi | 918e5d4 | 2017-02-25 03:58:21 +0000 | [diff] [blame] | 98 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 99 | 4 |
| 100 | FaceUri canonization failed. |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 101 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 102 | 5 |
| 103 | Ambiguous: multiple matching faces are found (**nfdc route add** only). |
Junxiao Shi | 1d62e62 | 2017-03-08 22:39:28 +0000 | [diff] [blame] | 104 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 105 | 6 |
| 106 | Route not found (**nfdc route list** and **nfdc route show** only). |
| 107 | |
| 108 | Examples |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 109 | -------- |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 110 | |
| 111 | ``nfdc route list`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 112 | List all routes. |
| 113 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 114 | ``nfdc route list nexthop 300`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 115 | List routes whose nexthop is face 300. |
| 116 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 117 | ``nfdc route list origin static`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 118 | List static routes. |
| 119 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 120 | ``nfdc route show prefix /localhost/nfd`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 121 | List routes with name prefix "/localhost/nfd". |
| 122 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 123 | ``nfdc route add prefix /ndn nexthop 300 cost 100`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 124 | Add a route with prefix "/ndn" toward face 300, with administrative cost 100. |
| 125 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 126 | ``nfdc route add prefix / nexthop udp://router.example.net`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 127 | Add a route with prefix "/" toward a face with the specified remote FaceUri. |
| 128 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 129 | ``nfdc route remove prefix /ndn nexthop 300 origin static`` |
Junxiao Shi | 0e13e1e | 2018-01-22 08:29:12 +0000 | [diff] [blame] | 130 | Remove the route whose prefix is "/ndn", nexthop is face 300, and origin is "static". |
| 131 | |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 132 | See Also |
Junxiao Shi | 6c13562 | 2016-11-21 14:30:33 +0000 | [diff] [blame] | 133 | -------- |
Davide Pesavento | 543b152 | 2024-06-25 17:00:32 -0400 | [diff] [blame^] | 134 | |
| 135 | :manpage:`nfdc(1)` |