Every device that connects to the internet needs an identity, and that identity is its IP address. Just as a letter needs a street address to reach the right house, data needs an IP address to reach the right device. This guide explains what an IP address is, the different types, how addresses are assigned, and how they work across networks.
Related reading: Internet and networking basics · What is a static IP? · Internet service providers
What Is an IP Address?
An IP address (Internet Protocol address) is a numerical identifier assigned to every device on a network. The Internet Protocol (IP) is the set of rules that carries data from a source to a destination in small packets, and within that protocol each device is known by a unique address.
An IP address does two jobs at once: it identifies a device (its identity on the network) and it locates it (where data should be sent). Thanks to this, routers can forward a packet step by step until it reaches the correct server on the other side of the world.
What Does It Do and How Does It Work?
When a device sends a request to the internet or a local network, the request is split into packets. Each packet's header carries both the sender's and the recipient's IP address, and the routers along the way use this information to pass the packet to its next hop.
- Addressing: Specifies which device the data should reach.
- Routing: Lets routers decide the path a packet takes from network to network.
- Identity: Allows devices on the same network to tell one another apart.
- Reachability: Makes a server accessible over the internet.
IPv4 vs IPv6
Two versions of IP are in use side by side today. IPv4 is the long-established version and is 32 bits long; addresses are written as four numbers separated by dots (for example 192.168.1.10). Each number ranges from 0 to 255.
A 32-bit space holds roughly 4.3 billion (2 to the power of 32) unique addresses. As the number of connected devices grew rapidly, this pool became insufficient over time, which led to a newer version.
IPv6 is 128 bits long and is written in hexadecimal as eight groups separated by colons (for example 2001:0db8:85a3::8a2e:0370:7334). This width provides an address space so large it is effectively inexhaustible in practice.
| Feature | IPv4 | IPv6 |
|---|---|---|
| Length | 32 bits | 128 bits |
| Notation | Dotted decimal (192.168.1.10) | Hexadecimal with colons (2001:db8::1) |
| Address count | About 4.3 billion | Effectively inexhaustible |
| Example | 203.0.113.5 | 2001:0db8:85a3::8a2e:0370:7334 |
| Auto configuration | Commonly via DHCP | DHCPv6 and stateless autoconfiguration (SLAAC) |
Public and Private IP Addresses
IP addresses fall into two groups by how they are used: public and private. A public IP is unique across the internet and can be reached directly from outside. A private IP is valid only inside a local network; it is given to devices on a home or office network and is not routed directly on the internet.
The RFC 1918 standard reserves specific ranges for private use on local networks:
| Range | CIDR notation | Typical use |
|---|---|---|
| 10.0.0.0 – 10.255.255.255 | 10.0.0.0/8 | Large enterprise networks |
| 172.16.0.0 – 172.31.255.255 | 172.16.0.0/12 | Medium-sized networks |
| 192.168.0.0 – 192.168.255.255 | 192.168.0.0/16 | Home and small office networks |
In addition, the address 127.0.0.1 is the loopback that points a device back to itself, while the 169.254.0.0/16 range holds the link-local addresses a device assigns to itself when it cannot reach a DHCP server.
NAT: How Private IPs Reach the Internet
Dozens of devices in your home go online through a single public IP address. The mechanism that makes this possible is NAT (Network Address Translation). Your modem/router translates the private IPs on the local network into one public IP, then routes the returning replies back to the correct device.
Because IPv4 addresses are scarce, some providers use CGNAT (Carrier-Grade NAT), where multiple subscribers share the same public IP. We also cover how the public/private split affects your network in our static IP guide.
Static and Dynamic IPs
IP addresses are also grouped by how they are assigned. A dynamic IP is assigned automatically by a provider or router and can change over time; most home users have a dynamic IP.
A static IP, by contrast, is fixed and does not change. It matters for users who host their own server, set up remote access, or bind a service to a specific address. You can find the differences and when each one is appropriate in our what is a static IP article.
- Dynamic IP: Assigned automatically, can change, practical for home use.
- Static IP: Fixed, preferred for server and remote-access scenarios.
How Are Addresses Assigned?
On a local network, IP addresses are usually handed out automatically by DHCP (Dynamic Host Configuration Protocol). When a device joins the network, it asks a DHCP server for an address, a gateway, and DNS details, and the server assigns a suitable address for a set period (a lease).
The public IP you use to reach the internet is allocated by your internet service provider (ISP). Providers distribute the address blocks they hold to subscribers, either dynamically or statically.
Address Classes (A, B, C)
When IPv4 was designed, addresses were divided into classes. In this "classful" scheme the size of an address block was fixed: Class A was meant for very large networks, Class B for medium-sized networks, and Class C for small networks. Class D was reserved for multicast and Class E for experimental purposes.
| Class | Leading bits | Default mask | Use |
|---|---|---|---|
| A | 0 | /8 | Very large networks |
| B | 10 | /16 | Medium-sized networks |
| C | 110 | /24 | Small networks |
| D | 1110 | - | Multicast |
| E | 1111 | - | Reserved / experimental |
Because fixed block sizes wasted addresses, the classful system gradually gave way to the more flexible CIDR. Even so, the concept of classes is still worth knowing in order to read older documentation and some configurations.
Subnet Mask and CIDR Notation
An IP address has two parts: the network part and the host (device) part. The subnet mask defines where these two parts split. In modern notation the mask is expressed as a number appended to the address, which is called CIDR (Classless Inter-Domain Routing). CIDR removes the rigid boundaries of the classful system and lets address blocks be divided into smaller or larger pieces as needed.
192.168.1.0/24
| |
| +-- /24 = first 24 bits are the network part (255.255.255.0)
+------------- network address
In a /24 block:
Total addresses : 256
Usable hosts : 254 (network and broadcast excluded)
First host : 192.168.1.1
Last host : 192.168.1.254The larger the mask number, the smaller the device capacity of the network. Common block sizes are:
| CIDR | Subnet mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /30 | 255.255.255.252 | 2 |
How Do I Find My IP Address?
You can find your device's local IP address from your operating system's command line. Your public IP, which reaches the internet, is different and is usually discovered by asking an external service.
# Windows - local IP
ipconfig
# Linux / macOS - local IP
ip addr # newer systems
ifconfig # older systems
# Public IP - on any system
curl ifconfig.me
curl https://api.ipify.orgIPs and Ports
An IP address specifies which device data should reach, while a port number specifies which service on that device it should reach. Web traffic, for example, typically uses ports 80 and 443. An IP together with a port points to a single service (for example 203.0.113.5:443).
Knowing which ports on a server are exposed to the outside is important for security; we go into detail in our open port scanning article.
IP and Domain Names
People struggle to remember numeric addresses, so we use domain names like example.com instead. When you enter a domain name, the DNS (Domain Name System) steps in and translates that name into the relevant server's IP address. In other words, the domain name is a readable label, while communication still runs over the IP address underneath.
A domain name can move to a different server over time; in that case only the IP address in the DNS record is updated, and visitors reach the new server without the domain name changing. This flexibility, managing the domain name and the IP address independently of each other, is one of the biggest advantages of the system.
Privacy and the Legal Picture in Turkey
An IP address can make a person indirectly identifiable, which makes it a sensitive piece of information from a privacy standpoint. In Turkey, the processing of personal data is governed by the Personal Data Protection Law No. 6698 (KVKK); when an IP address can be linked to a natural person, it may qualify as personal data.
The core framework for online publications is Law No. 5651 (on Regulating Publications on the Internet and Combating Crimes Committed Through Such Publications). This law places an obligation on access providers and hosting providers to keep certain traffic/access records, in which the IP address is an important component. The Information and Communication Technologies Authority (BTK) plays a central role in applying the law.
Law No. 5651 also allows access to content to be blocked; we examine the criteria used for access blocking in our access blocking article.
Frequently Asked Questions
Will my IP address change?
If you use a dynamic IP, it can change from time to time; restarting your modem or your provider renewing the assignment can change the address. A static IP does not change.
Can more than one device have the same IP address?
Two devices on the same local network cannot share the same private IP, as that causes a conflict. However, devices on different local networks can independently use the same private address (such as 192.168.1.10), because those addresses are not unique on the internet.
Can IPv4 and IPv6 talk to each other?
Not directly, because they have different address structures. Dual-stack configuration or translation/tunneling methods are used for compatibility.
Does my public IP reveal my identity?
A public IP on its own does not show your name; it can indicate an approximate geographic location and your service provider. Matching an IP to a specific subscriber requires the provider's records and a legal process.