RibMgmt » History » Version 35
Davide Pesavento, 02/02/2025 09:54 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 | 32 | Davide Pesavento | Alternatively, an application may use the [[PrefixAnnouncement|Prefix Announcement Protocol]] to register prefixes to itself. |
162 | 28 | Junxiao Shi | |
163 | 1 | Junxiao Shi | ### Unregister a route |
164 | |||
165 | **command-verb**: `unregister` |
||
166 | 11 | Junxiao Shi | |
167 | 26 | Davide Pesavento | This command removes a route from the RIB. |
168 | 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. |
169 | |||
170 | ControlParameters fields: |
||
171 | |||
172 | 3 | Junxiao Shi | * Name (required) |
173 | * FaceId (optional) |
||
174 | 1 | Junxiao Shi | * Origin (optional) |
175 | 25 | Davide Pesavento | |
176 | 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). |
177 | 1 | Junxiao Shi | |
178 | 32 | Davide Pesavento | *Origin* defaults to `app` (=0). |
179 | 3 | Junxiao Shi | |
180 | 26 | Davide Pesavento | Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face. |
181 | A client needs self unregistration when it stops serving a name prefix, but intends to continue execution. |
||
182 | 1 | Junxiao Shi | |
183 | 25 | Davide Pesavento | If the route does not exist, this command does nothing, but is still considered successful. |
184 | 1 | Junxiao Shi | |
185 | 32 | Davide Pesavento | If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters: |
186 | 3 | Junxiao Shi | |
187 | 1 | Junxiao Shi | * Name: unchanged |
188 | * FaceId: nexthop FaceId (not zero) |
||
189 | 32 | Davide Pesavento | * Origin: unchanged if request specifies; `app` (=0) if request omits |
190 | 1 | Junxiao Shi | |
191 | 12 | Junxiao Shi | ### Semantics of successful responses |
192 | |||
193 | Successful responses from these commands indicate that RIB Management has received and authorized the command, and will perform the requested updates shortly. |
||
194 | RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent. |
||
195 | 1 | Junxiao Shi | |
196 | 8 | Junxiao Shi | |
197 | ## RIB Dataset |
||
198 | |||
199 | Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`. |
||
200 | |||
201 | 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: |
202 | 31 | Davide Pesavento | |
203 | RibEntry = RIB-ENTRY-TYPE TLV-LENGTH |
||
204 | Name |
||
205 | 1*Route |
||
206 | |||
207 | Route = ROUTE-TYPE TLV-LENGTH |
||
208 | FaceId |
||
209 | Origin |
||
210 | Cost |
||
211 | Flags |
||
212 | 1 | Junxiao Shi | [ExpirationPeriod] |
213 | |||
214 | 34 | Davide Pesavento | * **Flags** is the inclusive OR of route inheritance flags, encoded in the same way as the `register` command. |
215 | * **ExpirationPeriod** is the remaining lifetime of a route. This field is omitted if the route has infinite lifetime. |
||
216 | 17 | Junxiao Shi | |
217 | |||
218 | ## Routable Prefixes Dataset |
||
219 | |||
220 | 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`. |
221 | 17 | Junxiao Shi | |
222 | Generally, a **routable prefix** is a name prefix that satisfies one of the following: |
||
223 | 18 | Junxiao Shi | |
224 | * The prefix is advertised into a routing protocol from this router. |
||
225 | 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. |
226 | |||
227 | 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. |
228 | 17 | Junxiao Shi | |
229 | Each routable prefix is represented by a **Name** block in the dataset. |
||
230 | 8 | Junxiao Shi | |
231 | |||
232 | ## TLV-TYPE assignments |
||
233 | |||
234 | Type | Assigned value | Assigned value (hex) |
||
235 | ------------------------------------------- | ----------------- | -------------------- |
||
236 | RibEntry | 128 | 0x80 |
||
237 | Route | 129 | 0x81 |