Project

General

Profile

RibMgmt » History » Version 34

Davide Pesavento, 02/02/2025 09:15 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 15 Vince Lehman
## RIB Entry
16 14 Vince Lehman
17 15 Vince Lehman
A **RIB Entry** maintains a list of routes associated with a particular namespace.
18 14 Vince Lehman
19 16 Vince Lehman
A RIB Entry contains:
20 14 Vince Lehman
21
* Name prefix
22
* a list of Routes
23
24 1 Junxiao Shi
## Route
25
26 32 Davide Pesavento
A **route** indicates that data with a certain name prefix may be available via a certain nexthop.
27 1 Junxiao Shi
28
A route contains:
29
30
* Name prefix
31
* nexthop FaceId
32 3 Junxiao Shi
* origin
33 1 Junxiao Shi
* cost
34
* route inheritance flags
35
36 3 Junxiao Shi
### Route origin
37
38 21 Alex Afanasyev
**Origin** is a value in [0, 65535] range that indicates who is announcing a route.
39 3 Junxiao Shi
40 32 Davide Pesavento
* **app** (=0): indicates a Route toward a local producer application
41
* **static** (=255): indicates a static route
42
* **nlsr** (=128): indicates a route installed by NLSR routing protocol
43
* **prefixann** (=129): indicates a route installed by a prefix announcement
44
* **client** (=65): indicates a Route toward an end host connected to this router, installed via [[AutoPrefixPropagation]]
45
* **autoreg** (=64): indicates a Route toward an end host connected to this router, registered automatically by the `nfd-autoreg` tool
46
* **autoconf** (=66): indicates a Route toward a remote router that this end host has connected to, registered automatically by the `ndn-autoconfig` tool
47 3 Junxiao Shi
48 1 Junxiao Shi
### Route cost
49 3 Junxiao Shi
50
**Cost** indicates the preference among multiple routes with same Name prefix.
51 1 Junxiao Shi
52 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.
53 1 Junxiao Shi
54
### Route inheritance
55
56
Each route can have two route inheritance flags:
57
58 25 Davide Pesavento
* `CHILD_INHERIT`: indicates that this route may be used even if a longer prefix is matched.
59 1 Junxiao Shi
  This flag applies on a single route.
60 25 Davide Pesavento
* `CAPTURE`: indicates that no shorter prefix can be used; overrides `CHILD_INHERIT`.
61 1 Junxiao Shi
  This flag applies on the prefix: if any route of a prefix has this flag, the prefix will have this flag.
62
63
Example:
64
65 25 Davide Pesavento
Name prefix | Nexthop FaceId | CHILD\_INHERIT | CAPTURE
66 1 Junxiao Shi
------------|----------------|----------------|---------
67
/           | 1              | yes            | no
68
/           | 2              | no             | no
69
/A          | 3              | yes            | no
70
/A/B/C      | 4              | yes            | no
71
/D          | 5              | yes            | yes
72
/D          | 6              | yes            | no
73
74
* Interest /A/P can go to face 1 and 3.
75
    * It cannot go to face 2, because that route has CHILD\_INHERIT=no.
76
* Interest /A/B/C/Q can go to face 1, 3, and 4.
77
* Interest /D/R can go to face 5 and 6.
78
    * It cannot go to face 1, because one of the routes on /D sets CAPTURE=yes.
79
* Interest /S can go to face 1 and 2.
80
81 6 Junxiao Shi
### Effective routing cost
82
83 30 Junxiao Shi
To determine the routing cost of a nexthop face for FIB entry:
84 1 Junxiao Shi
85 30 Junxiao Shi
1. Collect all routes whose name is a prefix of the FIB entry name and has the nexthop face.
86
2. Select the routes with longest prefix. This could select multiple routes if they have distinct origins.
87
3. Use the lowest cost among these routes.
88
89 6 Junxiao Shi
Example:
90
91 25 Davide Pesavento
Name prefix | Nexthop FaceId | Origin | Cost | CHILD\_INHERIT | CAPTURE
92 6 Junxiao Shi
------------|----------------|--------|------|----------------|---------
93
/A          | 1              | static | 10   | no             | no
94
/A          | 1              | nlsr   | 20   | yes            | no
95
/A          | 2              | static | 30   | no             | no
96
/A/B        | 1              | static | 40   | yes            | no
97
/A/B        | 2              | static | 50   | yes            | no
98
/A/B/C      | 3              | static | 60   | yes            | no
99
/A/B/C/D    | 4              | static | 70   | yes            | yes
100
101 25 Davide Pesavento
The corresponding FIB should be:
102 6 Junxiao Shi
103 1 Junxiao Shi
Name prefix | Nexthop records
104
------------|----------------
105 6 Junxiao Shi
/A          | (face=1,cost=10) (face=2,cost=30)
106 30 Junxiao Shi
/A/B        | (face=1,cost=40) (face=2,cost=50)
107
/A/B/C      | (face=1,cost=40) (face=2,cost=50) (face=3,cost=60)
108 6 Junxiao Shi
/A/B/C/D    | (face=4,cost=70)
109 1 Junxiao Shi
110 12 Junxiao Shi
111 1 Junxiao Shi
## Control Commands
112
113
[[ControlCommand]] **management-module**: `rib`
114
115
### Register a route
116
117
**command-verb**: `register`
118
119 11 Junxiao Shi
This command adds a route to the RIB.  
120 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.
121 25 Davide Pesavento
122 1 Junxiao Shi
ControlParameters fields:
123
124
* Name (required)
125
* FaceId (optional)
126 3 Junxiao Shi
* Origin (optional)
127
* Cost (optional)
128 1 Junxiao Shi
* Flags (optional)
129
* ExpirationPeriod (optional)
130 25 Davide Pesavento
131 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.
132 23 Junxiao Shi
133 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).
134 1 Junxiao Shi
135 32 Davide Pesavento
*Origin* defaults to `app` (=0).
136 1 Junxiao Shi
137 25 Davide Pesavento
*Cost* defaults to zero.
138
139 32 Davide Pesavento
*Flags* is the inclusive OR of the following route inheritance flags:
140 25 Davide Pesavento
141 32 Davide Pesavento
* `CHILD_INHERIT` = 1
142
* `CAPTURE` = 2
143 1 Junxiao Shi
144 32 Davide Pesavento
The default is `CHILD_INHERIT`.
145 25 Davide Pesavento
146 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.
147 1 Junxiao Shi
148 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*.
149
150
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters:
151
152 1 Junxiao Shi
* Name: Name prefix
153 19 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
154 1 Junxiao Shi
* Origin: route origin
155 3 Junxiao Shi
* Cost: route cost
156 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
157 25 Davide Pesavento
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's infinity
158 1 Junxiao Shi
159 32 Davide Pesavento
Alternatively, an application may use the [[PrefixAnnouncement|Prefix Announcement Protocol]] to register prefixes to itself.
160 28 Junxiao Shi
161 1 Junxiao Shi
### Unregister a route
162
163
**command-verb**: `unregister`
164 11 Junxiao Shi
165 26 Davide Pesavento
This command removes a route from the RIB.  
166 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.
167
168
ControlParameters fields:
169
170 3 Junxiao Shi
* Name (required)
171
* FaceId (optional)
172 1 Junxiao Shi
* Origin (optional)
173 25 Davide Pesavento
174 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).
175 1 Junxiao Shi
176 32 Davide Pesavento
*Origin* defaults to `app` (=0).
177 3 Junxiao Shi
178 26 Davide Pesavento
Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face.
179
A client needs self unregistration when it stops serving a name prefix, but intends to continue execution.
180 1 Junxiao Shi
181 25 Davide Pesavento
If the route does not exist, this command does nothing, but is still considered successful.
182 1 Junxiao Shi
183 32 Davide Pesavento
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters:
184 3 Junxiao Shi
185 1 Junxiao Shi
* Name: unchanged
186
* FaceId: nexthop FaceId (not zero)
187 32 Davide Pesavento
* Origin: unchanged if request specifies; `app` (=0) if request omits
188 1 Junxiao Shi
189 12 Junxiao Shi
### Semantics of successful responses
190
191
Successful responses from these commands indicate that RIB Management has received and authorized the command, and will perform the requested updates shortly.
192
RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent.
193 1 Junxiao Shi
194 8 Junxiao Shi
195
## RIB Dataset
196
197
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
198
199 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:
200 31 Davide Pesavento
201
    RibEntry = RIB-ENTRY-TYPE TLV-LENGTH
202
                 Name
203
                 1*Route
204
205
    Route    = ROUTE-TYPE TLV-LENGTH
206
                 FaceId
207
                 Origin
208
                 Cost
209
                 Flags
210 1 Junxiao Shi
                 [ExpirationPeriod]
211
212 34 Davide Pesavento
* **Flags** is the inclusive OR of route inheritance flags, encoded in the same way as the `register` command.
213
* **ExpirationPeriod** is the remaining lifetime of a route. This field is omitted if the route has infinite lifetime.
214 17 Junxiao Shi
215
216
## Routable Prefixes Dataset
217
218 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`.
219 17 Junxiao Shi
220
Generally, a **routable prefix** is a name prefix that satisfies one of the following:
221 18 Junxiao Shi
222
* The prefix is advertised into a routing protocol from this router.
223 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.
224
225 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.
226 17 Junxiao Shi
227
Each routable prefix is represented by a **Name** block in the dataset.
228 8 Junxiao Shi
229
230
## TLV-TYPE assignments
231
232
Type                                        | Assigned value    | Assigned value (hex)
233
------------------------------------------- | ----------------- | --------------------
234
RibEntry                                    | 128               | 0x80
235
Route                                       | 129               | 0x81