Project

General

Profile

RibMgmt » History » Version 24

Davide Pesavento, 02/09/2018 02:31 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 17 Junxiao Shi
* **client**(=65): indicates a Route toward an end host connected to this router, installed via [[AutoPrefixPropagation]]
44
* **autoreg**(=64): indicates a Route toward an end host connected to this router, registered automatically by nfd-autoreg tool
45
* **autoconf**(=66): indicates a Route toward a remote router that this end host has connected to, registered automatically by ndn-autoconf tool
46 3 Junxiao Shi
47
### Route cost
48
49 1 Junxiao Shi
**Cost** indicates the preference among multiple routes with same Name prefix.
50 3 Junxiao Shi
The nexthop face on a route with lower cost is preferred.
51
52 1 Junxiao Shi
Unlike IP routing, the nexthop face to use is decided by forwarding strategy.
53 3 Junxiao Shi
Route cost is a suggestion to strategy; strategy MAY consider route cost when making forwarding decisions.
54 1 Junxiao Shi
55
### Route inheritance
56
57
Each route can have two route inheritance flags:
58
59
* CHILD\_INHERIT: indicates that this route may be used even if a longer prefix is matched.
60
  This flag applies on a single route.
61
* CAPTURE: indicates that no shorter prefix can be used; overrides CHILD\_INHERIT.
62
  This flag applies on the prefix: if any route of a prefix has this flag, the prefix will have this flag.
63
64
Example:
65
66
Name prefix | nexthop FaceId | CHILD\_INHERIT | CAPTURE
67
------------|----------------|----------------|---------
68
/           | 1              | yes            | no
69
/           | 2              | no             | no
70
/A          | 3              | yes            | no
71
/A/B/C      | 4              | yes            | no
72
/D          | 5              | yes            | yes
73
/D          | 6              | yes            | no
74
75
* Interest /A/P can go to face 1 and 3.
76
    * It cannot go to face 2, because that route has CHILD\_INHERIT=no.
77
* Interest /A/B/C/Q can go to face 1, 3, and 4.
78
* Interest /D/R can go to face 5 and 6.
79
    * It cannot go to face 1, because one of the routes on /D sets CAPTURE=yes.
80
* Interest /S can go to face 1 and 2.
81
82 6 Junxiao Shi
### Effective routing cost
83
84
The routing cost of a nexthop face for a Name prefix is the lowest cost among all Routes toward this nexthop face that can apply to this Name prefix.
85
86
Example:
87
88
Name prefix | nexthop FaceId | Origin | Cost | CHILD\_INHERIT | CAPTURE
89
------------|----------------|--------|------|----------------|---------
90
/A          | 1              | static | 10   | no             | no
91
/A          | 1              | nlsr   | 20   | yes            | no
92
/A          | 2              | static | 30   | no             | no
93
/A/B        | 1              | static | 40   | yes            | no
94
/A/B        | 2              | static | 50   | yes            | no
95
/A/B/C      | 3              | static | 60   | yes            | no
96
/A/B/C/D    | 4              | static | 70   | yes            | yes
97
98
The corresponding FIB should be:
99
100
Name prefix | NextHop records
101
------------|----------------
102
/A          | (face=1,cost=10) (face=2,cost=30)
103
/A/B        | (face=1,cost=20) (face=2,cost=50)
104
/A/B/C      | (face=1,cost=20) (face=2,cost=50) (face=3,cost=60)
105
/A/B/C/D    | (face=4,cost=70)
106 1 Junxiao Shi
107 12 Junxiao Shi
108 1 Junxiao Shi
## Control Commands
109
110
[[ControlCommand]] **management-module**: `rib`
111
112
### Register a route
113
114
**command-verb**: `register`
115
116 11 Junxiao Shi
This command adds a route to the RIB.  
117
This command can be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix.
118 1 Junxiao Shi
119
ControlParameters fields:
120
121
* Name (required)
122
* FaceId (optional)
123 3 Junxiao Shi
* Origin (optional)
124 1 Junxiao Shi
* Cost (optional)
125 3 Junxiao Shi
* Flags (optional)
126 1 Junxiao Shi
* ExpirationPeriod (optional)
127
128 23 Junxiao Shi
Name is the name prefix of the route.
129
NFD MAY impose a limit on the length of name prefix. The current limit is 32 name components.
130
If Name exceeds this limit, the command fails with code 414.
131
132 1 Junxiao Shi
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
133 22 Junxiao Shi
If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration).
134 1 Junxiao Shi
135 3 Junxiao Shi
Origin defaults to app(=0).
136
137
Cost defaults to zero.
138
139 1 Junxiao Shi
Flags is an inclusive OR of route inheritance flags.
140
CHILD\_INHERIT=1, CAPTURE=2.
141
It defaults to CHILD\_INHERIT.
142
143 3 Junxiao Shi
ExpirationPeriod gives the duration (in milliseconds) in which this route is effective.
144
After ExpirationPeriod has elapsed, or when the face fails, the route is removed.
145 9 Junxiao Shi
ExpirationPeriod defaults to Infinity.
146 1 Junxiao Shi
147 3 Junxiao Shi
If a route of same Name, FaceId, and Origin exists, its Cost and Flags are updated, and its lifetime is extended to now + ExpirationPeriod.
148 1 Junxiao Shi
149 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
150 1 Junxiao Shi
151
* Name: Name prefix
152 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
153 19 Junxiao Shi
* Origin: route origin
154 3 Junxiao Shi
* Cost: route cost
155 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
156 9 Junxiao Shi
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's Infinity
157 1 Junxiao Shi
158
### Unregister a route
159
160
**command-verb**: `unregister`
161
162 11 Junxiao Shi
This command removes a route from the RIB.  
163
This command can be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix.
164 1 Junxiao Shi
165
ControlParameters fields:
166
167
* Name (required)
168 3 Junxiao Shi
* FaceId (optional)
169
* Origin (optional)
170 1 Junxiao Shi
171
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
172
If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration).
173
174 3 Junxiao Shi
Origin defaults to app(=0).
175
176 1 Junxiao Shi
Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face.
177
Client needs self deregistration when it stops serving a name prefix, but intends to continue execution.
178
179 4 Junxiao Shi
If route does not exist, this command does nothing, but is still considered successful.
180 1 Junxiao Shi
181 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
182 1 Junxiao Shi
183
* Name: unchanged
184 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
185 1 Junxiao Shi
* Origin: unchanged if request specifies; app(=0) if request omits
186 12 Junxiao Shi
187
### Semantics of successful responses
188
189
Successful responses from these commands indicate that NFD RIB Management has received and authorized the command, and will perform the requested updates shortly.
190
RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent.
191 8 Junxiao Shi
192
193
## RIB Dataset
194
195
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
196
197
Multiple routes of same Name prefix are organized into a **RIB entry**.
198
Each RIB entry is represented by a **RibEntry** block:
199
200
    RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
201
                  Name
202
                  Route+
203
    
204
    Route    := ROUTE-TYPE TLV-LENGTH
205
                  FaceId
206
                  Origin
207
                  Cost
208
                  Flags
209 9 Junxiao Shi
                  ExpirationPeriod?
210 1 Junxiao Shi
211
Flags is inclusive OR of route inheritance flags, encoded in the same way as `register` command.  
212
ExpirationPeriod is the remaining lifetime of a route, or omitted if it's Infinity.
213 17 Junxiao Shi
214
215
## Routable Prefixes Dataset
216
217
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`.
218
219
Generally, a **routable prefix** is a name prefix that satisfies one of the following:
220
221 18 Junxiao Shi
* The prefix is advertised into a routing protocol from this router.
222
* The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router.
223 17 Junxiao Shi
224
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.
225
However, since the network is a dynamic and distributed system, global reachability cannot be guaranteed even if a routable prefix is used.
226
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