Uniquely Identifying Network Sessions for Traffic Analysis
In network traffic analysis, the 5-tuple is a set of five values that uniquely identifies a bidirectional network flow or session. Every packet traveling across a network contains these five pieces of information.
Firewall policies match on 5-tuple values to permit or deny traffic. Understanding this helps you read and write effective rules.
NetFlow/IPFIX records are organized by 5-tuple. You'll query flows using these fields constantly.
When investigating alerts, you'll pivot on source/destination IPs and ports to find related malicious activity.
Correlating events across logs requires matching 5-tuples to reconstruct what happened during an incident.
Let's examine where each tuple element lives within a network packet. Click "Generate New Packet" to see different examples.
| Number | Protocol | Description | Has Ports? |
|---|---|---|---|
| 1 | ICMP | Internet Control Message Protocol (ping, traceroute) | No |
| 6 | TCP | Transmission Control Protocol (reliable, connection-oriented) | Yes |
| 17 | UDP | User Datagram Protocol (fast, connectionless) | Yes |
| 47 | GRE | Generic Routing Encapsulation (tunneling) | No |
| 50 | ESP | Encapsulating Security Payload (IPsec) | No |
NetFlow and firewall logs display connection information using 5-tuple format. Practice reading these entries to identify sessions.
| Source IP | Src Port | Dest IP | Dst Port | Protocol | Action |
|---|
When a client connects to a server, there are actually two flows:
192.168.1.100:52431 → 10.0.0.50:443 (TCP)
10.0.0.50:443 → 192.168.1.100:52431 (TCP)