-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdraft-ietf-dnsop-dns-capture-format-00.txt
More file actions
2128 lines (1444 loc) · 79.6 KB
/
draft-ietf-dnsop-dns-capture-format-00.txt
File metadata and controls
2128 lines (1444 loc) · 79.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnsop J. Dickinson
Internet-Draft J. Hague
Intended status: Standards Track S. Dickinson
Expires: June 9, 2017 Sinodun IT
T. Manderson
J. Bond
ICANN
December 6, 2016
C-DNS: A DNS Packet Capture Format
draft-ietf-dnsop-dns-capture-format-00
Abstract
This document describes a data representation for collections of DNS
messages. The format is designed for efficient storage and
transmission of large packet captures of DNS traffic; it attempts to
minimize the size of such packet capture files but retain the full
DNS message contents along with the most useful transport meta data.
It is intended to assist with the development of DNS traffic
monitoring applications.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on June 9, 2017.
Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
Dickinson, et al. Expires June 9, 2017 [Page 1]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Requirements Terminology . . . . . . . . . . . . . . . . . . 4
3. Data Collection Use Cases . . . . . . . . . . . . . . . . . . 4
4. Design Considerations . . . . . . . . . . . . . . . . . . . . 6
5. C-DNS conceptual overview . . . . . . . . . . . . . . . . . . 8
6. Choice of CBOR . . . . . . . . . . . . . . . . . . . . . . . 8
7. C-DNS CBOR format . . . . . . . . . . . . . . . . . . . . . . 8
7.1. CDDL definition . . . . . . . . . . . . . . . . . . . . . 8
7.2. Format overview . . . . . . . . . . . . . . . . . . . . . 9
7.3. File header contents . . . . . . . . . . . . . . . . . . 9
7.4. File preamble contents . . . . . . . . . . . . . . . . . 10
7.5. Configuration contents . . . . . . . . . . . . . . . . . 10
7.6. Block contents . . . . . . . . . . . . . . . . . . . . . 11
7.7. Block preamble map . . . . . . . . . . . . . . . . . . . 12
7.8. Block statistics . . . . . . . . . . . . . . . . . . . . 12
7.9. Block table map . . . . . . . . . . . . . . . . . . . . . 13
7.10. IP address table . . . . . . . . . . . . . . . . . . . . 13
7.11. Class/Type table . . . . . . . . . . . . . . . . . . . . 13
7.12. Name/RDATA table . . . . . . . . . . . . . . . . . . . . 14
7.13. Query Signature table . . . . . . . . . . . . . . . . . . 14
7.14. Question table . . . . . . . . . . . . . . . . . . . . . 16
7.15. Resource Record (RR) table . . . . . . . . . . . . . . . 17
7.16. Question list table . . . . . . . . . . . . . . . . . . . 17
7.17. Resource Record list table . . . . . . . . . . . . . . . 17
7.18. Query/Response data . . . . . . . . . . . . . . . . . . . 18
7.19. Address Event counts . . . . . . . . . . . . . . . . . . 20
8. C-DNS to PCAP . . . . . . . . . . . . . . . . . . . . . . . . 21
8.1. Name Compression . . . . . . . . . . . . . . . . . . . . 22
9. Data Collection . . . . . . . . . . . . . . . . . . . . . . . 23
9.1. Matching algorithm . . . . . . . . . . . . . . . . . . . 23
9.2. Message identifiers . . . . . . . . . . . . . . . . . . . 24
9.2.1. Primary ID (required) . . . . . . . . . . . . . . . . 24
9.2.2. Secondary ID (optional) . . . . . . . . . . . . . . . 24
9.3. Algorithm Parameters . . . . . . . . . . . . . . . . . . 24
9.4. Algorithm Requirements . . . . . . . . . . . . . . . . . 24
9.5. Algorithm Limitations . . . . . . . . . . . . . . . . . . 25
9.6. Workspace . . . . . . . . . . . . . . . . . . . . . . . . 25
9.7. Output . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.8. Post Processing . . . . . . . . . . . . . . . . . . . . . 25
Dickinson, et al. Expires June 9, 2017 [Page 2]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25
11. Security Considerations . . . . . . . . . . . . . . . . . . . 25
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 25
13. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 26
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 26
14.1. Normative References . . . . . . . . . . . . . . . . . . 26
14.2. Informative References . . . . . . . . . . . . . . . . . 27
14.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Appendix A. CDDL . . . . . . . . . . . . . . . . . . . . . . . . 28
Appendix B. DNS Name compression example . . . . . . . . . . . . 33
B.1. NSD compression algorithm . . . . . . . . . . . . . . . . 34
B.2. Knot Authoritative compression algorithm . . . . . . . . 35
B.3. Observed differences . . . . . . . . . . . . . . . . . . 35
Appendix C. Comparison of Binary Formats . . . . . . . . . . . . 35
Appendix D. Sample data on the C-DNS format . . . . . . . . . . 36
D.1. Comparison to full PCAPS . . . . . . . . . . . . . . . . 36
D.2. Block size choices . . . . . . . . . . . . . . . . . . . 36
D.3. Blocking vs more simple output . . . . . . . . . . . . . 36
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 37
1. Introduction
There has long been a need to collect DNS queries and responses on
authoritative and recursive name servers for monitoring and analysis.
This data is used in a number of ways including traffic monitoring,
analyzing network attacks and DITL [ditl].
A wide variety of tools already exist to facilitate the collection of
DNS traffic data. DSC [dsc], packetq [packetq], dnscap [dnscap] and
dnstap [dnstap]. However, there is no standard exchange format for
large DNS packet captures and PCAP [pcap] or PCAP-NG [pcapng] are
typically used in practice. Such file formats can contain much
additional information not directly pertinent to DNS traffic analysis
which unnecessarily increases the capture file size.
There has also been work on using other text based formats to
describe DNS packets [I-D.daley-dnsxml], [I-D.hoffman-dns-in-json]
but these are largely aimed at producing convenient representations
of single messages.
Many DNS operators may receive 100's of thousands of queries per
second on a single name server instance so a mechanism to minimize
the storage size (and therefore upload overhead) of the data
collected is highly desirable.
This documents focusses on the problem of capturing and storing large
packet capture files of DNS traffic. with the following goals in
mind:
Dickinson, et al. Expires June 9, 2017 [Page 3]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
o Minimize the file size for storage and transmission
o Minimizing the overhead of producing the packet capture file and
the cost of any further (general purpose) compression of the file
to minimise the size
This document contains
o A discussion of the some common use cases in which such DNS data
is collected. See Section 3.
o A discussion of the major design considerations in developing an
efficient data representation for collections of DNS messages.
See Section 4.
o A definition of a CBOR [RFC7049] representation of a collection of
DNS messages. This will be referred to as the C-DNS format
(Compacted-DNS). See Section 7.
o Notes on converting C-DNS back to PCAP format. See Section 8.
o Some high level implementation considerations for applications
designed to produce C-DNS, e.g. a query response matching
algorithm. See Section 9.
2. Requirements Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119].
3. Data Collection Use Cases
In an ideal world it would be optimal to collect full packet captures
of all packets going in or out of a name server. However, there are
several design choices or other limitations that are common to many
DNS installations and operators.
o Servers are hosted in a variety of situations
* Operator self hosted servers
* Third party hosting (including multiple third parties)
* Third party hardware (including multiple third parties)
o Data is collected under different conditions
Dickinson, et al. Expires June 9, 2017 [Page 4]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
* On well provisioned servers running in a steady state.
* On heavily loaded servers
* On virtualized servers
* On servers that are under attack
* On servers that are unwitting intermediaries in attacks
o Traffic can be collected via a variety of mechanisms
* On the same hardware as the name server itself
* Using a network tap to listen in from another server
* Using port mirroring to listen in from another server
o The capabilities of data collection (and upload) networks vary
* Out-of-band networks with the same capacity as the in-band
network
* Out-of-band networks with less capacity than the in-band
network
* Everything on the in-band network
Clearly, there is a wide range of use cases from very limited data
collection environments (third party hardware, servers that are under
attack, packet capture on the name server itself and no out-of-band
network) to 'limitless' environments (self hosted, well provisioned
servers, using a network tap or port mirroring with an out-of-band
networks with the same capacity as the in-band network). In the
former, it is unfeasible to reliably collect full PCAPS especially if
the server is under attack. In the latter case, collection of full
PCAPs may be reasonable.
As a result of these restrictions the data format discussed below was
designed with the most limited use case in mind such that
o Data collection will occur on the same hardware as the name server
itself.
o Collected data will be stored on the same hardware as the name
server itself, at least temporarily.
Dickinson, et al. Expires June 9, 2017 [Page 5]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
o Collected data being returned to some central analysis system will
use the same network interface as the DNS queries and responses.
o There are multiple third party servers involved.
and therefore minimal storage size of the capture files is a major
factor.
Another consideration for any application that records DNS traffic is
that the running of the name server software and the transmission of
DNS queries and responses is the most important job of a name server.
Any data collection system co-located with the name server will need
to be intelligent enough to carefully manage its CPU, disk, memory
and network utilization. Hence this use case benefits from a format
that has a relatively low overhead to produce and minimizes the
requirement for further potentially costly compression.
However, it was also essential that interoperability with less
restricted infrastructure was maintained. In particular it is highly
desirable that the resulting collection format should facilitate the
re-creation of common formats (such as PCAPs) that are as close to
the original as is realistic given the restrictions above.
4. Design Considerations
This section presents some of the major design considerations used in
the development of the C-DNS format.
o The basic unit of data is a combined DNS Query and the associated
Response (a 'Q/R data item'). The same structure will be used for
unmatched queries and responses. Queries without responses will
be captured omitting the Response data. Responses without queries
will be captured omitting the Query data (but using the Query
section from the Response, if present, as an identifying QNAME).
Rationale: A Query and Response represents the basic level of a
clients interaction with the server. Also, combining the Query and
Response into one item lowers storage requirements due to commonality
in the data in most cases.
o Each Q/R data item will comprise a default Q/R data description
and a set of optional sections. Inclusion of optional sections
shall be configurable.
Rationale: Different users will have different requirements for data
to be available for analysis. Users with minimal requirements should
not have to pay the cost of recording full data, however this will
limit the ability to reconstruct PCAPS. For example omitting the
Dickinson, et al. Expires June 9, 2017 [Page 6]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
Resource Records from a Response will reduce the files size, and in
principle responses can be synthesized if there is enough context.
o Multiple Q/R items will be collected into blocks in the format.
Common data in a block will be abstracted and referenced from
individual Q/R items by indexing. The maximum number of Q/R items
in a block will be configurable.
Rationale: This blocking and indexing provides a significant
reduction in the volume of file data generated. Whilst introducing
complexity it provides compression of the data that makes use of
knowledge of the DNS packet structure.
[TODO: Further discussion on commonality between DNS packets e.g.
o common query signatures
o for the authoritative case there are a finite set of valid
responses and much commonality in NXDOMAIN responses]
It is anticipated that the files produced will be subject to further
compression using general purpose compression tools. Measurements
show that blocking significantly reduces the CPU required to perform
such strong compression. See Appendix D.
o Meta-data about other packets received should also be included in
each block. For example counts of malformed DNS packets and non-
DNS packets (e.g. ICMP, TCP resets) sent to the server are of
interest.
It should be noted that any structured capture format that does not
capture the DNS payload byte for byte will likely be limited to some
extent in that it cannot represent 'malformed' DNS packets. Only
those packets that can be transformed reasonably into the structured
format can be represented by it. So if a query is malformed this
will lead to the (well formed) DNS responses with error code FORMERR
appearing as 'unmatched'.
[TODO: Need further discussion of well-formed vs malformed packets
and how name servers view this definition.]
[TODO: Need to develop optional representation of malformed packets
within CBOR and what this means for packet matching. This may
influence which fields are optional in the rest of the
representation.]
Packets such as those described above can be separately recorded in a
PCAP file for later analysis.
Dickinson, et al. Expires June 9, 2017 [Page 7]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
5. C-DNS conceptual overview
The following figures show purely schematic representations of the
C-DNS format to convey the high-level structure of the C-DNS format.
Section 7 provides a detailed discussion of the CBOR representation
and individual elements.
Figure showing the C-DNS format (PNG) [1]
Figure showing the C-DNS format (SVG) [2]
Figure showing the Q/R data item and Block tables format (PNG) [3]
Figure showing the Q/R data item and Block tables format (SVG) [4]
6. Choice of CBOR
This document presents a detailed format description using CBOR, the
Concise Binary Object Representation defined in [RFC7049].
The choice of CBOR was made taking a number of factors into account.
o CBOR is a binary representation, and so economical in storage
space.
o Other similar representations were investigated, and whilst all
had attractive features, none had a significant advantage over
CBOR. See Appendix C and Appendix D - for some discussion of
this.
o CBOR is an IETF Standard and familiar to IETF participants, and
being based on the successful JSON text format, requires very
little familiarization for those in the wider industry.
o CBOR can also be easily converted to JSON for debugging and other
human inspection requirements.
o CBOR data schemas can be described using CDDL
[I-D.greevenbosch-appsawg-cbor-cddl].
7. C-DNS CBOR format
7.1. CDDL definition
The CDDL definition for the C-DNS format is given in Appendix A.
Dickinson, et al. Expires June 9, 2017 [Page 8]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
7.2. Format overview
A C-DNS file begins with a file header containing a file type
identifier and preamble. The preamble contains information on the
collection settings.
This is followed by a series of data blocks.
A block consists of a block header, containing various tables of
common data, and some statistics for the traffic received over the
block. The block header is then followed by a list of the Q/R pairs
detailing the queries and responses received during the block. The
list of Q/R pairs is in turn followed by a list of per-client counts
of particular IP events that occurred during collection of the block
data.
The exact nature of the DNS data will affect what block size is the
best fit, however sample data for a root server indicated that block
sizes in the low 1000's give good results. See Appendix D.2 for more
details.
If no field type is specified then the field is unsigned.
In the following
o For all quantities that contain bit flags, bit 0 indicates the
least significant bit.
o Items described as indexes are the index of the data item in the
referenced table. Indexes are 1-based. An index value of 0 is
reserved to mean not present.
7.3. File header contents
The file header contains the following:
+-------------+---------------+-------------------------------------+
| Field | Type | Description |
+-------------+---------------+-------------------------------------+
| File type | Text string | String identifying the file type |
| ID | | |
| | | |
| File | Map of items | Collection information for the |
| preamble | | whole file. |
| | | |
| File Blocks | Array of | The data blocks |
| | Blocks | |
+-------------+---------------+-------------------------------------+
Dickinson, et al. Expires June 9, 2017 [Page 9]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
7.4. File preamble contents
The file preamble contains the following:
+---------------+----------+----------------------------------------+
| Field | Type | Description |
+---------------+----------+----------------------------------------+
| Format | Unsigned | Indicates version of format used in |
| version | | file. |
| | | |
| Configuration | Map of | The collection configuration. |
| | items | Optional. |
| | | |
| Generator ID | Text | String identifying the collection |
| | string | program. Optional. |
| | | |
| Host ID | Text | String identifying the collecting |
| | string | host. Blank if converting an existing |
| | | PCAP file. Optional. |
+---------------+----------+----------------------------------------+
7.5. Configuration contents
The collection configuration contains the following items. All are
optional.
+-------------+----------+------------------------------------------+
| Field | Type | Description |
+-------------+----------+------------------------------------------+
| Query | Unsigned | To be matched with a query, a response |
| timeout | | must arrive within this number of |
| | | seconds. |
| | | |
| Skew | Unsigned | The network stack may report a response |
| timeout | | before the corresponding query. A |
| | | response is not considered to be missing |
| | | a query until after this many micro- |
| | | seconds. |
| | | |
| Snap length | Unsigned | Collect up to this many bytes per |
| | | packet. |
| | | |
| Promiscuous | Unsigned | 1 if promiscuous mode was enabled on the |
| mode | | interface, 0 otherwise. |
| | | |
| Interfaces | Array of | Identifiers of the interfaces used for |
| | text | collection. |
| | strings | |
Dickinson, et al. Expires June 9, 2017 [Page 10]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
| | | |
| VLAN IDs | Array of | Identifiers of VLANs selected for |
| | unsigned | collection. |
| | | |
| Filter | Text | "tcpdump" [pcap] style filter for input. |
| | string | |
| | | |
| Query | Unsigned | Bit flags indicating sections in Query |
| collection | | packets to be collected. |
| options | | |
| | | Bit 0. Collect second and subsequent |
| | | question sections. |
| | | Bit 1. Collect Answer sections. |
| | | Bit 2. Collect Authority sections. |
| | | Bit 3. Collection Additional sections. |
| | | |
| Response | Unsigned | Bit flags indicating sections in |
| collection | | Response packets to be collected. |
| options | | |
| | | Bit 0. Collect second and subsequent |
| | | question sections. |
| | | Bit 1. Collect Answer sections. |
| | | Bit 2. Collect Authority sections. |
| | | Bit 3. Collection Additional sections. |
| | | |
| Accept RR | Array of | A set of RR type names [rrtypes]. If not |
| types | text | empty, only the nominated RR types are |
| | strings | collected. |
| | | |
| Ignore RR | Array of | A set of RR type names [rrtypes]. If not |
| types | text | empty, all RR types are collected except |
| | strings | those listed. If present, this item must |
| | | be empty if a non-empty list of Accept |
| | | RR types is present. |
+-------------+----------+------------------------------------------+
7.6. Block contents
Each block contains the following:
Dickinson, et al. Expires June 9, 2017 [Page 11]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
+-------------+------------------+----------------------------------+
| Field | Type | Description |
+-------------+------------------+----------------------------------+
| Block | Map of items | Overall information for the |
| preamble | | block. |
| | | |
| Block | Map of | Statistics about the block. |
| statistics | statistics | |
| | | |
| Block | Map of tables | The tables containing data |
| tables | | referenced by individual Q/R |
| | | entries. |
| | | |
| Q/Rs | Array of Q/Rs | Details of individual Q/R pairs. |
| | | |
| Address | Array of Address | Per client counts of ICMP |
| Event | Event counts | messages and TCP resets. |
| Counts | | |
+-------------+------------------+----------------------------------+
7.7. Block preamble map
The block preamble map contains overall information for the block.
+-----------+----------+--------------------------------------------+
| Field | Type | Description |
+-----------+----------+--------------------------------------------+
| Timestamp | Array of | A timestamp for the earliest record in the |
| | unsigned | block. The timestamp is specified as a |
| | | CBOR array with two elements as in Posix |
| | | struct timeval. The first element is an |
| | | unsigned integer time_t and the second is |
| | | an unsigned integer number of |
| | | microseconds. The latter is always a value |
| | | between 0 and 999,999. |
+-----------+----------+--------------------------------------------+
[TODO: Extend to support pico/nano. Also do this for Time offset and
Response delay]
7.8. Block statistics
[TODO: Add block statistics]
Dickinson, et al. Expires June 9, 2017 [Page 12]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
7.9. Block table map
The block table map contains the block tables. Each element, or
table, is an array. The following tables detail the contents of each
block table.
The Present column in the following tables indicates the
circumstances when an optional field will be present. A Q/R pair may
be:
o A Query plus a Response.
o A Query without a Response.
o A Response without a Query.
Also:
o A Query and/or a Response may contain an OPT section.
o A Question may or may not be present. If the Query is available,
the Question section of the Query is used. If no Query is
available, the Question section of the Response is used. Unless
otherwise noted, a Question refers to the first Question in the
Question section.
So, for example, a field listed with a Present value of QUERY is
present whenever the Q/R pair contains a Query. If the pair contains
a Response only, the field will not be present.
7.10. IP address table
This table holds all client and server IP addresses in the block.
Each item in the table is a single IP address.
+---------+--------+------------------------------------------------+
| Field | Type | Description |
+---------+--------+------------------------------------------------+
| Address | Byte | The IP address, in network byte order. The |
| | string | string is 4 bytes long for an IPv4 address, 16 |
| | | bytes long for an IPv6 address. |
+---------+--------+------------------------------------------------+
7.11. Class/Type table
This table holds pairs of RR CLASS and TYPE values. Each item in the
table is a CBOR map.
Dickinson, et al. Expires June 9, 2017 [Page 13]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
+-------+--------------+
| Field | Description |
+-------+--------------+
| Class | CLASS value. |
| | |
| Type | TYPE value. |
+-------+--------------+
[TODO: Can this be optimized? Should a class of IN be inferred if
not present?]
7.12. Name/RDATA table
This table holds the contents of all NAME or RDATA items in the
block. Each item in the table is the content of a single NAME or
RDATA.
+-------+--------+--------------------------------------------------+
| Field | Type | Description |
+-------+--------+--------------------------------------------------+
| Data | Byte | The NAME or RDATA contents. NAMEs, and labels |
| | string | within RDATA contents, are in uncompressed label |
| | | format. |
+-------+--------+--------------------------------------------------+
7.13. Query Signature table
This table holds elements of the Q/R data that are often common to
between different individual Q/R records. Each item in the table is
a CBOR map. Each item in the map has an unsigned value and an
unsigned key.
The following abbreviations are used in the Present (P) column
o Q = QUERY
o A = Always
o QT = QUESTION
o QO = QUERY, OPT
o QR = QUERY & RESPONSE
o R = RESPONSE
+------------+----+-------------------------------------------------+
| Field | P | Description |
Dickinson, et al. Expires June 9, 2017 [Page 14]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
+------------+----+-------------------------------------------------+
| Server | A | The index in the IP address table of the server |
| address | | IP address. |
| | | |
| Server | A | The server port. |
| port | | |
| | | |
| Transport | A | Bit flags describing the protocol used to |
| flags | | service the query. Bit 0 is the least |
| | | significant bit. |
| | | Bit 0. Transport type. 0 = UDP, 1 = TCP. |
| | | Bit 1. IP type. 0 = IPv4, 1 = IPv6. |
| | | |
| Q/R | A | Bit flags indicating information present in |
| signature | | this Q/R pair. Bit 0 is the least significant |
| flags | | bit. |
| | | Bit 0. 1 if a Query is present. |
| | | Bit 1. 1 if a Response is present. |
| | | Bit 2. 1 if one or more Question is present. |
| | | Bit 3. 1 if a Query is present and it has an |
| | | OPT Resource Record. |
| | | Bit 4. 1 if a Response is present and it has an |
| | | OPT Resource Record. |
| | | Bit 5. 1 if a Response is present but has no |
| | | Question. |
| | | |
| Query | Q | Query OPCODE. |
| OPCODE | | |
| | | |
| Q/R DNS | A | Bit flags with values from the Query and |
| flags | | Response DNS flags. Bit 0 is the least |
| | | significant bit. Flag values are 0 if the Query |
| | | or Response is not present. |
| | | Bit 0. Query Checking Disabled (CD) flag. |
| | | Bit 1. Query Authenticated Data (AD) flag. |
| | | Bit 2. Query reserved (Z) flag. |
| | | Bit 3. Query Recursion Available (RA) flag. |
| | | Bit 4. Query Recursion Desired (RD) flag. |
| | | Bit 5. Query TrunCation (TC) flag. |
| | | Bit 6. Query Authoritative Answer (AA) flag. |
| | | Bit 7. Query DNSSEC answer OK (D0) flag. |
| | | Bit 8. Response Checking Disabled (CD) flag. |
| | | Bit 9. Response Authenticated Data (AD) flag. |
| | | Bit 10. Response reserved (Z) flag. |
| | | Bit 11. Response Recursion Available (RA) flag. |
| | | Bit 12. Response Recursion Desired (RD) flag. |
| | | Bit 13. Response TrunCation (TC) flag. |
| | | Bit 14. Response Authoritative Answer (AA) |
Dickinson, et al. Expires June 9, 2017 [Page 15]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
| | | flag. |
| | | |
| Query | Q | Query RCODE. If the Query contains OPT, this |
| RCODE | | value incorporates any EXTENDED_RCODE_VALUE. |
| | | |
| Question | QT | The index in the Class/Type table of the CLASS |
| Class/Type | | and TYPE of the first Question. |
| | | |
| Question | QT | The QDCOUNT in the Query, or Response if no |
| QDCOUNT | | Query present. |
| | | |
| Query | Q | Query ANCOUNT. |
| ANCOUNT | | |
| | | |
| Query | Q | Query ARCOUNT. |
| ARCOUNT | | |
| | | |
| Query | Q | Query NSCOUNT. |
| NSCOUNT | | |
| | | |
| Query EDNS | QO | The Query EDNS version. |
| version | | |
| | | |
| EDNS UDP | QO | The Query EDNS sender's UDO payload size |
| size | | |
| | | |
| Query OPT | QO | The index in the NAME/RDATA table of the OPT |
| RDATA | | RDATA. |
| | | |
| Response | R | Response RCODE. If the Response contains OPT, |
| RCODE | | this value incorporates any |
| | | EXTENDED_RCODE_VALUE. |
+------------+----+-------------------------------------------------+
7.14. Question table
This table holds details on individual Questions in a Question
section. Each item in the table is a CBOR map containing a single
Question. Each item in the map has an unsigned value and an unsigned
key. This data is optionally collected.
Dickinson, et al. Expires June 9, 2017 [Page 16]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
+------------+------------------------------------------------------+
| Field | Description |
+------------+------------------------------------------------------+
| QNAME | The index in the NAME/RDATA table of the QNAME. |
| | |
| Class/Type | The index in the Class/Type table of the CLASS and |
| | TYPE of the Question. |
+------------+------------------------------------------------------+
7.15. Resource Record (RR) table
This table holds details on individual Resource Records in RR
sections. Each item in the table is a CBOR map containing a single
Resource Record. This data is optionally collected.
+------------+------------------------------------------------------+
| Field | Description |
+------------+------------------------------------------------------+
| NAME | The index in the NAME/RDATA table of the NAME. |
| | |
| Class/Type | The index in the Class/Type table of the CLASS and |
| | TYPE of the RR. |
| | |
| TTL | The RR Time to Live. |
| | |
| RDATA | The index in the NAME/RDATA table of the RR RDATA. |
+------------+------------------------------------------------------+
7.16. Question list table
This table holds a list of second and subsequent individual Questions
in a Question section. Each item in the table is a CBOR unsigned.
This data is optionally collected.
+----------+--------------------------------------------------------+
| Field | Description |
+----------+--------------------------------------------------------+
| Question | The index in the Question table of the individual |
| | Question. |
+----------+--------------------------------------------------------+
7.17. Resource Record list table
This table holds a list of individual Resource Records in a Answer,
Authority or Additional section. Each item in the table is a CBOR
unsigned. This data is optionally collected.
Dickinson, et al. Expires June 9, 2017 [Page 17]
Internet-Draft C-DNS: A DNS Packet Capture Format December 2016
+-------+-----------------------------------------------------------+
| Field | Description |
+-------+-----------------------------------------------------------+
| RR | The index in the Resource Record table of the individual |
| | Resource Record. |
+-------+-----------------------------------------------------------+
7.18. Query/Response data
The block Q/R data is a CBOR array of individual Q/R items. Each
item in the array is a CBOR map containing details on the individual
Q/R pair.
Note that there is no requirement that the elements of the Q/R array
are presented in strict chronological order.
The following abbreviations are used in the Present (P) column
o Q = QUERY
o A = Always
o QT = QUESTION
o QO = QUERY, OPT
o QR = QUERY & RESPONSE
o R = RESPONSE
Each item in the map has an unsigned value (with the exception of
those listed below) and an unsigned key.
o Query extended information and Response extended information which
are of Type Extended Information.
o Response delay which is an integer (This can be negative if the
network stack/capture library returns them out of order.)