Project

General

Profile

RibMgmt » History » Version 28

Junxiao Shi, 08/13/2018 05:38 AM

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 27 Teng Liang
* **selflearning**(=129): indicates a route installed by the self-learning forwarding strategy
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
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.
86
87
Example:
88
89 25 Davide Pesavento
Name prefix | Nexthop FaceId | Origin | Cost | CHILD\_INHERIT | CAPTURE
90 6 Junxiao Shi
------------|----------------|--------|------|----------------|---------
91
/A          | 1              | static | 10   | no             | no
92
/A          | 1              | nlsr   | 20   | yes            | no
93
/A          | 2              | static | 30   | no             | no
94
/A/B        | 1              | static | 40   | yes            | no
95
/A/B        | 2              | static | 50   | yes            | no
96
/A/B/C      | 3              | static | 60   | yes            | no
97
/A/B/C/D    | 4              | static | 70   | yes            | yes
98
99
The corresponding FIB should be:
100
101 25 Davide Pesavento
Name prefix | Nexthop records
102 6 Junxiao Shi
------------|----------------
103
/A          | (face=1,cost=10) (face=2,cost=30)
104
/A/B        | (face=1,cost=20) (face=2,cost=50)
105
/A/B/C      | (face=1,cost=20) (face=2,cost=50) (face=3,cost=60)
106
/A/B/C/D    | (face=4,cost=70)
107 1 Junxiao Shi
108 12 Junxiao Shi
109 1 Junxiao Shi
## Control Commands
110
111
[[ControlCommand]] **management-module**: `rib`
112
113
### Register a route
114
115
**command-verb**: `register`
116
117 11 Junxiao Shi
This command adds a route to the RIB.  
118 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.
119 1 Junxiao Shi
120
ControlParameters fields:
121
122
* Name (required)
123
* FaceId (optional)
124 3 Junxiao Shi
* Origin (optional)
125 1 Junxiao Shi
* Cost (optional)
126 3 Junxiao Shi
* Flags (optional)
127 1 Junxiao Shi
* ExpirationPeriod (optional)
128
129 25 Davide Pesavento
*Name* is the name prefix of the route.
130
A forwarder MAY impose a limit on the length of the name prefix. The current limit in NFD is 32 name components.
131
If *Name* exceeds this limit, the command fails with code 414.
132 23 Junxiao Shi
133 25 Davide Pesavento
*FaceId* is the FaceId returned by [[FaceMgmt|Face Management]].
134
If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self registration).
135 1 Junxiao Shi
136 25 Davide Pesavento
*Origin* defaults to app(=0).
137 3 Junxiao Shi
138 25 Davide Pesavento
*Cost* defaults to zero.
139 3 Junxiao Shi
140 25 Davide Pesavento
*Flags* is the inclusive OR of route inheritance flags.
141
`CHILD_INHERIT`=1, `CAPTURE`=2.
142
It defaults to `CHILD_INHERIT`.
143 1 Junxiao Shi
144 25 Davide Pesavento
*ExpirationPeriod* gives the duration (in milliseconds) for which this route is effective.
145
After *ExpirationPeriod* has elapsed, or when the face fails, the route is removed.
146
*ExpirationPeriod* defaults to infinity.
147 1 Junxiao Shi
148 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*.
149 1 Junxiao Shi
150 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
151 1 Junxiao Shi
152
* Name: Name prefix
153 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
154 19 Junxiao Shi
* Origin: route origin
155 3 Junxiao Shi
* Cost: route cost
156 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
157 25 Davide Pesavento
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's infinity
158 1 Junxiao Shi
159 28 Junxiao Shi
Alternatively, application may use [[PrefixAnnouncement|Prefix Announcement Protocol]] to register prefixes to itself.
160
161 1 Junxiao Shi
### Unregister a route
162
163
**command-verb**: `unregister`
164
165 11 Junxiao Shi
This command removes a route from the RIB.  
166 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.
167 1 Junxiao Shi
168
ControlParameters fields:
169
170
* Name (required)
171 3 Junxiao Shi
* FaceId (optional)
172
* Origin (optional)
173 1 Junxiao Shi
174 25 Davide Pesavento
*FaceId* is the FaceId returned by [[FaceMgmt|Face Management]].
175
If *FaceId* is omitted or is set to zero, it is implied as the requesting face (self unregistration).
176 1 Junxiao Shi
177 25 Davide Pesavento
*Origin* defaults to app(=0).
178 3 Junxiao Shi
179 26 Davide Pesavento
Self unregistration is unnecessary if the client is quitting. The forwarder SHOULD automatically remove routes belonging to a closed face.
180
A client needs self unregistration when it stops serving a name prefix, but intends to continue execution.
181 1 Junxiao Shi
182 25 Davide Pesavento
If the route does not exist, this command does nothing, but is still considered successful.
183 1 Junxiao Shi
184 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
185 1 Junxiao Shi
186
* Name: unchanged
187 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
188 1 Junxiao Shi
* Origin: unchanged if request specifies; app(=0) if request omits
189 12 Junxiao Shi
190
### Semantics of successful responses
191
192 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.
193 12 Junxiao Shi
RIB and FIB updates are asynchronous, and they are not necessarily completed when the response is sent.
194 8 Junxiao Shi
195
196
## RIB Dataset
197
198
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
199
200
Multiple routes of same Name prefix are organized into a **RIB entry**.
201
Each RIB entry is represented by a **RibEntry** block:
202
203
    RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
204
                  Name
205
                  Route+
206
    
207
    Route    := ROUTE-TYPE TLV-LENGTH
208
                  FaceId
209
                  Origin
210
                  Cost
211
                  Flags
212 9 Junxiao Shi
                  ExpirationPeriod?
213 1 Junxiao Shi
214
Flags is inclusive OR of route inheritance flags, encoded in the same way as `register` command.  
215
ExpirationPeriod is the remaining lifetime of a route, or omitted if it's Infinity.
216 17 Junxiao Shi
217
218
## Routable Prefixes Dataset
219
220
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`.
221
222
Generally, a **routable prefix** is a name prefix that satisfies one of the following:
223
224 18 Junxiao Shi
* The prefix is advertised into a routing protocol from this router.
225
* The prefix can be registered onto a connected router via [[AutoPrefixPropagation]] from this end host, and falls under a routable prefix of that router.
226 17 Junxiao Shi
227
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.
228
However, since the network is a dynamic and distributed system, global reachability cannot be guaranteed even if a routable prefix is used.
229
230
Each routable prefix is represented by a **Name** block in the dataset.
231 8 Junxiao Shi
232
233
## TLV-TYPE assignments
234
235
Type                                        | Assigned value    | Assigned value (hex)
236
------------------------------------------- | ----------------- | --------------------
237
RibEntry                                    | 128               | 0x80
238
Route                                       | 129               | 0x81