Project

General

Profile

RibMgmt » History » Version 36

Junxiao Shi, 05/16/2025 05:10 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 11 Junxiao Shi
This command adds a route to the RIB.  
122 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.
123 25 Davide Pesavento
124 1 Junxiao Shi
ControlParameters fields:
125
126
* Name (required)
127
* FaceId (optional)
128 3 Junxiao Shi
* Origin (optional)
129
* Cost (optional)
130 1 Junxiao Shi
* Flags (optional)
131
* ExpirationPeriod (optional)
132 25 Davide Pesavento
133 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.
134 23 Junxiao Shi
135 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).
136 1 Junxiao Shi
137 32 Davide Pesavento
*Origin* defaults to `app` (=0).
138 1 Junxiao Shi
139 25 Davide Pesavento
*Cost* defaults to zero.
140
141 32 Davide Pesavento
*Flags* is the inclusive OR of the following route inheritance flags:
142 25 Davide Pesavento
143 32 Davide Pesavento
* `CHILD_INHERIT` = 1
144
* `CAPTURE` = 2
145 1 Junxiao Shi
146 32 Davide Pesavento
The default is `CHILD_INHERIT`.
147 25 Davide Pesavento
148 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.
149 1 Junxiao Shi
150 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*.
151
152
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters:
153
154 1 Junxiao Shi
* Name: Name prefix
155 19 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
156 1 Junxiao Shi
* Origin: route origin
157 3 Junxiao Shi
* Cost: route cost
158 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
159 25 Davide Pesavento
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's infinity
160 1 Junxiao Shi
161 36 Junxiao Shi
### Register a route with Prefix Announcement object
162
163
This command announces a prefix using a [[PrefixAnnouncement]] object. NFD-RIB accepts this command as a *signed Interest* with the following name: 
164
165
``` 
166
/localhost/nfd/rib/announce/<params-sha256> 
167
/localhop/nfd/rib/announce/<params-sha256> 
168
``` 
169
170
The Interest's ApplicationParameters element carries the prefix announcement object. 
171
NFD-RIB converts this command into an equivalent `rib/register` command. The route's *origin* is set to "prefix announcement" (=129). 
172
173
The response is the same as the `rib/register` command. 
174
175
### Example 
176
177
``` 
178
Interest 
179
  Name /localhop/nfd/rib/announce/params-sha256=607a2bc7653eea18b47e92b84edc58bab5aaa321d4efb39ceeccc6cafbcbb3d1 
180
  MustBeFresh 
181
  ApplicationParameters 
182
    PrefixAnnouncement 
183
  InterestSignatureInfo 
184
  InterestSignatureValue  
185
``` 
186
187
Assuming the enclosed PrefixAnnouncement is the one shown in the [[PrefixAnnouncement]] example, NFD-RIB should interpret this command same as `rib/register` command with the following ControlParameters: 
188
189
* Name: `/net/example` 
190
* Origin: 129 
191
* ExpirationPeriod: 3600000; optionally, constrained by the ValidityPeriod of the PrefixAnnouncement
192 28 Junxiao Shi
193 1 Junxiao Shi
### Unregister a route
194
195
**command-verb**: `unregister`
196 11 Junxiao Shi
197 26 Davide Pesavento
This command removes a route from the RIB.  
198 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.
199
200
ControlParameters fields:
201
202 3 Junxiao Shi
* Name (required)
203
* FaceId (optional)
204 1 Junxiao Shi
* Origin (optional)
205 25 Davide Pesavento
206 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).
207 1 Junxiao Shi
208 32 Davide Pesavento
*Origin* defaults to `app` (=0).
209 3 Junxiao Shi
210 26 Davide Pesavento
Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face.
211
A client needs self unregistration when it stops serving a name prefix, but intends to continue execution.
212 1 Junxiao Shi
213 25 Davide Pesavento
If the route does not exist, this command does nothing, but is still considered successful.
214 1 Junxiao Shi
215 32 Davide Pesavento
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters:
216 3 Junxiao Shi
217 1 Junxiao Shi
* Name: unchanged
218
* FaceId: nexthop FaceId (not zero)
219 32 Davide Pesavento
* Origin: unchanged if request specifies; `app` (=0) if request omits
220 1 Junxiao Shi
221 12 Junxiao Shi
### Semantics of successful responses
222
223
Successful responses from these commands indicate that RIB Management has received and authorized the command, and will perform the requested updates shortly.
224
RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent.
225 1 Junxiao Shi
226 8 Junxiao Shi
227
## RIB Dataset
228
229
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
230
231 33 Davide Pesavento
Multiple routes of the same Name prefix are organized into a **RIB entry**. Each RIB entry is represented by a **RibEntry** block:
232 31 Davide Pesavento
233
    RibEntry = RIB-ENTRY-TYPE TLV-LENGTH
234
                 Name
235
                 1*Route
236
237
    Route    = ROUTE-TYPE TLV-LENGTH
238
                 FaceId
239
                 Origin
240
                 Cost
241
                 Flags
242 1 Junxiao Shi
                 [ExpirationPeriod]
243
244 34 Davide Pesavento
* **Flags** is the inclusive OR of route inheritance flags, encoded in the same way as the `register` command.
245
* **ExpirationPeriod** is the remaining lifetime of a route. This field is omitted if the route has infinite lifetime.
246 17 Junxiao Shi
247
248
## Routable Prefixes Dataset
249
250 32 Davide Pesavento
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`.
251 17 Junxiao Shi
252
Generally, a **routable prefix** is a name prefix that satisfies one of the following:
253 18 Junxiao Shi
254
* The prefix is advertised into a routing protocol from this router.
255 17 Junxiao Shi
* The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router.
256
257 32 Davide Pesavento
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.
258 17 Junxiao Shi
259
Each routable prefix is represented by a **Name** block in the dataset.
260 8 Junxiao Shi
261
262
## TLV-TYPE assignments
263
264
Type                                        | Assigned value    | Assigned value (hex)
265
------------------------------------------- | ----------------- | --------------------
266
RibEntry                                    | 128               | 0x80
267
Route                                       | 129               | 0x81