RibMgmt » History » Revision 3
Revision 2 (Lan Wang, 04/18/2014 04:22 AM) → Revision 3/31 (Junxiao Shi, 04/18/2014 10:59 AM)
# RIB Management **RIB Management** is a module of [[Management|NFD Management protocol]]. It provides: * commands to register and unregister routes * commands to advertise and withdraw prefix with a routing protocol RIB Management commands are published in namespace `ndn:/localhost/nfd/rib`. ## Route A **route**, or a **routing entry**, indicates that contents under a certain name prefix may be available via a certain face. A route contains: * Name prefix * nexthop FaceId * origin * cost * route inheritance flags ### Route origin **Origin** indicates who is announcing a route. * **app**(=0): local producer application * **static**(=255): static route * **nlsr**(=128): NLSR ### Route cost **Cost** indicates the preference among multiple routes with same Name prefix. The nexthop face on a route with lower cost is preferred. Unlike IP routing, the nexthop face to use is decided by forwarding strategy. Route Routing cost is a suggestion to strategy; strategy MAY consider route routing cost when making forwarding decisions. ### Route inheritance Each route can have two route inheritance flags: * CHILD\_INHERIT: indicates that this route may be used even if a longer prefix is matched. This flag applies on a single route. * CAPTURE: indicates that no shorter prefix can be used; overrides CHILD\_INHERIT. This flag applies on the prefix: if any route of a prefix has this flag, the prefix will have this flag. Example: Name prefix | nexthop FaceId | CHILD\_INHERIT | CAPTURE ------------|----------------|----------------|--------- / | 1 | yes | no / | 2 | no | no /A | 3 | yes | no /A/B/C | 4 | yes | no /D | 5 | yes | yes /D | 6 | yes | no * Interest /A/P can go to face 1 and 3. * It cannot go to face 2, because that route has CHILD\_INHERIT=no. * Interest /A/B/C/Q can go to face 1, 3, and 4. * Interest /D/R can go to face 5 and 6. * It cannot go to face 1, because one of the routes on /D sets CAPTURE=yes. * Interest /S can go to face 1 and 2. ## Control Commands [[ControlCommand]] **management-module**: `rib` ### Register a route **command-verb**: `register` This command adds a route to the RIB. ControlParameters fields: * Name (required) * FaceId (optional) * Origin Flags (optional) * Cost (optional) * Flags (optional) * ExpirationPeriod (optional) FaceId is the FaceId returned in [[FaceMgmt|Face Management]]. If FaceId is omitted or is set to zero, it is implied as the requesting face (self registration). If face does not exist, the command fails with code 410. Origin defaults to app(=0). Cost defaults to zero. Flags is an inclusive OR of route inheritance flags. CHILD\_INHERIT=1, CAPTURE=2. It defaults to CHILD\_INHERIT. Cost defaults to zero. ExpirationPeriod gives indicates the duration (in milliseconds) in which this route is effective. After ExpirationPeriod has is elapsed, or when the face fails, the route is removed. ExpirationPeriod defaults to (practically) Infinity when FaceId is omitted or is set to zero; otherwise, it defaults to 1 hour. If a route of same Name, FaceId, Name and Origin FaceId exists, its Flags and Cost and Flags are updated, and its lifetime is extended to now + ExpirationPeriod. If the command succeeds, \<body> \<Body> in ControlResponse block contains updated ControlParameters: ControlParameters. * Name: Name prefix * FaceId: nexthop FaceId * Route: route origin * Cost: route cost * Flags: inclusive OR of route inheritance flags * Cost: routing cost * ExpirationPeriod: remaining lifetime (in milliseconds) ### Unregister a route **command-verb**: `unregister` This command removes a route from the RIB. ControlParameters fields: * Name (required) * FaceId (optional) * Origin (optional) (required) FaceId is the FaceId returned in [[FaceMgmt|Face Management]]. If FaceId is omitted or is set to zero, it is implied as the requesting face (self deregistration). Origin defaults to app(=0). Self deregistration is unnecessary if client is quitting. NFD automatically removes routes belonging to a failed face. Client needs self deregistration when it stops serving a name prefix, but intends to continue execution. If face or route does not exist, this command does nothing, but is still considered successful. If the command succeeds, \<body> \<Body> in ControlResponse block contains updated ControlParameters: * Name: unchanged * FaceId: unchanged if request specifies non-zero; requesting FaceId if request omits or specifies zero ### Advertise a prefix **command-verb**: `advertise` This command is not defined in this revision. ### Withdraw a prefix **command-verb**: `withdraw` This command is not defined in this revision.