FibMgmt » History » Revision 19
Revision 18 (Alex Afanasyev, 01/30/2014 05:51 PM) → Revision 19/45 (Alex Afanasyev, 02/10/2014 11:09 AM)
# NFD FIB Management Protocol
The **FIB management protocol** allows an entity to manipulate the FIB entry.
The FIB management protocol uses [[Signed Interests]]-Data exchange.
The command request and response follows the [[ControlCommand|NFD Control Command specification]]
## Command format
### Request
Request is a signed Interest with the following name:
/localhost/nfd/fib/<command-verb>/<command-options>/<timestamp>/<SignatureInfo>/<SignatureValue>
\ / \ / \ /
------- ------- ------------- --------------- -------------------- --------------------
\/ \/ \/
NFD Control Command FibManager command Signed Interest related information
to FibManager and command options
Command options is defined as a TLV-encoded ``FibManagementOptions`` block.
Each individual command defines a subset of required and optional elements in the ``FibManagementOptions`` block.
Note that ``Name`` field is required for ``FibManagementOptions`` block.
FibManagementOptions ::= FIB-MANAGEMENT-OPTIONS-TYPE TLV-LENGTH
Name
FaceId?
Cost?
Strategy?
// Name defined in NDN-TLV spec
FaceId ::= FACEID-TYPE TLV-LENGTH
nonNegativeInteger
Cost ::= COST-TYPE TLV-LENGTH
nonNegativeInteger
Strategy ::= STRATEGY-TYPE TLV-LENGTH
Name
### Response
Command response is a Data packet that contains TLV-encoded ``ControlResponse`` block, defined in [[ControlCommand|NFD Control Command specification]].
Content of ``ControlResponse`` on success: The response has StatusCode 200 if the command succeeds.
Field in ``ControlResponse`` <!-- Alex: Should positive responses contain TLV-Encoded ``FibManagementOptions`` block | Value
---------------------------------- | -----
``StatusCode`` | 200
``StatusText`` | "Success"
``<StatusBody>`` | ``FibManagementOptions`` block, either echoed or with updated ``FaceId`` field related to the command (after StatusText)? -->
Content of ``ControlResponse`` on error:
Field in ``ControlResponse`` block | Value
---------------------------------- | -----
``StatusCode`` | 4xx, 500x, or Any other error codes based on RFC2616 status code (4xx, 5xx, [?]) mean error.
``StatusText`` | Human-readable description Description of the error
``<StatusBody>`` | Not can be present
in ``StatusText`` field of ``ControlResponse`` command.
### Operations
**FIB management protocol** protocol supports five operations:
* insert a FIB entry (command-verb: ``insert``)
* delete a FIB entry (command-verb: ``delete``)
* add a nexthop to a FIB entry (command-verb: ``add-nexthop``)
* remove a nexthop from a FIB entry (command-verb: ``remove-nexthop``)
* set the forwarding strategy for a namespace (command-verb: ``set-strategy``)
## Insert a FIB entry
**command-verb:** ``insert``
Required fields in ``FibManagementOptions`` block:
* ``Name``
If a FIB entry for Name already exists, this command does nothing, but is still considered successful.
## Delete a FIB entry
**command-verb:** ``delete``
Required fields in ``FibManagementOptions`` block:
* ``Name``
If a FIB entry for Name does not exist, this command does nothing, but is still considered successful.
## Add a nexthop
**command-verb:** ``add-nexthop``
This command adds a nexthop to an existing FIB entry.
Required fields in ``FibManagementOptions`` block:
* ``Name``
* ``FaceId``
* ``Cost``
If a nexthop of same ``FaceId`` exists on the FIB entry, its cost is updated.
**FaceId** is the FaceId returned in [[FaceMgmt|NFD Face Management protocol]].
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
If the FIB entry does not exist, the response has StatusCode 404.
## Remove a nexthop
**command-verb**: ``remove-nexthop``
This command removes a nexthop from a FIB entry.
Removing the last nexthop in a FIB entry will not automatically delete the FIB entry.
Required fields in ``FibManagementOptions`` block:
* ``Name``
* ``FaceId``
**FaceId** is the FaceId returned in *NFD Face Management protocol*.
If **FaceId** is set to zero, it is implied as the face of the entity sending this command.
If the FIB entry does not exist, the response has StatusCode 404.
If the specified nexthop does not exist on the FIB entry, this command does nothing,
but is still considered successful.
## Set strategy
This command sets a forwarding strategy for a namespace.
The format of this command will be defined in a later version of this spec.
Required fields in ``FibManagementOptions`` block:
* ``Name``
* ``Strategy``
## TLV-TYPE assignments
Type | Assigned value | Assigned value (hex)
------------------------------------------- | ----------------- | --------------------
FibManagementOptions | 104 | 0x68
FaceId | 105 | 0x69
Cost | 106 | 0x6a
Strategy | 107 | 0x6b