summaryrefslogtreecommitdiffstats
path: root/contrib/libpcap/doc/pcap.txt
blob: cfa6645fc24fe6dfe420a48a7fada72bfa4f4a6b (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680


Network Working Group                                       L. Degioanni
Internet-Draft                                                  F. Risso
Expires: August 30, 2004                           Politecnico di Torino
                                                              March 2004


                  PCAP New Generation Dump File Format
                                  pcap

Status of this Memo

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups. Note that other
   groups may also distribute working documents as Internet-Drafts.

   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."

   The list of current Internet-Drafts can be accessed at http://
   www.ietf.org/ietf/1id-abstracts.txt.

   The list of Internet-Draft Shadow Directories can be accessed at
   http://www.ietf.org/shadow.html.

   This Internet-Draft will expire on August 30, 2004.

Copyright Notice

   Copyright (C) The Internet Society (2004). All Rights Reserved.

Abstract

   This document describes a format to dump captured packets on a file.
   This format is extensible and it is currently proposed for
   implementation in the libpcap/WinPcap packet capture library.












Degioanni & Risso       Expires August 30, 2004                 [Page 1]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


Table of Contents

   1.  Objectives . . . . . . . . . . . . . . . . . . . . . . . . . .  3
   2.  General File Structure . . . . . . . . . . . . . . . . . . . .  4
   2.1 General Block Structure  . . . . . . . . . . . . . . . . . . .  4
   2.2 Block Types  . . . . . . . . . . . . . . . . . . . . . . . . .  5
   2.3 Block Hierarchy and Precedence . . . . . . . . . . . . . . . .  5
   2.4 Data format  . . . . . . . . . . . . . . . . . . . . . . . . .  6
   3.  Block Definition . . . . . . . . . . . . . . . . . . . . . . .  8
   3.1 Section Header Block (mandatory) . . . . . . . . . . . . . . .  8
   3.2 Interface Description Block (mandatory)  . . . . . . . . . . .  9
   3.3 Packet Block (optional)  . . . . . . . . . . . . . . . . . . . 13
   3.4 Simple Packet Block (optional) . . . . . . . . . . . . . . . . 15
   3.5 Name Resolution Block (optional) . . . . . . . . . . . . . . . 16
   3.6 Interface Statistics Block (optional)  . . . . . . . . . . . . 18
   4.  Options  . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
   5.  Experimental Blocks (deserved to a further investigation)  . . 23
   5.1 Other Packet Blocks (experimental) . . . . . . . . . . . . . . 23
   5.2 Compression Block (experimental) . . . . . . . . . . . . . . . 23
   5.3 Encryption Block (experimental)  . . . . . . . . . . . . . . . 23
   5.4 Fixed Length Block (experimental)  . . . . . . . . . . . . . . 24
   5.5 Directory Block (experimental) . . . . . . . . . . . . . . . . 25
   5.6 Traffic Statistics and Monitoring Blocks (experimental)  . . . 25
   5.7 Event/Security Block (experimental)  . . . . . . . . . . . . . 25
   6.  Conclusions  . . . . . . . . . . . . . . . . . . . . . . . . . 27
   7.  Most important open issues . . . . . . . . . . . . . . . . . . 28
       Intellectual Property and Copyright Statements . . . . . . . . 29
























Degioanni & Risso       Expires August 30, 2004                 [Page 2]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


1. Objectives

   The problem of exchanging packet traces becomes more and more
   critical every day; unfortunately, no standard solutions exist for
   this task right now. One of the most accepted packet interchange
   formats is the one defined by libpcap, which is rather old and does
   not fit for some of the nowadays applications especially in terms of
   extensibility.

   This document proposes a new format for dumping packet traces. The
   following goals are being pursued:

   o  Extensibility: aside of some common functionalities, third parties
      should be able to enrich the information embedded in the file with
      proprietary extensions, which will be ignored by tools that are
      not able to understand them.

   o  Portability: a capture trace must contain all the information
      needed to read data independently from network, hardware and
      operating system of the machine that made the capture.

   o  Merge/Append data: it should be possible to add data at the end of
      a given file, and the resulting file must still be readable.




























Degioanni & Risso       Expires August 30, 2004                 [Page 3]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


2. General File Structure

2.1 General Block Structure

   A capture file is organized in blocks, that are appended one to
   another to form the file. All the blocks share a common format, which
   is shown in Figure 1.

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                          Block Type                           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Block Total Length                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                          Block Body                           /
      /          /* variable length, aligned to 32 bits */            /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                      Block Total Length                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Figure 1: Basic block structure.

   The fields have the following meaning:

   o  Block Type (32 bits): unique value that identifies the block.
      Values whose Most Significant Bit (MSB) is equal to 1 are reserved
      for local use. They allow to save private data to the file and to
      extend the file format.

   o  Block Total Length: total size of this block, in bytes. For
      instance, a block that does not have a body has a length of 12
      bytes.

   o  Block Body: content of the block.

   o  Block Total Length: total size of this block, in bytes. This field
      is duplicated for permitting backward file navigation.

   This structure, shared among all blocks, makes easy to process a file
   and to skip unneeded or unknown blocks. Blocks can be nested one
   inside the others (NOTE: needed?). Some of the blocks are mandatory,
   i.e. a dump file is not valid if they are not present, other are
   optional.

   The structure of the blocks allows to define other blocks if needed.
   A parser that does non understand them can simply ignore their
   content.



Degioanni & Risso       Expires August 30, 2004                 [Page 4]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


2.2 Block Types

   The currently defined blocks are the following:

   1.  Section Header Block: it defines the most important
       characteristics of the capture file.

   2.  Interface Description Block: it defines the most important
       characteristics of the interface(s) used for capturing traffic.

   3.  Packet Block: it contains a single captured packet, or a portion
       of it.

   4.  Simple Packet Block: it contains a single captured packet, or a
       portion of it, with only a minimal set of information about it.

   5.  Name Resolution Block: it defines the mapping from numeric
       addresses present in the packet dump and the canonical name
       counterpart.

   6.  Capture Statistics Block: it defines how to store some
       statistical data (e.g. packet dropped, etc) which can be useful
       to undestand the conditions in which the capture has been made.

   7.  Compression Marker Block: TODO

   8.  Encryption Marker Block: TODO

   9.  Fixed Length Marker Block: TODO

   The following blocks instead are considered interesting but the
   authors believe that they deserve more in-depth discussion before
   being defined:

   1.  Further Packet Blocks

   2.  Directory Block

   3.  Traffic Statistics and Monitoring Blocks

   4.  Alert and Security Blocks

   TODO Currently standardized Block Type codes are specified in
   Appendix 1.

2.3 Block Hierarchy and Precedence

   The file must begin with a Section Header Block. However, more than



Degioanni & Risso       Expires August 30, 2004                 [Page 5]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   one Section Header Block can be present on the dump, each one
   covering the data following it till the next one (or the end of
   file). A Section includes the data delimited by two Section Header
   Blocks (or by a Section Header Block and the end of the file),
   including the first Section Header Block.

   In case an application cannot read a Section because of different
   version number, it must skip everything until the next Section Header
   Block. Note that, in order to properly skip the blocks until the next
   section, all blocks must have the fields Type and Length at the
   beginning. This is a mandatory requirement that must be maintained in
   future versions of the block format.

   Figure 2 shows two valid files: the first has a typical
   configuration, with a single Section Header that covers the whole
   file. The second one contains three headers, and is normally the
   result of file concatenation. An application that understands only
   version 1.0 of the file format skips the intermediate section and
   restart processing the packets after the third Section Header.

      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | SHB v1.0  |                      Data                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      Typical configuration with a single Section Header Block


      |--   1st Section   --|--   2nd Section   --|--  3rd Section  --|
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      | SHB v1.0  |  Data   | SHB V1.1  |  Data   | SHB V1.0  |  Data |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      Configuration with three different Section Header Blocks

      Figure 2: File structure example: the Section Header Block.

   NOTE: TO BE COMPLETED with some examples of other blocks

2.4 Data format

   Data contained in each section will always be saved according to the
   characteristics (little endian / big endian) of the dumping machine.
   This refers to all fields that are saved as numbers and that span
   over two or more bytes.

   The approach of having each section saved in the native format of the
   generating host is more efficient because it avoids translation of
   data when reading / writing on the host itself, which is the most
   common case when generating/processing capture dumps.



Degioanni & Risso       Expires August 30, 2004                 [Page 6]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   TODO Probably we have to specify something more here. Is what we're
   saying enough to avoid any kind of ambiguity?.

















































Degioanni & Risso       Expires August 30, 2004                 [Page 7]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


3. Block Definition

   This section details the format of the body of the blocks currently
   defined.

3.1 Section Header Block (mandatory)

   The Section Header Block is mandatory. It identifies the beginning of
   a section of the capture dump file. Its format is shown in Figure 3.

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                            Magic                              |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |              Major            |             Minor             |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                      Options (variable)                       /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 3: Section Header Block format.

   The meaning of the fields is:

   o  Magic: magic number, whose value is the hexadecimal number
      0x1A2B3C4D. This number can be used to distinguish section that
      have been saved on little-endian machines from the one saved on
      big-endian machines.

   o  Major: number of the current mayor version of the format. Current
      value is 1.

   o  Minor: number of the current minor version of the format. Current
      value is 0.

   o  Options: optionally, a list of options (formatted according to the
      rules defined in Section 4) can be present.

   Aside form the options defined in Section 4, the following options
   are valid within this block:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | Hardware       | 2              | variable       | An ascii       |
   |                |                |                | string         |



Degioanni & Risso       Expires August 30, 2004                 [Page 8]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   |                |                |                | containing the |
   |                |                |                | description of |
   |                |                |                | the hardware   |
   |                |                |                | used to create |
   |                |                |                | this section.  |
   |                |                |                |                |
   | Operating      | 3              | variable       | An ascii       |
   | System         |                |                | string         |
   |                |                |                | containing the |
   |                |                |                | name of the    |
   |                |                |                | operating      |
   |                |                |                | system used to |
   |                |                |                | create this    |
   |                |                |                | section.       |
   |                |                |                |                |
   | User           | 3              | variable       | An ascii       |
   | Application    |                |                | string         |
   |                |                |                | containing the |
   |                |                |                | name of the    |
   |                |                |                | application    |
   |                |                |                | used to create |
   |                |                |                | this section.  |
   +----------------+----------------+----------------+----------------+

                                Table 1

   The Section Header Block does not contain data but it rather
   identifies a list of blocks (interfaces, packets) that are logically
   correlated. This block does not contain any reference to the size of
   the section it is currently delimiting, therefore the reader cannot
   skip a whole section at once. In case a section must be skipped, the
   user has to repeatedly skip all the blocks contained within it; this
   makes the parsing of the file slower but it permits to append several
   capture dumps at the same file.

3.2 Interface Description Block (mandatory)

   The Interface Description Block is mandatory. This block is needed to
   specify the characteristics of the network interface on which the
   capture has been made. In order to properly associate the captured
   data to the corresponding interface, the Interface Description Block
   must be defined before any other block that uses it; therefore, this
   block is usually placed immediately after the Section Header Block.

   An Interface Description Block is valid only inside the section which
   it belongs to. The structure of a Interface Description Block is
   shown in Figure 4.




Degioanni & Risso       Expires August 30, 2004                 [Page 9]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Interface ID         |           LinkType            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                            SnapLen                            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                      Options (variable)                       /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

             Figure 4: Interface Description Block format.

   The meaning of the fields is:

   o  Interface ID: a progressive number that identifies uniquely any
      interface inside current section. Two Interface Description Blocks
      can have the same Interface ID only if they are in different
      sections of the file. The Interface ID is referenced by the packet
      blocks.

   o  LinkType: a value that defines the link layer type of this
      interface.

   o  SnapLen: maximum number of bytes dumped from each packet. The
      portion of each packet that exceeds this value will not be stored
      in the file.

   o  Options: optionally, a list of options (formatted according to the
      rules defined in Section 4) can be present.

   In addition to the options defined in Section 4, the following
   options are valid within this block:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | if_name        | 2              | Variable       | Name of the    |
   |                |                |                | device used to |
   |                |                |                | capture data.  |
   |                |                |                |                |
   | if_IPv4addr    | 3              | 8              | Interface      |
   |                |                |                | network        |
   |                |                |                | address and    |
   |                |                |                | netmask.       |
   |                |                |                |                |
   | if_IPv6addr    | 4              | 17             | Interface      |



Degioanni & Risso       Expires August 30, 2004                [Page 10]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   |                |                |                | network        |
   |                |                |                | address and    |
   |                |                |                | prefix length  |
   |                |                |                | (stored in the |
   |                |                |                | last byte).    |
   |                |                |                |                |
   | if_MACaddr     | 5              | 6              | Interface      |
   |                |                |                | Hardware MAC   |
   |                |                |                | address (48    |
   |                |                |                | bits).         |
   |                |                |                |                |
   | if_EUIaddr     | 6              | 8              | Interface      |
   |                |                |                | Hardware EUI   |
   |                |                |                | address (64    |
   |                |                |                | bits), if      |
   |                |                |                | available.     |
   |                |                |                |                |
   | if_speed       | 7              | 8              | Interface      |
   |                |                |                | speed (in      |
   |                |                |                | bps).          |
   |                |                |                |                |
   | if_tsaccur     | 8              | 1              | Precision of   |
   |                |                |                | timestamps. If |
   |                |                |                | the Most       |
   |                |                |                | Significant    |
   |                |                |                | Bit is equal   |
   |                |                |                | to zero, the   |
   |                |                |                | remaining bits |
   |                |                |                | indicates the  |
   |                |                |                | accuracy as as |
   |                |                |                | a negative     |
   |                |                |                | power of 10    |
   |                |                |                | (e.g. 6 means  |
   |                |                |                | microsecond    |
   |                |                |                | accuracy). If  |
   |                |                |                | the Most       |
   |                |                |                | Significant    |
   |                |                |                | Bit is equal   |
   |                |                |                | to zero, the   |
   |                |                |                | remaining bits |
   |                |                |                | indicates the  |
   |                |                |                | accuracy as as |
   |                |                |                | negative power |
   |                |                |                | of 2 (e.g. 10  |
   |                |                |                | means 1/1024   |
   |                |                |                | of second). If |
   |                |                |                | this option is |
   |                |                |                | not present, a |



Degioanni & Risso       Expires August 30, 2004                [Page 11]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   |                |                |                | precision of   |
   |                |                |                | 10^-6 is       |
   |                |                |                | assumed.       |
   |                |                |                |                |
   | if_tzone       | 9              | 4              | Time zone for  |
   |                |                |                | GMT support    |
   |                |                |                | (TODO: specify |
   |                |                |                | better).       |
   |                |                |                |                |
   | if_flags       | 10             | 4              | Interface      |
   |                |                |                | flags. (TODO:  |
   |                |                |                | specify        |
   |                |                |                | better.        |
   |                |                |                | Possible       |
   |                |                |                | flags:         |
   |                |                |                | promiscuous,   |
   |                |                |                | inbound/outbou |
   |                |                |                | nd, traffic    |
   |                |                |                | filtered       |
   |                |                |                | during         |
   |                |                |                | capture).      |
   |                |                |                |                |
   | if_filter      | 11             | variable       | The filter     |
   |                |                |                | (e.g. "capture |
   |                |                |                | only TCP       |
   |                |                |                | traffic") used |
   |                |                |                | to capture     |
   |                |                |                | traffic. The   |
   |                |                |                | first byte of  |
   |                |                |                | the Option     |
   |                |                |                | Data keeps a   |
   |                |                |                | code of the    |
   |                |                |                | filter used    |
   |                |                |                | (e.g. if this  |
   |                |                |                | is a libpcap   |
   |                |                |                | string, or BPF |
   |                |                |                | bytecode, and  |
   |                |                |                | more). More    |
   |                |                |                | details about  |
   |                |                |                | this format    |
   |                |                |                | will be        |
   |                |                |                | presented in   |
   |                |                |                | Appendix XXX   |
   |                |                |                | (TODO).        |
   |                |                |                |                |
   | if_opersystem  | 12             | variable       | An ascii       |
   |                |                |                | string         |
   |                |                |                | containing the |



Degioanni & Risso       Expires August 30, 2004                [Page 12]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   |                |                |                | name of the    |
   |                |                |                | operating      |
   |                |                |                | system of the  |
   |                |                |                | machine that   |
   |                |                |                | hosts this     |
   |                |                |                | interface.     |
   |                |                |                | This can be    |
   |                |                |                | different from |
   |                |                |                | the same       |
   |                |                |                | information    |
   |                |                |                | that can be    |
   |                |                |                | contained by   |
   |                |                |                | the Section    |
   |                |                |                | Header Block   |
   |                |                |                | (Section 3.1)  |
   |                |                |                | because the    |
   |                |                |                | capture can    |
   |                |                |                | have been done |
   |                |                |                | on a remote    |
   |                |                |                | machine.       |
   +----------------+----------------+----------------+----------------+

                                Table 2


3.3 Packet Block (optional)

   A Packet Block is the standard container for storing the packets
   coming from the network. The Packet Block is optional because packets
   can be stored either by means of this block or the Simple Packet
   Block, which can be used to speed up dump generation. The format of a
   packet block is shown in Figure 5.



















Degioanni & Risso       Expires August 30, 2004                [Page 13]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |         Interface ID          |          Drops Count          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Timestamp (High)                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                        Timestamp (Low)                        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         Captured Len                          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                          Packet Len                           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                                                               |
      |                          Packet Data                          |
      |                                                               |
      |              /* variable length, byte-aligned */              |
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                      Options (variable)                       /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                     Figure 5: Packet Block format.

   The Packet Block has the following fields:

   o  Interface ID: Specifies the interface this packet comes from, and
      corresponds to the ID of one of the Interface Description Blocks
      present in this section of the file (see Figure 4).

   o  Drops Count: a local drop counter. It specified the number of
      packets lost (by the interface and the operating system) between
      this packet and the preceding one. The value xFFFF (in
      hexadecimal) is reserved for those systems in which this
      information is not available.

   o  Timestamp (High): the most significative part of the timestamp. in
      standard Unix format, i.e. from 1/1/1970.

   o  Timestamp (Low): the less significative part of the timestamp. The
      way to interpret this field is specified by the 'ts_accur' option
      (see Figure 4) of the Interface Description block referenced by
      this packet. If the Interface Description block does not contain a
      'ts_accur' option, then this field is expressed in microseconds.

   o  Captured Len: number of bytes captured from the packet (i.e. the



Degioanni & Risso       Expires August 30, 2004                [Page 14]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


      length of the Packet Data field). It will be the minimum value
      among the actual Packet Length and the snapshot length (defined in
      Figure 4).

   o  Packet Len: actual length of the packet when it was transmitted on
      the network. Can be different from Captured Len if the user wants
      only a snapshot of the packet.

   o  Packet Data: the data coming from the network, including
      link-layer headers. The length of this field is Captured Len. The
      format of the link-layer headers depends on the LinkType field
      specified in the Interface Description Block (see Section 3.2) and
      it is specified in Appendix XXX (TODO).

   o  Options: optionally, a list of options (formatted according to the
      rules defined in Section 4) can be present.


3.4 Simple Packet Block (optional)

   The Simple Packet Block is a lightweight container for storing the
   packets coming from the network. Its presence is optional.

   A Simple Packet Block is similar to a Packet Block (see Section 3.3),
   but it is smaller, simpler to process and contains only a minimal set
   of information. This block is preferred to the standard Packet Block
   when performance or space occupation are critical factors, such as in
   sustained traffic dump applications. A capture file can contain both
   Packet Blocks and Simple Packet Blocks: for example, a capture tool
   could switch from Packet Blocks to Simple Packet Blocks when the
   hardware resources become critical.

   The Simple Packet Block does not contain the Interface ID field.
   Therefore, it must be assumed that all the Simple Packet Blocks have
   been captured on the interface previously specified in the Interface
   Description Block.

   Figure 6 shows the format of the Simple Packet Block.













Degioanni & Risso       Expires August 30, 2004                [Page 15]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                          Packet Len                           |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                                                               |
      |                          Packet Data                          |
      |                                                               |
      |              /* variable length, byte-aligned */              |
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 6: Simple Packet Block format.

   The Packet Block has the following fields:

   o  Packet Len: actual length of the packet when it was transmitted on
      the network. Can be different from captured len if the packet has
      been truncated.

   o  Packet data: the data coming from the network, including
      link-layers headers. The length of this field can be derived from
      the field Block Total Length, present in the Block Header.

   The Simple Packet Block does not contain the timestamp because this
   is one of the most costly operations on PCs. Additionally, there are
   applications that do not require it; e.g. an Intrusion Detection
   System is interested in packets, not in their timestamp.

   The Simple Packet Block is very efficient in term of disk space: a
   snapshot of length 100 bytes requires only 16 bytes of overhead,
   which corresponds to an efficiency of more than 86%.

3.5 Name Resolution Block (optional)

   The Name Resolution Block is used to support the correlation of
   numeric addresses (present in the captured packets) and their
   corresponding canonical names and it is optional. Having the literal
   names saved in the file, this prevents the need of a name resolution
   in a delayed time, when the association between names and addresses
   can be different from the one in use at capture time. Moreover, The
   Name Resolution Block avoids the need of issuing a lot of DNS
   requests every time the trace capture is opened, and allows to have
   name resolution also when reading the capture with a machine not
   connected to the network.

   The format of the Name Resolution Block is shown in Figure 7.




Degioanni & Risso       Expires August 30, 2004                [Page 16]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Record Type              |         Record Length         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       Record Value                            |
      |              /* variable length, byte-aligned */              |
      |               + + + + + + + + + + + + + + + + + + + + + + + + +
      |               |               |               |               |
      +-+-+-+-+-+-+-+-+ + + + + + + + + + + + + + + + + + + + + + + + +
                . . . other records . . .
      |  Record Type == end_of_recs   |  Record Length == 00          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                      Options (variable)                       /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                Figure 7: Name Resolution Block format.

   A Name Resolution Block is a zero-terminated list of records (in the
   TLV format), each of which contains an association between a network
   address and a name. There are three possible types of records:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | end_of_recs    | 0              | 0              | End of records |
   |                |                |                |                |
   | ip4_rec        | 1              | Variable       | Specifies an   |
   |                |                |                | IPv4 address   |
   |                |                |                | (contained in  |
   |                |                |                | the first 4    |
   |                |                |                | bytes),        |
   |                |                |                | followed by    |
   |                |                |                | one or more    |
   |                |                |                | zero-terminate |
   |                |                |                | d strings      |
   |                |                |                | containing the |
   |                |                |                | DNS entries    |
   |                |                |                | for that       |
   |                |                |                | address.       |
   |                |                |                |                |
   | ip6_rec        | 1              | Variable       | Specifies an   |
   |                |                |                | IPv6 address   |
   |                |                |                | (contained in  |
   |                |                |                | the first 16   |
   |                |                |                | bytes),        |



Degioanni & Risso       Expires August 30, 2004                [Page 17]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   |                |                |                | followed by    |
   |                |                |                | one or more    |
   |                |                |                | zero-terminate |
   |                |                |                | d strings      |
   |                |                |                | containing the |
   |                |                |                | DNS entries    |
   |                |                |                | for that       |
   |                |                |                | address.       |
   +----------------+----------------+----------------+----------------+

                                Table 3

   After the list or Name Resolution Records, optionally, a list of
   options (formatted according to the rules defined in Section 4) can
   be present.

   A Name Resolution Block is normally placed at the beginning of the
   file, but no assumptions can be taken about its position. Name
   Resolution Blocks can be added in a second time by tools that process
   the file, like network analyzers.

   In addiction to the options defined in Section 4, the following
   options are valid within this block:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | ns_dnsname     | 2              | Variable       | An ascii       |
   |                |                |                | string         |
   |                |                |                | containing the |
   |                |                |                | name of the    |
   |                |                |                | machine (DNS   |
   |                |                |                | server) used   |
   |                |                |                | to perform the |
   |                |                |                | name           |
   |                |                |                | resolution.    |
   +----------------+----------------+----------------+----------------+


3.6 Interface Statistics Block (optional)

   The Interface Statistics Block contains the capture statistics for a
   given interface and it is optional. The statistics are referred to
   the interface defined in the current Section identified by the
   Interface ID field.

   The format of the Interface Statistics Block is shown in Figure 8.




Degioanni & Risso       Expires August 30, 2004                [Page 18]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         IfRecv                                |
      |                          (high + low)                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         IfDrop                                |
      |                          (high + low)                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         FilterAccept                          |
      |                          (high + low)                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         OSDrop                                |
      |                          (high + low)                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                         UsrDelivered                          |
      |                          (high + low)                         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Interface ID         |           Reserved            |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                      Options (variable)                       /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              Figure 8: Interface Statistics Block format.

   The fields have the following meaning:

   o  IfRecv: number of packets received from the interface during the
      capture. This number is reported as a 64 bits value, in which the
      most significat bits are located in the first four bytes of the
      field.

   o  IfDrop: number of packets dropped by the interface during the
      capture due to lack of resources.

   o  FilterAccept: number of packets accepeted by filter during current
      capture.

   o  OSDrop: number of packets dropped by the operating system during
      the capture.

   o  UsrDelivered: number of packets delivered to the user.
      UsrDelivered can be different from the value 'FilterAccept -
      OSDropped' because some packets could still lay in the OS buffers
      when the capture ended.




Degioanni & Risso       Expires August 30, 2004                [Page 19]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   o  Interface ID: reference to an Interface Description Block.

   o  Reserved: Reserved to future use.

   o  Options: optionally, a list of options (formatted according to the
      rules defined in Section 4) can be present.

   In addiction to the options defined in Section 4, the following
   options are valid within this block:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | isb_starttime  | 2              | 8              | Time in which  |
   |                |                |                | the capture    |
   |                |                |                | started; time  |
   |                |                |                | will be stored |
   |                |                |                | in two blocks  |
   |                |                |                | of four bytes  |
   |                |                |                | each,          |
   |                |                |                | containing the |
   |                |                |                | timestamp in   |
   |                |                |                | seconds and    |
   |                |                |                | nanoseconds.   |
   |                |                |                |                |
   | isb_endtime    | 3              | 8              | Time in which  |
   |                |                |                | the capture    |
   |                |                |                | started; time  |
   |                |                |                | will be stored |
   |                |                |                | in two blocks  |
   |                |                |                | of four bytes  |
   |                |                |                | each,          |
   |                |                |                | containing the |
   |                |                |                | timestamp in   |
   |                |                |                | seconds and    |
   |                |                |                | nanoseconds.   |
   +----------------+----------------+----------------+----------------+














Degioanni & Risso       Expires August 30, 2004                [Page 20]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


4. Options

   Almost all blocks have the possibility to embed optional fields.
   Optional fields can be used to insert some information that may be
   useful when reading data, but that it is not really needed for packet
   processing. Therefore, each tool can be either read the content of
   the optional fields (if any), or skip them at once.

   Skipping all the optional fields at once is straightforward because
   most of the blocks have a fixed length, therefore the field Block
   Length (present in the General Block Structure, see  Section 2.1) can
   be used to skip everything till the next block.

   Options are a list of Type - Length - Value fields, each one
   containing a single value:

   o  Option Type (2 bytes): it contains the code that specifies the
      type of the current TLV record. Option types whose Most
      Significant Bit is equal to one are reserved for local use;
      therefore, there is no guarantee that the code used is unique
      among all capture files (generated by other applications). In case
      of vendor-specific extensions that have to be identified uniquely,
      vendors must request an Option Code whose MSB is equal to zero.

   o  Option Length (2 bytes): it contains the length of the following
      'Option Value' field.

   o  Option Value (variable length): it contains the value of the given
      option. The length of this field as been specified by the Option
      Length field.

   Options may be repeated several times (e.g. an interface that has
   several IP addresses associated to it). The option list is terminated
   by a special code which is the 'End of Option'.

   The format of the optional fields is shown in Figure 9.















Degioanni & Risso       Expires August 30, 2004                [Page 21]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      Option Code              |         Option Length         |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       Option Value                            |
      |              /* variable length, byte-aligned */              |
      |               + + + + + + + + + + + + + + + + + + + + + + + + +
      |               /               /               /               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      /                                                               /
      /                 . . . other options . . .                     /
      /                                                               /
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |   Option Code == opt_endofopt  |  Option Length == 0          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Figure 9: Options format.

   The following codes can always be present in any optional field:

   +----------------+----------------+----------------+----------------+
   | Name           | Code           | Length         | Description    |
   +----------------+----------------+----------------+----------------+
   | opt_endofopt   | 0              | 0              | End of         |
   |                |                |                | options: it is |
   |                |                |                | used to        |
   |                |                |                | delimit the    |
   |                |                |                | end of the     |
   |                |                |                | optional       |
   |                |                |                | fields. This   |
   |                |                |                | block cannot   |
   |                |                |                | be repeated    |
   |                |                |                | within a given |
   |                |                |                | list of        |
   |                |                |                | options.       |
   |                |                |                |                |
   | opt_comment    | 1              | variable       | Comment: it is |
   |                |                |                | an ascii       |
   |                |                |                | string         |
   |                |                |                | containing a   |
   |                |                |                | comment that   |
   |                |                |                | is associated  |
   |                |                |                | to the current |
   |                |                |                | block.         |
   +----------------+----------------+----------------+----------------+





Degioanni & Risso       Expires August 30, 2004                [Page 22]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


5. Experimental Blocks (deserved to a further investigation)

5.1 Other Packet Blocks (experimental)

   Can some other packet blocks (besides the two described in the
   previous paragraphs) be useful?

5.2 Compression Block (experimental)

   The Compression Block is optional. A file can contain an arbitrary
   number of these blocks. A Compression Block, as the name says, is
   used to store compressed data. Its format is shown in Figure 10.

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |  Compr. Type  |                                               |
      +-+-+-+-+-+-+-+-+                                               |
      |                                                               |
      |                       Compressed Data                         |
      |                                                               |
      |              /* variable length, byte-aligned */              |
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Figure 10: Compression Block format.

   The fields have the following meaning:

   o  Compression Type: specifies the compression algorithm. Possible
      values for this field are 0 (uncompressed), 1 (Lempel Ziv), 2
      (Gzip), other?? Probably some kind of dumb and fast compression
      algorithm could be effective with some types of traffic (for
      example web), but which?

   o  Compressed Data: data of this block. Once decompressed, it is made
      of other blocks.


5.3 Encryption Block (experimental)

   The Encryption Block is optional. A file can contain an arbitrary
   number of these blocks. An Encryption Block is used to sotre
   encrypted data. Its format is shown in Figure 11.







Degioanni & Risso       Expires August 30, 2004                [Page 23]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |   Encr. Type  |                                               |
      +-+-+-+-+-+-+-+-+                                               |
      |                                                               |
      |                       Compressed Data                         |
      |                                                               |
      |              /* variable length, byte-aligned */              |
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Figure 11: Encryption Block format.

   The fields have the following meaning:

   o  Compression Type: specifies the encryption algorithm. Possible
      values for this field are ??? NOTE: this block should probably
      contain other fields, depending on the encryption algorithm. To be
      define precisely.

   o  Encrypted Data: data of this block. Once decripted, it consists of
      other blocks.


5.4 Fixed Length Block (experimental)

   The Fixed Length Block is optional. A file can contain an arbitrary
   number of these blocks. A Fixed Length Block can be used to optimize
   the access to the file. Its format is shown in Figure 12. A Fixed
   Length Block stores records with constant size. It contains a set of
   Blocks (normally Packet Blocks or Simple Packet Blocks), of wihich it
   specifies the size. Knowing this size a priori helps to scan the file
   and to load some portions of it without truncating a block, and is
   particularly useful with cell-based networks like ATM.
















Degioanni & Risso       Expires August 30, 2004                [Page 24]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          Cell Size            |                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
      |                                                               |
      |                        Fixed Size Data                        |
      |                                                               |
      |              /* variable length, byte-aligned */              |
      |                                                               |
      |                                                               |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 12: Fixed Length Block format.

   The fields have the following meaning:

   o  Cell size: the size of the blocks contained in the data field.

   o  Fixed Size Data: data of this block.


5.5 Directory Block (experimental)

   If present, this block contains the following information:

   o  number of indexed packets (N)

   o  table with position and length of any indexed packet (N entries)

   A directory block must be followed by at least N packets, otherwise
   it must be considered invalid. It can be used to efficiently load
   portions of the file to memory and to support operations on memory
   mapped files. This block can be added by tools like network analyzers
   as a consequence of file processing.

5.6 Traffic Statistics and Monitoring Blocks (experimental)

   One or more blocks could be defined to contain network statistics or
   traffic monitoring information. They could be use to store data
   collected from RMON or Netflow probes, or from other network
   monitoring tools.

5.7 Event/Security Block (experimental)

   This block could be used to store events. Events could contain
   generic information (for example network load over 50%, server
   down...) or security alerts. An event could be:



Degioanni & Risso       Expires August 30, 2004                [Page 25]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   o  skipped, if the application doesn't know how to do with it

   o  processed independently by the packets. In other words, the
      applications skips the packets and processes only the alerts

   o  processed in relation to packets: for example, a security tool
      could load only the packets of the file that are near a security
      alert; a monitorg tool could skip the packets captured while the
      server was down.










































Degioanni & Risso       Expires August 30, 2004                [Page 26]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


6. Conclusions

   The file format proposed in this document should be very versatile
   and satisfy a wide range of applications. In the simplest case, it
   can contain a raw dump of the network data, made of a series of
   Simple Packet Blocks. In the most complex case, it can be used as a
   repository for heterogeneous information. In every case, the file
   remains easy to parse and an application can always skip the data it
   is not interested in; at the same time, different applications can
   share the file, and each of them can benfit of the information
   produced by the others. Two or more files can be concatenated
   obtaining another valid file.







































Degioanni & Risso       Expires August 30, 2004                [Page 27]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


7. Most important open issues

   o  Data, in the file, must be byte or word aligned? Currently, the
      structure of this document is not consistent with respect to this
      point.














































Degioanni & Risso       Expires August 30, 2004                [Page 28]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


Intellectual Property Statement

   The IETF takes no position regarding the validity or scope of any
   intellectual property or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; neither does it represent that it
   has made any effort to identify any such rights. Information on the
   IETF's procedures with respect to rights in standards-track and
   standards-related documentation can be found in BCP-11. Copies of
   claims of rights made available for publication and any assurances of
   licenses to be made available, or the result of an attempt made to
   obtain a general license or permission for the use of such
   proprietary rights by implementors or users of this specification can
   be obtained from the IETF Secretariat.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights which may cover technology that may be required to practice
   this standard. Please address the information to the IETF Executive
   Director.


Full Copyright Statement

   Copyright (C) The Internet Society (2004). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION



Degioanni & Risso       Expires August 30, 2004                [Page 29]

Internet-Draft    PCAP New Generation Dump File Format        March 2004


   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.


Acknowledgment

   Funding for the RFC Editor function is currently provided by the
   Internet Society.











































Degioanni & Risso       Expires August 30, 2004                [Page 30]

OpenPOWER on IntegriCloud