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