Project

General

Profile

RibMgmt » History » Version 12

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