RibMgmt » History » Version 30
Junxiao Shi, 03/12/2020 03:09 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 | 12 | Junxiao Shi | A **route** indicates that contents under 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 | 1 | Junxiao Shi | * **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 | 29 | Teng Liang | * **prefixann**(=129): indicates a route installed by a prefix announcement |
44 | 17 | Junxiao Shi | * **client**(=65): indicates a Route toward an end host connected to this router, installed via [[AutoPrefixPropagation]] |
45 | 26 | Davide Pesavento | * **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 | ### Route cost |
||
49 | |||
50 | 1 | Junxiao Shi | **Cost** indicates the preference among multiple routes with same Name prefix. |
51 | 3 | Junxiao Shi | The nexthop face on a route with lower cost is preferred. |
52 | |||
53 | 1 | Junxiao Shi | Unlike IP routing, the nexthop face to use is decided by forwarding strategy. |
54 | 3 | Junxiao Shi | Route cost is a suggestion to strategy; 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 | 25 | Davide Pesavento | This command can also be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix. |
123 | 1 | Junxiao Shi | |
124 | ControlParameters fields: |
||
125 | |||
126 | * Name (required) |
||
127 | * FaceId (optional) |
||
128 | 3 | Junxiao Shi | * Origin (optional) |
129 | 1 | Junxiao Shi | * Cost (optional) |
130 | 3 | Junxiao Shi | * Flags (optional) |
131 | 1 | Junxiao Shi | * ExpirationPeriod (optional) |
132 | |||
133 | 25 | Davide Pesavento | *Name* is the name prefix of the route. |
134 | A forwarder MAY impose a limit on the length of the name prefix. The current limit in NFD is 32 name components. |
||
135 | If *Name* exceeds this limit, the command fails with code 414. |
||
136 | 23 | Junxiao Shi | |
137 | 25 | Davide Pesavento | *FaceId* is the FaceId returned by [[FaceMgmt|Face Management]]. |
138 | If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self registration). |
||
139 | 1 | Junxiao Shi | |
140 | 25 | Davide Pesavento | *Origin* defaults to app(=0). |
141 | 3 | Junxiao Shi | |
142 | 25 | Davide Pesavento | *Cost* defaults to zero. |
143 | 3 | Junxiao Shi | |
144 | 25 | Davide Pesavento | *Flags* is the inclusive OR of route inheritance flags. |
145 | `CHILD_INHERIT`=1, `CAPTURE`=2. |
||
146 | It defaults to `CHILD_INHERIT`. |
||
147 | 1 | Junxiao Shi | |
148 | 25 | Davide Pesavento | *ExpirationPeriod* gives the duration (in milliseconds) for which this route is effective. |
149 | After *ExpirationPeriod* has elapsed, or when the face fails, the route is removed. |
||
150 | *ExpirationPeriod* defaults to infinity. |
||
151 | 1 | Junxiao Shi | |
152 | 25 | 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*. |
153 | 1 | Junxiao Shi | |
154 | 3 | Junxiao Shi | If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters: |
155 | 1 | Junxiao Shi | |
156 | * Name: Name prefix |
||
157 | 5 | Junxiao Shi | * FaceId: nexthop FaceId (not zero) |
158 | 19 | Junxiao Shi | * Origin: route origin |
159 | 3 | Junxiao Shi | * Cost: route cost |
160 | 1 | Junxiao Shi | * Flags: inclusive OR of route inheritance flags |
161 | 25 | Davide Pesavento | * ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's infinity |
162 | 1 | Junxiao Shi | |
163 | 28 | Junxiao Shi | Alternatively, application may use [[PrefixAnnouncement|Prefix Announcement Protocol]] to register prefixes to itself. |
164 | |||
165 | 1 | Junxiao Shi | ### Unregister a route |
166 | |||
167 | **command-verb**: `unregister` |
||
168 | |||
169 | 11 | Junxiao Shi | This command removes a route from the RIB. |
170 | 26 | Davide Pesavento | This command can also be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix. |
171 | 1 | Junxiao Shi | |
172 | ControlParameters fields: |
||
173 | |||
174 | * Name (required) |
||
175 | 3 | Junxiao Shi | * FaceId (optional) |
176 | * Origin (optional) |
||
177 | 1 | Junxiao Shi | |
178 | 25 | Davide Pesavento | *FaceId* is the FaceId returned by [[FaceMgmt|Face Management]]. |
179 | If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self unregistration). |
||
180 | 1 | Junxiao Shi | |
181 | 25 | Davide Pesavento | *Origin* defaults to app(=0). |
182 | 3 | Junxiao Shi | |
183 | 26 | Davide Pesavento | Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face. |
184 | A client needs self unregistration when it stops serving a name prefix, but intends to continue execution. |
||
185 | 1 | Junxiao Shi | |
186 | 25 | Davide Pesavento | If the route does not exist, this command does nothing, but is still considered successful. |
187 | 1 | Junxiao Shi | |
188 | 3 | Junxiao Shi | If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters: |
189 | 1 | Junxiao Shi | |
190 | * Name: unchanged |
||
191 | 5 | Junxiao Shi | * FaceId: nexthop FaceId (not zero) |
192 | 1 | Junxiao Shi | * Origin: unchanged if request specifies; app(=0) if request omits |
193 | 12 | Junxiao Shi | |
194 | ### Semantics of successful responses |
||
195 | |||
196 | 25 | Davide Pesavento | Successful responses from these commands indicate that RIB Management has received and authorized the command, and will perform the requested updates shortly. |
197 | 12 | Junxiao Shi | RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent. |
198 | 8 | Junxiao Shi | |
199 | |||
200 | ## RIB Dataset |
||
201 | |||
202 | Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`. |
||
203 | |||
204 | Multiple routes of same Name prefix are organized into a **RIB entry**. |
||
205 | Each RIB entry is represented by a **RibEntry** block: |
||
206 | |||
207 | RibEntry := RIB-ENTRY-TYPE TLV-LENGTH |
||
208 | Name |
||
209 | Route+ |
||
210 | |||
211 | Route := ROUTE-TYPE TLV-LENGTH |
||
212 | FaceId |
||
213 | Origin |
||
214 | Cost |
||
215 | Flags |
||
216 | 9 | Junxiao Shi | ExpirationPeriod? |
217 | 1 | Junxiao Shi | |
218 | Flags is inclusive OR of route inheritance flags, encoded in the same way as `register` command. |
||
219 | ExpirationPeriod is the remaining lifetime of a route, or omitted if it's Infinity. |
||
220 | 17 | Junxiao Shi | |
221 | |||
222 | ## Routable Prefixes Dataset |
||
223 | |||
224 | RIB Management collects a list of routable prefixes and publishes them as a published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/routable-prefixes` and `ndn:/localhop/nfd/rib/routable-prefixes`. |
||
225 | |||
226 | Generally, a **routable prefix** is a name prefix that satisfies one of the following: |
||
227 | |||
228 | 18 | Junxiao Shi | * The prefix is advertised into a routing protocol from this router. |
229 | * The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router. |
||
230 | 17 | Junxiao Shi | |
231 | 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. |
||
232 | However, since the network is a dynamic and distributed system, global reachability cannot be guaranteed even if a routable prefix is used. |
||
233 | |||
234 | Each routable prefix is represented by a **Name** block in the dataset. |
||
235 | 8 | Junxiao Shi | |
236 | |||
237 | ## TLV-TYPE assignments |
||
238 | |||
239 | Type | Assigned value | Assigned value (hex) |
||
240 | ------------------------------------------- | ----------------- | -------------------- |
||
241 | RibEntry | 128 | 0x80 |
||
242 | Route | 129 | 0x81 |