StrategyChoice » History » Version 13
Davide Pesavento, 02/09/2018 02:31 PM
| 1 | 4 | Junxiao Shi | # Strategy Choice Management |
|---|---|---|---|
| 2 | 1 | Junxiao Shi | |
| 3 | 13 | Davide Pesavento | {{>toc}} |
| 4 | 12 | Davide Pesavento | |
| 5 | 4 | Junxiao Shi | **Strategy Choice Management** is a module of [[Management|NFD Management protocol]]. |
| 6 | It provides: |
||
| 7 | 1 | Junxiao Shi | |
| 8 | 4 | Junxiao Shi | * commands to choose the forwarding strategy for a namespace |
| 9 | 5 | Junxiao Shi | * a dataset of strategy choices |
| 10 | 1 | Junxiao Shi | |
| 11 | 7 | Junxiao Shi | Strategy Choice Management commands and datasets are available under namespace `ndn:/localhost/nfd/strategy-choice`. |
| 12 | 1 | Junxiao Shi | |
| 13 | |||
| 14 | 12 | Davide Pesavento | ## Strategies |
| 15 | 1 | Junxiao Shi | |
| 16 | 8 | Junxiao Shi | A strategy is identified by a name. |
| 17 | 1 | Junxiao Shi | |
| 18 | 8 | Junxiao Shi | NFD currently supports the following strategies: |
| 19 | 1 | Junxiao Shi | |
| 20 | 4 | Junxiao Shi | * ndn:/localhost/nfd/strategy/best-route |
| 21 | * ndn:/localhost/nfd/strategy/broadcast |
||
| 22 | 1 | Junxiao Shi | * ndn:/localhost/nfd/strategy/client-control |
| 23 | * ndn:/localhost/nfd/strategy/ncc |
||
| 24 | 8 | Junxiao Shi | * ndn:/localhost/nfd/strategy/access |
| 25 | * ndn:/localhost/nfd/strategy/asf |
||
| 26 | 1 | Junxiao Shi | |
| 27 | 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. |
| 28 | 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. |
||
| 29 | 1 | Junxiao Shi | |
| 30 | 6 | Junxiao Shi | |
| 31 | 4 | Junxiao Shi | ## Control Commands |
| 32 | 1 | Junxiao Shi | |
| 33 | 4 | Junxiao Shi | [[ControlCommand]] **management-module**: `strategy-choice` |
| 34 | 3 | Junxiao Shi | |
| 35 | 4 | Junxiao Shi | ### Set the strategy for a namespace |
| 36 | 1 | Junxiao Shi | |
| 37 | 4 | Junxiao Shi | **command-verb**: `set` |
| 38 | 1 | Junxiao Shi | |
| 39 | 4 | Junxiao Shi | ControlParameters fields: |
| 40 | 1 | Junxiao Shi | |
| 41 | * Name (required) |
||
| 42 | * Strategy (required) |
||
| 43 | |||
| 44 | 10 | Junxiao Shi | **Name** is the name prefix on which the strategy is selected. |
| 45 | NFD MAY impose a limit on the length of name prefix. The current limit is 32 name components. |
||
| 46 | If Name exceeds this limit, the command fails with code 414. |
||
| 47 | 6 | Junxiao Shi | |
| 48 | 10 | Junxiao Shi | **Strategy** must be a Name that identifies a strategy. |
| 49 | 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. |
| 50 | If **Strategy** does not match any registered strategy, the command fails with code 404. |
||
| 51 | 11 | Junxiao Shi | In case of an error during strategy initiation (such as unacceptable parameter), the command fails with code 409. |
| 52 | 6 | Junxiao Shi | |
| 53 | If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters: |
||
| 54 | |||
| 55 | * Name: unchanged |
||
| 56 | 8 | Junxiao Shi | * Strategy: strategy instance name, which always contains a version component and may contain parameters name components |
| 57 | 6 | Junxiao Shi | |
| 58 | 1 | Junxiao Shi | ### Unset the strategy for a namespace |
| 59 | |||
| 60 | **command-verb**: `unset` |
||
| 61 | |||
| 62 | ControlParameters fields: |
||
| 63 | |||
| 64 | 4 | Junxiao Shi | * Name (required) |
| 65 | 1 | Junxiao Shi | |
| 66 | 6 | Junxiao Shi | After this operation, the effective strategy at **Name** is inherited from the parent. |
| 67 | If there is no strategy defined at **Name**, this command does nothing, but is still considered successful. |
||
| 68 | 1 | Junxiao Shi | |
| 69 | 8 | Junxiao Shi | **Name** must not be `ndn:/`, otherwise the command fails with code 400. |
| 70 | 5 | Junxiao Shi | |
| 71 | |||
| 72 | ## Strategy Choice Dataset |
||
| 73 | |||
| 74 | Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`. |
||
| 75 | |||
| 76 | 9 | Davide Pesavento | Each choice is represented by a **StrategyChoice** block: |
| 77 | 1 | Junxiao Shi | |
| 78 | 5 | Junxiao Shi | StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH |
| 79 | Name |
||
| 80 | Strategy |
||
| 81 | |||
| 82 | * **Name** is the namespace on which a strategy is chosen. |
||
| 83 | * **Strategy** is the strategy chosen for this namespace. |
||
| 84 | 6 | Junxiao Shi | |
| 85 | 5 | Junxiao Shi | |
| 86 | ## TLV-TYPE assignments |
||
| 87 | |||
| 88 | Type | Assigned value | Assigned value (hex) |
||
| 89 | ------------------------------------------- | ----------------- | -------------------- |
||
| 90 | StrategyChoice | 128 | 0x80 |