Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
Network Forensics Foundations: Capture Files, Vantage Points, Packet Loss and Evidence Hashing
Introduction
Network evidence reaches an investigator as somebody else's record: an alert, a log line, a capture file handed over by the network team. Every one of them was made by a device at a place, and the device and the place decide what it could record.
Before a capture can carry a finding, two questions have to be answered about it: what each field in it means and who wrote it, and whether the capture itself is complete and intact.
Every stage can lose or change something. A capture is checked at each one before it is relied on.
This lesson answers both on the course's own lab network: a small company with two workstations on a LAN, a resolver and a web proxy in a server segment, and a firewall that translates every outbound connection to one public address. It reads one connection on both sides of that firewall, then reads five captures of the lab's traffic for what each kept and lost.
Module 1 teaches the network fundamentals in full, and Module 2 the collection and preservation of captures.
The Record You Are Handed
An alert names fields from packetsSuppose the perimeter sensor reports a connection from the company's public address to a web server. Zeek, which Module 4 covers in full, wrote this line about it:
ts id.orig_h id.orig_p id.resp_h id.resp_p service
2026-11-09 19:42:03.289 198.51.100.10 40902 203.0.113.80 443 ssl
Every value in that line except the time was read from packet headers: the two addresses from the IP header, the ports from the TCP header, the service from what Zeek recognized in the payload.
The sensor added only its clock. That is true of almost every network record an investigator meets, from a firewall log to a flow export, which is why the first skill is knowing which device wrote each field.
The originator address in the line is 198.51.100.10. It belongs to the company, so the first instinct is to say the company's network made the connection, which is true, and that the host at that address made it, which is not. That address is the firewall's. Some workstation behind the firewall made the connection, and this sensor, outside the firewall, cannot say which.
Ask of every field in a record
The sender, a router, a firewall doing NAT, or the sensor itself
Inside or outside the firewall, on which segment, by which sensor
And which other record would show the missing part
Those three questions apply to every record the course reads. The alert is where an investigation starts, not the evidence it ends on.
The line also has things it cannot say. It does not name a user, because no packet carries one. It does not name the program on the workstation that opened the connection, because that is endpoint evidence, which Module 12 joins in. And it does not say what was fetched, because the service is TLS and the content is encrypted.
An investigator who knows what a record cannot say writes findings that stop where the evidence stops, and asks for the other record that would continue them.
The time deserves the same care. The timestamp is the sensor's clock when the first packet reached it, written in seconds since 1970 in UTC and converted for display. A second sensor with a clock a few seconds off will disagree with this one about the same packet, and Module 2 shows how to measure the difference rather than guess it.
Who Wrote Each Field
The same packet on both sides of the firewallThe lab has a sensor on each side of the firewall, so the same connection can be read twice. Here is its first packet, frame 5 in both captures, with five fields from each:
$ for f in inside outside; do tshark -r $f.pcap -Y frame.number==5 \
-T fields -e ip.src -e ip.dst -e ip.ttl -e tcp.srcport -e ip.id; done
10.20.30.45 203.0.113.80 64 40902 0xee5e
198.51.100.10 203.0.113.80 63 40902 0xee5e
Drawn as the path the packet took, with the fields each side recorded:
The firewall rewrote the source address and lowered the TTL by one; the source port 40902 and the IP ID 0xee5e passed through unchanged, which is what ties the two records together.
The first line is the LAN sensor; the second is outside. The destination is the same. The source address changed from 10.20.30.45 to 198.51.100.10, because the firewall rewrote it on the way out: source NAT.
The time to live dropped from 64 to 63, because the firewall is a router and every router lowers it by one, so the TTL difference counts the routers between two sensors. The source port, 40902, and the IP identification, 0xee5e, are identical on both sides.
Those unchanged fields are what join the two records. The outside line names only the firewall; the inside line names the workstation; the shared port and IP ID prove they are the same packet. This firewall happened to leave them alone. Many rewrite the port as well, and Module 1 shows how to join across NAT when the cheap fields change, using translation logs and timing.
The question this answers in practice is attribution. A complaint arrives naming the company's public address, a destination and a time. The outside record confirms the connection; only the inside record, joined on the surviving fields, names the workstation. Without an inside sensor or the firewall's own translation log, the attribution stops at the firewall, and the finding says so.
The general rule is that a field is evidence of what the device that last wrote it put there. The TTL outside is the firewall's. The source address outside is the firewall's. The destination and the payload are the sender's, carried unchanged. Reading a record means knowing which is which.
What a Capture File Records About Itself
Before you read a packet, read the fileA capture file is more than its packets. It records the format it was written in, the link type, how many bytes of each packet were kept, and the time of its first and last packet. capinfos, which ships with Wireshark, prints all of it:
What a capture file records about itself
Each of those is a line in capinfos' output. Run on two files from the lab, with the options for counts, sizes, the time range and the encapsulation:
$ capinfos -c -l -s -d -a -e -i switch.pcapng trunc.pcap
File name: switch.pcapng
Packet size limit: file hdr: (not set)
Number of packets: 433
File size: 336 kB
Data size: 321 kB
Earliest packet time: 2026-11-09 20:31:42.911174546
Latest packet time: 2026-11-09 20:31:52.184328212
Data bit rate: 277 kbps
File name: trunc.pcap
Packet size limit: file hdr: 96 bytes
Packet size limit: inferred: 96 bytes
Number of packets: 433
File size: 42 kB
Data size: 321 kB
Earliest packet time: 2026-11-09 20:31:42.911174
Latest packet time: 2026-11-09 20:31:52.184328
Data bit rate: 277 kbps
These two files hold the same 433 packets from the same nine seconds on the LAN switch, and their data size, the bytes that crossed the wire, is identical at 321435.
The difference is the packet size limit. switch.pcapng has none set and kept every byte. trunc.pcap was captured with a snap length of 96 bytes, so the capture tool kept only the first 96 bytes of each packet, and its file is a fraction of the size.
The file also records its timestamp precision. switch.pcapng is pcapng with nanosecond resolution; trunc.pcap is classic pcap with microseconds. Neither precision says anything about accuracy: a nanosecond timestamp from a clock that is two seconds wrong is precisely wrong. Module 2 measures a sensor's clock offset from packets matched across the NAT.
The time range matters as much as the counts. A capture that starts after the event, or ends before it, cannot show the event, however carefully it is read. Comparing the first and last packet times against the window the investigation cares about is a ten-second check that saves hours of searching for traffic the file never held.
capinfos is the first command to run on any capture you are handed, before opening it in Wireshark, and its output belongs in the case notes. It costs a second and tells you what the file can and cannot support.
What a Short Snap Length Leaves
Headers without payloadsA snap length is a deliberate choice: keep headers, drop payloads, and a capture lasts far longer on the same disk. The cost shows up the moment the payload matters. Here is one packet from the short capture:
$ tshark -r trunc.pcap -Y frame.number==24 \
-T fields -e frame.len -e frame.cap_len -e _ws.col.Protocol
194 96 TCP
The packet was 194 bytes on the wire and 96 were kept, and TShark marks it as limited during capture. 221 of the file's 433 packets were cut short the same way. The addresses, ports and flags are all there; the HTTP request inside the packet is not, so TShark calls it TCP rather than HTTP.
Zeek, run over the same file, reaches the same limit from the other side:
capture dst port service missed_bytes history
trunc.pcap 80 - 262408 ShADaGdggFf
uplink.pcap 80 http 0 ShADadFf
Over the full uplink capture, Zeek identified the connection as HTTP and missed nothing.
Over the truncated capture it could not identify the service at all and reports hundreds of thousands of missed bytes. Its history carries G and g, content gaps on the originator's and the responder's side; Zeek's documentation notes that it records gaps logarithmically, a repeated letter meaning ten times as many, so the letters show that gaps happened rather than how many.
A connection log built from a short-snap capture still answers who talked to whom, when and how much; it cannot answer what was said, or even reliably which protocol was spoken.
The two files make the trade-off concrete. On the same nine seconds of traffic, the short snap length produced a file a fraction of the size of the full capture, which at the same disk budget means many times the retention.
An organization that keeps headers for months and full packets for days has made exactly this trade, and an investigator working an older incident will usually be reading the headers-only copy.
None of this makes truncated captures wrong. They are the right choice for long retention of headers. The investigator's job is to read the snap length before writing a finding that needs the payload, and to say so plainly in the finding when the capture cannot support it.
Where It Was Taken Decides What It Saw
Three captures of the same nine secondsThe same activity, captured at the same moment from two places, produces different evidence:
Where a sensor sits decides what it can record; how it is configured decides how much of each packet it keeps.
The LAN switch mirror saw 433 packets. The sensor on the firewall's uplink saw 391. The missing 42 were never going to reach it: a connection from one workstation to the other on port 8000, which stayed on the switch, and an ARP exchange. Every packet the uplink could see, it captured; its counters show no drops, so the difference is entirely a matter of where it sat.
The reasonable mistake
Treating a missing connection as one that never happened
An analyst searches the firewall uplink capture for traffic between two workstations, finds none, and writes that ws45 never connected to ws46. The connection happened; 41 of its frames are in the LAN switch capture. It never crossed the firewall, so the uplink sensor could not have seen it.
Instead: Write absence as a property of the capture point: "no connection between the two hosts appears at the uplink sensor, which does not see traffic that stays on the LAN switch." Then go and get the capture that could have seen it.
The same reasoning applies in reverse. A connection that appears at the uplink did cross the firewall, which a LAN capture alone could not prove. Each vantage point adds certainty about some paths and none about others, and an investigation that has two sensors, one each side of the firewall, can say far more than one that has either alone.
A capture point is a choice about what can be seen, and every location has blind spots: the uplink cannot see LAN-local traffic, a LAN mirror cannot see what the firewall changed, and nothing outside an encrypted tunnel can see inside it. Module 1's lesson on capture location compares the lab's sensors directly, and Module 2 covers taps, mirror ports, host capture and cloud mirroring, each with what it misses.
Vantage also changes what the fields mean. The same connection seen at the uplink carries the workstation's private address; seen outside the firewall it carries the public one, as section 2 showed. A finding that quotes an address without the sensor it came from leaves the reader to guess which side it was on.
The practical rule, then, is to write the vantage point into every finding drawn from a capture, so that the reader can tell an absence that means something from an absence the sensor could not have avoided.
What Was Lost, and How the Capture Says So
Three independent signalsA capture can also miss packets it was in a position to see, when the capture process falls behind the traffic. The lab recorded one file download twice, once by a capture that kept up and once by one that did not. The capture tools' own reports, written when each stopped:
$ cat stats-kdrop.txt stats-kdrop-ref.txt | cut -c1-80
tcpdump: listening on ptra, link-type EN10MB (Ethernet), snapshot length 262144
2319 packets captured
2330 packets received by filter
11 packets dropped by kernel
Capturing on 'ptrb'
File: kdrop-ref.pcap
Packets captured: 2330
Packets received/dropped on interface 'ptrb': 2330/0 (pcap:0/dumpcap:0/flushed:0
tcpdump reported 11 packets dropped by the kernel; the reference capture of the same download, by dumpcap, reported none and holds exactly 11 more packets. Those counters are the first signal, and they only exist if whoever collected the capture kept the tool's output. Many captures arrive without it.
The packets themselves are the second signal. TCP numbers every byte, so a gap in the sequence numbers shows that a segment the receiver acknowledged was never captured:
$ tshark -r kdrop.pcap -Y tcp.analysis.lost_segment \
-T fields -e frame.number -e tcp.seq | head -4
299 217407
571 438951
825 663391
1063 890727
TShark flags 7 places in the lossy capture where a previous segment was not captured, and none in the reference. The third signal is Zeek's connection log, which reports bytes it could not reassemble:
capture service resp_bytes missed_bytes history
kdrop.pcap http 2097358 10136 ShADadgfF
kdrop-ref.pcap http 2097358 0 ShADadfF
The same connection, the same response size, and in the lossy capture 10136 missed bytes and a g in the history. Zeek's own documentation describes missed bytes as representative of packet loss, and g as a content gap on the responder's side. Three signals from three places, each available when the others are not:
Three ways a capture tells you it lost something
tcpdump reported 11 packets dropped by the kernel
TShark flags 7 segments where an earlier one was not captured
missed_bytes 10136 and a g, for gap, in the history
The three signals fail differently. The counters are only as good as the collector's record-keeping. The sequence gaps only appear in TCP, so a UDP stream that lost packets shows nothing comparable. Zeek's missed bytes only appear for connections Zeek reassembles. An investigator checks whichever signals the capture allows and states which were available, because a missing signal is not the same as a clean one.
A capture with gaps is still evidence. It cannot support a claim about the exact contents of what was transferred, and the finding says so. Module 2 adds loss on the network itself and on the mirror path, which look different again.
Keeping It
A hash fixes the fileA finding cites a packet by file and frame number, and a reviewer can only check it if they have exactly the same file. A cryptographic hash makes that checkable:
$ sha256sum switch.pcapng trunc.pcap uplink.pcap
8d2d057ef6d8f97c3a1e1997ea356074fd02fbd878de6c5cd9909d42a71f2b91 switch.pcapng
5ca4762695a1da67f459a3ada21ee340928dbe28381224a847aab24eb5d537e5 trunc.pcap
3b8f7a160787f32d4d61a6fe4e6e3a14e4e0f0e92bdaf05be381782c647b1a1e uplink.pcap
Each line is a SHA-256 hash of one file. Change a single byte, or filter the capture and save the result, and the hash changes completely. That is the point: a hash recorded at collection, carried with the file and recomputed by whoever receives it, proves the file has not changed. Frame numbers are only meaningful for one specific file, so a citation names the file and its hash together.
Record the hash at the moment of collection, not after analysis has begun. A hash computed later proves only that the file has not changed since then.
Hashing is the start of handling, not the whole of it. The collection is logged: who captured, where, when, with what tool and settings, and with what counters at the end.
The original is kept untouched and work is done on a copy. Every transfer is recorded. Module 2's lesson on preserving evidence covers chain of custody, storage, transfer and the authority and privacy questions that come with capturing other people's traffic.
All of that comes together in a statement that travels with the capture and tells a reader what it can carry:
An integrity statement, in four lines
File name, SHA-256, size, first and last packet time
Where the sensor sat, and what that point could not see
Snap length, drop counters, gaps found in the packets
Who collected it, when, how it reached you, what you worked on
A statement like this is short, and writing it takes minutes once the checks are done. Its value is that it separates the claims the capture supports from the ones it does not before anyone relies on it, and it gives a reviewer a list of things to check rather than a conclusion to trust.
The four lines answer the questions every reviewer asks: is this the file, where was it taken, is it complete, and who has handled it. Module 2 ends with an exercise that writes one for two supplied captures and tests the collector's claims against the files.
What Modules 1 and 2 Build On It
Fundamentals, then collectionModule 1 reads the network the way an investigator needs it: packets as evidence, addressing and routing, ports and sessions, name resolution, NAT and proxies, enterprise architectures, and capture location, each from the lab's own captures. Module 2 then collects: what a capture file holds, where to tap, capture filters and snap length, dropped and missing packets, timestamps and clocks, rolling capture and retention, and preserving evidence.
The two modules in order:
Modules 1 and 2, in order
The order is deliberate. Reading a packet correctly comes before deciding where to capture it, and both come before judging whether a capture someone else made can be trusted, which is the question most real investigations start with, usually under time pressure and with a capture somebody else configured.
Both modules end on exercises that look like the work: mapping six outside connections to their hosts and paths, and writing an integrity statement for two captures whose collector made claims the files do not support.
The habits in this lesson run through every later module. Every record is read for who wrote each field, every capture for where it was taken and what it lost, and every finding for the file and hash it rests on.
Each lesson in those modules is built on captures from the same lab, taken with the commands shown, so every packet a lesson cites can be opened and checked by the student. That is the standard the course holds its findings to, and the reason this lesson spent its time on what a capture can and cannot carry before any analysis.
The lab captures in this lesson are the same ones the modules use, so the hosts, addresses and files here recur. The lab pack that holds them, and the tools to read them, are set up in the course's Lab Setup pages.
Practice
Can this capture carry the finding? the lab capturesThe prepared evidence below is five captures from the lab network: what each file says about itself, what its capture tool reported when it stopped, and Zeek's view of the same downloads. Decide which captures can be relied on, and for what.
If you have Wireshark installed, run capinfos on any capture of your own and read the packet size limit, the time range and the encapsulation before opening it. Then check whether whoever made it kept the capture tool's final counters, because without them the first signal of loss is gone.
A network record is a set of fields written by different devices at different places, and the first question of any field is which device wrote it. A capture is checked before it is used: what the file records about itself, where it was taken, what its counters and its packets say about loss, and a hash that fixes it. Those checks decide what a finding can claim.
The next lesson opens a capture and reads one conversation in it, packet by packet.
Versions this lesson relies on: Wireshark and TShark 4.6.9; Zeek 9.0.1 (LTS); tcpdump 4.99.4.