Project

General

Profile

CsMgmt » History » Version 21

Davide Pesavento, 02/02/2025 09:28 PM

1 1 Junxiao Shi
# Content Store Management
2
3 13 Davide Pesavento
{{>toc}}
4 12 Davide Pesavento
5 1 Junxiao Shi
**Content Store Management** is a module of [[Management|NFD Management protocol]].
6
It provides commands and datasets about the Content Store and its usage in forwarding.
7
8
Content Store Management commands and datasets are available under namespace `ndn:/localhost/nfd/cs`.
9
10
## Control Commands
11
12 2 Junxiao Shi
[[ControlCommand]] **management-module**: `cs`
13 1 Junxiao Shi
14 11 Davide Pesavento
### Update configuration
15 1 Junxiao Shi
16
**command-verb**: `config`
17
18 5 Junxiao Shi
This command updates CS configuration.
19 21 Davide Pesavento
To discover the current configuration, either retrieve the CS Information Dataset or send an empty `config` command.
20 1 Junxiao Shi
21 5 Junxiao Shi
ControlParameters fields:
22
23 8 Junxiao Shi
* Capacity (optional): maximum number of CS entries.
24 1 Junxiao Shi
* Flags (optional): CS enablement flags (see below).
25 11 Davide Pesavento
* Mask (optional): MUST be specified if *Flags* is present, and omitted if *Flags* is omitted.
26 5 Junxiao Shi
27 1 Junxiao Shi
*Flags* is the inclusive OR of the following CS enablement flags:
28 21 Davide Pesavento
29
* `CS_ENABLE_ADMIT` (=1): enables the CS to admit new Data.
30
* `CS_ENABLE_SERVE` (=2): enables the CS to satisfy Interests using cached Data.
31
32 1 Junxiao Shi
The initial value of *Flags* in NFD's CS is equivalent to `CS_ENABLE_ADMIT` | `CS_ENABLE_SERVE`.
33 5 Junxiao Shi
34
If all fields are omitted, the command has no effect but is still considered successful.
35
36 21 Davide Pesavento
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters reflecting the current configuration:
37 5 Junxiao Shi
38
* Capacity (required)
39
* Flags (required)
40
41 11 Davide Pesavento
Note to future protocol designers: when the CS is extended to have multiple storage tiers (such as RAM and SSD), ControlParameter shall have an optional *Name* field to indicate the storage tier being configured.
42 5 Junxiao Shi
43 11 Davide Pesavento
### Erase entries
44 1 Junxiao Shi
45
**command-verb**: `erase`
46
47 9 Junxiao Shi
This command erases entries from the CS.
48
49
ControlParameters fields:
50
51 17 Davide Pesavento
* Name (required): name prefix to start erasing.
52 1 Junxiao Shi
* Count (optional): maximum number of entries to erase, must not be zero; if omitted, indicates "no limit".
53
54 18 Davide Pesavento
This command causes the forwarder to erase CS entries under the specified name prefix *Name*. The forwarder is free to erase any entries under *Name*, and does not need to follow a particular order.
55
The number of erased entries shall not exceed *Count*, if specified. A forwarder MAY impose a non-zero upper bound on *Count*. If *Count* in a request exceeds the upper bound (including when it is omitted, i.e. "no limit"), the forwarder acts as if *Count* was set to the upper bound.
56 15 Junxiao Shi
57 21 Davide Pesavento
If the command succeeds, \<body> in ControlResponse block contains the updated ControlParameters indicating the result:
58 9 Junxiao Shi
59
* Name (required)
60 17 Davide Pesavento
* Capacity (optional): upper bound of *Count*, included only when *Count* in the request exceeds the upper bound AND there are more entries under *Name* after erasing.
61
* Count (required): actual number of erased entries.
62 9 Junxiao Shi
63 10 Davide Pesavento
If there are no CS entries under the specified name prefix, the command does nothing but is still considered successful.
64 1 Junxiao Shi
65
## CS Information Dataset
66
67 11 Davide Pesavento
The CS configuration and runtime performance are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/cs/info`.
68 3 Junxiao Shi
69 19 Davide Pesavento
    CsInfo = CS-INFO-TYPE TLV-LENGTH
70 1 Junxiao Shi
               Capacity
71 19 Davide Pesavento
               Flags
72
               NCsEntries
73
               NHits
74
               NMisses
75 2 Junxiao Shi
76 21 Davide Pesavento
    (all sub-TLVs have NonNegativeInteger as value)
77 1 Junxiao Shi
78 5 Junxiao Shi
Note to future protocol designers: in CsInfo element, fields that reflect configuration shall be placed before fields that reflect runtime counters.
79 1 Junxiao Shi
80
Note to future protocol designers: when the CS is extended to have multiple storage tiers (such as RAM and SSD), each storage tier shall have separate counters, multiple CsInfo elements appear in the dataset and each has a *Name* field as the first child to indicate the storage tier.
81
82 5 Junxiao Shi
## CS Enumeration
83 1 Junxiao Shi
84 21 Davide Pesavento
*(NOTE: this is a work in progress)*
85 1 Junxiao Shi
86 21 Davide Pesavento
A subset of CS entries can be queried as a [[StatusDataset|Status Dataset]] under `ndn:/localhost/nfd/cs/query`.
87
88 19 Davide Pesavento
    CsQuery = CS-QUERY-TYPE TLV-LENGTH
89
                Name
90
                PacketSize
91 1 Junxiao Shi
                FreshnessPeriod
92 20 Davide Pesavento
93 2 Junxiao Shi
94 1 Junxiao Shi
## TLV-TYPE assignments
95 2 Junxiao Shi
96
Type                                        | Assigned number   | Assigned number (hex)
97
------------------------------------------- | ----------------- | ---------------------
98 1 Junxiao Shi
CsInfo                                      | 128               | 0x80
99 17 Davide Pesavento
Capacity       	       	       	       	    | 131      	       	| 0x83
100
Count  	       	       	       	            | 132               | 0x84
101
Flags  	                                    | 108               | 0x6c
102 7 Junxiao Shi
NCsEntries                                  | 135               | 0x87
103 2 Junxiao Shi
NHits                                       | 129               | 0x81
104
NMisses                                     | 130               | 0x82