Project

General

Profile

CsMgmt » History » Version 19

Davide Pesavento, 06/03/2020 05:33 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
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 11 Davide Pesavento
*Flags* is the inclusive OR of the following CS enablement flags:
28
  1=`CS_ENABLE_ADMIT`, enables the CS to admit new Data.
29
  2=`CS_ENABLE_SERVE`, enables the CS to satisfy Interests using cached Data.
30
The initial value of *Flags* in NFD's CS is equivalent to `CS_ENABLE_ADMIT` | `CS_ENABLE_SERVE`.
31 5 Junxiao Shi
32
If all fields are omitted, the command has no effect but is still considered successful.
33
34
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters reflecting current configuration:
35
36
* Capacity (required)
37
* Flags (required)
38
39 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.
40 5 Junxiao Shi
41 11 Davide Pesavento
### Erase entries
42 1 Junxiao Shi
43
**command-verb**: `erase`
44
45 9 Junxiao Shi
This command erases entries from the CS.
46
47
ControlParameters fields:
48
49
* Name (required): name prefix to start erasing.
50 17 Davide Pesavento
* Count (optional): maximum number of entries to erase, must not be zero; if omitted, indicates "no limit".
51 1 Junxiao Shi
52 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.
53
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.
54 15 Junxiao Shi
55 1 Junxiao Shi
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters indicating the result:
56 9 Junxiao Shi
57
* Name (required)
58 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.
59
* Count (required): actual number of erased entries.
60 9 Junxiao Shi
61 10 Davide Pesavento
If there are no CS entries under the specified name prefix, the command does nothing but is still considered successful.
62 1 Junxiao Shi
63
## CS Information Dataset
64
65 11 Davide Pesavento
The CS configuration and runtime performance are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/cs/info`.
66 3 Junxiao Shi
67 19 Davide Pesavento
    CsInfo = CS-INFO-TYPE TLV-LENGTH
68
               Capacity
69
               Flags
70
               NCsEntries
71
               NHits
72
               NMisses
73 2 Junxiao Shi
74 1 Junxiao Shi
    (TLVs have nonNegativeInteger as value)
75
76 5 Junxiao Shi
Note to future protocol designers: in CsInfo element, fields that reflect configuration shall be placed before fields that reflect runtime counters.
77 1 Junxiao Shi
78 11 Davide Pesavento
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.
79 5 Junxiao Shi
80 1 Junxiao Shi
## CS Enumeration
81
82
A subset of CS entries can be queried into a [[StatusDataset|Status Dataset]] under `ndn:/localhost/nfd/cs/query`.
83
84 19 Davide Pesavento
    CsQuery = CS-QUERY-TYPE TLV-LENGTH
85
                Name
86
                PacketSize
87
                FreshnessPeriod
88 1 Junxiao Shi
89 6 Yanbiao Li
    (TLVs have nonNegativeInteger as value)
90 2 Junxiao Shi
91 1 Junxiao Shi
## TLV-TYPE assignments
92 2 Junxiao Shi
93
Type                                        | Assigned number   | Assigned number (hex)
94
------------------------------------------- | ----------------- | ---------------------
95 1 Junxiao Shi
CsInfo                                      | 128               | 0x80
96 17 Davide Pesavento
Capacity       	       	       	       	    | 131      	       	| 0x83
97
Count  	       	       	       	            | 132               | 0x84
98
Flags  	                                    | 108               | 0x6c
99 7 Junxiao Shi
NCsEntries                                  | 135               | 0x87
100 2 Junxiao Shi
NHits                                       | 129               | 0x81
101
NMisses                                     | 130               | 0x82