StrategyChoice » History » Version 10
Junxiao Shi, 01/21/2018 12:11 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 | 6 | Junxiao Shi | |
| 50 | If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters: |
||
| 51 | |||
| 52 | * Name: unchanged |
||
| 53 | 8 | Junxiao Shi | * Strategy: strategy instance name, which always contains a version component and may contain parameters name components |
| 54 | 6 | Junxiao Shi | |
| 55 | 1 | Junxiao Shi | ### Unset the strategy for a namespace |
| 56 | |||
| 57 | **command-verb**: `unset` |
||
| 58 | |||
| 59 | ControlParameters fields: |
||
| 60 | |||
| 61 | 4 | Junxiao Shi | * Name (required) |
| 62 | 1 | Junxiao Shi | |
| 63 | 6 | Junxiao Shi | After this operation, the effective strategy at **Name** is inherited from the parent. |
| 64 | If there is no strategy defined at **Name**, this command does nothing, but is still considered successful. |
||
| 65 | 1 | Junxiao Shi | |
| 66 | 8 | Junxiao Shi | **Name** must not be `ndn:/`, otherwise the command fails with code 400. |
| 67 | 5 | Junxiao Shi | |
| 68 | |||
| 69 | ## Strategy Choice Dataset |
||
| 70 | |||
| 71 | Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`. |
||
| 72 | |||
| 73 | 9 | Davide Pesavento | Each choice is represented by a **StrategyChoice** block: |
| 74 | 1 | Junxiao Shi | |
| 75 | 5 | Junxiao Shi | StrategyChoice := STRATEGY-CHOICE-TYPE TLV-LENGTH |
| 76 | Name |
||
| 77 | Strategy |
||
| 78 | |||
| 79 | * **Name** is the namespace on which a strategy is chosen. |
||
| 80 | * **Strategy** is the strategy chosen for this namespace. |
||
| 81 | 6 | Junxiao Shi | |
| 82 | 5 | Junxiao Shi | |
| 83 | ## TLV-TYPE assignments |
||
| 84 | |||
| 85 | Type | Assigned value | Assigned value (hex) |
||
| 86 | ------------------------------------------- | ----------------- | -------------------- |
||
| 87 | StrategyChoice | 128 | 0x80 |