Project

General

Profile

StrategyChoice » History » Revision 7

Revision 6 (Junxiao Shi, 09/08/2014 05:19 PM) → Revision 7/16 (Junxiao Shi, 07/29/2015 08:35 AM)

# Strategy Choice Management 

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

 * commands to choose the forwarding strategy for a namespace 
 * a dataset of strategy choices 

 Strategy Choice Management commands and datasets are available under published in namespace `ndn:/localhost/nfd/strategy-choice`. 


 ## Strategy 

 A strategy is identified by a Name. 

 NFD currently supports builtin strategies only. The following strategies are available: 

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

 Each strategy listed above may have one or more versions. Strategy version is increased when there is a major behavior change; bugfixes usually won't bump strategy version. The version number is appended to strategy Name. 


 ## Control Commands 

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

 ### Set the strategy for a namespace 

 **command-verb**: `set` 

 ControlParameters fields: 

 * Name (required) 
 * Strategy (required) 

 **Name** is the Name prefix on which the strategy is selected. 

 **Strategy** must be a Name that represents a builtin strategy.   
 It could be either an unversioned Name to select the latest version of a strategy, or a versioned Name to select a specific version. It's recommended to use an unversioned Name so that the latest strategy version is picked.   
 If **Strategy** does not match any builtin strategy, the command fails with code 504. 

 If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters: 

 * Name: unchanged 
 * Strategy: versioned strategy Name 

 ### Unset the strategy for a namespace 

 **command-verb**: `unset` 

 ControlParameters fields: 

 * Name (required) 

 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 fails with code 403. 


 ## Strategy Choice Dataset 

 Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`. 

 Each face is represented by a **StrategyChoice** block: 

     StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH 
                         Name 
                         Strategy 

 * **Name** is the namespace on which a strategy is chosen. 
 * **Strategy** is the strategy chosen for this namespace. 


 ## TLV-TYPE assignments 

 Type                                          | Assigned value      | Assigned value (hex) 
 ------------------------------------------- | ----------------- | -------------------- 
 StrategyChoice                                | 128                 | 0x80