What is IPv4? IPv4 (Internet Protocol version 4) is the 32-bit addressing system used to identify devices connected to the internet and local networks. An IPv4 address consists of four numbers separated by dots, each between 0 and 255 (e.g. 192.0.2.10). 32 bits means 232, or about 4.3 billion, different addresses.
IPv4 was defined in 1981 in RFC 791 and still carries a large share of internet traffic today. This guide explains the structure of an IPv4 address, subnet masks and CIDR notation, private and public IP ranges, NAT, why IPv4 addresses ran out and how IPv4 differs from IPv6.
How to read an IPv4 address
An IPv4 address is really 32 ones and zeros. To make it readable, the 32 bits are split into four groups of 8 bits (octets), and each octet is written as a decimal number:
| 1st octet | 2nd octet | 3rd octet | 4th octet | |
|---|---|---|---|---|
| Decimal | 192 | 168 | 1 | 10 |
| Binary | 11000000 | 10101000 | 00000001 | 00001010 |
Because 8 bits can hold at most 255, no octet can be larger than 255; 192.168.1.300 is not a valid IPv4 address.
Network part, subnet mask and CIDR
Every IPv4 address has two parts: the network part, which shows which network the device is on, and the host part, which identifies the device within that network. The subnet mask defines where the boundary is. For example, the mask 255.255.255.0 says that the first 24 bits identify the network and the last 8 bits identify devices.
The same information is written more compactly in CIDR (Classless Inter-Domain Routing) notation: the “/24” in 192.0.2.0/24 means the network part is 24 bits long. Common block sizes:
| CIDR | Subnet mask | Total addresses | Typical use |
|---|---|---|---|
| /32 | 255.255.255.255 | 1 | A single IP (e.g. a firewall rule) |
| /30 | 255.255.255.252 | 4 | Link between two routers |
| /29 | 255.255.255.248 | 8 | Small group of servers |
| /28 | 255.255.255.240 | 16 | A few servers and services |
| /27 | 255.255.255.224 | 32 | Small business network |
| /26 | 255.255.255.192 | 64 | Virtual server infrastructure |
| /25 | 255.255.255.128 | 128 | Hosting infrastructure |
| /24 | 255.255.255.0 | 256 | Smallest block that can be announced on the internet via BGP |
| /22 | 255.255.252.0 | 1,024 | Mid-sized network |
| /16 | 255.255.0.0 | 65,536 | Large enterprise network |
The first address in a block is the network address and the last is the broadcast address; neither is assigned to devices, and the gateway usually takes one more. So the number of usable IPs is lower than the total: in a /29 block, for example, 5 of the 8 addresses can be assigned to servers.
IPv4 address classes (A, B, C, D, E)
In the early internet, addresses were divided into fixed-size classes. Since the move to CIDR in 1993 classes are no longer used for routing, but you still see them in networking courses and older documents:
| Class | First octet | Default mask | Use |
|---|---|---|---|
| A | 1–126 | /8 | Very large networks |
| B | 128–191 | /16 | Medium-sized networks |
| C | 192–223 | /24 | Small networks |
| D | 224–239 | – | Multicast |
| E | 240–255 | – | Experimental, reserved |
Addresses starting with 127 are not part of any class; 127.0.0.0/8 is reserved for loopback, which refers to the device itself (e.g. 127.0.0.1, “localhost”).
Private and public IPv4 addresses
A public IP address is unique on the internet and directly reachable; servers, websites and mail servers use public IPs. Private IP addresses are used only inside local networks, are not routed on the internet and can be reused in different networks. The private ranges reserved by RFC 1918 and other special-purpose blocks:
| Range | Purpose |
|---|---|
10.0.0.0/8 | Private network (large enterprise networks, cloud internal networks) |
172.16.0.0/12 | Private network (172.16.0.0 – 172.31.255.255) |
192.168.0.0/16 | Private network (home and office routers) |
100.64.0.0/10 | Shared address space for carrier-grade NAT (CGNAT) |
127.0.0.0/8 | Loopback |
169.254.0.0/16 | Link-local; assigned automatically when no DHCP address is received |
192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Reserved for documentation and examples |
224.0.0.0/4 | Multicast |
If your computer gets an address starting with 169.254.x.x, it cannot get an address from the network’s DHCP server (usually the router); check the cable and router connection.
What is NAT and why is it used?
Even with dozens of devices at home, you usually get a single public IP from your internet provider. Your router uses NAT (Network Address Translation) to send the traffic of privately addressed devices to the internet through that single public IP. NAT eased the IPv4 shortage for years, but it makes direct inbound connections to a device difficult. That is why servers, game servers and services such as VPNs that must be reachable from outside need their own public IP address. Some operators put customers behind an extra layer of NAT (CGNAT); in that case the WAN address shown on your router may start with 100.64.x.x.
Static vs dynamic IP address
A dynamic IP may change each time the connection is renewed and is common on home internet. A static IP stays the same; it is needed for servers, camera recording systems, remote desktop and IP-restricted applications. When you rent a server (VDS, cloud or dedicated), you are assigned a static IPv4 address.
Why did IPv4 addresses run out?
4.3 billion addresses seemed plenty in the early days of the internet, but smartphones, servers and IoT devices used them up quickly. Once reserved blocks (private networks, multicast and so on) are subtracted, the usable space is even smaller. IANA, which managed the central pool, handed its last blocks to the regional registries in 2011; RIPE NCC, responsible for Europe, the Middle East and Central Asia, made its last /22 allocation in November 2019. Today new IPv4 demand is met by transferring or leasing existing blocks. The long-term solution is IPv6.
Differences between IPv4 and IPv6
| IPv4 | IPv6 | |
|---|---|---|
| Address length | 32 bits | 128 bits |
| Number of addresses | About 4.3 billion | About 3.4 × 1038 |
| Notation | Dotted decimal (192.0.2.10) | Hexadecimal with colons (2001:db8::10) |
| Header | 20–60 bytes, variable | Fixed 40 bytes, with extension headers |
| Address assignment | Manual or DHCP | Manual, SLAAC or DHCPv6 |
| Broadcast | Yes | No (multicast and anycast are used) |
| Need for NAT | Common | Usually unnecessary thanks to abundant addresses |
Although IPv6 is spreading, many internet services are still reachable only over IPv4. That is why servers usually run both protocols together (dual-stack). For migration planning, see our IPv4 to IPv6 migration article.
How to find your IPv4 address
- Windows: Type
ipconfigin Command Prompt; the “IPv4 Address” line shows your local (private) address. - Linux: Use
ip -4 addrorhostname -I. - macOS: Run
ipconfig getifaddr en0(for Wi-Fi). - Public IP address: To see the address your router uses on the internet, open a “what is my IP” site or run
curl -4 ifconfig.mein a terminal.
When do you need additional IPv4 addresses?
- Using a separate IP with a clean reputation and a reverse DNS (RDNS) record for a mail server,
- Running a VPN, a proxy or several services from different IPs,
- Assigning separate IPs to virtual server or hosting customers,
- Announcing your own network on the internet via BGP with your own ASN (at least a /24 block).
With Sunucun’s IPv4 lease service you can lease blocks from /29 (5 usable IPs) to /22 (1,022 usable IPs). Reverse DNS records can be set on every block; on /24 and /22 blocks the WHOIS record can be registered in your name. The autonomous system number you need to announce your own network is explained in our what is ASN guide.
Frequently asked questions
How many digits does an IPv4 address have?
An IPv4 address is 32 bits and consists of four numbers separated by dots. Each number is between 0 and 255, so the longest address is 15 characters (e.g. 255.255.255.255).
What does an IP address starting with 192.168 mean?
The 192.168.0.0/16 range is reserved for private networks. These addresses are used in home and office networks and are not routed on the internet; you reach the internet through your router’s public IP.
Have IPv4 addresses run out?
The free pool that registries could allocate is largely exhausted. New demand is met by transferring or leasing existing blocks, while IPv6 is spreading as the long-term solution.
Is IPv4 or IPv6 faster?
The protocol itself does not change speed noticeably; the network path and operators’ routing make the real difference. On some networks IPv6 can show lower latency because there are fewer NAT layers.
Can a server have more than one IPv4 address?
Yes. Several IPs can be configured on a server’s network interface; this is how separate IPs are given to each site, service or virtual machine.
If your servers need additional IP addresses, see the block sizes and current prices on the IPv4 lease page.
Categories
-
CentOS 7 guides
-
cPanel 19 guides
-
CyberPanel 18 guides
-
Operating Systems 80 guides
-
Juniper Networks 18 guides
-
Control Panels 49 guides
-
Linux 15 guides
-
MySQL 29 guides
-
Network 84 guides
-
Plesk Panel 12 guides
-
Virtual Servers 284 guides
-
SEO 2 guides
-
Cyber Security 5 guides
-
Technology 158 guides
-
VMware 38 guides
-
WordPress 19 guides
-
Artificial Intelligence 21 guides