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