Skip to content

The OSI Model and Protocols for Network Investigators

The OSI reference model divides network communication into seven layers, each generating distinct forensic artifacts that investigators can recover from packet captures, logs, and device memory. This topic explains how TCP/IP, DNS, HTTP/S, and common application-layer protocols create evidence, and how investigators locate and interpret that evidence at each layer.

Last updated:

Share

The OSI (Open Systems Interconnection) reference model organises network communication into seven numbered layers, from the physical transmission of bits at Layer 1 to the application protocols at Layer 7. Each layer adds its own header information to data passing downward from sender to receiver, and strips that header information on the way back up at the receiving end. For a network investigator, this layered structure means that a single packet capture file contains simultaneous artifacts from multiple layers: the MAC addresses recorded by Layer 2 (Data Link), the IP addresses from Layer 3 (Network), the TCP port numbers and sequence numbers from Layer 4 (Transport), and the HTTP request or DNS query from Layer 7 (Application). Understanding which layer produced a particular field is the basis of any packet-level analysis.

The TCP/IP protocol suite, which is the practical implementation of the OSI model's concepts in the global internet, collapses the seven OSI layers into four functional layers: Link, Internet, Transport, and Application. TCP/IP is what investigators actually encounter when examining network traffic. The OSI model remains useful as a diagnostic and analytical framework because it provides a shared vocabulary for describing where in the communication stack a particular piece of evidence originates. When an investigator says a finding is at the transport layer, every other investigator knows they mean TCP or UDP fields, not IP addresses and not application data.

Network protocols generate forensic artifacts in two primary forms: live traffic captured in packet capture (PCAP) files using tools such as Wireshark, tcpdump, or commercial network forensics platforms, and log data recorded by network devices such as routers, firewalls, DNS resolvers, web proxies, and email servers. Each protocol leaves a different signature in these artifacts. DNS queries reveal domain lookups. HTTP transactions record URLs, user-agent strings, and server responses. SMTP headers trace an email's path through multiple mail transfer agents. Investigators must know what each protocol records, where those records are kept, and how to extract and interpret them under conditions that preserve evidential integrity.

By the end of this topic you will be able to:

  • Name the seven OSI layers and identify the forensic artifacts each layer generates in a packet capture.
  • Explain the TCP three-way handshake and describe the evidential significance of SYN, SYN-ACK, and ACK timestamps in an investigation.
  • Identify the DNS fields that reveal domain lookups, query timing, and resolver paths, and explain how DNS tunnelling is detected.
  • Describe the HTTP/S fields that carry forensic value and explain what TLS encryption conceals and what it leaves visible.
  • Match common application-layer protocols (SMTP, FTP, SMB, IMAP) to the types of cases where their traffic is most likely to appear as evidence.
Key terms
Encapsulation
The process by which each OSI layer wraps the payload from the layer above it inside its own header (and sometimes trailer). A packet capture shows the result of encapsulation: the outermost frame contains all inner headers nested inside it.
PCAP (packet capture file)
A binary file format that stores raw network traffic captured from a network interface. Tools such as Wireshark, tcpdump, and Zeek read PCAP files and decode the encapsulated protocol headers at each layer.
TCP three-way handshake
The connection establishment sequence in TCP: the client sends SYN, the server responds SYN-ACK, and the client completes with ACK. The timestamps on these three packets establish the precise time a connection began and are a standard artifact in network investigations.
Server Name Indication (SNI)
A TLS extension in which the client includes the target hostname in the ClientHello message before encryption is established. SNI is visible in plaintext in a packet capture even when HTTPS content is encrypted, revealing which website a device was connecting to.
DNS query log
A record maintained by a DNS resolver listing each domain name query, the requesting IP address, the response, and the timestamp. DNS query logs are a primary source of evidence in investigations involving malware command-and-control, phishing, and DNS tunnelling.
Protocol Data Unit (PDU)
The named unit of data at each OSI layer: a frame at Layer 2, a packet at Layer 3, a segment at Layer 4, and a message or datagram at Layer 7. Investigators use these terms to specify precisely which layer of a capture they are analysing.

The Seven OSI Layers and Their Forensic Artifacts

The OSI model was published by the International Organization for Standardization in 1984. It describes seven distinct layers of abstraction through which data passes when two systems communicate. In a forensic context, the model is a map: it tells the investigator which layer produced the evidence they are looking at and therefore which tool and method is appropriate for extraction.

LayerNameProtocol examplesForensic artifacts
7ApplicationHTTP, DNS, SMTP, FTP, SMBURLs, email content, filenames, query strings, user-agent strings
6PresentationTLS/SSL, JPEG encodingTLS handshake records, certificate fields, SNI hostname, cipher suite
5SessionNetBIOS, RPCSession identifiers, connection sequence, authentication exchanges
4TransportTCP, UDPPort numbers, sequence numbers, handshake timestamps, connection state
3NetworkIP, ICMPSource and destination IP addresses, TTL values, fragmentation flags
2Data LinkEthernet, Wi-Fi 802.11MAC addresses, BSSID, 802.11 frame headers, ARP tables
1PhysicalCables, radio signalsSignal analysis, channel data, hardware identifiers at RF level

In practice, investigators work most often at Layers 2 through 7. Layer 1 analysis requires specialised radio frequency or cable-tap equipment and arises in wireless eavesdropping cases. Layers 2 and 3 are where device and network identity artifacts live: MAC addresses identify hardware interfaces, IP addresses identify logical hosts, and ARP tables show which MAC was associated with which IP at a given time. Layers 4 and 7 are where connection and content evidence lives.

TCP/IP at Layers 3 and 4: Connection Evidence

The Internet Protocol (IP) at Layer 3 provides the addressing that routes packets between networks. Each IP packet header contains a source IP address, a destination IP address, a Time-To-Live (TTL) value, and a protocol identifier (6 for TCP, 17 for UDP). The TTL decrements by 1 at each router hop; its value when captured can indicate approximately how many hops remain from source, which helps investigators estimate the geographic or network distance of the origin. IP fragmentation flags appear when large packets are split across links with smaller maximum transmission units.

TCP at Layer 4 adds port numbers, sequence numbers, acknowledgment numbers, and control flags. Source and destination port numbers identify the service: port 80 is HTTP, port 443 is HTTPS, port 25 is SMTP, port 53 is DNS (over UDP by default, TCP for large responses). The TCP three-way handshake produces three packets with precise timestamps. In an investigation timeline, the SYN packet timestamp is when the client initiated the connection, which can be correlated with user activity logs, authentication events, or system clock artifacts.

TCP sequence numbers allow reconstruction of the byte stream from out-of-order or fragmented captures. Tools like Wireshark perform this reassembly automatically and present the application-layer payload as a readable stream. This is how an investigator can extract a file download, a form submission, or an email body from a packet capture even if the underlying packets arrived in a non-sequential order. UDP provides no equivalent reassembly mechanism; UDP-based protocols either handle ordering in the application layer or accept potential loss.

DNS: The Directory Service as Evidence Source

DNS (Domain Name System) translates human-readable domain names into IP addresses. Nearly every internet connection is preceded by a DNS query, which makes DNS logs a near-complete record of a device's outbound connection attempts. A DNS query contains the querying IP address, the domain name requested, the query type (A for IPv4, AAAA for IPv6, MX for mail servers, TXT for text records), and a timestamp. The response contains the IP address returned and the Time-To-Live, which indicates how long the resolver caches the result.

DNS logs are maintained by several different systems and each has a different retention policy and legal access pathway. The authoritative name servers for a domain are operated by the domain owner. The recursive resolver is typically operated by the user's ISP or by a third-party resolver (Cloudflare 1.1.1.1, Google 8.8.8.8). Enterprise networks often run internal recursive resolvers with centralised logging. In an investigation, obtaining DNS logs from the internal corporate resolver is often faster and produces more detail than approaching the ISP.

DNS tunnelling is a technique used to exfiltrate data or establish covert command-and-control channels by encoding data inside DNS query and response fields. An attacker controls a domain and its authoritative name server. The malware on the victim machine sends DNS queries for subdomains that encode exfiltrated data: for example, base64-encoded file chunks as successive subdomains of attacker-controlled.com. The responses carry encoded instructions. Detection signatures include: unusually long subdomains, high query frequency to a single domain, low TTL values, and TXT or NULL record type queries. Zeek (formerly Bro) network monitoring software includes DNS analysis modules specifically designed to flag tunnelling patterns.

HTTP and HTTPS: Web Traffic as Evidence

HTTP (Hypertext Transfer Protocol) operates at Layer 7 and is the primary protocol for web communication. An HTTP request contains: the method (GET, POST, PUT, DELETE), the URL path, the HTTP version, the Host header identifying the target domain, the User-Agent header identifying the client software and version, Cookie headers carrying session tokens, and in POST requests, the message body which may contain form data, file uploads, or API payloads. The server response includes a status code, content-type, and the response body. All of these fields are plaintext in unencrypted HTTP traffic and are directly readable in a packet capture.

HTTPS adds TLS encryption between the TCP layer and the HTTP application layer. The TLS handshake, which occurs after the TCP handshake, is visible in a packet capture: it includes the ClientHello (containing the supported cipher suites and, critically, the SNI hostname extension), the ServerHello, and the server certificate chain. The certificate reveals the server's identity, the issuing certificate authority, and validity dates. Once the handshake completes, the HTTP request and response content are encrypted and not readable without the session keys.

Investigators use several approaches when HTTPS encryption blocks content access. In controlled environments (corporate networks or endpoint forensics), TLS session keys can be extracted from browser memory or from a SSLKEYLOGFILE log maintained by the browser, and these keys can be loaded into Wireshark to decrypt captures. Network proxy logs (from devices that perform TLS inspection) record the decrypted HTTP fields on the proxy side. Web server access logs record the same request fields on the server side. When none of these are available, investigators work with the metadata: connection endpoints, data transfer volume, timing, and SNI values.

Application-Layer Protocols in Common Investigations

Email protocols generate artifacts that trace message paths across multiple systems. SMTP (Simple Mail Transfer Protocol, port 25 or 587) is used between mail servers and from mail clients to outgoing servers. Each SMTP server that handles a message prepends a Received header to the message, creating a chain that records the IP address and hostname of each mail transfer agent and the timestamp at each hop. These Received headers are not encrypted and are included in the raw message source, which investigators can obtain from the receiving mail server.

FTP (File Transfer Protocol) uses two separate TCP connections: a control channel on port 21 for commands and responses, and a data channel (port 20 in active mode, or an ephemeral port in passive mode) for file content. FTP credentials and commands are transmitted in plaintext on the control channel. SFTP (SSH File Transfer Protocol) and FTPS (FTP over TLS) encrypt these fields; the underlying connection metadata (IP addresses, port numbers, connection timestamps) remains visible. SMB (Server Message Block), used for Windows file sharing on ports 445 and 139, records file access events that appear in Windows Security Event Logs as well as in packet captures.

IMAP (Internet Message Access Protocol, port 143 or 993 over TLS) and POP3 (port 110 or 995 over TLS) are used by email clients to retrieve messages from mail servers. IMAP keeps messages on the server and is common in enterprise environments; POP3 downloads and optionally deletes them, making the server-side copy unreliable after retrieval. In investigations involving cloud email (Microsoft 365, Google Workspace), investigators typically obtain records via lawful process to the provider rather than from packet captures, because the traffic is encrypted and the provider's audit logs contain more structured data than a network capture would yield.

ProtocolPort(s)Evidence plaintext?Key forensic artifact
HTTP80YesURLs, user-agent, cookie, POST body
HTTPS443No (content encrypted)SNI hostname, certificate, TLS version, transfer size/timing
DNS53 UDP/TCPYesQueried domain, query type, response IP, timestamp
SMTP25, 587Yes (unless STARTTLS)Received headers, sender, recipient, message-id
FTP21 (control)YesCredentials, commands, filenames
SMB445Partial (auth often encrypted)File access paths, user account, timestamps
IMAP143, 993143 yes / 993 noMailbox operations, folder structure, message flags

Lawful Capture, Chain of Custody, and Jurisdictional Frameworks

Network traffic capture requires legal authority in every jurisdiction. In the United States, the Electronic Communications Privacy Act (ECPA) and the Wiretap Act (18 U.S.C. Chapter 119) govern real-time interception of network traffic, with separate provisions for stored communications under the Stored Communications Act. A pen register order authorises collection of metadata (IP addresses, port numbers, connection times) without a full wiretap warrant. In the United Kingdom, the Investigatory Powers Act 2016 governs both targeted interception and bulk collection, with oversight by the Investigatory Powers Commissioner. In the European Union, the General Data Protection Regulation (GDPR) and the e-Privacy Directive impose constraints on the retention and processing of traffic data. In India, the Information Technology Act 2000 as amended authorises interception under Sections 69 and 69B, with the Digital Personal Data Protection Act 2023 adding further constraints on data handling.

Chain of custody for packet captures begins at acquisition. The investigator must document the interface from which traffic was captured, the tool used (including version), the exact capture filter applied if any, the start and end timestamps, and the hash value (SHA-256) of the resulting PCAP file. Wireshark and tcpdump both record capture start time in the PCAP global header. Any analysis that modifies the file, such as applying a display filter in Wireshark and saving a filtered copy, must be documented as a derivative work, with the original PCAP preserved separately.

Log records obtained from ISPs, corporate network devices, or cloud providers are typically produced in response to a court order or equivalent legal process. The legal standards differ: metadata (connection logs, DNS query logs) often requires a lower threshold than content (intercepted payloads). Investigators working across borders must account for mutual legal assistance treaty (MLAT) requirements when the network device or server is in a different country from the investigation. The Legal and Jurisdictional Frameworks topic covers the procedural requirements in detail.

Check your understanding
Question 1 of 4· 0 answered

An investigator examining a packet capture finds a TLS ClientHello packet. Which OSI layer produced this record, and what forensic field within it is visible in plaintext despite the encryption?

Key Takeaways

  • The OSI model's seven layers each generate distinct forensic artifacts: MAC addresses at Layer 2, IP addresses and TTL at Layer 3, port numbers and TCP sequence numbers at Layer 4, TLS handshake records and SNI at Layer 6, and protocol content at Layer 7.
  • DNS query logs are a near-complete record of outbound connection attempts from a device and are the primary detection point for malware command-and-control, DNS tunnelling, and domain-generation algorithm traffic.
  • HTTPS encrypts application-layer content but leaves the TLS handshake, including the SNI hostname and server certificate, visible in plaintext; session key files or proxy logs are required to access the HTTP request and response bodies.
  • NAT means that a public IP address in a packet capture identifies a gateway, not a device; attribution to an individual host requires the NAT router's session logs mapping internal IP and port to the external connection.
  • Network traffic capture requires specific legal authority in every jurisdiction, from the US Wiretap Act and Stored Communications Act to the UK Investigatory Powers Act 2016 and India's IT Act 2000; lawful process requirements differ between metadata and content, and cross-border cases require MLAT procedures.
Why does the OSI model matter for forensic investigators?
The OSI model gives investigators a structured way to reason about where evidence lives in a network communication. Each layer encapsulates its own headers and payloads, so a packet capture contains artifacts from multiple layers simultaneously. Knowing which layer produced a particular field tells the investigator where to look, what tool to use, and how to interpret what they find.
What forensic evidence does DNS traffic generate?
DNS queries and responses are logged by resolvers, firewalls, and endpoint security tools. They reveal which domain names a device requested, when, and from which IP address. DNS logs are particularly valuable for identifying command-and-control communication, data exfiltration via DNS tunnelling, and the timing of malware activity. Many jurisdictions allow DNS logs to be obtained from ISPs under lawful process.
What is the difference between a TCP handshake and a session in forensic terms?
The TCP three-way handshake (SYN, SYN-ACK, ACK) establishes a connection and is visible in a packet capture as the first three packets of any TCP session. Forensically, the handshake timestamps establish when a connection was initiated. The session itself is the full sequence of packets exchanged between handshake and teardown, and it contains the application-layer payload, which may include HTTP requests, email content, or file transfers.
Can investigators recover HTTPS content from a packet capture?
HTTPS encrypts the application-layer payload using TLS, so the content of HTTP requests and responses is not visible in a standard packet capture. However, the TLS handshake reveals the server certificate and the negotiated cipher suite, and the Server Name Indication (SNI) field reveals the hostname in plaintext even when the content is encrypted. Session keys logged by the browser or endpoint can decrypt captures in controlled environments.
What application-layer protocols are most commonly analysed in network forensics?
HTTP and HTTPS are the most common because most internet traffic uses them. Email protocols (SMTP, IMAP, POP3) appear in corporate investigations and phishing cases. FTP and SMB appear in data theft cases. DNS is analysed in nearly every investigation. Messaging apps use proprietary protocols over TLS, but metadata such as connection endpoints and timing is visible even when content is encrypted.

Test yourself on Mobile and Network Forensics with free, timed mocks.

Practice Mobile and Network Forensics questions

Found this useful? Pass it along.

Share

Spotted an error in this page? Report a correction or read our editorial standards.

Your journey to becoming a forensic professional starts here.

Practice with mock tests, learn from structured notes, and get your questions answered by a global forensic community, all in one place.