Project

General

Profile

FibMgmt » History » Revision 29

Revision 27 (Junxiao Shi, 03/06/2014 09:42 PM) → Revision 29/44 (Junxiao Shi, 03/18/2014 11:34 AM)

# NFD FIB Management Protocol 

 The **FIB Management** 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 module [[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 [[Management|NFD Management protocol]]. required and optional elements in the `FibManagementOptions` block. 
 It provides: Note that `Name` field is required for `FibManagementOptions` block. 

     FibManagementOptions ::= FIB-MANAGEMENT-OPTIONS-TYPE TLV-LENGTH 
                                Name 
                                FaceId? 
                                Cost? 
    
     // Name defined in NDN-TLV spec 

     FaceId                 ::= FACEID-TYPE TLV-LENGTH 
                                nonNegativeInteger 
    
     Cost                   ::= COST-TYPE TLV-LENGTH 
                                nonNegativeInteger 

 ### 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 two operations: 

 * commands **add-nexthop**: add a nexthop to insert, update, and delete a FIB entries and nexthop records entry 
 * **remove-nexthop**: remove a dataset of nexthop from a FIB entries and nexthop records entry 

 FIB Management commands and datasets are published in namespace `ndn:/localhost/nfd/fib`. 



 ## Control Commands 

 [[ControlCommand]] **management-module**: `fib` 

 ### Add a nexthop 

 **command-verb**: **command-verb:** `add-nexthop` 

 This command adds a nexthop to a FIB entry. 
 If the FIB entry does not exist, it is inserted automatically. 

 ControlParameters fields: Required fields in `FibManagementOptions` block: 

 * Name (required) `Name` 
 * FaceId (required) `FaceId` 
 * Cost (optional) `Cost` 

 FaceId **FaceId** is the FaceId returned in [[FaceMgmt|Face Management]]. [[FaceMgmt|NFD Face Management protocol]]. 
 If FaceId **FaceId** is set to zero, it is implied as the face of the entity sending this command.   
 If face does not exist, the command fails with code 410. 

 Cost defaults to zero. 
 If a nexthop of same FaceId `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. 
 If the last nexthop record in a FIB entry is removed, the FIB entry is deleted automatically. also deleted. 

 ControlParameters fields: Required fields in `FibManagementOptions` block: 

 * Name (required) `Name` 
 * FaceId (required) `FaceId` 

 FaceId **FaceId** is the FaceId returned in [[FaceMgmt|Face Management]]. [[FaceMgmt|NFD Face Management protocol]]. 
 If FaceId **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 command fails with code response has StatusCode 404. 

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



 ## FIB Dataset 

 FIB entries and nexthop records are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/fib/list`. 

 Each FIB entry is represented by a **FibEntry** blocks: 

     FibEntry        := FIB-ENTRY-TYPE TLV-LENGTH 
                        Name 
                        NextHopRecord+ 
    
     NextHopRecord := NEXT-HOP-RECORD TLV-LENGTH 
                        FaceId 
                        Cost 



 ## TLV-TYPE assignments 

 Type                                          | Assigned value      | Assigned value (hex) 
 ------------------------------------------- | ----------------- | -------------------- 
 FibEntry                                      FibManagementOptions                          | 128 104                 | 0x80 0x68 
 NextHopRecord                                 FaceId                                        | 129 105                 | 0x81 0x69 
 Cost                                          | 106                 | 0x6a