StrategyChoice » History » Revision 17
Revision 16 (Davide Pesavento, 06/03/2020 05:34 PM) → Revision 17/18 (Davide Pesavento, 02/02/2025 08:57 PM)
# Strategy Choice Management {{>toc}} **Strategy Choice Management** is a module of [[Management|NFD Management protocol]]. It provides: * commands to choose the forwarding strategy for a namespace * a dataset of strategy choices Strategy Choice Management commands and datasets are available under namespace `ndn:/localhost/nfd/strategy-choice`. ## Strategies A strategy is identified by a name. NFD currently supports the following strategies: * `ndn:/localhost/nfd/strategy/best-route` ndn:/localhost/nfd/strategy/best-route * `ndn:/localhost/nfd/strategy/access` ndn:/localhost/nfd/strategy/access * `ndn:/localhost/nfd/strategy/asf` ndn:/localhost/nfd/strategy/asf * `ndn:/localhost/nfd/strategy/multicast` ndn:/localhost/nfd/strategy/multicast * `ndn:/localhost/nfd/strategy/self-learning` ndn:/localhost/nfd/strategy/self-learning * ndn:/localhost/nfd/strategy/ncc Each strategy listed above may have one or more versions. The strategy Strategy version is increased when there is a major behavior change; bug fixes bugfixes usually will not won't bump the strategy version. The version component is appended to the strategy name. 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. ## Control Commands [[ControlCommand]] **management-module**: `strategy-choice` ### Set the strategy for a namespace **command-verb**: `set` ControlParameters fields: * Name (required) * Strategy (required) *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. *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. If *Strategy* does not match any registered strategy, the command fails with code 404. In case of error during strategy initialization (such as unacceptable parameter), the command fails with code 409. If the command succeeds, \<Body> in ControlResponse block contains the updated ControlParameters: * Name: unchanged * Strategy: strategy instance name, which always contains a version component and MAY contain the parameters' name components ### Unset the strategy for a namespace **command-verb**: `unset` ControlParameters fields: * Name (required) After this operation, the effective strategy at *Name* is inherited from the parent. If there is no strategy defined at *Name*, this command does nothing nothing, but is still considered successful. *Name* MUST NOT be `ndn:/`, otherwise the command fails with code 400. ## Strategy Choice Dataset Strategy choices for namespaces are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/strategy-choice/list`. Each choice is represented by a **StrategyChoice** element: StrategyChoice = STRATEGY-CHOICE-TYPE TLV-LENGTH Name Strategy * **Name** is the namespace on which a strategy is chosen. * **Strategy** is the strategy chosen for this namespace. ## TLV-TYPE assignments Type | Assigned value | Assigned value (hex) ------------------------------------------- | ----------------- | -------------------- StrategyChoice | 128 | 0x80