Back to blog

What Is an IP Address? A Complete Guide to Structure, Types, IPv4/IPv6, and Protection

Benjamin Carter

2026-09-07 · 34 min read

1. What Is an IP Address?

An IP address (Internet Protocol address) is a numeric identifier assigned to every device on an IP network. It uniquely locates that device so that data can travel from a source host to a destination host across the internet. Think of it as your device’s “street number” in the networked world.

By version, IP addresses come in two main families:

TypeBit lengthNotationAddress capacity
IPv432 bitsDotted-decimal, e.g. 192.168.1.1~4.3 billion
IPv6128 bitsColon-hexadecimal, e.g. 2001:db8:85a3::8a2e:370:7334~3.4 × 10³⁸

Practical note: Most home and office networks today carry both IPv4 and IPv6 addresses at the same time. If your router admin page shows two addresses with different prefixes, that is why.

An IP address serves two core functions in network communication:

  1. Identification — telling the network who this device is.
  2. Location — telling routers where this device is, so they can forward packets to it.

Without an IP address, a device cannot be addressed and cannot communicate with other devices. This is the single biggest difference between “online” and “offline.”

2. Composition of an IP Address

An IPv4 address is 32 bits long. For human readability, it is split into four 8-bit segments (called octets), each converted to a decimal number between 0 and 255, and separated by dots. This is the familiar “dotted-decimal notation.” For example:

Binary   : 11000000.10101000.00000001.00000001
Decimal : 192.168.1.1

Those 32 bits are further divided into two logical parts:

  • Network ID — identifies the subnet / neighborhood the device belongs to.
  • Host ID — identifies the specific device within that subnet.

Which bits are the network ID and which are the host ID is determined by the subnet mask. The most common subnet mask, 255.255.255.0, means the first 24 bits are the network ID and the last 8 bits are the host ID. In CIDR notation this is written as /24.

Example: IP 192.168.1.10 / Subnet Mask 255.255.255.0

ItemDotted-decimalNetwork IDHost ID
Device IP192.168.1.10192.168.110
Subnet mask255.255.255.0255.255.255 (first 24 bits = network)0 (last 8 bits = host)

A bitwise AND operation between the IP and the subnet mask yields 192.168.1.0 — this is the “subnet address” the device belongs to.

In real-world engineering, IPv4 supports two addressing schemes:

  • Classful addressing — divides networks into fixed A/B/C/D/E classes (covered in §4).
  • Classless addressing (CIDR) — uses arbitrary-length prefixes to divide networks, conserves addresses, and is today’s de facto standard on the public internet.

3. Types of IP Addresses

There is more than one way to classify an IP address. The three most common dimensions are:

3.1 By Reach: Public IP vs. Private IP

DimensionPublic IPPrivate IP
DefinitionGlobally unique on the public internetValid only inside a local area network (LAN)
Routable on the internetYesNo
How it’s assignedBy your ISP, or applied for from a regional registryBy a local DHCP server or network administrator
Common use casesWeb servers, mail servers, APIs, remote accessHome / office LAN devices
Uniqueness scopeUnique across the entire internetUnique only within its own LAN
IPv4 reserved range—10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
IPv6 reserved range—fc00::/7 (ULA, Unique Local Address)

In a typical home broadband setup, the address your ISP gives to the optical modem / router is the public IP; the address your router hands to your phone or laptop is the private IP. That is also why “swapping the router” usually changes the IP you see from the outside, while the IPs of devices inside the LAN look almost the same.

Private IPs cannot reach the internet directly because they are not routed on the public internet. To let private-IP devices go online, you must use NAT (Network Address Translation) — the router maps every internal device’s “private IP + port” onto a single public IP. This is exactly what allows hundreds of home devices to share one public IP.

3.2 By Version: IPv4 vs. IPv6

DimensionIPv4IPv6
Address length32 bits128 bits
Capacity~4.3 billion~3.4 × 10³⁸ (theoretically one address per grain of sand on Earth)
NotationDotted-decimal, e.g. 192.168.1.1Colon-hexadecimal, e.g. 2001:db8::1
Header20–60 bytes (with checksum and fragmentation fields)Fixed 40 bytes (no checksum, no router-side fragmentation)
SecurityIPSec optionalIPSec natively integrated (recommended)
Address assignmentDHCP (manual / automatic)SLAAC by default, optional DHCPv6
NAT needed?Commonly used to ease address exhaustionDesigned end-to-end reachable, no NAT needed
BroadcastSupports broadcast addressBroadcast removed, replaced by multicast
DNS record typeA recordAAAA record

Because IPv4 addresses are nearly exhausted, ISPs worldwide are migrating to IPv6 through three transition mechanisms: Dual-Stack, Tunneling (6to4 / 6rd / ISATAP), and Translation (NAT64 / DNS64 / 464XLAT). The two protocols are expected to coexist for the long term.

3.3 By Allocation: Dynamic IP vs. Static IP

DimensionDynamic IPStatic IP
How it’s assignedAssigned temporarily by a DHCP server; changes when the lease expires or on reconnectManually configured or DHCP-reserved; never changes
Changes over timeYesNo
CostUsually included with broadband servicePublic static IPs are typically billed extra
Best forOrdinary home users, mobile devicesWeb servers, mail servers, remote work, NAS, surveillance
Remote-access friendlinessLower (needs DDNS)High (a fixed address is all you need)

Sponsored tip — Cliproxy: Cliproxy provides high-quality dynamic and static IPs for both personal and business use. New users can enjoy an exclusive 5% discount with code lZvJcWBLCm at checkout.

4. IPv4 Address Classes (A, B, C, D, E)

In the early days of IPv4, the address space was divided by the leading bits into five classes — the so-called classful addressing system. Class A was reserved for huge networks, B for mid-size, C for small. Class D was reserved for multicast, and Class E was held back for future use. Even though CIDR has long since replaced this on the public internet, understanding the five classes is still networking 101 — subnet-mask and gateway explanations all build on it.

4.1 Class Reference Table

ClassLeading bitsFirst octet (decimal)Default subnet maskNetwork bitsHost bitsNumber of networksHosts per networkUse case
A01–126255.0.0.0 (/8)824126 (2⁷−2)16,777,214 (2²⁴−2)Very large networks
B10128–191255.255.0.0 (/16)161616,384 (2¹⁴)65,534 (2¹⁶−2)Mid-size networks
C110192–223255.255.255.0 (/24)2482,097,152 (2²¹)254 (2⁸−2)Small networks
D1110224–239—————Multicast
E11110240–255—————Experimental / reserved

Note: The Class A network count subtracts 0.0.0.0 (this network) and 127.0.0.0/8 (loopback), yielding 2⁷−2 = 126. Hosts per network subtracts all-zeros (the network address) and all-ones (the broadcast address), yielding 2ⁿ−2.

4.2 Class A

Class A dedicates 1 byte to the network ID and 3 bytes to the host ID, so each Class A network can host up to ~16.77 million devices (2²⁴−2). The range is 1.0.0.0 to 126.255.255.255. The Class A private range is 10.0.0.0/8.

4.3 Class B

Class A dedicates 2 bytes to the network ID and 2 bytes to the host ID, allowing up to ~65,534 hosts per network. The range is 128.0.0.0 to 191.255.255.255. The Class B private range is 172.16.0.0/12 (172.16.0.0 to 172.31.255.255).

4.4 Class C

Class C dedicates 3 bytes to the network ID and 1 byte to the host ID, allowing up to 254 hosts per network. The range is 192.0.0.0 to 223.255.255.255. This is the most common class for homes and small businesses. The Class C private range is 192.168.0.0/16, which is also where the familiar home-router default addresses such as 192.168.0.1 and 192.168.1.1 come from.

4.5 Class D (Multicast)

Class D has no network/host split. It is dedicated to multicast — sending one copy of the data to a group of subscribers at the same time. The range is 224.0.0.0 to 239.255.255.255. Typical applications include IPTV, video conferencing, routing protocols (OSPF, RIP), and gaming multicasts.

4.6 Class E (Experimental / Reserved)

Class E covers 240.0.0.0 to 255.255.255.254 and is reserved for experimental and future use. It is not allocated commercially.

5. Special IP Addresses

The table below lists the “special” addresses you see often but cannot use as regular host IPs — these are also called reserved or non-routable addresses.

Address / rangePurposeNotes
127.0.0.1 (127.0.0.0/8)LoopbackTest traffic sent to your own machine; never leaves the NIC. Used for self-tests likeping 127.0.0.1 and local service tests.
169.254.0.0/16Link-Local (APIPA)Auto-assigned by Windows / macOS when DHCP fails; LAN-only self-rescue; cannot reach the internet.
0.0.0.0This host / unspecified“This machine”; often used by servers to bind all NICs or to mean “no specific route.”
255.255.255.255Limited broadcastAll hosts on the local network; routers will not forward it.
x.x.x.255Directed broadcastAll hosts on a specific subnet (IPv4 only; removed in IPv6).
192.168.0.0/16Class C privateMost common in home / small-office networks.
172.16.0.0/12Class B privateMid-size enterprise / corporate networks.
10.0.0.0/8Class A privateLarge internal networks.
100.64.0.0/10CGNAT sharedCarrier-Grade NAT shared range used by ISPs for home broadband.
198.18.0.0/15BenchmarkingUsed for network equipment performance testing; ordinary traffic should never appear here.
224.0.0.0/4MulticastClass D range, used for multicast communication.
::1IPv6 loopbackEquivalent to 127.0.0.1 in IPv4.
fe80::/10IPv6 link-localAuto-generated on every IPv6 interface for local-link use.

6. How IP Addresses Work

An IP address alone is just a number on a device. What actually carries data from A to B is the four-piece combo of IP address + subnet mask + default gateway + DNS.

Suppose your PC wants to visit www.example.com. Behind the scenes, this is what happens:

  1. DNS resolution. The browser sends a DNS query to the configured DNS server (e.g. 223.5.5.5 or 8.8.8.8). The DNS server returns the destination public IP, for example 93.184.216.34.
  2. Subnet-mask check. Your local IP 192.168.1.10 with subnet mask 255.255.255.0 is AND-ed against the destination IP, giving 192.168.1.0. The network IDs differ, so the destination is not on your local subnet and must go through the gateway.
  3. Hand off to the default gateway. Your machine sends every packet destined for 93.184.216.34 to the default gateway — usually the router’s LAN-side IP, e.g. 192.168.1.1.
  4. NAT translation. The router replaces the source address 192.168.1.10 (private) with the public IP assigned by your ISP (e.g. 203.0.113.5) and creates a session-mapping table entry.
  5. Internet routing. The ISP-side BGP routers select a path to 93.184.216.34 across the global internet and forward the packet to its destination.
  6. Return path. The reply packet travels back the same way. The router uses its session table to translate the destination back to 192.168.1.10 and delivers it to your machine.

The core building blocks above are:

  • Subnet mask / CIDR — decides which subnet an IP belongs to, and therefore whether routing is required.
  • Default gateway — the exit from your subnet to other networks; in virtually every home setup, this is the LAN-side IP of your home router.
  • DNS — translates human-friendly domain names into machine-friendly IPs. It is essentially a globally distributed database, using UDP port 53.
  • NAT (Network Address Translation) — the bidirectional translation between private and public IPs; effectively mandatory for home and enterprise IPv4 connectivity.
  • DHCP — automatically assigns IP, subnet mask, gateway, and DNS to LAN devices, removing the need for manual configuration.

7. How to Find Your Own IP Address

“Finding your IP” actually means two different things: your public IP (what the internet sees) and your private IP (what the router gave you on the LAN).

7.1 Public IP (External IP)

The simplest way is to open any of the following sites in a browser — the page will display your current egress public IPv4/IPv6:

  • https://ifconfig.me
  • https://ipinfo.io/ip
  • https://whatismyip.com
  • https://ipv6-test.com

You can also use the command line:

# Linux / macOS
curl ifconfig.me
curl ipinfo.io/ip

# Windows PowerShell
(Invoke-WebRequest -UseBasicParsing -Uri "https://ifconfig.me/ip").Content

7.2 Private IP — Windows

  • GUI: Start → Settings → Network & Internet → Ethernet / Wi-Fi → current connection → scroll down to see the IPv4 address.
  • Command prompt: Press Win + R, type cmd, run ipconfig, and look for “IPv4 Address.”

7.3 Private IP — macOS / Linux

  • macOS: Apple menu → System Settings → Network → select the current network → Details → TCP/IP.
  • Linux terminal:

7.4 Private IP — Smartphones

  • iPhone: Settings → Wi-Fi → tap the (i) icon next to the current Wi-Fi → view IP address.
  • Android: Settings → Network & Internet → Wi-Fi → current network → IP address. Alternatively, pull down the notification shade and long-press the Wi-Fi icon for details.

Tip: Phones sometimes show more than just the private IP — including the IPv6 address and the router address. The “router” or “gateway” entry is your router’s IP (usually 192.168.0.1 or 192.168.1.1). Open that address in a browser to access the router admin page.

8. Risks and Harms of IP Address Leakage

If your public IP becomes known to an adversary — whether by accident or by deliberate probing — several classes of risk follow:

  1. Geolocation exposure (city-level). An attacker can run an IP reverse lookup to learn your approximate city / district and your ISP. Note that IP-based geolocation is generally not precise down to a street address; only your ISP can tie an IP to your real identity, and only through legal process.
  2. Targeted DDoS attacks. Streamers, live broadcasters, P2P downloaders, and server admins are often hit with targeted high-volume attacks after their public IP is exposed, leading to disconnections.
  3. Service scanning and port exposure. A public IP with open ports (self-hosted NAS, web services, remote desktop) is easy prey for automated scanners that then try brute-force logins or known exploits.
  4. Social-engineering and targeted scams. Once an attacker knows “this is a user on ISP X in city Y,” they can craft convincing phishing scripts — “local ISP support,” “local tax office,” and so on.
  5. Geo-based price discrimination and blocking. Many streaming, e-commerce, and ticketing sites differentiate prices or restrict content by IP geography. Once your specific IP is identified, related services may be denied outright.
  6. ISP tracking and throttling. Your ISP always knows which IP you are using. Even on HTTPS, the destination domain is visible through SNI, so the ISP may throttle or block based on what you visit.

Technical reality: An IP address is not a “key that opens your computer,” but it is a critical link in the attack chain.

9. How to Protect Your IP Address

The following checklist goes from easiest to most advanced, and lets you ratchet up your IP privacy step by step.

1. Browser-Level Protection

  • Disable WebRTC. The browser’s built-in WebRTC technology can directly leak your real IP — the so-called “WebRTC leak.”
    • Firefox: visit about:config and set media.peerconnection.enabled = false.
    • Chrome: install an extension such as “WebRTC Leak Prevent.”
  • Enable DNS over HTTPS (DoH). Encrypt DNS queries so that your ISP cannot see which domains you resolve. Toggle it on in Chrome / Firefox settings.

2. Router and Home Network Layer

  • Change the router’s default admin password (no more admin/admin) and enable WPA3 or WPA2 encryption.
  • Update firmware regularly, and turn off unnecessary remote management, UPnP, and port forwarding.
  • Bind NAS, cameras, remote desktop, and similar services to a static private IP + allow-list to reduce the chance of automated scanners finding them.

3. Temporary, High-Strength Anonymity

  • Tor Browser. Triple-proxy anonymity, suited to scenarios that demand extreme privacy (e.g. investigative journalism). Trade-off: very slow.
  • Proxy servers. Compared with ordinary proxy tools, Cliproxy offers a comprehensive upgrade for privacy and security, balancing anonymity, stability, and safety. It provides end-to-end no-trace relay: no logs of browsing history, access trails, request contents, or identity information, eliminating the secondary privacy risks of platform data leaks and log tracing. New users can enjoy an exclusive 5% discount with code lZvJcWBLCm at checkout.

5. Detection and Self-Check

Periodically visit the following sites to confirm that your IP is actually hidden:

  • https://ipleak.net
  • https://browserleaks.com
  • https://dnsleaktest.com

Frequently Asked Questions (FAQ)

Q1. What is the difference between an IP address and a MAC address?

An IP address is a logical address at the network layer. It can change as the network changes (e.g. switching Wi-Fi or restarting the router may give you a new IP). A MAC address is a physical address at the data-link layer, burned into the network interface card. In theory it is globally unique and does not change. In everyday communication the two cooperate: the IP locates the remote network, and the MAC pinpoints the specific device inside that network (with ARP / NDP handling the mapping).

Q2. What happens when IPv4 addresses run out? Why do we need IPv6?

IPv4 has only ~4.3 billion addresses. Since 2019, IANA and the major regional registries (APNIC / RIPE / ARIN) have progressively exhausted their IPv4 pools. In the short term, NAT keeps things alive by letting many devices share a single public IP. In the long term, IPv6 expands the address space to ~3.4 × 10³⁸ addresses and solves the problem at its root.

Q3. Can public and private IPs be translated into each other?

Yes — through NAT (Network Address Translation). The most common home scenario: all devices on the LAN have their private IPs translated to the same public IP by the router. On the return path, the router uses the port number to map back to the correct internal device. CGNAT (Carrier-Grade NAT) pushes this step further down into the ISP, so many households share the same pool of public IPs.

Q4. What are 192.168.1.1 and 192.168.0.1?

Both are Class C private IP addresses, used only inside a LAN and never seen on the public internet. Their most common use is as the default admin address of a home router. Type http://192.168.1.1\ or http://192.168.0.1\ in a browser, and a login page usually appears (default credentials are typically printed on the bottom of the router).

Q5. What is 127.0.0.1 used for? Can it be attacked?

127.0.0.1 is the IPv4 loopback address. The operating system delivers any packet sent to this address back to the same machine without ever touching the physical network. It is the standard “local machine address” used in development and debugging (e.g. http://127.0.0.1:8080\) and for ping self-tests. Because packets never leave the host, external networks cannot directly attack 127.0.0.1. However, beware of other programs on the same machine: if malware is already running on the system, it can reach local services (such as a database) through 127.0.0.1. This is called a local-loopback attack.

Conclusion

Understanding IP addresses is not just useful for network engineers — it helps developers, product managers, security and operations staff, and ordinary users troubleshoot everyday connectivity problems. Mastering the main thread — structure → classes → special addresses → how it works → how to look it up → how to protect it — covers roughly 90% of the IP-related issues you will encounter in real work.

Data Retrieval Explained: How It Works, Key Concepts, and Practical Uses

Benjamin Carter 2025-05-13 · 10 min read

Top IG Follower Export Tools in 2025: Features, Security Insights Native IP Integration Tips

Benjamin Carter 2025-05-17 · 13 min read

How IP Fraud Scores Help Prevent Payment Risks: Principles, Benefits & Best Practices

Benjamin Carter 2025-07-09 · 9 min read