blob: d17a34721d7a95e4e0f8a1f2f05bcf580bc6b0af [file] [log] [blame]
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -07001.. _packetFormat:
2
3NDNS Packet format
4==================
5
6NDNS Query
7----------
8
9Requests to the zone are made in the format of a standard NDN interest.
10
11See `Interest section <http://named-data.net/doc/ndn-tlv/interest.html>`_ for details.
12
13
14NDNS Response
15-------------
16
17NDNS Response is an ordinary `NDN-TLV Data packet <http://named-data.net/doc/ndn-tlv/data.html>`_
18with specialized ``MetaInfo`` block:
19
20::
21
22 Data ::= DATA-TLV TLV-LENGTH
23 Name
24 MetaInfo (= NdnsMetaInfo)
25 Content
26 Signature
27
28Every response from the NDNS system comes in the same generic form.
29Specialization of different types of NDNS responses is accomplished through
30``NDNS Type`` field of MetaInfo.
31
32See :ref `NDNS Type section` <NDNS-Type> for details
33
34
35NdnsMetaInfo
36~~~~~~~~~~~~
37
38``NdnsMetaInfo`` specified here represents portions that are specified in `MetaInfo
39<http://named-data.net/doc/ndn-tlv/data.html#metainfo>`_ of any NDN-TLV Data packet with
40NDNS specific additions.
41
42::
43
44 NdnsMetaInfo ::= META-INFO-TYPE TLV-LENGTH
45 ContentType (= 0)
46 FreshnessPeriod
47 NdnsType
48 AnswerCount
49
50
51ContentType
52+++++++++++
53
54::
55
56 ContentType ::= CONTENT-TYPE-TYPE TLV-LENGTH
57 nonNegativeInteger
58
59For an NDNS packet the ``ContentType`` should always be ``BLOB`` (=0), specificity is accomplished
60by NDNS-Type.
61
62See :ref: `NDNS-Type` for details
63
64
65FreshnessPeriod
66+++++++++++++++
67
68::
69
70 FreshnessPeriod ::= FRESHNESS-PERIOD-TLV TLV-LENGTH
71 nonNegativeInteger
72
73
74``FreshnessPeriod`` is required to be present in any NDNS response Data packets. As in
75any other Data packet, it specifies how long after the arrive of the data the recieving
76node should wait before marking it stale.
77
78See `NDN Packet Specification - Freshness Period <http://named-data.net/doc/ndn-tlv/data.html#freshnessperiod>`_
79
80
81.. _NDNS-Type:
82
83NDNS-Type
84+++++++++
85
86::
87
88 NdnsType ::= NDNS-TYPE-TLV TLV-LENGTH
89 nonNegativeIntegear
90
91There are 3 distinct types of NDNS Responses:
92
93+-----------+------------------------------------------------------------------+
94| Type | Description |
95+===========+==================================================================+
96| NDNS Data | indicates an answer was found, and that contains the requested |
97| | content |
98+-----------+------------------------------------------------------------------+
99| NDNS NACK | indicates that the responding zone has no content matching the |
100| | query. |
101+-----------+------------------------------------------------------------------+
102| NDNS AUTH | indicates that the zone has content, but a more specific |
103| | question is need to determine the correct content to server. |
104+-----------+------------------------------------------------------------------+
105
106.. _AnswerCount:
107
108AnswerCount
109+++++++++++
110
111::
112
113 AnswerCount ::= ANSWER-COUNT-TLV TLV-LENGTH
114 nonNegativeIntegear
115
116This field is used to specify the number of answer in a response.
117
118
119Content
120~~~~~~~
121
122::
123
124 Content ::= CONTENT-TYPE TLV-LENGTH BYTE*