Project

General

Profile

RibMgmt » History » Version 20

Alex Afanasyev, 03/14/2017 12:14 PM

1 1 Junxiao Shi
# RIB Management
2
3 17 Junxiao Shi
{{toc}}
4
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 20 Alex Afanasyev
**Origin** is a value in [0, 255] 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
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
129
If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration).  
130
If face does not exist, the command fails with code 410.
131
132 3 Junxiao Shi
Origin defaults to app(=0).
133
134
Cost defaults to zero.
135
136 1 Junxiao Shi
Flags is an inclusive OR of route inheritance flags.
137
CHILD\_INHERIT=1, CAPTURE=2.
138
It defaults to CHILD\_INHERIT.
139
140 3 Junxiao Shi
ExpirationPeriod gives the duration (in milliseconds) in which this route is effective.
141
After ExpirationPeriod has elapsed, or when the face fails, the route is removed.
142 9 Junxiao Shi
ExpirationPeriod defaults to Infinity.
143 1 Junxiao Shi
144 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.
145 1 Junxiao Shi
146 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
147 1 Junxiao Shi
148
* Name: Name prefix
149 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
150 19 Junxiao Shi
* Origin: route origin
151 3 Junxiao Shi
* Cost: route cost
152 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
153 9 Junxiao Shi
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's Infinity
154 1 Junxiao Shi
155
### Unregister a route
156
157
**command-verb**: `unregister`
158
159 11 Junxiao Shi
This command removes a route from the RIB.  
160
This command can be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix.
161 1 Junxiao Shi
162
ControlParameters fields:
163
164
* Name (required)
165 3 Junxiao Shi
* FaceId (optional)
166
* Origin (optional)
167 1 Junxiao Shi
168
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
169
If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration).
170
171 3 Junxiao Shi
Origin defaults to app(=0).
172
173 1 Junxiao Shi
Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face.
174
Client needs self deregistration when it stops serving a name prefix, but intends to continue execution.
175
176 4 Junxiao Shi
If route does not exist, this command does nothing, but is still considered successful.
177 1 Junxiao Shi
178 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
179 1 Junxiao Shi
180
* Name: unchanged
181 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
182 1 Junxiao Shi
* Origin: unchanged if request specifies; app(=0) if request omits
183 12 Junxiao Shi
184
### Semantics of successful responses
185
186
Successful responses from these commands indicate that NFD RIB Management has received and authorized the command, and will perform the requested updates shortly.
187
RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent.
188 8 Junxiao Shi
189
190
## RIB Dataset
191
192
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
193
194
Multiple routes of same Name prefix are organized into a **RIB entry**.
195
Each RIB entry is represented by a **RibEntry** block:
196
197
    RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
198
                  Name
199
                  Route+
200
    
201
    Route    := ROUTE-TYPE TLV-LENGTH
202
                  FaceId
203
                  Origin
204
                  Cost
205
                  Flags
206 9 Junxiao Shi
                  ExpirationPeriod?
207 1 Junxiao Shi
208
Flags is inclusive OR of route inheritance flags, encoded in the same way as `register` command.  
209
ExpirationPeriod is the remaining lifetime of a route, or omitted if it's Infinity.
210 17 Junxiao Shi
211
212
## Routable Prefixes Dataset
213
214
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`.
215
216
Generally, a **routable prefix** is a name prefix that satisfies one of the following:
217
218 18 Junxiao Shi
* The prefix is advertised into a routing protocol from this router.
219
* The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router.
220 17 Junxiao Shi
221
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.
222
However, since the network is a dynamic and distributed system, global reachability cannot be guaranteed even if a routable prefix is used.
223
224
Each routable prefix is represented by a **Name** block in the dataset.
225 8 Junxiao Shi
226
227
## TLV-TYPE assignments
228
229
Type                                        | Assigned value    | Assigned value (hex)
230
------------------------------------------- | ----------------- | --------------------
231
RibEntry                                    | 128               | 0x80
232
Route                                       | 129               | 0x81