IP Addressing and Routing Fundamentals for Investigators
Every packet on the internet carries source and destination IP addresses, and the routers between them leave a trail that investigators can follow back to a physical location. This topic covers IPv4 and IPv6 addressing, subnetting, and routing from the perspective of tracing network traffic and attributing communications to their origin.
Last updated:
An IP address is the foundational identifier that links a communication on the internet to a network location. Every connection a suspect device makes, every email sent, every file downloaded, carries a source IP address and a destination IP address. Those addresses are recorded in server logs, firewall records, and ISP databases. Investigators who understand how IP addressing works, how routers move packets between networks, and how address blocks are allocated to organisations can read those records accurately, serve the right legal process on the right provider, and present the attribution chain in court without technical error.
IPv4 uses 32-bit addresses written in dotted-decimal notation, yielding about 4.3 billion possible addresses. The exhaustion of IPv4 space drove two workarounds: Network Address Translation (NAT), which hides many devices behind one public address, and the transition to IPv6, which uses 128-bit addresses. Both introduce complications for attribution. NAT means a single public IP may represent hundreds of users, and only the ISP's internal logs resolve which user made which connection at what time. IPv6 removes NAT in most deployments but introduces privacy extensions that rotate addresses automatically.
Routing is the mechanism by which packets find their way across the internet. Each router maintains a routing table that maps destination address ranges to the next hop. The Border Gateway Protocol (BGP) is the protocol by which autonomous systems, the independently operated networks that make up the internet, advertise those ranges to each other. Understanding BGP and the Regional Internet Registry (RIR) system helps investigators identify the organisation responsible for a given IP address, a necessary step before serving any legal demand for subscriber records.
By the end of this topic you will be able to:
- Read an IPv4 address in dotted-decimal and CIDR notation, calculate the network and host portions, and identify whether an address is public or private.
- Explain how NAT works and describe what investigative steps are needed to attribute a connection made through NAT to a specific device.
- Describe how BGP and the RIR system allocate and advertise address blocks, and use WHOIS or RDAP to identify the organisation responsible for a given IP.
- Distinguish IPv6 from IPv4 in logs and explain how privacy extensions affect device-level attribution.
- Trace the chain of attribution evidence from a server log IP address through ISP subscriber records to a physical location, identifying the correct legal process at each step.
- CIDR (Classless Inter-Domain Routing)
- A compact notation for IP address ranges that appends a prefix length to the address, such as 192.168.1.0/24. The prefix length states how many leading bits identify the network. CIDR replaced the older Class A/B/C system and is the standard notation in routing tables, firewall rules, and WHOIS records.
- NAT (Network Address Translation)
- A mechanism by which a router replaces private source IP addresses with a single public IP address before forwarding packets to the internet, and reverses the mapping for returning traffic. NAT is the reason a single ISP-assigned IP may represent many users, and its internal port-mapping logs are essential for per-device attribution.
- BGP (Border Gateway Protocol)
- The routing protocol that autonomous systems use to advertise the IP address ranges they control to one another. BGP is the mechanism underlying global internet routing. Investigators use BGP data to confirm which network is originating traffic from a given address range.
- RIR (Regional Internet Registry)
- One of five organisations that allocate IP address blocks by region: ARIN (Americas), RIPE NCC (Europe, Middle East, Central Asia), APNIC (Asia-Pacific), LACNIC (Latin America and Caribbean), and AFRINIC (Africa). RIR databases are the authoritative source for address-to-organisation mapping queries via WHOIS or RDAP.
- Autonomous System (AS)
- A collection of IP networks operated under a single routing policy and identified by a unique Autonomous System Number (ASN). ISPs, large enterprises, and cloud providers each operate one or more ASes. Identifying the AS behind a suspect IP is the first step in determining which ISP or hosting provider to contact.
- IPv6 Privacy Extensions (RFC 8981)
- A mechanism defined in RFC 8981 (formerly RFC 4941) by which IPv6 hosts generate temporary randomised addresses for outbound connections, rotating them at intervals. These extensions were introduced to prevent long-term tracking of devices by server operators, but they complicate investigator attempts to link an IPv6 address observed in a log back to a specific device without ISP assistance.
IPv4 addressing and subnetting
An IPv4 address is a 32-bit number written as four octets in decimal, separated by dots: for example, 203.0.113.45. The address has two logical parts: a network portion, which identifies the network, and a host portion, which identifies the device within that network. The boundary between those two parts is defined by the subnet mask.
In CIDR notation, the mask length follows a forward slash. The address 203.0.113.45/24 means the first 24 bits (the first three octets, 203.0.113) identify the network, and the remaining 8 bits identify the host. That network can hold 254 usable host addresses (256 minus the network address and the broadcast address). A /16 network holds 65,534 hosts. A /30 holds 2 usable hosts and is typical for point-to-point router links. Knowing these calculations lets an investigator read routing tables and determine whether two addresses belong to the same segment.
| CIDR prefix | Subnet mask | Usable hosts | Typical use |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | Large RIR allocation to ISP |
| /16 | 255.255.0.0 | 65,534 | Enterprise campus or ISP region |
| /24 | 255.255.255.0 | 254 | Small office or ISP subscriber block |
| /28 | 255.255.255.240 | 14 | Small server group or subscriber |
| /30 | 255.255.255.252 | 2 | Point-to-point router link |
| /32 | 255.255.255.255 | 1 | Single host route or loopback |
RFC 1918 reserves three address ranges for private use: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These ranges are not routed on the public internet. If an IP address in an evidence log falls within one of these ranges, it identifies a position inside a local network, not a public internet endpoint. The investigator must then obtain the NAT or firewall logs from the device that connects that local network to the internet.
NAT and the attribution gap
NAT was introduced to extend the life of the IPv4 address space. A home router or ISP gateway receives one public IP address and uses it for all outbound connections from the devices behind it. When a device sends a packet outbound, the router replaces the private source IP with the public IP and assigns a port number to track the session in its translation table. The remote server sees only the public IP and the assigned port, not the private address of the originating device.
For investigators, this creates a two-step attribution problem. Step one: identify the ISP or organisation responsible for the public IP from the server log, using an RIR WHOIS or RDAP query. Step two: serve legal process on that ISP or organisation to obtain the subscriber record for that IP at the exact time of the connection. Most ISPs can return the subscriber identity from their DHCP or session logs if the request includes the IP address, the timestamp in UTC, and the protocol and port. Incomplete timestamps, or requests in local time without timezone specification, lead to misattribution because DHCP leases cycle and the same public IP may be assigned to different subscribers over time.
Legal frameworks differ by jurisdiction. In India, Section 67C of the Information Technology Act 2000 requires intermediaries to preserve logs for a period specified by the government; the Bharatiya Nagarik Suraksha Sanhita 2023 provides the procedural basis for production orders. In the United States, 18 U.S.C. § 2703 governs compelled disclosure of subscriber records from electronic communication service providers. In the United Kingdom, the Investigatory Powers Act 2016 authorises production of communications data including subscriber identity linked to an IP address. EU member states operate under Directive 2016/680 for law enforcement access to personal data held by processors.
The RIR system and WHOIS lookups
The five Regional Internet Registries distribute IP address blocks to ISPs and large organisations within their geographic regions. ARIN covers the Americas; RIPE NCC covers Europe, the Middle East, and Central Asia; APNIC covers Asia-Pacific; LACNIC covers Latin America and the Caribbean; AFRINIC covers Africa. Each RIR maintains a public database of its allocations, queryable via WHOIS (the legacy text protocol) or the modern RDAP (Registration Data Access Protocol) which returns structured JSON.
A WHOIS or RDAP query against an IP address returns the organisation that holds the address block, the range of the block (in CIDR notation), and administrative and technical contact information. This tells an investigator which ISP or hosting company to approach. It does not reveal the individual subscriber. For a cloud-hosted address (an AWS, Azure, or Google Cloud IP, for example), the WHOIS record names the cloud provider as the holder. The next step is the cloud provider's own abuse or law enforcement contact process, using a legal production order in the relevant jurisdiction.
ASNs provide a second lookup path. A BGP route lookup against an IP address returns the ASN advertising the route. Tools such as Team Cymru's IP-to-ASN mapping service or the RIPE NCC Routing Information Service (RIS) allow investigators to confirm which network is currently or historically advertising a given prefix. This matters when the WHOIS record shows a sub-allocation from a downstream provider: the BGP data shows the actual network carrying the traffic, which may differ from the resource holder named in the RIR database.
Routing and hop-by-hop evidence
Routing is the process by which packets move from source to destination across a series of routers. Each router consults its routing table, selects the best matching route for the destination address, and forwards the packet to the next hop. BGP manages the advertisement of routes between autonomous systems; Interior Gateway Protocols (IGPs) such as OSPF and EIGRP manage routing within a single AS.
Traceroute (or tracert on Windows) is the primary diagnostic tool for mapping the path a packet takes. It sends probes with incrementing Time-To-Live (TTL) values, causing each router to return an ICMP Time Exceeded message as its TTL expires, which reveals the router's IP address and round-trip time. Investigators use traceroute to identify the network path between two points, confirm geographic routing, and spot anomalies such as traffic transiting a country or ISP not expected from the address geography.
Router logs and NetFlow records are the most forensically significant routing-layer artefacts. NetFlow (and its successor IPFIX) captures per-flow summaries: source IP, destination IP, protocol, ports, byte count, packet count, and start and end timestamps. These records are compact enough for ISPs to retain for months and provide a complete picture of what traffic crossed a given router at any point in time. Full packet capture (PCAP) contains the payload of every packet but is too large for long-term retention except on small monitored segments.
IPv6 and its investigative implications
IPv6 addresses are 128 bits long, written as eight groups of four hexadecimal digits separated by colons: for example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334. Consecutive groups of zeros may be compressed to ::, so the above could be written 2001:db8:85a3::8a2e:370:7334. The network prefix is again expressed in CIDR notation after the address. ISPs typically assign subscribers a /48 or /56 prefix, leaving the subscriber to assign /64 prefixes to individual network segments.
IPv6 eliminates the need for NAT in most deployments, because the address space is large enough for every device to have a globally unique public address. This creates a direct mapping from address to interface, which simplifies some attribution steps. However, privacy extensions (RFC 8981) cause hosts to generate randomised interface identifiers for outbound connections. These temporary addresses rotate on a schedule of hours to days, so a server log may contain a sequence of different IPv6 source addresses from the same physical device over the course of a day.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address length | 32 bits (4 octets) | 128 bits (8 groups of 4 hex digits) |
| NAT in common use | Yes, widespread | Generally no; large address space removes need |
| Privacy address rotation | N/A (NAT masks device identity) | Yes, via RFC 8981 temporary addresses |
| Attribution steps | Public IP → ISP WHOIS → subscriber record via legal process | IPv6 prefix → ISP WHOIS → subscriber record + device ID via legal process |
| Address exhaustion | Exhausted in all RIR regions | No foreseeable exhaustion |
| Log appearance | 203.0.113.45 | 2001:db8:85a3::8a2e:370:7334 |
When collecting network evidence, investigators must capture both IPv4 and IPv6 traffic. A dual-stack host (one configured with both IPv4 and IPv6) may use IPv6 for connections to sites that support it and IPv4 for others. Logs from a single session may therefore span both address families. Missing one family means missing evidence.
Building the attribution chain: from log to suspect
Attribution in network investigation is a chain of evidence, not a single lookup. Each step must be documented, each record preserved with its chain of custody, and each legal process served and returned in a form acceptable to the court in the relevant jurisdiction.
- Step 1: Extract the IP and timestamp. From the server log or victim system, record the source IP address and the exact UTC timestamp of the connection. Confirm the server clock was synchronised to NTP and document any known clock offset.
- Step 2: WHOIS or RDAP query. Query the appropriate RIR database to identify the organisation or ISP responsible for the IP block. Document the query, the time of query, and the response in full. For cloud-hosted IPs, identify the provider and their law enforcement contact path.
- Step 3: Serve legal process. Issue a production order or equivalent legal demand to the identified ISP or hosting provider. Include the IP address, the UTC timestamp, and (for CGNAT environments) the source port. Request subscriber identity, service address, and any associated device identifiers.
- Step 4: Cross-reference with device evidence. Match the subscriber record against physical access to the service address. If the connection came from a shared access point (public Wi-Fi, office network), consider whether internal NAT or DHCP logs from that location can narrow the attribution to a specific device or user.
- Step 5: Corroborate with device forensics. Network attribution alone places a connection at a location. Device forensics (browser history, cached credentials, application logs) places the suspect at the device. Both threads together form the attribution case. See Digital Forensics for the device-side techniques.
VPNs and proxy services add intermediate hops to this chain. The server log shows the VPN or proxy IP, not the subscriber's IP. The investigator must first identify the VPN provider and serve process there to obtain the subscriber's IP, then repeat the chain from that IP. Some VPN providers claim to retain no logs; whether this claim is accurate depends on the provider's jurisdiction, technical architecture, and prior history of responding to legal process. The DNS and Domain Investigation topic covers how DNS queries can sometimes expose a user's true IP even when a VPN is active.
An investigator finds the source IP 192.168.10.45 in a victim server's application log. What does this tell them?
Key Takeaways
- IPv4 addresses are 32 bits in dotted-decimal notation; CIDR prefix length defines the network boundary. RFC 1918 private addresses (10/8, 172.16/12, 192.168/16) never appear as public internet sources and indicate internal network placement in a log.
- NAT and CGNAT hide individual devices behind shared public IPs. Attributing a connection through NAT requires the public IP, an exact UTC timestamp, and the source port; without all three, the ISP cannot identify the subscriber from its port-mapping logs.
- The five RIRs (ARIN, RIPE NCC, APNIC, LACNIC, AFRINIC) maintain authoritative databases of IP address allocations. A WHOIS or RDAP query identifies the organisation or ISP responsible for an address block, which is the entity to target with legal process for subscriber records.
- IPv6 removes NAT for most deployments but introduces RFC 8981 privacy extensions that rotate device addresses. Investigators must request the network prefix from the ISP and correlate it with a device identifier, not a single temporary IPv6 address.
- Network attribution is a documented chain: log extraction with hash, RIR WHOIS query, legal production order to ISP or hosting provider, and corroboration with device forensics. Each step must be timestamped and preserved with chain of custody for the evidence to be admissible in court.
What is the difference between a public and a private IP address?
How does Network Address Translation affect attribution?
What does a WHOIS or RDAP lookup tell an investigator?
What is a subnet mask and why does it matter in network investigations?
How does IPv6 change the attribution picture?
Test yourself on Cyber Forensics with free, timed mocks.
Practice Cyber Forensics questionsSpotted an error in this page? Report a correction or read our editorial standards.