Project

General

Profile

StrategyChoice » History » Version 8

Junxiao Shi, 01/22/2017 07:35 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 7 Junxiao Shi
Strategy Choice Management commands and datasets are available under namespace `ndn:/localhost/nfd/strategy-choice`.
10 1 Junxiao Shi
11
12 4 Junxiao Shi
## Strategy
13 1 Junxiao Shi
14 8 Junxiao Shi
A strategy is identified by a name.
15 1 Junxiao Shi
16 8 Junxiao Shi
NFD currently supports the following strategies:
17 1 Junxiao Shi
18 4 Junxiao Shi
* ndn:/localhost/nfd/strategy/best-route
19
* ndn:/localhost/nfd/strategy/broadcast
20 1 Junxiao Shi
* ndn:/localhost/nfd/strategy/client-control
21
* ndn:/localhost/nfd/strategy/ncc
22 8 Junxiao Shi
* ndn:/localhost/nfd/strategy/access
23
* ndn:/localhost/nfd/strategy/asf
24 1 Junxiao Shi
25 8 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 component is appended to the strategy name.
26
A strategy may accept parameters name components. Parameters are always optional. They may be appended to the strategy name after the version component. Whether a strategy accepts parameters and the syntax and semantics of the parameters are defined by each strategy.
27 1 Junxiao Shi
28 6 Junxiao Shi
29 4 Junxiao Shi
## Control Commands
30 1 Junxiao Shi
31 4 Junxiao Shi
[[ControlCommand]] **management-module**: `strategy-choice`
32 3 Junxiao Shi
33 4 Junxiao Shi
### Set the strategy for a namespace
34 1 Junxiao Shi
35 4 Junxiao Shi
**command-verb**: `set`
36 1 Junxiao Shi
37 4 Junxiao Shi
ControlParameters fields:
38 1 Junxiao Shi
39
* Name (required)
40
* Strategy (required)
41
42
**Name** is the Name prefix on which the strategy is selected.
43 6 Junxiao Shi
44 8 Junxiao Shi
**Strategy** must be a Name that identifies a strategy.  
45
It could be either an unversioned name to instantiate the latest version of a strategy, or a versioned name to instantiate a specific version. If the chosen strategy accepts parameters, they may be appended after a versioned name.
46
If **Strategy** does not match any registered strategy, the command fails with code 404.
47 6 Junxiao Shi
48
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters:
49
50
* Name: unchanged
51 8 Junxiao Shi
* Strategy: strategy instance name, which always contains a version component and may contain parameters name components
52 6 Junxiao Shi
53 1 Junxiao Shi
### Unset the strategy for a namespace
54
55
**command-verb**: `unset`
56
57
ControlParameters fields:
58
59 4 Junxiao Shi
* Name (required)
60 1 Junxiao Shi
61 6 Junxiao Shi
After this operation, the effective strategy at **Name** is inherited from the parent.  
62
If there is no strategy defined at **Name**, this command does nothing, but is still considered successful.
63 1 Junxiao Shi
64 8 Junxiao Shi
**Name** must not be `ndn:/`, otherwise the command fails with code 400.
65 5 Junxiao Shi
66
67
## Strategy Choice Dataset
68
69
Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`.
70
71
Each face is represented by a **StrategyChoice** block:
72 1 Junxiao Shi
73 5 Junxiao Shi
    StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH
74
                        Name
75
                        Strategy
76
77
* **Name** is the namespace on which a strategy is chosen.
78
* **Strategy** is the strategy chosen for this namespace.
79 6 Junxiao Shi
80 5 Junxiao Shi
81
## TLV-TYPE assignments
82
83
Type                                        | Assigned value    | Assigned value (hex)
84
------------------------------------------- | ----------------- | --------------------
85
StrategyChoice                              | 128               | 0x80