Project

General

Profile

StrategyChoice » History » Revision 4

Revision 3 (Junxiao Shi, 03/04/2014 08:25 AM) → Revision 4/16 (Junxiao Shi, 03/18/2014 11:35 AM)

# NFD Strategy Choice Management Protocol 

 The **Strategy Choice Management** is a module of [[Management|NFD Management protocol]]. 
 It provides: 

 * commands protocol** allows an entity to choose set the forwarding strategy for a namespace namespace. 

 The Strategy Choice Management commands are published protocol uses [[Command Interests]]-Data exchange. 
 The command request and response follows [[ControlCommand|NFD Control Command specification]]. 

 ## Command format 

 ### Request 

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

     /localhost/nfd/strategy-choice/<command-verb>/<command-options>/............................ 

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

 Command options is defined as a TLV-encoded `StrategyChoiceOptions` block. 
 Each individual command defines a subset of required and optional elements in namespace `ndn:/localhost/nfd/strategy-choice`. 



 ## the `StrategyChoiceOptions` block. 
 Note that `Name` field is required for `StrategyChoiceOptions` block. 

     StrategyChoiceOptions ::= STRATEGY-CHOICE-OPTIONS-TYPE TLV-LENGTH 
                                 Name 
                                 Strategy? 
    
     // Name defined in NDN-TLV spec 

     Strategy                ::= STRATEGY-TYPE TLV-LENGTH 
                                 Name 

 A strategy ### Response 

 Command response is represented by a Name. Data packet that contains TLV-encoded `ControlResponse` block, defined in [[ControlCommand|NFD Control Command specification]]. 

 NFD currently supports builtin strategies only. The following strategies are available: Content of `ControlResponse` on success: 

 * ndn:/localhost/nfd/strategy/best-route Field in `ControlResponse` block | Value 
 * ndn:/localhost/nfd/strategy/broadcast -------------------------------- | ----- 
 `StatusCode`                       | 200 
 `StatusText`                       | "Success" 
 `<StatusBody>`                     | `StrategyChoiceOptions` block, echoed 

 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 

 **Strategy Choice protocol** supports two operations: 

 * ndn:/localhost/nfd/strategy/client-control **set**: set the strategy for a namespace 
 * ndn:/localhost/nfd/strategy/ncc 



 **unset**: unset the strategy for a namespace 

 ## Control Commands 

 [[ControlCommand]] **management-module**: `strategy-choice` 

 ### Set the strategy for a namespace 

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

 ControlParameters fields: Required fields in `StrategyChoiceOptions` block: 

 * Name (required) `Name` 
 * Strategy (required) `Strategy` 

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

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

 If the Strategy does not match any builtin strategy, the command fails with code response has StatusCode 504. 

 ### ## Unset the strategy for a namespace 

 **command-verb**: **command-verb:** `unset` 

 ControlParameters fields: Required fields in `StrategyChoiceOptions` block: 

 * Name (required) `Name` 

 After this operation, the effective strategy at Name is inherited from the parent.   
 

 If there is no strategy defined at Name, this command does nothing, but is still considered successful. 

 Name must not be `ndn:/`, otherwise the command operation fails with code StatusCode 403. 

 ## TLV-TYPE assignments 

 Type                                          | Assigned value      | Assigned value (hex) 
 ------------------------------------------- | ----------------- | -------------------- 
 StrategyChoiceOptions                         | 109                 | 0x6d 
 Strategy                                      | 107                 | 0x6b