Project

General

Profile

RibMgmt » History » Version 6

Junxiao Shi, 06/27/2014 05:03 AM

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 6 Junxiao Shi
### Effective routing cost
67
68
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.
69
70
Example:
71
72
Name prefix | nexthop FaceId | Origin | Cost | CHILD\_INHERIT | CAPTURE
73
------------|----------------|--------|------|----------------|---------
74
/A          | 1              | static | 10   | no             | no
75
/A          | 1              | nlsr   | 20   | yes            | no
76
/A          | 2              | static | 30   | no             | no
77
/A/B        | 1              | static | 40   | yes            | no
78
/A/B        | 2              | static | 50   | yes            | no
79
/A/B/C      | 3              | static | 60   | yes            | no
80
/A/B/C/D    | 4              | static | 70   | yes            | yes
81
82
The corresponding FIB should be:
83
84
Name prefix | NextHop records
85
------------|----------------
86
/A          | (face=1,cost=10) (face=2,cost=30)
87
/A/B        | (face=1,cost=20) (face=2,cost=50)
88
/A/B/C      | (face=1,cost=20) (face=2,cost=50) (face=3,cost=60)
89
/A/B/C/D    | (face=4,cost=70)
90
91 1 Junxiao Shi
## Control Commands
92
93
[[ControlCommand]] **management-module**: `rib`
94
95
### Register a route
96
97
**command-verb**: `register`
98
99
This command adds a route to the RIB.
100
101
ControlParameters fields:
102
103
* Name (required)
104
* FaceId (optional)
105 3 Junxiao Shi
* Origin (optional)
106 1 Junxiao Shi
* Cost (optional)
107 3 Junxiao Shi
* Flags (optional)
108 1 Junxiao Shi
* ExpirationPeriod (optional)
109
110
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
111
If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration).  
112
If face does not exist, the command fails with code 410.
113
114 3 Junxiao Shi
Origin defaults to app(=0).
115
116
Cost defaults to zero.
117
118 1 Junxiao Shi
Flags is an inclusive OR of route inheritance flags.
119
CHILD\_INHERIT=1, CAPTURE=2.
120
It defaults to CHILD\_INHERIT.
121
122 3 Junxiao Shi
ExpirationPeriod gives the duration (in milliseconds) in which this route is effective.
123
After ExpirationPeriod has elapsed, or when the face fails, the route is removed.
124
ExpirationPeriod defaults to (practically) Infinity when FaceId is omitted or is set to zero; otherwise, it defaults to 1 hour.
125 1 Junxiao Shi
126 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.
127 1 Junxiao Shi
128 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
129 1 Junxiao Shi
130
* Name: Name prefix
131 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
132 3 Junxiao Shi
* Route: route origin
133
* Cost: route cost
134 1 Junxiao Shi
* Flags: inclusive OR of route inheritance flags
135
* ExpirationPeriod: remaining lifetime (in milliseconds)
136
137
### Unregister a route
138
139
**command-verb**: `unregister`
140
141
This command removes a route from the RIB.
142
143
ControlParameters fields:
144
145
* Name (required)
146 3 Junxiao Shi
* FaceId (optional)
147
* Origin (optional)
148 1 Junxiao Shi
149
FaceId is the FaceId returned in [[FaceMgmt|Face Management]].
150
If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration).
151
152 3 Junxiao Shi
Origin defaults to app(=0).
153
154 1 Junxiao Shi
Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face.
155
Client needs self deregistration when it stops serving a name prefix, but intends to continue execution.
156
157 4 Junxiao Shi
If route does not exist, this command does nothing, but is still considered successful.
158 1 Junxiao Shi
159 3 Junxiao Shi
If the command succeeds, \<body> in ControlResponse block contains updated ControlParameters:
160 1 Junxiao Shi
161
* Name: unchanged
162 5 Junxiao Shi
* FaceId: nexthop FaceId (not zero)
163 4 Junxiao Shi
* Origin: unchanged if request specifies; app(=0) if request omits
164 1 Junxiao Shi
165
### Advertise a prefix
166
167
**command-verb**: `advertise`
168
169 3 Junxiao Shi
This command is not defined in this revision.
170
171 1 Junxiao Shi
### Withdraw a prefix
172
173
**command-verb**: `withdraw`
174 3 Junxiao Shi
175
This command is not defined in this revision.