RibMgmt » History » Version 37
Davide Pesavento, 05/16/2025 06:00 PM
1 | 1 | Junxiao Shi | # RIB Management |
---|---|---|---|
2 | |||
3 | 24 | Davide Pesavento | {{>toc}} |
4 | 17 | Junxiao Shi | |
5 | 1 | Junxiao Shi | **RIB Management** is a module of [[Management|NFD Management protocol]]. |
6 | It provides: |
||
7 | |||
8 | * commands to register and unregister routes |
||
9 | 8 | Junxiao Shi | * a dataset of routes |
10 | 17 | Junxiao Shi | * a dataset of routable prefixes |
11 | 1 | Junxiao Shi | |
12 | 13 | Junxiao Shi | RIB Management commands and datasets are available under namespace `ndn:/localhost/nfd/rib`. |
13 | RIB Management commands are also available under namespace `ndn:/localhop/nfd/rib`. |
||
14 | 1 | Junxiao Shi | |
15 | 35 | Davide Pesavento | |
16 | 15 | Vince Lehman | ## RIB Entry |
17 | 14 | Vince Lehman | |
18 | 15 | Vince Lehman | A **RIB Entry** maintains a list of routes associated with a particular namespace. |
19 | 14 | Vince Lehman | |
20 | 16 | Vince Lehman | A RIB Entry contains: |
21 | 14 | Vince Lehman | |
22 | * Name prefix |
||
23 | * a list of Routes |
||
24 | |||
25 | 35 | Davide Pesavento | |
26 | 1 | Junxiao Shi | ## Route |
27 | |||
28 | 32 | Davide Pesavento | A **route** indicates that data with a certain name prefix may be available via a certain nexthop. |
29 | 1 | Junxiao Shi | |
30 | A route contains: |
||
31 | |||
32 | * Name prefix |
||
33 | * nexthop FaceId |
||
34 | 3 | Junxiao Shi | * origin |
35 | 1 | Junxiao Shi | * cost |
36 | * route inheritance flags |
||
37 | |||
38 | 3 | Junxiao Shi | ### Route origin |
39 | |||
40 | 1 | Junxiao Shi | **Origin** is a value in [0, 65535] range that indicates who is announcing a route. |
41 | |||
42 | 35 | Davide Pesavento | * **app** (=0): indicates a Route toward a local producer application. |
43 | * **static** (=255): indicates a static route. |
||
44 | * **nlsr** (=128): indicates a route installed by NLSR routing protocol. |
||
45 | * **prefixann** (=129): indicates a route installed by a prefix announcement. |
||
46 | * **client** (=65): indicates a Route toward an end host connected to this router, installed via [[AutoPrefixPropagation]]. |
||
47 | * **autoreg** (=64): indicates a Route toward an end host connected to this router, registered automatically by the `nfd-autoreg` tool. |
||
48 | * **autoconf** (=66): indicates a Route toward a remote router that this end host has connected to, registered automatically by the `ndn-autoconfig` tool. |
||
49 | 3 | Junxiao Shi | |
50 | 1 | Junxiao Shi | ### Route cost |
51 | 3 | Junxiao Shi | |
52 | **Cost** indicates the preference among multiple routes with same Name prefix. |
||
53 | 1 | Junxiao Shi | |
54 | 32 | Davide Pesavento | Generally, the nexthop face on a route with lower cost is preferred. Unlike IP routing, in NDN the nexthop face to use is decided by the forwarding strategy. Route cost is a suggestion to the strategy: the strategy MAY consider route cost when making forwarding decisions. |
55 | 1 | Junxiao Shi | |
56 | ### Route inheritance |
||
57 | |||
58 | Each route can have two route inheritance flags: |
||
59 | |||
60 | 25 | Davide Pesavento | * `CHILD_INHERIT`: indicates that this route may be used even if a longer prefix is matched. |
61 | 1 | Junxiao Shi | This flag applies on a single route. |
62 | 25 | Davide Pesavento | * `CAPTURE`: indicates that no shorter prefix can be used; overrides `CHILD_INHERIT`. |
63 | 1 | Junxiao Shi | This flag applies on the prefix: if any route of a prefix has this flag, the prefix will have this flag. |
64 | |||
65 | Example: |
||
66 | |||
67 | 25 | Davide Pesavento | Name prefix | Nexthop FaceId | CHILD\_INHERIT | CAPTURE |
68 | 1 | Junxiao Shi | ------------|----------------|----------------|--------- |
69 | / | 1 | yes | no |
||
70 | / | 2 | no | no |
||
71 | /A | 3 | yes | no |
||
72 | /A/B/C | 4 | yes | no |
||
73 | /D | 5 | yes | yes |
||
74 | /D | 6 | yes | no |
||
75 | |||
76 | * Interest /A/P can go to face 1 and 3. |
||
77 | * It cannot go to face 2, because that route has CHILD\_INHERIT=no. |
||
78 | * Interest /A/B/C/Q can go to face 1, 3, and 4. |
||
79 | * Interest /D/R can go to face 5 and 6. |
||
80 | * It cannot go to face 1, because one of the routes on /D sets CAPTURE=yes. |
||
81 | * Interest /S can go to face 1 and 2. |
||
82 | |||
83 | 6 | Junxiao Shi | ### Effective routing cost |
84 | |||
85 | 30 | Junxiao Shi | To determine the routing cost of a nexthop face for FIB entry: |
86 | 1 | Junxiao Shi | |
87 | 30 | Junxiao Shi | 1. Collect all routes whose name is a prefix of the FIB entry name and has the nexthop face. |
88 | 2. Select the routes with longest prefix. This could select multiple routes if they have distinct origins. |
||
89 | 3. Use the lowest cost among these routes. |
||
90 | |||
91 | 6 | Junxiao Shi | Example: |
92 | |||
93 | 25 | Davide Pesavento | Name prefix | Nexthop FaceId | Origin | Cost | CHILD\_INHERIT | CAPTURE |
94 | 6 | Junxiao Shi | ------------|----------------|--------|------|----------------|--------- |
95 | /A | 1 | static | 10 | no | no |
||
96 | /A | 1 | nlsr | 20 | yes | no |
||
97 | /A | 2 | static | 30 | no | no |
||
98 | /A/B | 1 | static | 40 | yes | no |
||
99 | /A/B | 2 | static | 50 | yes | no |
||
100 | /A/B/C | 3 | static | 60 | yes | no |
||
101 | /A/B/C/D | 4 | static | 70 | yes | yes |
||
102 | |||
103 | 25 | Davide Pesavento | The corresponding FIB should be: |
104 | 6 | Junxiao Shi | |
105 | 1 | Junxiao Shi | Name prefix | Nexthop records |
106 | ------------|---------------- |
||
107 | 6 | Junxiao Shi | /A | (face=1,cost=10) (face=2,cost=30) |
108 | 30 | Junxiao Shi | /A/B | (face=1,cost=40) (face=2,cost=50) |
109 | /A/B/C | (face=1,cost=40) (face=2,cost=50) (face=3,cost=60) |
||
110 | 6 | Junxiao Shi | /A/B/C/D | (face=4,cost=70) |
111 | 1 | Junxiao Shi | |
112 | 12 | Junxiao Shi | |
113 | 1 | Junxiao Shi | ## Control Commands |
114 | |||
115 | [[ControlCommand]] **management-module**: `rib` |
||
116 | |||
117 | ### Register a route |
||
118 | |||
119 | **command-verb**: `register` |
||
120 | |||
121 | 37 | Davide Pesavento | This command adds a route to the RIB. |
122 | |||
123 | 1 | Junxiao Shi | This command can also be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix. |
124 | 25 | Davide Pesavento | |
125 | 1 | Junxiao Shi | ControlParameters fields: |
126 | |||
127 | * Name (required) |
||
128 | * FaceId (optional) |
||
129 | 3 | Junxiao Shi | * Origin (optional) |
130 | * Cost (optional) |
||
131 | 1 | Junxiao Shi | * Flags (optional) |
132 | * ExpirationPeriod (optional) |
||
133 | 25 | Davide Pesavento | |
134 | 32 | Davide Pesavento | *Name* is the name prefix of the route. A forwarder MAY impose a limit on the length of the name prefix. The current limit in NFD is 32 name components. If *Name* exceeds this limit, the command fails with code 414. |
135 | 23 | Junxiao Shi | |
136 | 32 | Davide Pesavento | *FaceId* is the FaceId returned by [[FaceMgmt|Face Management]]. If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self registration). |
137 | 1 | Junxiao Shi | |
138 | 32 | Davide Pesavento | *Origin* defaults to `app` (=0). |
139 | 1 | Junxiao Shi | |
140 | 25 | Davide Pesavento | *Cost* defaults to zero. |
141 | |||
142 | 32 | Davide Pesavento | *Flags* is the inclusive OR of the following route inheritance flags: |
143 | 25 | Davide Pesavento | |
144 | 32 | Davide Pesavento | * `CHILD_INHERIT` = 1 |
145 | * `CAPTURE` = 2 |
||
146 | 1 | Junxiao Shi | |
147 | 32 | Davide Pesavento | The default is `CHILD_INHERIT`. |
148 | 25 | Davide Pesavento | |
149 | 32 | Davide Pesavento | *ExpirationPeriod* gives the duration (in milliseconds) for which this route is effective. After *ExpirationPeriod* has elapsed, or when the face fails, the route is removed. *ExpirationPeriod* defaults to infinity. |
150 | 1 | Junxiao Shi | |
151 | 32 | Davide Pesavento | If a route of same *Name*, *FaceId*, and *Origin* exists, its *Cost* and *Flags* are updated and its lifetime is extended to now + *ExpirationPeriod*. |
152 | |||
153 | If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters: |
||
154 | |||
155 | 1 | Junxiao Shi | * Name: Name prefix |
156 | 19 | Junxiao Shi | * FaceId: nexthop FaceId (not zero) |
157 | 1 | Junxiao Shi | * Origin: route origin |
158 | 3 | Junxiao Shi | * Cost: route cost |
159 | 1 | Junxiao Shi | * Flags: inclusive OR of route inheritance flags |
160 | 25 | Davide Pesavento | * ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's infinity |
161 | 1 | Junxiao Shi | |
162 | ### Register a route with Prefix Announcement object |
||
163 | |||
164 | 37 | Davide Pesavento | This command announces a prefix using a [[PrefixAnnouncement]] object. |
165 | 1 | Junxiao Shi | |
166 | 37 | Davide Pesavento | The RIB management module accepts this command as a *signed Interest* with the following name: |
167 | 1 | Junxiao Shi | |
168 | 37 | Davide Pesavento | ``` |
169 | /localhost/nfd/rib/announce/<params-sha256> |
||
170 | /localhop/nfd/rib/announce/<params-sha256> |
||
171 | ``` |
||
172 | 36 | Junxiao Shi | |
173 | 37 | Davide Pesavento | The Interest's ApplicationParameters element carries the prefix announcement object. |
174 | The RIB management module converts this command into an equivalent `rib/register` command. The route's *origin* is set to "prefix announcement" (=129). |
||
175 | The response is the same as the `rib/register` command. |
||
176 | 1 | Junxiao Shi | |
177 | 37 | Davide Pesavento | #### Example |
178 | 36 | Junxiao Shi | |
179 | 37 | Davide Pesavento | ``` |
180 | Interest |
||
181 | Name /localhop/nfd/rib/announce/params-sha256=607a2bc7653eea18b47e92b84edc58bab5aaa321d4efb39ceeccc6cafbcbb3d1 |
||
182 | MustBeFresh |
||
183 | ApplicationParameters |
||
184 | PrefixAnnouncement |
||
185 | InterestSignatureInfo |
||
186 | InterestSignatureValue |
||
187 | ``` |
||
188 | 36 | Junxiao Shi | |
189 | 37 | Davide Pesavento | Assuming the enclosed PrefixAnnouncement is the one shown in the [[PrefixAnnouncement]] example, the RIB management module should interpret this command same as `rib/register` command with the following ControlParameters: |
190 | 36 | Junxiao Shi | |
191 | 37 | Davide Pesavento | * Name: `/net/example` |
192 | * Origin: 129 |
||
193 | 28 | Junxiao Shi | * ExpirationPeriod: 3600000; optionally, constrained by the ValidityPeriod of the PrefixAnnouncement |
194 | 1 | Junxiao Shi | |
195 | ### Unregister a route |
||
196 | |||
197 | 11 | Junxiao Shi | **command-verb**: `unregister` |
198 | 26 | Davide Pesavento | |
199 | 37 | Davide Pesavento | This command removes a route from the RIB. |
200 | |||
201 | 1 | Junxiao Shi | This command can also be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix. |
202 | |||
203 | 3 | Junxiao Shi | ControlParameters fields: |
204 | |||
205 | 1 | Junxiao Shi | * Name (required) |
206 | 25 | Davide Pesavento | * FaceId (optional) |
207 | 32 | Davide Pesavento | * Origin (optional) |
208 | 1 | Junxiao Shi | |
209 | 32 | Davide Pesavento | *FaceId* is the FaceId returned by [[FaceMgmt|Face Management]]. If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self unregistration). |
210 | 3 | Junxiao Shi | |
211 | 26 | Davide Pesavento | *Origin* defaults to `app` (=0). |
212 | |||
213 | 1 | Junxiao Shi | Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face. |
214 | 25 | Davide Pesavento | A client needs self unregistration when it stops serving a name prefix, but intends to continue execution. |
215 | 1 | Junxiao Shi | |
216 | 32 | Davide Pesavento | If the route does not exist, this command does nothing, but is still considered successful. |
217 | 3 | Junxiao Shi | |
218 | 1 | Junxiao Shi | If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters: |
219 | |||
220 | 32 | Davide Pesavento | * Name: unchanged |
221 | 1 | Junxiao Shi | * FaceId: nexthop FaceId (not zero) |
222 | 12 | Junxiao Shi | * Origin: unchanged if request specifies; `app` (=0) if request omits |
223 | |||
224 | ### Semantics of successful responses |
||
225 | |||
226 | 1 | Junxiao Shi | Successful responses from these commands indicate that RIB Management has received and authorized the command, and will perform the requested updates shortly. |
227 | 8 | Junxiao Shi | RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent. |
228 | |||
229 | |||
230 | ## RIB Dataset |
||
231 | |||
232 | 33 | Davide Pesavento | Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`. |
233 | 31 | Davide Pesavento | |
234 | Multiple routes of the same Name prefix are organized into a **RIB entry**. Each RIB entry is represented by a **RibEntry** block: |
||
235 | |||
236 | RibEntry = RIB-ENTRY-TYPE TLV-LENGTH |
||
237 | Name |
||
238 | 1*Route |
||
239 | |||
240 | Route = ROUTE-TYPE TLV-LENGTH |
||
241 | FaceId |
||
242 | Origin |
||
243 | 1 | Junxiao Shi | Cost |
244 | Flags |
||
245 | 34 | Davide Pesavento | [ExpirationPeriod] |
246 | |||
247 | 17 | Junxiao Shi | * **Flags** is the inclusive OR of route inheritance flags, encoded in the same way as the `register` command. |
248 | * **ExpirationPeriod** is the remaining lifetime of a route. This field is omitted if the route has infinite lifetime. |
||
249 | |||
250 | |||
251 | 32 | Davide Pesavento | ## Routable Prefixes Dataset |
252 | 17 | Junxiao Shi | |
253 | RIB Management collects a list of routable prefixes and publishes it as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/routable-prefixes` and `ndn:/localhop/nfd/rib/routable-prefixes`. |
||
254 | 18 | Junxiao Shi | |
255 | Generally, a **routable prefix** is a name prefix that satisfies one of the following: |
||
256 | 17 | Junxiao Shi | |
257 | * The prefix is advertised into a routing protocol from this router. |
||
258 | 32 | Davide Pesavento | * The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router. |
259 | 17 | Junxiao Shi | |
260 | This means, generally, a local producer can have reasonable belief that it would be able to receive Interests expressed elsewhere in the network, if it registers a prefix under a routable prefix. However, since the network is a dynamic and distributed system, global reachability cannot be guaranteed even if a routable prefix is used. |
||
261 | 8 | Junxiao Shi | |
262 | Each routable prefix is represented by a **Name** block in the dataset. |
||
263 | |||
264 | |||
265 | ## TLV-TYPE assignments |
||
266 | |||
267 | Type | Assigned value | Assigned value (hex) |
||
268 | ------------------------------------------- | ----------------- | -------------------- |
||
269 | 1 | Junxiao Shi | RibEntry | 128 | 0x80 |
270 | Route | 129 | 0x81 |