Skip to main content

IPv4

Internet Protocol version 4

Pronunciation
eye-pee-vee-FOR
Updated 2 min read

Share this page

Send the link, quote the definition with a link back, or show it as a card on your own site.

https://softwaredictionary.org/terms/ipv4

In short

IPv4 is the internet's original addressing system, using 32-bit addresses written as four numbers such as 192.168.1.10, allowing about 4.3 billion addresses.

What is IPv4?

IPv4 was defined in 1981 and still carries a large share of internet traffic. Every device on a network needs an address, and an IPv4 address is 32 bits, written in dotted decimal as four numbers from 0 to 255. Part of the address identifies the network and the rest identifies the host, with the split written in CIDR notation such as /24.

Some ranges are reserved. 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private addresses for home and company networks, 127.0.0.1 is the loopback address for the machine itself, and 169.254.0.0/16 is used when a device can't get an address from DHCP. Private addresses aren't routed on the public internet.

About 4.3 billion addresses turned out to be far too few for every phone, laptop and server. The global pool of unallocated addresses ran out in 2011, and the internet kept growing mainly through NAT, which lets many private devices share one public address, and through IPv6, whose 128-bit addresses are practically unlimited.

A common misconception is that IPv4 is obsolete. Most networks run IPv4 and IPv6 side by side, called dual stack, and many services still depend on IPv4. Its scarcity also has a price: cloud providers charge for public IPv4 addresses, and they are bought and sold on a secondary market.

Key takeaways

  • IPv4 uses 32-bit addresses written as four numbers, such as 192.168.1.10.
  • It allows about 4.3 billion addresses and dates from 1981.
  • 10/8, 172.16/12 and 192.168/16 are private ranges; 127.0.0.1 is loopback.
  • The free address pool ran out in 2011; NAT stretched it further.
  • IPv6 is the successor, and most networks run both.

Example

Inspecting IPv4 addresses with Pythonpython
import ipaddress

addr = ipaddress.ip_address("192.168.1.10")
print(addr.is_private, addr.is_global)          # True False

net = ipaddress.ip_network("192.168.1.0/24")
print(net.num_addresses)                        # 256
print(addr in net)                              # True

print(ipaddress.ip_address("127.0.0.1").is_loopback)   # True
print(2 ** 32)                                  # 4294967296 possible addresses

Readers ask

What is the difference between IPv4 and IPv6?

IPv4 addresses are 32 bits long, giving about 4.3 billion addresses. IPv6 addresses are 128 bits long, giving an almost unlimited number, and IPv6 also simplifies headers and removes the need for NAT.

Why did the world run out of IPv4 addresses?

The 32-bit design predates the explosion of personal computers, phones and connected devices. With billions of devices and early allocations of very large blocks, the free pool was used up in 2011.

What is a private IPv4 address?

An address from the ranges reserved for internal networks, such as 192.168.x.x. They can be reused in every home and office, and reach the internet through NAT on the router.

Often compared

See also

Spotted a mistake or something missing on this page?Suggest an edit

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings