StrategyChoice » History » Revision 3
      « Previous |
    Revision 3/18
      (diff)
      | Next »
    
    Junxiao Shi, 03/04/2014 08:25 AM 
    
    
NFD Strategy Choice Protocol¶
The Strategy Choice protocol allows an entity to set the forwarding strategy for a namespace.
The Strategy Choice protocol uses Command Interests-Data exchange.
The command request and response follows NFD Control Command specification.
Command format¶
Request¶
Request is a 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 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
Response¶
Command response is a Data packet that contains TLV-encoded ControlResponse block, defined in NFD Control Command specification.
Content of ControlResponse on success:
Field in ControlResponse block | 
Value | 
|---|---|
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:
- set: set the strategy for a namespace
 - unset: unset the strategy for a namespace
 
Set the strategy for a namespace¶
command-verb: set
Required fields in StrategyChoiceOptions block:
NameStrategy
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/client-control
 - ndn:/localhost/nfd/strategy/ncc
 
If the Strategy does not match any builtin strategy, the response has StatusCode 504.
Unset the strategy for a namespace¶
command-verb: unset
Required fields in StrategyChoiceOptions block:
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 operation fails with StatusCode 403.
TLV-TYPE assignments¶
| Type | Assigned value | Assigned value (hex) | 
|---|---|---|
| StrategyChoiceOptions | 109 | 0x6d | 
| Strategy | 107 | 0x6b | 
Updated by Junxiao Shi over 11 years ago · 18 revisions