Project

General

Profile

FibMgmt » History » Revision 12

Revision 10 (Junxiao Shi, 01/30/2014 12:16 AM) → Revision 12/44 (Alex Afanasyev, 01/30/2014 12:22 PM)

# NFD FIB Management Protocol 

 The **FIB management protocol** allows an entity to manipulate the FIB entry. 

 The FIB management This 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. 

     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]]. 

 The response has StatusCode 200 if the command succeeds. 

 <!-- Alex: Should positive responses contain TLV-Encoded ``FibManagementOptions`` block related to the command (after StatusText)? --> 

 Any other status code (4xx, 5xx, [?]) mean error. 
 Description of the error 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``) 


 ## Command format 

 The FIB management protocol uses Interest-Data exchange. 
 The command request and response formats are specified in [[ControlCommand|NFD Control Command specification]]. 


 ## Insert a FIB entry 

 **command-verb:** ``insert`` **fibinsert** command inserts a FIB entry. 

 Required fields in ``FibManagementOptions`` block: The command verb is **fibinsert**. 
 Request Interest must be signed. 

 * ``Name`` The request options have the following format: 

     FibInsertOptions ::= FIB-INSERT-OPTIONS-TYPE TLV-LENGTH 
                            Name 

 The response has StatusCode 200 if the command succeeds. 

 If a FIB entry for Name already exists, this command does nothing, but is still considered successful. 

 


 ## Delete a FIB entry 

 **command-verb:** ``delete`` **fibdelete** command deletes a FIB entry. 

 Required fields in ``FibManagementOptions`` block: The command verb is **fibdelete**. 
 Request Interest must be signed. 

 * ``Name`` The request options have the following format: 

     FibDeleteOptions ::= FIB-DELETE-OPTIONS-TYPE TLV-LENGTH 
                            Name 

 The response has StatusCode 200 if the command succeeds. 

 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 **fibaddnexthop** command adds a nexthop to an existing FIB entry. 

 Required fields in ``FibManagementOptions`` block: 

 * ``Name`` 
 * ``FaceId`` 
 * ``Cost`` 

 If a nexthop of same ``FaceId`` FaceId exists on the FIB entry, its cost is updated. 

 The command verb is **fibaddnexthop**. 
 Request Interest must be signed. 

 The request options have the following format: 

     FibAddNextHopOptions ::= FIB-ADD-NEXTHOP-OPTIONS-TYPE TLV-LENGTH 
                                Name 
                                FaceId 
                                Cost 
    
     FaceId                 ::= FACEID-TYPE TLV-LENGTH 
                                nonNegativeInteger 
    
     Cost                   ::= COST-TYPE TLV-LENGTH 
                                nonNegativeInteger 

 **FaceId** is the FaceId returned in [[NFD *NFD Face Management protocol]]. 

 protocol*. 
 If **FaceId** is set to zero, it is implied as the face of the entity sending this command. 

 The response has StatusCode 200 if the command succeeds. 

 If the FIB entry does not exist, the response has StatusCode 404. 

 


 ## Remove a nexthop 

 **command-verb**: ``remove-nexthop`` 

 This **fibremovenexthop** 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`` The command verb is **fibremovenexthop**. 
 * ``FaceId`` Request Interest must be signed. 

 The request options have the following format: 

     FibRemoveNextHopOptions ::= FIB-REMOVE-NEXTHOP-OPTIONS-TYPE TLV-LENGTH 
                                   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. 


 

 The response has StatusCode 200 if the command succeeds. 

 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 **fibstrategy** command sets picks 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 FibInsertOptions                              | 55547               | 0xd8fb 
 FibDeleteOptions                              | 56539               | 0xdcdb 
 FibAddNextHopOptions                          | 129                 | 0x81 
 FibRemoveNextHopOptions                       | 129                 | 0x81 
 FaceId                                        | 130 132                 | 0x82 0x84 
 Cost                                          | 131                 63672               | 0x83 
 Strategy                                      | 132                 | 0x84 0xf8b8