Project

General

Profile

StrategyChoice » History » Version 11

Junxiao Shi, 02/03/2018 03:49 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 10 Junxiao Shi
**Name** is the name prefix on which the strategy is selected.
43
NFD MAY impose a limit on the length of name prefix. The current limit is 32 name components.
44
If Name exceeds this limit, the command fails with code 414.
45 6 Junxiao Shi
46 10 Junxiao Shi
**Strategy** must be a Name that identifies a strategy.
47 8 Junxiao Shi
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.
48
If **Strategy** does not match any registered strategy, the command fails with code 404.
49 11 Junxiao Shi
In case of an error during strategy initiation (such as unacceptable parameter), the command fails with code 409.
50 6 Junxiao Shi
51
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters:
52
53
* Name: unchanged
54 8 Junxiao Shi
* Strategy: strategy instance name, which always contains a version component and may contain parameters name components
55 6 Junxiao Shi
56 1 Junxiao Shi
### Unset the strategy for a namespace
57
58
**command-verb**: `unset`
59
60
ControlParameters fields:
61
62 4 Junxiao Shi
* Name (required)
63 1 Junxiao Shi
64 6 Junxiao Shi
After this operation, the effective strategy at **Name** is inherited from the parent.  
65
If there is no strategy defined at **Name**, this command does nothing, but is still considered successful.
66 1 Junxiao Shi
67 8 Junxiao Shi
**Name** must not be `ndn:/`, otherwise the command fails with code 400.
68 5 Junxiao Shi
69
70
## Strategy Choice Dataset
71
72
Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`.
73
74 9 Davide Pesavento
Each choice is represented by a **StrategyChoice** block:
75 1 Junxiao Shi
76 5 Junxiao Shi
    StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH
77
                        Name
78
                        Strategy
79
80
* **Name** is the namespace on which a strategy is chosen.
81
* **Strategy** is the strategy chosen for this namespace.
82 6 Junxiao Shi
83 5 Junxiao Shi
84
## TLV-TYPE assignments
85
86
Type                                        | Assigned value    | Assigned value (hex)
87
------------------------------------------- | ----------------- | --------------------
88
StrategyChoice                              | 128               | 0x80