Project

General

Profile

RibMgmt » History » Version 11

Junxiao Shi, 10/12/2014 01:08 PM

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
A **route**, or a **routing entry**, indicates that contents under a certain name prefix may be available via a certain face.
15
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
95 1 Junxiao Shi
## Control Commands
96
97
[[ControlCommand]] **management-module**: `rib`
98
99
### Register a route
100
101
**command-verb**: `register`
102
103 11 Junxiao Shi
This command adds a route to the RIB.  
104
This command can be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix.
105 1 Junxiao Shi
106
ControlParameters fields:
107
108
* Name (required)
109
* FaceId (optional)
110 3 Junxiao Shi
* Origin (optional)
111 1 Junxiao Shi
* Cost (optional)
112 3 Junxiao Shi
* Flags (optional)
113 1 Junxiao Shi
* ExpirationPeriod (optional)
114
115
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
116
If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration).  
117
If face does not exist, the command fails with code 410.
118
119 3 Junxiao Shi
Origin defaults to app(=0).
120
121
Cost defaults to zero.
122
123 1 Junxiao Shi
Flags is an inclusive OR of route inheritance flags.
124
CHILD\_INHERIT=1, CAPTURE=2.
125
It defaults to CHILD\_INHERIT.
126
127 3 Junxiao Shi
ExpirationPeriod gives the duration (in milliseconds) in which this route is effective.
128
After ExpirationPeriod has elapsed, or when the face fails, the route is removed.
129 9 Junxiao Shi
ExpirationPeriod defaults to Infinity.
130 1 Junxiao Shi
131 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.
132 1 Junxiao Shi
133 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
134 1 Junxiao Shi
135
* Name: Name prefix
136 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
137 3 Junxiao Shi
* Route: route origin
138
* Cost: route cost
139 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
140 9 Junxiao Shi
* ExpirationPeriod: remaining lifetime (in milliseconds), or omitted if it's Infinity
141 1 Junxiao Shi
142
### Unregister a route
143
144
**command-verb**: `unregister`
145
146 11 Junxiao Shi
This command removes a route from the RIB.  
147
This command can be accepted on `ndn:/localhop/nfd` management prefix, in addition to the default `ndn:/localhost/nfd` management prefix.
148 1 Junxiao Shi
149
ControlParameters fields:
150
151
* Name (required)
152 3 Junxiao Shi
* FaceId (optional)
153
* Origin (optional)
154 1 Junxiao Shi
155
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
156
If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration).
157
158 3 Junxiao Shi
Origin defaults to app(=0).
159
160 1 Junxiao Shi
Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face.
161
Client needs self deregistration when it stops serving a name prefix, but intends to continue execution.
162
163 4 Junxiao Shi
If route does not exist, this command does nothing, but is still considered successful.
164 1 Junxiao Shi
165 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
166 1 Junxiao Shi
167
* Name: unchanged
168 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
169 4 Junxiao Shi
* Origin: unchanged if request specifies; app(=0) if request omits
170 8 Junxiao Shi
171
172
## RIB Dataset
173
174
Routes are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/rib/list`.
175
176
Multiple routes of same Name prefix are organized into a **RIB entry**.
177
Each RIB entry is represented by a **RibEntry** block:
178
179
    RibEntry := RIB-ENTRY-TYPE TLV-LENGTH
180
                  Name
181
                  Route+
182
    
183
    Route    := ROUTE-TYPE TLV-LENGTH
184
                  FaceId
185
                  Origin
186
                  Cost
187
                  Flags
188 9 Junxiao Shi
                  ExpirationPeriod?
189 8 Junxiao Shi
190
Flags is inclusive OR of route inheritance flags, encoded in the same way as `register` command.  
191 9 Junxiao Shi
ExpirationPeriod is the remaining lifetime of a route, or omitted if it's Infinity.
192 8 Junxiao Shi
193
194
## TLV-TYPE assignments
195
196
Type                                        | Assigned value    | Assigned value (hex)
197
------------------------------------------- | ----------------- | --------------------
198
RibEntry                                    | 128               | 0x80
199
Route                                       | 129               | 0x81