Project

General

Profile

CsMgmt » History » Version 9

Junxiao Shi, 02/08/2018 05:48 PM

1 1 Junxiao Shi
# Content Store Management
2
3
**Content Store Management** is a module of [[Management|NFD Management protocol]].
4
It provides commands and datasets about the Content Store and its usage in forwarding.
5
6
Content Store Management commands and datasets are available under namespace `ndn:/localhost/nfd/cs`.
7
8
## Control Commands
9
10 2 Junxiao Shi
[[ControlCommand]] **management-module**: `cs`
11 1 Junxiao Shi
12
### Update config
13
14
**command-verb**: `config`
15
16 5 Junxiao Shi
This command updates CS configuration.
17
To discover the current configuration, either retrieve the CS Information Dataset, or send an empty `config` command.
18 1 Junxiao Shi
19 5 Junxiao Shi
ControlParameters fields:
20
21 8 Junxiao Shi
* Capacity (optional): maximum number of CS entries.
22 1 Junxiao Shi
* Flags (optional): CS enablement flags (see below).
23 9 Junxiao Shi
* Mask (optional): must be specified if Flags is present, or omitted if Flags is omitted.
24 5 Junxiao Shi
25
Flags is an inclusive OR of CS enablement flags.
26
1=CS\_ENABLE\_ADMIT, enables the CS to admit new Data.
27
2=CS\_ENABLE\_SERVE, enables the CS to satisfy Interests using cached Data.
28
The initial value of the CS is CS\_ENABLE\_ADMIT | CS\_ENABLE\_SERVE.
29
30
If all fields are omitted, the command has no effect but is still considered successful.
31
32
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters reflecting current configuration:
33
34
* Capacity (required)
35
* Flags (required)
36
37
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.
38
39 1 Junxiao Shi
### Erase entry
40
41
**command-verb**: `erase`
42
43 9 Junxiao Shi
This command erases entries from the CS.
44
45
ControlParameters fields:
46
47
* Name (required): name prefix to start erasing.
48
* NCsEntries (optional): maximum number of entries to erase, default is 1.
49
50
This command causes NFD to erase up to *NCsEntries* CS entries under the specified name prefix *Name*.
51
If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters indicating the result:
52
53
* Name (required)
54
* Capacity (optional): upper bound of *NCsEntries*, included only when the upper bound is exceeded.
55
* NCsEntries (required): actual number of erased entries.
56
57
If there is no CS entry under the specified name prefix, the command does nothing but is still considered successful.
58
59
NFD MAY impose a upper bound on *NCsEntries*. This upper bound MUST NOT be zero. If *NCsEntries* in a request exceeds the upper bound, NFD erases entries until reaching the upper bound, responds with status code 206, and includes the upper bound in *Capacity* field of the response body. The current upper bound is 64 entries.
60 1 Junxiao Shi
61
## CS Information Dataset
62
63
CS config and runtime performance are published as a [[StatusDataset|Status Dataset]] at `ndn:/localhost/nfd/cs/info`.
64 3 Junxiao Shi
65 1 Junxiao Shi
    CsInfo ::= CS-INFO-TYPE TLV-LENGTH
66 5 Junxiao Shi
                 Capacity
67
                 Flags
68 7 Junxiao Shi
                 NCsEntries
69 3 Junxiao Shi
                 NHits
70 1 Junxiao Shi
                 NMisses
71 2 Junxiao Shi
72 1 Junxiao Shi
    (TLVs have nonNegativeInteger as value)
73
74 5 Junxiao Shi
Note to future protocol designers: in CsInfo element, fields that reflect configuration shall be placed before fields that reflect runtime counters.
75 1 Junxiao Shi
76 5 Junxiao Shi
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.
77
78 1 Junxiao Shi
## CS Enumeration
79
80
A subset of CS entries can be queried into a [[StatusDataset|Status Dataset]] under `ndn:/localhost/nfd/cs/query`.
81
82 6 Yanbiao Li
    CsQuery ::= CS-QUERY-TYPE TLV-LENGTH
83
                    Name
84
                    PacketSize
85
                    FreshnessPeriod
86 1 Junxiao Shi
87 6 Yanbiao Li
    (TLVs have nonNegativeInteger as value)
88 2 Junxiao Shi
89
## TLV-TYPE assignments
90
91
Type                                        | Assigned number   | Assigned number (hex)
92 1 Junxiao Shi
------------------------------------------- | ----------------- | ---------------------
93
CsInfo                                      | 128               | 0x80
94 5 Junxiao Shi
Capacity                                    | 131               | 0x83
95
Flags                                       | 108               | 0x6c
96 7 Junxiao Shi
NCsEntries                                  | 135               | 0x87
97 2 Junxiao Shi
NHits                                       | 129               | 0x81
98
NMisses                                     | 130               | 0x82