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