RibMgmt » History » Revision 4
« Previous |
Revision 4/31
(diff)
| Next »
Junxiao Shi, 04/18/2014 03:45 PM
RIB Management¶
RIB Management is a module of 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 cost is a suggestion to strategy; strategy MAY consider route 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 (optional)
- Cost (optional)
- Flags (optional)
- ExpirationPeriod (optional)
FaceId is the FaceId returned in 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.
ExpirationPeriod gives the duration (in milliseconds) in which this route is effective.
After ExpirationPeriod has 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, and Origin exists, its Cost and Flags are updated, and its lifetime is extended to now + ExpirationPeriod.
If the command succeeds, <body> in ControlResponse block contains updated ControlParameters:
- Name: Name prefix
- FaceId: nexthop FaceId
- Route: route origin
- Cost: route cost
- Flags: inclusive OR of route inheritance flags
- 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)
FaceId is the FaceId returned in 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 route does not exist, this command does nothing, but is still considered successful.
If the command succeeds, <body> in ControlResponse block contains updated ControlParameters:
- Name: unchanged
- FaceId: unchanged if request specifies non-zero; requesting FaceId if request omits or specifies zero
- Origin: unchanged if request specifies; app(=0) if request omits
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.
Updated by Junxiao Shi over 10 years ago · 31 revisions