Skip to content

PCAP and PCAPNG Evidence

PCAP and PCAPNG both preserve packet records. Their different file structures affect how examiners recover interface, timestamp and capture context.

By Reviewed by Jeevesh Kumar

Last updated:

PCAP and PCAPNG are formats for saved packet captures. Both can carry timestamps, recorded packet bytes and packet lengths. Classic PCAP describes the capture with one file-level header followed by packet records. PCAPNG stores information in blocks and can describe multiple interfaces and record additional context.

The filename extension is a useful label. Confirm the actual format with a capture reader when the evidence depends on format or metadata. Review the link type, interface information, timestamp settings and recorded lengths before interpreting individual packets or choosing how to export an exhibit.

Key terms

PCAP
A capture-file format with a shared link type and timestamp convention. Each saved record reports both captured and original lengths, which helps identify truncation.
PCAPNG
A block-structured capture-file format that can describe several interfaces. Interpret the packet’s interface identifier and time resolution within its own section.
Link type
A format identifier that defines the representation of the recorded packet bytes. A reader uses it to locate and interpret the first protocol header.
Snapshot length
A configured upper limit on saved bytes per packet, when a limit applies. Compare the relevant record’s lengths before deciding whether any byte range survives.
Captured length
The number of packet bytes indicated as saved for a record. PCAPNG padding and metadata lie outside that count.
Original packet length
The recorder’s reported length before capture truncation. Compare it with captured length to evaluate what the record leaves out.
More key terms (4)
Interface Description Block
A PCAPNG block that identifies a logical interface and its link type, snapshot length and available options. It supplies the decoding context for packet blocks that reference it.
Section Header Block
The opening block of a PCAPNG section. It establishes the byte order and section context for following blocks.
Enhanced Packet Block
A PCAPNG block that includes an interface reference, timestamp and packet lengths. Its captured bytes, padding and options serve different analytical roles.
Timestamp resolution
The time interval represented by one timestamp unit in the file. It is needed to decode counts, while clock accuracy requires separate evidence.

Read the Classic PCAP File Header

Classic PCAP begins with a file header that identifies byte order and timestamp precision through its magic value. It also contains a link type and snapshot length. Subsequent records have timestamps and separate captured and original lengths followed by the recorded bytes. A reader uses the one link type when interpreting packet records across the file. IETF PCAP File Format Description

Use the file header to decode the record, then use captured and original lengths to describe how much of the packet was saved.

Timestamp precision describes the units the writer uses, such as microseconds or nanoseconds. The number of digits alone gives little information about clock accuracy. Likewise, a large snapshot length describes a configured ceiling. Compare captured and original lengths on relevant records before claiming that an application field could be recovered. The link type describes the packet representation and has limited value for identifying a physical network location on its own.

The file header is an efficient starting point for disagreements between readers. If one tool reports a different link type, confirm which file each tool opened and check whether a conversion occurred. Compare a representative early record before investigating a higher-layer decode. The correct starting offset depends on the packet encapsulation.

Locate the Interface for a PCAPNG Packet

A PCAPNG section starts with a Section Header Block. Interface Description Blocks describe interfaces in that section, and an Enhanced Packet Block refers to one by its interface identifier. The reader needs the applicable interface to interpret encapsulation and timestamp options. Interface numbering belongs to the section, so a different section can have its own interface zero. IETF PCAPNG File Format Description

Scroll horizontally if needed to see the full table.

FeatureClassic PCAPPCAPNG
EncapsulationOne file-level link typeLink type in each interface description
Timestamp RepresentationFile-level microsecond or nanosecond formatResolution and offset may be recorded per interface
Capture ContextLimited context in the file headerCan carry interface details, comments and statistics
Packet LengthsCaptured and original lengths in packet recordsCaptured and original lengths in Enhanced Packet Blocks

A file may include a name, comments or statistics, depending on the writer and how the file was produced. Examine those fields when they help identify a sensor or explain coverage, and treat descriptive values as assertions included in the file. Check the source manifest or collection configuration if a finding depends on the interface’s physical location. Some block types carry fewer fields than an Enhanced Packet Block. A Simple Packet Block, for example, carries no timestamp.

Interface zero is an index whose meaning depends on the surrounding section. A combined file can put interface zero in one section for Ethernet and interface zero in another for a different encapsulation. In examination notes, combine the section, interface and evidence identifier where that distinction affects the finding.

A PCAP Next Generation (PCAPNG) interface identifier is local to its section. Record both identifiers when locating the interface for a packet.

Interpret Available Metadata With Its Limits

In Wireshark, open Capture File Properties on the working copy. Review the format, time range, encapsulation and available interface fields. Compare the first and last packet times with the separately documented collection interval. A tool can display only the metadata available to it, and a file can represent a selected export. A short displayed interval can therefore be a file property even when the underlying sensor ran much longer. Wireshark Capture File Properties

Capture counters also have a collection context. In PCAPNG the optional Interface Statistics Block can contain counts for an interface from the collector’s measurement point. A file may carry fewer packet records than the number received by that interface. Keep the saved packet count and the interface’s counter separate. They can differ because of selection or export, and the difference alone leaves the reason unresolved.

A file may include a descriptive comment about a filter or the purpose of the collection. Record the exact source of any statement you rely on. You can use the comment to find the corresponding collection configuration or verify a known limitation. The application that wrote the file controls which optional details were included.

Preserve Format Context Through an Export

A conversion can be appropriate when a reviewer’s tool accepts one format. Preserve the source and compare the derivative with it. Check the packet count, time range, link type, representative lengths and any evidence-bearing interface or comment fields. Verify frame references in the output against the source when a report will cite them. If the conversion changes the units or scope, record the effect in the derivative notes.

Multiple interfaces can contribute records that look like duplicate packets or interleaving views of the same exchange. Preserve their interface assignments when chronology or observations across points matter. A merged timeline can still be useful when each row retains both the interface and its source timestamp. Use the original record when precision, clocks or encapsulation affect the comparison.

Lengths can survive a conversion even when other context changes. Check a few frames near an important boundary, such as packets captured on different interfaces or records with different timestamp resolutions. Preserve a small comparison of source and output values when conversion is part of the method used in a finding.

Distinguish a Missing Timestamp from a Displayed Value

For time-based findings, check whether the packet’s block actually carries a timestamp. An Enhanced Packet Block stores a timestamp that is interpreted using the associated interface’s options. A Simple Packet Block has no timestamp field and implicitly belongs to the first interface description in its section. File position is still available for those packets, so keep it distinct from recorded time. IETF PCAPNG Draft, Simple Packet Block

In the hypothetical Mixed Block Practice, an examiner finds an Enhanced Packet Block for a request, a Simple Packet Block for its reply and another Enhanced Packet Block for an unrelated message. The request and reply can be associated by their shared application identifier and opposite directions. The surrounding timestamped blocks do not supply the reply timestamp. A report can cite the reply’s position and observed fields, while leaving the response time unresolved.

Link the hypothetical reply using the application identifier and reverse direction. Its position in the file supplies a locator while its time remains unresolved.

Build the exhibit with separate columns for record position, timestamp from the capture and the block type. If a viewer supplies a blank or placeholder time for the reply, document the available field at block level. A service log with suitable timestamp semantics may provide a different time measure, which should be identified as such.

Check What a Merge Does to Interface Identity

Merging saved files creates a reading order and can change interface numbering. Wireshark’s Mergecap normally orders input packets by their stored timestamps and offers modes for combining Interface Description Blocks. Before relying on a merged exhibit, check which input file and interface each cited output row represents. An apparent temporal order can reflect different source clocks. Wireshark Mergecap Manual

In the hypothetical Two Recorder Merge Practice, both input files list interface zero with the label eth0. The intake manifest places one recorder beside a test client and the other beside the service. Preserve distinct interface descriptions in the derivative and verify the association for representative packets from both files. A mapping can record input evidence ID, input section and interface, original frame and output frame for every observation cited.

Suppose the merged file lists the service-side observation of a test packet two milliseconds before the client-side observation, and the clock offset is unknown. The separate records can still show the packet at both points. Establish the offset and its uncertainty before calculating transit time or interpreting that two-millisecond ordering.

Distinguish Packet Bytes From Block Padding

PCAPNG stores the size of the Enhanced Packet Block separately from the size of the captured packet. The block length covers its header, packet metadata, packet data, alignment padding, any options and the repeated length at the end. The captured length counts packet bytes only. Use the recorded packet length to determine where the captured data ends. IETF PCAPNG Format Draft

Scroll horizontally if needed to see the full table.

ValueScope in the hypothetical block
Captured packet length61 packet bytes
Aligned packet-data span64 bytes, including three padding bytes
Block total lengthEntire block, including header, metadata, optional fields and trailing length

In a hypothetical block with 61 saved packet bytes, the packet data is followed by three padding bytes to reach a 32-bit boundary. An examiner comparing a packet’s byte sequence with another copy should stop at the 61st byte. A length measured through the end of the padded span would imply three extra bytes. Comments and other options can increase the total block length without changing the captured packet length at all.

Stop at byte 61 when comparing the saved packet bytes. Alignment and options contribute to the block length.

State which object a count or hash describes. An evidence file digest covers the whole file, including its block metadata. A comparison confined to captured bytes addresses the saved packet representation. For a claim about an application payload, locate the payload within those captured bytes using the applicable link, network and transport headers. An offset from the beginning of the block and a payload offset describe two different positions.

Interpret Timestamp Ticks With the Correct Interface Options

An Enhanced Packet Block timestamp stores the upper and lower halves of a single unsigned count of ticks. The Interface Description Block specifies the tick length. Its optional if_tsresol encodes a decimal or binary resolution, and if_tsoffset supplies an offset in seconds. With the defaults, ticks represent microseconds and the offset is zero. Use the interface referenced by the packet within the current section to determine both values. IETF PCAPNG Format Draft

In a hypothetical test file, the count for interface A increases by 1,024 ticks, and its resolution is 1/1,024 second per tick. That is a measured difference of one second. Interface B also shows a difference of 1,024 ticks and uses microseconds, so the reported difference there is 1.024 milliseconds. Two equal tick differences represent different intervals.

Retain absolute times and interface assignments if you compare event order across those streams. Applying a documented offset decodes the time in the file. A separate comparison with a shared clock reference can address clock synchronization and uncertainty. For a duration within one interface, a constant offset cancels in subtraction. Between interfaces, different offsets and errors may matter.

Describe File Damage Separately From Capture Truncation

A saved packet can contain its full declared captured length even though the recorder clipped the original packet. A file can also end before the reader reaches all the bytes promised by a record or block. In the first case the stored bytes agree with the recorded capture length. In the second case there is a structural problem to document. In classic PCAP, the per-packet capture length describes the bytes immediately after its header. IETF PCAP Capture File Format Draft

Consider two hypothetical files. In one, an otherwise complete packet record reports a captured length of 96 and an original length of 144. The file includes exactly those 96 recorded bytes. In the other, the same captured length appears in the final record but only 23 bytes follow before end of file. The first record supports a 96-byte analysis. The second calls for verifying the received size, integrity and export or transfer conditions.

Check the declared captured length against the bytes present. A complete saved prefix supports analysis of that prefix. An incomplete record calls for integrity and export checks.

If a reader opens a damaged file and displays earlier records, note where its interpretation stops and which checks succeeded. Verify any cited earlier records against the preserved input or another documented reader when the finding warrants it. If the producer has a separate intact export, register it as a distinct item and record the relationship. An apparent stop at the final readable packet cannot establish when the collector stopped recording.

If the source digest matches, the bytes you received agree with that reference even if the reference file already contained an incomplete record.

Casework Example

Lesson Review

Check Your Understanding

Question 1 of 5· 0 answered
Where does classic PCAP put the link type that applies to the file?

Test yourself on Network Forensics with free, timed mocks.

Practice Network Forensics questions

Found this useful? Pass it along.