Let us discuss about Internet Protocol Version 4, Functions, IPv4 Addressing Modes, IPv4 Packet Structure, Advantages And Disadvantages Of IPv4
IPv4
Data routing via the Internet and device identification on networks are made possible by the widely used Internet Protocol Version 4 (IPv4). The Internet Engineering Task Force initially defined it in 1981 (IETF, RFC 791) and ARPANET replaced NCP with it in 1983. Even with its drawbacks, IPv4 nevertheless serves as the foundation for a sizable chunk of the Internet’s infrastructure.

You can also read Brouter Definition, How it Works, Features, Benefits, & Uses
Functions of Internet Protocol Version 4

- The network layer of the OSI model and the Internet layer of the TCP/IP model are where IPv4 functions. Its main duties include transporting data between hosts, assigning logical addresses to each host so that each host may be uniquely identified, and routing data between hosts.
- It operates as a connectionless, best-effort packet switching protocol, which means that it sends data packets on its own without ensuring delivery or arrival order, striving to get to the destination as best it can.
Address Format and Structure
- An IPv4 address is a binary number of 32 bits. Usually, there are four parts to this 32-bit number, called octets or bytes, each of which has eight bits.
- The four octets are expressed as decimal values (each ranging from 0 to 255) separated by periods in dotted-decimal notation, which is a standard representation of these addresses for human reading. Think of 192.168.1.1.
- The two primary components of an IPv4 address are the host part (Host ID), which identifies the specific device within the network, and the network part (Network ID), which identifies the network in question. A 32-bit integer called a subnet mask, which routers use to differentiate between the network ID and the host ID, determines how these components are divided.
IPv4 Packet Structure
As a Layer-3 protocol, Internet Protocol separates data segments from the Transport Layer (Layer-4) into packets. The data unit, also known as the IP Payload, is encapsulated in each IP packet along with additional header data.
Important fields in the IPv4 header consist of:
- Version: Internet Protocol version (e.g., IPv4) that was used.
- IHL (Internet Header Length): Minimum of 20 bytes for the full IP header.
- DSCP (Differentiated Services Code Point): Quality of Service (QoS) type of service.
- Total Length: Total IP packet length (header + payload).
- Identification, Flags, and Fragment Offset: Utilized for the fragmentation of packets.
- Time to Live (TTL): Stops looping by decreasing at every router (hop); when the TTL hits 0, the packet is destroyed.
- Protocol: Determines the subsequent upper-layer protocol (such as ICMP, TCP, or UDP).
- Header Checksum: Used for header error checking.
- Source Address: IP address of the sender, 32-bit.
- Destination Address: IP address of the receiver in 32 bits.
- Options: Optional field for timestamp, record routing, security, etc.
You can also read Importance Of Network Cabling And Types of Network Cables
IPv4 Addressing Modes (Types of Communication)
There are three addressing mode types that IPv4 supports:
- Unicast Addressing Mode: Data is transmitted to a single destination host in this mode. The 32-bit IP address of the destination host is contained in the Destination Address field. Here, the targeted server receives data from the client.
- Broadcast Addressing Mode: In a network segment, a packet is sent to every host using a unique broadcast address, such as 255.255.255.255.
- Multicast Addressing Mode: Packets are routed from a single source to numerous devices (one-to-many) that belong to a multicast group. Rather than going to one host or all hosts, data is delivered to a collection of devices. Starting with 224.x.x.x, the destination address is entered.
Address Classes for IPv4 (Historical) In the past, IPv4 addresses were divided into five classes (A, B, C, D, and E) based on the first octet of the address in order to control network size and addressing:
- Class A: The first bit is set to 0 for big networks. 0., the initial bit, spans the range 0.0.0.0 to 127.255.255.255. This class is intended for big networks and contains 8 bits for the network and 24 bits for hosts.
- Class B: Large to medium-sized networks are its target audience. The first two bits, 10s, are in the range 128.0.0.0 to 191.255.255.255. 16 bits for hosts and 16 bits for the network are also included. More than 65,000 hosts and 16,384 networks are supported.
- Class C: The first three bits are set to 110 for small local area networks (LANs). This class’s network is designed to use three octets. 8 host bits, 24 network bits, and a range of 192.0.0.0 to 223.255.255.255 make up the IP address. 254 hosts and more than 2 million networks are supported.
- Class D: Set to 1110 for the first four bits, reserved for multicasting. falls between 224.0.0.0 and 239.255.255.255. It is only used by programs that need multicasting. In other words, we don’t use Class D for routine networking tasks. Rather, the fourth bit is used for “0,” and the first three bits are set to “1.” Class D addresses are also 32-bit network addresses.
- Class E: Set to 1111 for the first four bits, reserved for experimentation or future usage. From 240.0.0.0 to 255.255.255.254, the first octet values are covered by this class of IP addresses. The first four bits of an E-class IP address are all one in binary format.
Addressing Concepts and Techniques
Subnetting: Divides a big network into smaller sub-networks for easier management and security, enabling the network address to be derived from bits of the host portion of an IP Address. Classful IP addressing does not offer the same flexibility as this. Network numbers are the initial IP address of a network, while broadcast IPs are the last; hosts are not able to be assigned either.
Classless Inter-Domain Routing (CIDR): Substituting a suffix (e.g., /24) to the IP address to indicate the number of bits constituting the network address gave additional flexibility in address allocation, replacing the class system. Because CIDR reduced the number of wasted addresses, it prolonged the life of IPv4 and delayed the expansion of routing tables.
Variable Length Subnet Mask (VLSM): Makes it possible to subnet subnets, which reduces waste and improves IP address allocation.
Private IP Networks (RFC 1918): Originally created to preserve public IPv4 addresses, these address ranges (Class A: 10.0.0.0/8; Class B: 172.16.0.0/12 to 172.31.0.0/12; Class C: 192.168.0.0/16 to 192.168.255.0/16) are usually utilized internally within organizations, with Network Address Translation (NAT) facilitating shared public IP access to the Internet.
Network Address Translation (NAT): A private IP address technique that enables several devices on a private network to access the Internet using a single public IPv4 address. Private IPs are converted to public IPs and vice versa via NAT.
Loopback IP Addresses: The self-address of a host (localhost) is reserved for the range 127.0.0.0 to 127.255.255.255. This is mostly used to test a machine’s TCP/IP software stack.
Link-local Addresses: If a host has not been manually issued an IP address and is unable to obtain one from the DHCP server, it can assign itself one from a range of reserved Link-local addresses. The local address of the link falls between 169.254.0.0 and 169.254.255.255.
Advantages of IPv4

Disadvantages of IPv4

Limited Address Space: IPv4 can support over 4.3 billion distinct addresses with a 32-bit address space. This may have looked enormous at first, but the rapid expansion of Internet-connected devices (such as smartphones and Internet of Things devices) has caused the public IPv4 address supply to almost completely run out.
Security: In the absence of further, frequently optional protocols like IPsec, it is not very secure.
Inefficient for Modern Needs: Large routing tables, intricate host and routing settings, and challenges with mobility, multi-homing, and Quality of Service (QoS) are all major disadvantages.
Cost: The shortage of IPv4 addresses raises their price.
IPv6 as Successor: These restrictions led to the development of IPv6 (Internet Protocol Version 6), a solution that offers a much bigger address space by utilizing 128-bit addresses.
Compatibility: IPv4 and IPv6 are incompatible by default. Tunnelling, which encapsulates IPv6 packets within IPv4 packets, and dual-stack, which runs both protocols simultaneously, are examples of transition methods that enable them to coexist throughout the ongoing migration.
DNS Support: In order to store IPv4 addresses in A records and IPv6 addresses in AAAA records, the Domain Name System (DNS) supports both protocols.
You can also read Advantages And Disadvantages Of POE IEEE 802.3 af Standard