IPv4 stands for Internet Protocol version 4. It is a widely used version of the Internet Protocol that assigns 32-bit addresses to network interfaces for communication across interconnected networks.
- It uses a set of four numbers, separated by periods (like 192.168.0.1), to give each device a unique address.
- This address helps data find its way from one device to another over the internet.

An IP address (Internet Protocol address) is a unique identifier assigned to each device connected to a network that uses the Internet Protocol for communication. It serves two main purposes:
- Identification: It uniquely identifies a device on a network.
- Location Addressing: It indicates where a device is located within a network, making data routing possible.
Understanding IPv4 Addressing
An IPv4 address consists of series of four eight-bit binary numbers which are separated by decimal point. Although any numbering system can be used to represent a unique 32- bit number, most commonly you see IP address expressed in dot decimal notation. Some of the examples are:
Site | Dot-decimal | Binary |
|---|---|---|
Twitter.com | 104.244.42.129 | 01101000.11110100.00101010.10000001 |
Reddit.com | 151.101.65.140 | 10010111.01100101.01000001.10001100 |
Linkedin.com | 108.174.10.10 | 01101100.10101110.00001010.00001010 |
IPv4 Address Format
An IPv4 address is a 32-bit numerical address divided into four 8-bit sections called octets or bytes. Each octet contains binary digits (0 or 1) and represents a decimal value from 0 to 255. The four octets are separated by periods, forming dotted-decimal notation, such as 185.107.80.231.
- 32-Bit Structure: Four octets, each containing 8 bits.
- Value Range: Each octet represents values from 0 to 255.
- Example: 185.107.80.231 contains four decimal octets.
Binary Representation
IPv4 is basically converted into binary form by computer although these are usually seen in decimal form for human readability. Each octet is converted into 8 bit binary number . For instance 185.107.80.231 in binary looks like:
- 185: 10111001
- 107: 01101011
- 80: 01010000
- 231: 11100111
So 185.107.80.231 in binary is: 10111001.01101011.01010000.11100111

Parts of IPv4
IPv4 addresses consist of three parts:
- Network Part: The network part indicates the distinctive variety that's appointed to the network. The network part conjointly identifies the category of the network that's assigned.
- Host Part: The host part uniquely identifies the machine on your network. This part of the IPv4 address is assigned to every host.
For each host on the network, the network part is the same, however, the host half must vary. - Subnet Number: This is the non obligatory part of IPv4. Local networks that have massive numbers of hosts are divided into subnets and subnet numbers are appointed to that.
Types of IPv4 Addressing
IPv4 basically supports three different types of addressing modes:

- Unicast Addressing Mode: This addressing mode is used to specify single sender and single receiver. Example: Accessing a website.
- Broadcast Addressing Mode: This addressing mode is used to send messages to all devices in a network. Example: sending a message in local network to all the devices.
- Multicast Addressing Mode: This addressing mode is typically used within a local network or across networks and sends messages to a group of devices. Example: Streaming audio to multiple devices at once.
IPv4 Datagram Header
These fields together ensure the proper delivery, routing, fragmentation, and reassembly of IP packets across the network.

- VERSION: Version of the IP protocol (4 bits), which is 4 for IPv4
- HLEN: IP header length (4 bits), which is the number of 32 bit words in the header. The minimum value for this field is 5 and the maximum is 15.
- Type of service: Low Delay, High Throughput, Reliability (8 bits)
- Total Length: Length of header + Data (16 bits), which has a minimum value 20 bytes and the maximum is 65,535 bytes.
- Identification: Unique Packet Id for identifying the group of fragments of a single IP datagram (16 bits)
- Flags: 3 flags of 1 bit each : reserved bit (must be zero), do not fragment flag, more fragments flag (same order)
- Fragment Offset: Represents the number of Data Bytes ahead of the particular fragment in the particular Datagram. Specified in terms of number of 8 bytes, which has the maximum value of 65,528 bytes.
- Time to live: Datagram’s lifetime (8 bits), It prevents the datagram to loop through the network by restricting the number of Hops taken by a Packet before delivering to the Destination.
- Protocol: Name of the protocol to which the data is to be passed (8 bits)
- Header Checksum: 16 bits header checksum for checking errors in the datagram header
- Source IP address: 32 bits IP address of the sender
- Destination IP address: 32 bits IP address of the receiver
- Option: Optional information such as source route, record route. Used by the Network administrator to check whether a path is working or not.
Characteristics of IPv4
- IPv4 could be a 32-bit IP Address.
- Addresses are commonly written in dotted-decimal notation, consisting of four octets separated by periods.
- Each octet can have a decimal value from 0 to 255.
- It uses the Post Address Resolution Protocol to map to the MAC address.
- It supports subnetting and Variable Length Subnet Masking (VLSM).
- Address Resolution Protocol (ARP) can resolve an IPv4 address to a link-layer address on networks that use ARP, such as Ethernet.
- The IPv4 header has a minimum length of 20 bytes and a maximum length of 60 bytes.
Advantages
- Wide Compatibility: IPv4 is supported by a large number of operating systems, networking devices, and applications.
- Simple Address Representation: Its dotted-decimal format makes addresses relatively easy to read and configure.
- Established Infrastructure: IPv4 benefits from mature networking protocols, tools, and routing infrastructure.
- Flexible Network Configuration: Subnetting and VLSM allow networks to be divided into appropriately sized subnets.
- Broad Network Support: IPv4 enables communication across local networks and the Internet using established routing mechanisms.
Disadvantages
- Limited Address Space: IPv4 provides approximately 4.3 billion possible 32-bit address values, but many are reserved for special purposes. The available public IPv4 address supply is limited.
- Dependence on NAT: Network Address Translation (NAT) is widely used to conserve public IPv4 addresses, but it can complicate some applications and end-to-end connectivity.
- Security Limitations: IPv4 does not inherently provide encryption or authentication, so additional security mechanisms may be required.
- Configuration and Management: Incorrect subnet masks, routing configurations, or address assignments can cause connectivity problems.
- Need for IPv6: IPv6 provides a much larger address space and additional capabilities to support the continued growth of Internet-connected devices.