Project

General

Profile

FibMgmt » History » Revision 25

Revision 24 (Junxiao Shi, 02/24/2014 08:44 AM) → Revision 25/44 (Junxiao Shi, 02/24/2014 08:25 PM)

# NFD FIB Management Protocol 

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

 The FIB management protocol uses [[Command Interests]]-Data exchange. 
 The command request and response follows the [[ControlCommand|NFD Control Command specification]] 

 ## Command format 

 ### Request 

 Request is a [[Command Interests|Signed Command Interest]] with the following name: 

     /localhost/nfd/fib/<command-verb>/<command-options>/............................ 

     \                  / \                                / \                            / 
      -------    -------     -------------    ---------------     ------------    ------------ 
             \/                         \/                                \/ 
     NFD Control Command         FibManager command                Command Interest 
     to FibManager               and command options              related information 


 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: 

 Field in `ControlResponse` block | Value 
 -------------------------------- | ----- 
 `StatusCode`                       | 200 
 `StatusText`                       | "Success" 
 `<StatusBody>`                     | `FibManagementOptions` block, either echoed or with updated `FaceId` field 

 Content of `ControlResponse` on error: 

 Field in `ControlResponse` block | Value 
 -------------------------------- | ----- 
 `StatusCode`                       | 4xx, 5xx, or other error codes based on RFC2616 
 `StatusText`                       | Human-readable description of the error 
 `<StatusBody>`                     | Not present 


 ### Operations 

 **FIB management protocol** supports five operations: 

 * **insert**: insert a FIB entry 
 * **delete**: delete a FIB entry 
 * **add-nexthop**: add a nexthop to a FIB entry 
 * **remove-nexthop**: remove a nexthop from a FIB entry 
 * **set-strategy**: set the forwarding strategy for a namespace 

 ## 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` 

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

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

 ## 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 [[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. 

 If the specified nexthop does not exist on the FIB entry, this command does nothing, 
 but is still considered successful. 

 

 ## Set strategy 

 **command-verb**: `set-strategy` 

 This command sets the forwarding strategy for a namespace. 

 Required fields in `FibManagementOptions` block: 

 * `Name` 
 * `Strategy` 

 **Strategy** must be a `Name` that represents a builtin strategy: 

 * ndn:/localhost/nfd/strategy/best-route 
 * ndn:/localhost/nfd/strategy/broadcast 
 * ndn:/localhost/nfd/strategy/ncc 

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

 If the Strategy does not match any builtin strategy, exist, the response has StatusCode 405. 

 


 ## TLV-TYPE assignments 

 Type                                          | Assigned value      | Assigned value (hex) 
 ------------------------------------------- | ----------------- | -------------------- 
 FibManagementOptions                          | 104                 | 0x68 
 FaceId                                        | 105                 | 0x69 
 Cost                                          | 106                 | 0x6a 
 Strategy                                      | 107                 | 0x6b