StrategyChoice » History » Version 17
Davide Pesavento, 02/02/2025 08:57 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 | 17 | Davide Pesavento | * `ndn:/localhost/nfd/strategy/best-route` |
21 | * `ndn:/localhost/nfd/strategy/access` |
||
22 | * `ndn:/localhost/nfd/strategy/asf` |
||
23 | * `ndn:/localhost/nfd/strategy/multicast` |
||
24 | * `ndn:/localhost/nfd/strategy/self-learning` |
||
25 | 15 | Davide Pesavento | |
26 | 17 | Davide Pesavento | Each strategy may have one or more versions. The strategy version is increased when there is a major behavior change; bug fixes usually will not bump the strategy version. The version component is appended to the strategy name. |
27 | 8 | Junxiao Shi | |
28 | 17 | Davide Pesavento | A strategy may accept parameters as 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 | 17 | Davide Pesavento | |
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 | ControlParameters fields: |
||
40 | |||
41 | * Name (required) |
||
42 | 14 | Davide Pesavento | * Strategy (required) |
43 | |||
44 | 17 | Davide Pesavento | *Name* is the name prefix on which the strategy is selected. A forwarder MAY impose a limit on the length of name prefix. The current limit in NFD is 32 name components. If *Name* exceeds this limit, the command fails with code 414. |
45 | 6 | Junxiao Shi | |
46 | 17 | Davide Pesavento | *Strategy* must be a Name that identifies a strategy. 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. |
47 | |||
48 | 14 | Davide Pesavento | If *Strategy* does not match any registered strategy, the command fails with code 404. |
49 | In case of error during strategy initialization (such as unacceptable parameter), the command fails with code 409. |
||
50 | 1 | Junxiao Shi | |
51 | 17 | Davide Pesavento | If the command succeeds, \<Body> in ControlResponse block contains the updated ControlParameters: |
52 | 6 | Junxiao Shi | |
53 | * Name: unchanged |
||
54 | 14 | Davide Pesavento | * Strategy: strategy instance name, which always contains a version component and MAY contain the 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 | 17 | Davide Pesavento | 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 | 14 | Davide Pesavento | *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 | 16 | Davide Pesavento | Each choice is represented by a **StrategyChoice** element: |
75 | 1 | Junxiao Shi | |
76 | 16 | Davide Pesavento | StrategyChoice = STRATEGY-CHOICE-TYPE TLV-LENGTH |
77 | Name |
||
78 | Strategy |
||
79 | 5 | Junxiao Shi | |
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 |