RibMgmt » History » Version 1
Junxiao Shi, 04/17/2014 10:38 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 | * cost |
||
20 | * route inheritance flags |
||
21 | |||
22 | **Cost** indicates the preference among multiple routes with same Name prefix. |
||
23 | The nexthop face on a route with lower cost is preferred. |
||
24 | Unlike IP routing, the nexthop face to use is decided by forwarding strategy. |
||
25 | Routing cost is a suggestion to strategy; strategy MAY consider routing cost when making forwarding decisions. |
||
26 | |||
27 | ### Route inheritance |
||
28 | |||
29 | Each route can have two route inheritance flags: |
||
30 | |||
31 | * CHILD\_INHERIT: indicates that this route may be used even if a longer prefix is matched. |
||
32 | This flag applies on a single route. |
||
33 | * CAPTURE: indicates that no shorter prefix can be used; overrides CHILD\_INHERIT. |
||
34 | This flag applies on the prefix: if any route of a prefix has this flag, the prefix will have this flag. |
||
35 | |||
36 | Example: |
||
37 | |||
38 | Name prefix | nexthop FaceId | CHILD\_INHERIT | CAPTURE |
||
39 | ------------|----------------|----------------|--------- |
||
40 | / | 1 | yes | no |
||
41 | / | 2 | no | no |
||
42 | /A | 3 | yes | no |
||
43 | /A/B/C | 4 | yes | no |
||
44 | /D | 5 | yes | yes |
||
45 | /D | 6 | yes | no |
||
46 | |||
47 | * Interest /A/P can go to face 1 and 3. |
||
48 | * It cannot go to face 2, because that route has CHILD\_INHERIT=no. |
||
49 | * Interest /A/B/C/Q can go to face 1, 3, and 4. |
||
50 | * Interest /D/R can go to face 5 and 6. |
||
51 | * It cannot go to face 1, because one of the routes on /D sets CAPTURE=yes. |
||
52 | * Interest /S can go to face 1 and 2. |
||
53 | |||
54 | ## Control Commands |
||
55 | |||
56 | [[ControlCommand]] **management-module**: `rib` |
||
57 | |||
58 | ### Register a route |
||
59 | |||
60 | **command-verb**: `register` |
||
61 | |||
62 | This command adds a route to the RIB. |
||
63 | |||
64 | ControlParameters fields: |
||
65 | |||
66 | * Name (required) |
||
67 | * FaceId (optional) |
||
68 | * Flags (optional) |
||
69 | * Cost (optional) |
||
70 | * ExpirationPeriod (optional) |
||
71 | |||
72 | FaceId is the FaceId returned in [[FaceMgmt|Face Management]]. |
||
73 | If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration). |
||
74 | If face does not exist, the command fails with code 410. |
||
75 | |||
76 | Flags is an inclusive OR of route inheritance flags. |
||
77 | CHILD\_INHERIT=1, CAPTURE=2. |
||
78 | It defaults to CHILD\_INHERIT. |
||
79 | |||
80 | Cost defaults to zero. |
||
81 | |||
82 | ExpirationPeriod indicates the duration (in milliseconds) in which this route is effective. |
||
83 | After ExpirationPeriod is elapsed, or when the face fails, the route is removed. |
||
84 | ExpirationPeriod defaults to Infinity when FaceId is omitted or is set to zero; otherwise, it defaults to 1 hour. |
||
85 | |||
86 | If a route of same Name and FaceId exists, its Flags and Cost are updated, and its lifetime is extend to now + ExpirationPeriod. |
||
87 | |||
88 | If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters. |
||
89 | |||
90 | * Name: Name prefix |
||
91 | * FaceId: nexthop FaceId |
||
92 | * Flags: inclusive OR of route inheritance flags |
||
93 | * Cost: routing cost |
||
94 | * ExpirationPeriod: remaining lifetime (in milliseconds) |
||
95 | |||
96 | ### Unregister a route |
||
97 | |||
98 | **command-verb**: `unregister` |
||
99 | |||
100 | This command removes a route from the RIB. |
||
101 | |||
102 | ControlParameters fields: |
||
103 | |||
104 | * Name (required) |
||
105 | * FaceId (required) |
||
106 | |||
107 | FaceId is the FaceId returned in [[FaceMgmt|Face Management]]. |
||
108 | If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration). |
||
109 | |||
110 | Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face. |
||
111 | Client needs self deregistration when it stops serving a name prefix, but intends to continue execution. |
||
112 | |||
113 | If face or route does not exist, this command does nothing, but is still considered successful. |
||
114 | |||
115 | If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters: |
||
116 | |||
117 | * Name: unchanged |
||
118 | * FaceId: unchanged if request specifies non-zero; requesting FaceId if request omits or specifies zero |
||
119 | |||
120 | ### Advertise a prefix |
||
121 | |||
122 | **command-verb**: `advertise` |
||
123 | |||
124 | ### Withdraw a prefix |
||
125 | |||
126 | **command-verb**: `withdraw` |