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