IPv4 (Internet Protocol version 4) is the foundational addressing system that powers most of today’s internet. Introduced in 1981, an IPv4 address is a 32-bit numeric identifier assigned to every device connected to a network. Written in dotted-decimal notation (e.g., 192.168.1.1), it comprises four octets separated by periods, each ranging from 0 to 255. This structure allows for approximately 4.3 billion unique addresses—a number that seemed vast in the early internet era but proved insufficient as digital expansion accelerated.
What is an IPv4 Address
An IPv4 (Internet Protocol version 4) address is a 32-bit numerical identifier assigned to every device connected to a network using the Internet Protocol. It serves as a unique “digital address” that enables devices to locate, communicate, and exchange data with each other across networks, including the internet.
Its two main functions is:
- 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.
IPv4 Address Format
IPv4 Address is 32 bit length address represented in decimal format. The whole address is divided into four equal block known as octet. Each Octet is separated by (.) dot notation.
For Examples- 192.168.1.10 – Each block of address ranges from 0 to 255.

Parts of an IPv4 Address
IPv4 Address is divided into two major parts: Network Portion and the Host portion.
Here’s a clear breakdown of the network part and host part of an IPv4 address, which together define how devices are identified and routed on networks:

Network Part
The network part of an IPv4 address Identifies the specific network segment a device belongs to (e.g., LAN network or “Home Wi-Fi. All devices on the same local network share the same network portion. Routers use this to forward traffic between networks.
Host Part
The host part of an IPv4 address identifies the specific device within the network segment. It must be unique within the same network.
Subnet Mask
A subnet mask is a 32-bit number used in IPv4 networking to distinguish between the network portion and host portion of an IP address. It acts like a filter or a “highlighter” that tells devices which part of an IP address identifies the network and which part identifies a specific device on that network.
All ones (1s) in subnet mask denotes the network portion and all zeroes (0s) denotes the host portion of IPv4 address. Let us take an example to understand it better
Subnet Mask Formats
Subnet mask is represented in two ways:
- Dotted-Decimal:
255.255.255.0(each255= 8 network bits). - CIDR Notation:
/24(shorthand for255.255.255.0, where “24” = 24 network bits). CIDR stands for Classless Inter Domain Routing. CIDR plays a key role , when we work on class less addressing scheme later on.
Classes of IPv4 Address
IPv4 address is classified into 5 different classes A, B, C, D, and E. This classful addressing system was a historical method for allocating IP addresses and defining the network and host portions of an address based on its range. Today, it has largely been replaced by Classless Inter-Domain Routing (CIDR), which provides more flexible and efficient address allocation.
| Class | First Octet Decimal Range (0-255) | First Octet Binary Range | IP Range | Default Subnet Mask | No of Hosts per Network ID | No of Networks |
| Class A | 0-127 | 0XXXXXXX | 0.0.0.0 – 127.255.255.255 | 255.0.0.0 | 224 – 2 | 27 |
| Class B | 128-191 | 10XXXXXX | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 | 216 – 2 | 214 |
| Class C | 192-223 | 110XXXXX | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 | 28 – 2 | 221 |
| Class D | 224-239 | 1110XXXX | 224.0.0.0 – 239.255.255.255 | – | – | – |
| Class E | 240-255 | 1111XXXX | 240.0.0.0 – 255.255.255 | – | – | – |
Class A IPv4 Address
Class A addresses are designed for very large networks with a massive number of hosts. They use the first octet for the network address and the remaining three octets for host addresses.
- First Octet Decimal Range of Class A is from 0-127
- First Octet Binary range is from 00000000 to 01111111
- The class identifier for Class A is 0.
- Number of network in Class A will be 27 – 2 .
- Number of Hosts per Network: 224 – 2 ( First and the last address of the network is not assigned to host).
- Default Subnet Mask: 255.0.0.0
- Special Range: The 127.0.0.0/8 range is reserved for loopback addresses, used for local machine testing.
Class B IPv4 Address
Class B addresses are suitable for medium to large-sized networks. They provide a balanced allocation of network and host addresses.
- First Octet Decimal Range of Class B is from 128- 191
- First Octet Binary range is from 10000000 to 10111111
- The class identifier for Class A is 10.
- Number of network in Class A will be 214 .
- Number of Hosts per Network: 216 – 2 ( First and the last address of the network is not assigned to host).
- Default Subnet Mask: 255.255.0.0
Class C IPv4 Address
Class C addresses are intended for small networks, as they allow for many networks but very few hosts per network.
- First Octet Decimal Range of Class C is from 192-223
- First Octet Binary range is from 11000000 to 11011111
- The class identifier for Class C is 110.
- Number of network in Class C will be 221 .
- Number of Hosts per Network: 28 – 2 ( First and the last address of the network is not assigned to host).
- Default Subnet Mask: 255.255.255.0
Class D and E IPv4 Address
These two classes are not used for standard unicast addressing like A, B, and C. They serve specialized purposes.
- Class D (224-239): Reserved for multicasting. A multicast address is used to send a single packet to a group of hosts simultaneously, such as for video streaming or online gaming.
- Class E (240-255): Reserved for experimental and future use. These addresses are not typically used in regular network operations.
Types of IPv4 Addresses based on Packet forwarding
IPv4 Address supports three types of packet forwarding techniques form source to destination.
- Unicast: A one-to-one communication where a packet is sent from a single source to a single destination. This is the most common form of IP addressing, used for tasks like accessing a website.
- Multicast: A one-to-many communication where a single packet is sent from a source to a specific group of destinations. This is often used for streaming video or online gaming, allowing for more efficient use of bandwidth.
- Broadcast: A one-to-all communication where a packet is sent from a source to every device on a specific network. The address
255.255.255.255is a common broadcast address.
Key IPv4 Header Information
The IPv4 header is a fundamental component of an IP packet that provides crucial information for routing and delivering data across networks. It’s like the address label on a physical envelope, containing all the instructions needed to get the “letter” (the data payload) to its destination.
The IPv4 header is typically 20 bytes long but can be up to 60 bytes if optional fields are used. It consists of several fields, each with a specific purpose:

- Version: A 4-bit field that identifies the IP protocol version being used. For IPv4, this is always 4.
- Internet Header Length (IHL): A 4-bit field that specifies the length of the header in 32-bit words (4-byte chunks). The minimum value is 5 (for a 20-byte header), and the maximum is 15 (for a 60-byte header).
- Type of Service (ToS): An 8-bit field used to specify the desired quality of service (QoS) for the packet, such as minimizing delay or maximizing throughput.
- Total Length: A 16-bit field that indicates the total size of the IP packet in bytes, including both the header and the data. The maximum size is 65,535 bytes.
- Identification: A 16-bit field that assigns a unique ID to each packet, which is essential for reassembling fragmented packets at the destination.
- Flags: A 3-bit field that controls fragmentation.
- The first bit is reserved.
- The second bit, the Don’t Fragment (DF) flag, tells routers not to fragment the packet.
- The third bit, the More Fragments (MF) flag, indicates that more fragments of the original packet are to follow.
- Fragment Offset: A 13-bit field that specifies the position of a fragment relative to the beginning of the original unfragmented packet.
- Time to Live (TTL): An 8-bit field that limits a packet’s lifespan on the network. Each router a packet passes through decrements the TTL by one. When it reaches zero, the packet is discarded to prevent it from looping indefinitely.
- Protocol: An 8-bit field that identifies the next-level protocol encapsulated in the packet’s data portion (e.g., TCP has a value of 6, and UDP has a value of 17).
- Header Checksum: A 16-bit field used to detect errors in the header. The checksum is re-calculated at each router to ensure header integrity.
- Source Address: A 32-bit field containing the IPv4 address of the sender.
- Destination Address: A 32-bit field containing the IPv4 address of the intended recipient.
- Options (Optional): A variable-length field for additional settings, such as security or routing information.








