CsMgmt » History » Version 12
Davide Pesavento, 02/09/2018 02:24 PM
1 | 1 | Junxiao Shi | # Content Store Management |
---|---|---|---|
2 | |||
3 | 12 | Davide Pesavento | {{toc}} |
4 | |||
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 | * NCsEntries (optional): maximum number of entries to erase, default is 1. |
||
51 | |||
52 | 10 | Davide Pesavento | This command causes the forwarder to erase up to *NCsEntries* CS entries under the specified name prefix *Name*. |
53 | 9 | Junxiao Shi | If the command succeeds, \<Body> in ControlResponse block contains updated ControlParameters indicating the result: |
54 | |||
55 | * Name (required) |
||
56 | * Capacity (optional): upper bound of *NCsEntries*, included only when the upper bound is exceeded. |
||
57 | * NCsEntries (required): actual number of erased entries. |
||
58 | |||
59 | 11 | Davide Pesavento | If there are no CS entries under the specified name prefix, the command does nothing but is still considered successful. |
60 | 9 | Junxiao Shi | |
61 | 10 | Davide Pesavento | A forwarder MAY impose an upper bound on *NCsEntries*. This upper bound MUST NOT be zero. If *NCsEntries* in a request exceeds the upper bound, the forwarder erases entries until reaching the upper bound, responds with status code 206, and includes the upper bound in the *Capacity* field of the response body. The current upper bound in NFD is 64 entries. |
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 | 1 | Junxiao Shi | CsInfo ::= CS-INFO-TYPE TLV-LENGTH |
68 | 5 | Junxiao Shi | Capacity |
69 | Flags |
||
70 | 7 | Junxiao Shi | NCsEntries |
71 | 3 | Junxiao Shi | NHits |
72 | 1 | Junxiao Shi | 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 | 6 | Yanbiao Li | 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 | ## TLV-TYPE assignments |
||
92 | |||
93 | Type | Assigned number | Assigned number (hex) |
||
94 | 1 | Junxiao Shi | ------------------------------------------- | ----------------- | --------------------- |
95 | CsInfo | 128 | 0x80 |
||
96 | 5 | Junxiao Shi | Capacity | 131 | 0x83 |
97 | Flags | 108 | 0x6c |
||
98 | 7 | Junxiao Shi | NCsEntries | 135 | 0x87 |
99 | 2 | Junxiao Shi | NHits | 129 | 0x81 |
100 | NMisses | 130 | 0x82 |