Skip to main content

What is IPv4?

IPv4 (Internet Protocol Version 4) is the fourth version of the Internet protocol addressing system, which helps devices communicate over networks. IPv4 is an addressing system, comparable to street addresses, for routing to devices over the Internet. IPv4 addresses have reached capacity, leading to workarounds, such as subnet masking and network address translation (NAT). IPv6, version six, is designed to extend the address space of Internet-connected devices and provide new features such as IPsec support, eventually deprecating IPv4.

How does IPv4 work?

IPv4 allows data communication amongst computers, mobile phones, the Internet of Things, and other devices connected to networks. Generally, when a device sends an IP packet, a router looks for the network and host addresses and routes it to the destination. IPv4 remains a widely used routing protocol in today’s Internet traffic as part of the transmission control protocol and Internet protocol (TCP/IP). Here are the key components of IPv4.

Addressing

The IPv4 address format is a 32-bit numeric address, which consists of four groups of octets separated by a decimal point. An octet contains 8 bits or 1 byte of information. For each octet, the value ranges between 0 and 255. Devices and network hardware use the IPv4 address to identify which computer should receive an IPv4 data packet. These are examples of valid IPv4 addresses.

  • 172.16.0.5
  • 10.0.0.25
  • 192.168.1.1

Network and host

You can separate an IPv4 address into a network prefix and a host number using a subnet mask. You can think of the host and network parts of an IP address as the area code and the end of a phone number.

For example, your computer’s IP address could be 192.168.1.104. In this case:

  • 192.168.1.0 is the network address
  • 104 is the host address

Routers use the network section to route the IP packet to the correct network segment. Then, the final router identifies the host section and delivers the packet to your computer.

Classful and classless addressing

Classful addressing is a method of grouping IPv4 addresses into several groups based on their network and host sizes. Each IPv4 class is meant for specific use cases.

  • Class A is designed for large networks. The first octet describes the network, and the remaining three octets define the host. For a class A address, the first bits of the network octet start with 0, allowing 126 usable network addresses, with each supporting around 16 million hosts.
  • Class B is designed for medium to large networks. The first two octets describe the network, and the remaining two octets define the host. For a class B address, the first bits of the network octet start with 10, allowing over 16000 network segments, with each supporting around 65,000 hosts.
  • Class C is designed for local networks. The first three octets describe the network, and the remaining octet defines the host. For class C addresses, the first bits of the network octet start with 110, allowing over 2 million network segments, with each supporting up to 254 hosts.
  • Class D is reserved for multicast addressing. Its first octet begins with 1110.
  • Class E is reserved for future use. Its first octet begins with 1111.

Classless addressing, also known as Classless Inter-Domain Routing (CIDR), is a more flexible addressing method that reduces the rate at which the IPv4 address space reaches capacity. With a classful address, you might end up with unused addresses. CIDR reduces unused addresses by assigning a variable-length subnet mask or prefix to an IPv4 address. The prefix tells the device the exact bits that represent the network address. For example, 192.168.1.10/25 uses the first 25 bits as the network address, instead of the 24 bits allocated in Class C addressing.

Subnet masking

Subnet masking enables a network device, such as a router, to distinguish between the network and host parts of an IPv4 address. A subnet mask uses a format similar to an IP address. When written in a binary format, 1 indicates the network and 0 indicates the host address.

For example, you set the network mask in a home router to 255.255.255.0. When the router receives an IP packet, it identifies the first three octets as the network address and the fourth octet as the host address.

Network address translation (NAT)

Network address translation (NAT) is a method that enables devices within a private network to connect to the Internet using a single shared IP address. NAT hides devices connected to the local network from the Internet. When a computer sends a data packet to the router, the router replaces the computer’s local IP address with its public address. Then, it sends the data packet to another device or server on the Internet. To a certain extent, NAT slows down the rate at which public IPv4 addresses are used up.

Broadcast and multicast

Broadcast is a data delivery method where a device sends IP packets to all connected devices using a special address. For example, 192.168.1.255 is a broadcast address for a local network. Meanwhile, multicast allows a device to send data to a group of devices registered to the multicast group.

Private and public address spaces

Private address spaces are a range of IP addresses that are reserved for local networks. Unless you use a router with NAT capabilities, devices with private addresses can't communicate with Internet-connected devices. Meanwhile, public address spaces are IP addresses assigned by an Internet service provider. They are globally unique IP addresses that devices use when they are connected to the Internet.

What are the key challenges of IPv4?

IPv4 has played a crucial role in the growth of the Internet. However, organizations face several challenges in continuing to use the routing protocol.

Address capacity

All IPv4 address spaces have already been allocated by the Internet Assigned Numbers Authority (IANA) to regional service providers. With slightly over 4.3 billion address spaces available, Internet service providers (ISPs) cannot allocate a unique address to the growing number of Internet-connected devices. To support new devices, service providers must reclaim unused address spaces.

Security considerations

IPv4 is not equipped with mandatory encryption and authentication methods. When sending data, network engineers must apply additional security measures, such as IPSec, to help secure data exchanges.

Network complexity

Because of address capacity, IPv4 requires complex routing methods, such as NAT, to support more devices. NAT separates public and private addresses with a routing table, which requires more effort to manage.

Performance

When routing IPv4 packets, they might go through multiple routers, which increases the delay. Additionally, network hardware might break IPv4 packets into smaller fragments when sending them. Destination computers require more time to reassemble the fragmented packets.

What is the difference between IPv4 and IPv6?

IPv4 and IPv6 allow computers to send information to one or more devices by routing data packets to unique addresses. However, these protocols differ in several ways.

Address space

The Internet Protocol version 4 supports up to 2³² or 4,294,967,296 IP addresses. Meanwhile, IPv6 provides a vastly larger address space by extending it to 2¹²⁸ or approximately 340 undecillions unique identifiers.

Naming standards

IPv4 uses dot decimal notation to separate four groups of 8-bit numbers to form a numeric address, such as 192.168.1.25. Conversely, an IPv6 address consists of eight groups of hexadecimal digits separated by colons, for example, 2001:0bd8:85a3::8a2e:0370:7334.

Communication type

Both protocols support unicast addressing. However, IPv4 uses broadcast and multicast addressing to allow one-to-many communication, while IPv6 uses anycast and multicast packets to achieve the same results.

Network address translation

Due to the limited address space, IPv4 uses Network Address Translation (NAT) so that multiple devices within a private network share a single public IP address. On the other hand, IPv6 doesn’t require NAT because it provides an almost limitless range of addresses for every device.

Security

In IPv4, securing data packets requires additional steps. Meanwhile, IPv6 enables devices to help protect data using the built-in IPSec protocol, which is optional in implementations.

How can AWS support your IPv6 networking requirements?

Many AWS services offer dual-stack and IPv4 connectivity for cloud-based network management with your preferred Internet protocol version.

  • Elastic Load Balancing Application Load Balancers support client connections to the Application Load Balancer using IPv4 or IPv6.
  • The AWS Direct Connect cloud service is the shortest path to your AWS resources. While in transit, your network traffic remains on the AWS global network and never touches the public Internet. This reduces the chance of hitting bottlenecks or unexpected increases in latency. Direct Connect supports IPv4 and hybrid architectures.
  • Amazon Virtual Private Cloud (Amazon VPC) gives you full control over your virtual networking environment, including resource placement, connectivity, and security. Amazon VPC offers IPv4 support.

Get started with building IPv4 network applications on AWS by creating a free account today.

Browse all cloud computing concepts

Browse all cloud computing concepts content here:

Loading
Loading
Loading
Loading
Loading

Did you find what you were looking for today?

Let us know so we can improve the quality of the content on our pages