Project

General

Profile

RibMgmt » History » Version 14

Vince Lehman, 03/17/2016 08:56 AM

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