Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 1 | .. _data: |
| 2 | |
| 3 | Data Packet |
| 4 | ----------- |
| 5 | |
| 6 | NDN Data packet is TLV defined as follows:: |
| 7 | |
| 8 | Data ::= DATA-TLV TLV-LENGTH |
| 9 | Name |
| 10 | MetaInfo |
| 11 | Content |
| 12 | Signature |
| 13 | |
| 14 | The Data packet represents some arbitrary binary data (held in the Content element) together with its Name, some additional bits of information (MetaInfo), and a digital Signature of the other three elements. The Name is the first element since all NDN packet processing starts with the name. Signature is put at the end of the packet to ease the implementation because signature computation covers all the elements before Signature. |
| 15 | |
| 16 | Name |
| 17 | ~~~~ |
| 18 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 19 | See :ref:`Name section <Name>` for details. |
| 20 | |
| 21 | .. _MetaInfo: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 22 | |
| 23 | MetaInfo |
| 24 | ~~~~~~~~ |
| 25 | |
| 26 | .. [#f1] If both ``ContentType`` and ``FreshnessPeriod`` are optional, one may consider ``Metainfo`` itself should be optional. But would have all 4 parts of Data packet help simplify implementation? We leave this question to people who are more familiar with high speed implementations. |
| 27 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 28 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 29 | |
| 30 | MetaInfo ::= META-INFO-TYPE TLV-LENGTH |
| 31 | ContentType? |
| 32 | FreshnessPeriod? |
Alexander Afanasyev | 08f39ce | 2014-02-12 19:53:50 +0000 | [diff] [blame] | 33 | FinalBlockId? |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 34 | |
| 35 | Compared with CCNx, four fields are removed: PublisherPublicKeyDigest, ExtOpt, Timestamp, and FinalBlockID for the following reasons. |
| 36 | |
| 37 | |
| 38 | - PublisherPublicKeyDigest is supposed to be used in selecting data packets signed by a particular key. |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 39 | We replace PublisherPublicKeyDigest with KeyLocator, which is part of the Signature block (see :ref:`Signature Section <Signature>`), due to the following consideration. |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 40 | First, it requires data consumer to acquire a *valid* public key, as opposed to the key locator, before sending Interest out. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 41 | Second, if a router is to verify the content objects, it must have other means to locate the keys first. |
| 42 | Further, it may require publishers to maintain their public keys and certificates by their public key digests instead of names. |
| 43 | |
| 44 | - ExtOpt was intended for extending XML-based ccnb format. Since we are now using TLV, ExtOpt is no longer needed. |
| 45 | |
| 46 | - Timestamp and FinalBlockID can be useful meta information for applications, but do not need to be processed at the network layer. |
| 47 | Therefore, if desired, applications should encode such meta information as part of the content. |
| 48 | |
| 49 | |
| 50 | ContentType |
| 51 | +++++++++++ |
| 52 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 53 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 54 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 55 | ContentType ::= CONTENT-TYPE-TYPE TLV-LENGTH |
Alexander Afanasyev | ca58dc2 | 2013-12-28 21:04:59 +0000 | [diff] [blame] | 56 | nonNegativeInteger |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 57 | |
| 58 | Three ContentTypes are currently defined: default (=0), LINK (=1), and KEY (=2). The **default** type of content is a BLOB (=0), which is the actual data bits identified by the data name. The \textbf{LINK} type of content is another name which identifies the actual data content. The ``KEY`` type of content is a public key. |
| 59 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 60 | Compared with CCNx, three types, ENCR, GONE, and NACK are removed. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 61 | ENCR means the content is encrypted, and since the network layer should not care whether content is encrypted or not, this type is not needed. |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 62 | GONE was a placeholder for implementing cache purging, however the research is yet to be carried out on how to accomplish this goal, if it is feasible to achieve, it is not included in this 0.1 version of NDN specification. |
| 63 | NACK is used to signal a downstream node that the upstream node is unable to retrieve a matching data. Since the actual NACK mechanism is still under active investigation, we do not include it in this version of specification, but may add it back in a future version. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 64 | |
| 65 | |
| 66 | FreshnessPeriod |
| 67 | +++++++++++++++ |
| 68 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 69 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 70 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 71 | FreshnessPeriod ::= FRESHNESS-PERIOD-TLV TLV-LENGTH |
Alexander Afanasyev | ca58dc2 | 2013-12-28 21:04:59 +0000 | [diff] [blame] | 72 | nonNegativeInteger |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 73 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 74 | The optional FreshnessPeriod indicates how long a node should wait after the arrival of this data before marking it as stale. The encoded value is number of milliseconds. Note that the stale data is still valid data; the expiration of FreshnessPeriod only means that the producer may have produced newer data. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 75 | |
| 76 | Each content store associates every piece of Data with a staleness bit. |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 77 | The initial setting of this bit for newly-arrived content is "not stale". If the Data carries FreshnessPeriod, then after the Data has been residing in the content store for FreshnessPeriod, it will be marked as stale. This is per object staleness and local to the NDN node. Another possible way to set the staleness bit of a local content is for a local client to send a command to the local NDN daemon. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 78 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 79 | If an Interest contains MustBeFresh TLV, a Data that has the staleness bit set is not eligible to be sent in response to that Interest. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 80 | The effect is the same as if that stale Data did not exist (i.e., the Interest might be matched by some other Data in the store, or, failing that, get forwarded to other nodes). |
| 81 | If an exact duplicate of a stale Data arrives, the effect is the same as if the stale Data had not been present. In particular, the Data in the store is no longer stale. As a practical matter, a stale Data should be ranked high on the list of things to discard from the store when a storage quota has been reached. |
| 82 | |
Alexander Afanasyev | 08f39ce | 2014-02-12 19:53:50 +0000 | [diff] [blame] | 83 | FinalBlockId |
| 84 | ++++++++++++ |
| 85 | |
| 86 | :: |
| 87 | |
Alexander Afanasyev | a6fc727 | 2014-06-13 11:58:06 -0700 | [diff] [blame^] | 88 | FinalBlockId ::= FINAL-BLOCK-ID-TLV TLV-LENGTH |
Alexander Afanasyev | 08f39ce | 2014-02-12 19:53:50 +0000 | [diff] [blame] | 89 | NameComponent |
| 90 | |
| 91 | The optional FinalBlockId indicates the identifier of the final block |
| 92 | in a sequence of fragments. |
| 93 | It should be present in the final block itself, and may also be present in other fragments to provide advanced warning of the end to consumers. |
| 94 | The value here should be equal to the last explicit Name Component of the final block. |
| 95 | |
| 96 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 97 | .. _Content: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 98 | |
| 99 | Content |
| 100 | ~~~~~~~ |
| 101 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 102 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 103 | |
| 104 | Content ::= CONTENT-TYPE TLV-LENGTH BYTE* |