Project

General

Profile

StrategyChoice » History » Version 6

Junxiao Shi, 09/08/2014 05:19 PM

1 4 Junxiao Shi
# Strategy Choice Management
2 1 Junxiao Shi
3 4 Junxiao Shi
**Strategy Choice Management** is a module of [[Management|NFD Management protocol]].
4
It provides:
5 1 Junxiao Shi
6 4 Junxiao Shi
* commands to choose the forwarding strategy for a namespace
7 5 Junxiao Shi
* a dataset of strategy choices
8 1 Junxiao Shi
9 5 Junxiao Shi
Strategy Choice Management commands and datasets are published in namespace `ndn:/localhost/nfd/strategy-choice`.
10 1 Junxiao Shi
11
12 4 Junxiao Shi
## Strategy
13 1 Junxiao Shi
14 6 Junxiao Shi
A strategy is identified by a Name.
15 1 Junxiao Shi
16 4 Junxiao Shi
NFD currently supports builtin strategies only. The following strategies are available:
17 1 Junxiao Shi
18 4 Junxiao Shi
* ndn:/localhost/nfd/strategy/best-route
19
* ndn:/localhost/nfd/strategy/broadcast
20
* ndn:/localhost/nfd/strategy/client-control
21 1 Junxiao Shi
* ndn:/localhost/nfd/strategy/ncc
22 4 Junxiao Shi
23 6 Junxiao Shi
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.
24 1 Junxiao Shi
25 6 Junxiao Shi
26 4 Junxiao Shi
## Control Commands
27 1 Junxiao Shi
28 4 Junxiao Shi
[[ControlCommand]] **management-module**: `strategy-choice`
29 3 Junxiao Shi
30 4 Junxiao Shi
### Set the strategy for a namespace
31 1 Junxiao Shi
32 4 Junxiao Shi
**command-verb**: `set`
33 1 Junxiao Shi
34 4 Junxiao Shi
ControlParameters fields:
35 1 Junxiao Shi
36 4 Junxiao Shi
* Name (required)
37 1 Junxiao Shi
* Strategy (required)
38
39 6 Junxiao Shi
**Name** is the Name prefix on which the strategy is selected.
40 1 Junxiao Shi
41 6 Junxiao Shi
**Strategy** must be a Name that represents a builtin strategy.  
42
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.  
43
If **Strategy** does not match any builtin strategy, the command fails with code 504.
44
45
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters:
46
47
* Name: unchanged
48
* Strategy: versioned strategy Name
49
50 1 Junxiao Shi
### Unset the strategy for a namespace
51 4 Junxiao Shi
52 1 Junxiao Shi
**command-verb**: `unset`
53
54
ControlParameters fields:
55
56 4 Junxiao Shi
* Name (required)
57 1 Junxiao Shi
58 6 Junxiao Shi
After this operation, the effective strategy at **Name** is inherited from the parent.  
59
If there is no strategy defined at **Name**, this command does nothing, but is still considered successful.
60 1 Junxiao Shi
61 6 Junxiao Shi
**Name** must not be `ndn:/`, otherwise the command fails with code 403.
62 5 Junxiao Shi
63
64
## Strategy Choice Dataset
65
66
Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`.
67
68
Each face is represented by a **StrategyChoice** block:
69 1 Junxiao Shi
70 5 Junxiao Shi
    StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH
71
                        Name
72
                        Strategy
73
74
* **Name** is the namespace on which a strategy is chosen.
75
* **Strategy** is the strategy chosen for this namespace.
76 6 Junxiao Shi
77 5 Junxiao Shi
78
## TLV-TYPE assignments
79
80
Type                                        | Assigned value    | Assigned value (hex)
81
------------------------------------------- | ----------------- | --------------------
82
StrategyChoice                              | 128               | 0x80