blob: e028df5353dc0c9d65004421c55850aead97e711 [file] [log] [blame]
Junxiao Shi6c135622016-11-21 14:30:33 +00001nfdc-strategy
2=============
3
Davide Pesavento543b1522024-06-25 17:00:32 -04004Synopsis
Junxiao Shi6c135622016-11-21 14:30:33 +00005--------
Junxiao Shi6c135622016-11-21 14:30:33 +00006
Davide Pesavento543b1522024-06-25 17:00:32 -04007| **nfdc strategy** [**list**]
8| **nfdc strategy** **show** [**prefix**] *PREFIX*
9| **nfdc strategy** **set** [**prefix**] *PREFIX* [**strategy**] *STRATEGY*
10| **nfdc strategy** **unset** [**prefix**] *PREFIX*
11
12Description
Junxiao Shi6c135622016-11-21 14:30:33 +000013-----------
Davide Pesavento543b1522024-06-25 17:00:32 -040014
Junxiao Shi6c135622016-11-21 14:30:33 +000015In NFD, packet forwarding behavior is determined by forwarding pipelines and forwarding strategies.
16The forwarding pipelines define general steps of packet processing.
17Forwarding strategies provide the intelligence to make decision on whether, when, and where
18to forward Interests.
19
20NFD contains multiple forwarding strategy implementations.
21The strategy choice table determines which strategy is used in forwarding an Interest.
22
Junxiao Shi5d3e4812017-04-05 16:52:59 +000023The **nfdc strategy list** command shows a list of strategy choices.
24
25The **nfdc strategy show** command shows the effective strategy choice for a specific name.
Junxiao Shi6c135622016-11-21 14:30:33 +000026
Junxiao Shib283f522017-04-06 20:46:15 +000027The **nfdc strategy set** command sets the strategy for a name prefix.
Davide Pesavento543b1522024-06-25 17:00:32 -040028The strategy for the ``"/"`` prefix is the default strategy.
Junxiao Shi6c135622016-11-21 14:30:33 +000029
Junxiao Shib283f522017-04-06 20:46:15 +000030The **nfdc strategy unset** command clears the strategy choice at a name prefix,
Junxiao Shi6c135622016-11-21 14:30:33 +000031so that a strategy choice at a shorter prefix or the default strategy will be used.
Junxiao Shib283f522017-04-06 20:46:15 +000032It undoes a prior **nfdc strategy set** command on the same name prefix.
Davide Pesavento543b1522024-06-25 17:00:32 -040033It is prohibited to unset the strategy choice for the ``"/"`` prefix because there must always be
34a default strategy.
Junxiao Shi6c135622016-11-21 14:30:33 +000035
Davide Pesavento543b1522024-06-25 17:00:32 -040036Options
Junxiao Shi6c135622016-11-21 14:30:33 +000037-------
Davide Pesavento543b1522024-06-25 17:00:32 -040038
39.. option:: <PREFIX>
40
Junxiao Shi6c135622016-11-21 14:30:33 +000041 The name prefix of a strategy choice.
42 The strategy choice is effective for all Interests under the name prefix,
Junxiao Shib283f522017-04-06 20:46:15 +000043 unless overridden by another strategy choice at a longer prefix.
Junxiao Shi6c135622016-11-21 14:30:33 +000044
Davide Pesavento543b1522024-06-25 17:00:32 -040045.. option:: <STRATEGY>
46
Junxiao Shi6c135622016-11-21 14:30:33 +000047 A name that identifies the forwarding strategy.
Davide Pesavento543b1522024-06-25 17:00:32 -040048 Consult the NFD Developer's Guide for a complete list of all implemented strategies.
Junxiao Shi6c135622016-11-21 14:30:33 +000049
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040050 For the ASF, BestRoute, and Multicast strategies, the following options may be supplied
51 to configure exponential retransmission suppression by appending them after the strategy
52 name and version number.
53
Davide Pesavento543b1522024-06-25 17:00:32 -040054 retx-suppression-initial
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040055 Starting duration of the suppression interval within which any retransmitted
56 Interests are considered for suppression. The default value is 10 ms.
57
58 Format: ``retx-suppression-initial~<milliseconds>``
59
Davide Pesavento543b1522024-06-25 17:00:32 -040060 retx-suppression-max
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040061 Maximum duration of the suppression interval. Must not be smaller than
62 **retx-suppression-initial**. The default value is 250 ms.
63
64 Format: ``retx-suppression-max~<milliseconds>``
65
Davide Pesavento543b1522024-06-25 17:00:32 -040066 retx-suppression-multiplier
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -040067 The suppression interval is increased by this multiplier. The default value is 2.
68
69 Format: ``retx-suppression-multiplier~<float>``
70
71 See :manpage:`nfd-asf-strategy(7)` for details on additional parameters for ASF strategy.
72
Davide Pesavento543b1522024-06-25 17:00:32 -040073Exit Status
74-----------
Junxiao Shi5d3e4812017-04-05 16:52:59 +000075
Davide Pesavento543b1522024-06-25 17:00:32 -0400760
77 Success.
Junxiao Shi5d3e4812017-04-05 16:52:59 +000078
Davide Pesavento543b1522024-06-25 17:00:32 -0400791
80 An unspecified error occurred.
Junxiao Shi5d3e4812017-04-05 16:52:59 +000081
Davide Pesavento543b1522024-06-25 17:00:32 -0400822
83 Malformed command line.
Junxiao Shib283f522017-04-06 20:46:15 +000084
Davide Pesavento543b1522024-06-25 17:00:32 -0400857
86 Strategy not found (**nfdc strategy set** only).
87
88Examples
Junxiao Shi0e13e1e2018-01-22 08:29:12 +000089--------
Davide Pesavento543b1522024-06-25 17:00:32 -040090
91``nfdc strategy list``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +000092 List all configured strategy choices.
93
Davide Pesavento543b1522024-06-25 17:00:32 -040094``nfdc strategy show prefix /localhost/ping/1``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +000095 Identify which strategy will handle Interests named "/localhost/ping/1".
96
Davide Pesavento543b1522024-06-25 17:00:32 -040097``nfdc strategy set prefix / strategy /localhost/nfd/strategy/best-route``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +000098 Set the default strategy to best-route, latest version.
99
Davide Pesavento543b1522024-06-25 17:00:32 -0400100``nfdc strategy set prefix /ndn strategy /localhost/nfd/strategy/multicast/v=4``
Eric Newberry7249fb42021-04-04 21:09:32 -0700101 Set the strategy for the "/ndn" prefix to multicast, version 4.
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000102
Davide Pesavento543b1522024-06-25 17:00:32 -0400103``nfdc strategy set prefix /ndn strategy /localhost/nfd/strategy/multicast/v=4/retx-suppression-initial~20/retx-suppression-max~500``
Ashlesh Gawande1ef93d02022-04-08 00:25:06 -0400104 Set the strategy for the "/ndn" prefix to multicast, version 4, with retransmission
105 suppression initial interval set to 20 ms and maximum interval set to 500 ms.
106
Davide Pesavento543b1522024-06-25 17:00:32 -0400107``nfdc strategy unset prefix /ndn``
Junxiao Shi0e13e1e2018-01-22 08:29:12 +0000108 Clear the strategy choice for the "/ndn" prefix.
109
Davide Pesavento543b1522024-06-25 17:00:32 -0400110See Also
Junxiao Shi6c135622016-11-21 14:30:33 +0000111--------
Davide Pesavento543b1522024-06-25 17:00:32 -0400112
113:manpage:`nfdc(1)`,
114:manpage:`nfd-asf-strategy(7)`