Internet Protocol version 4 (IPv4), is a widely used network layer protocol that forms the foundation of the Internet and most local area networks (LANs). It is part of the Internet Protocol suite (commonly known as TCP/IP) and is responsible for the addressing and routing of data packets so that they can be sent across networks and delivered to their intended destinations.
Key characteristics of IPv4 include:
- 32-Bit Addressing: IPv4 addresses are 32 bits in length and are typically represented as four decimal numbers separated by periods (e.g., 192.168.1.1). This addressing scheme allows for approximately 4.3 billion unique IP addresses.
- Address Classes: IPv4 addresses are divided into five classes (A, B, C, D, and E), each with a different range of address values. Classes A, B, and C are used for host addressing, while classes D and E are reserved for special purposes.
- Subnetting: IPv4 allows for the creation of subnetworks (subnets) within larger networks, enabling more efficient address allocation and routing.
- Protocol for Packet Routing: IPv4 uses a routing table to determine the best path for forwarding data packets from the source to the destination based on the destination IP address.
- NAT (Network Address Translation): NAT is a technique used to conserve IPv4 address space by allowing multiple devices within a private network to share a single public IPv4 address for communication with external networks.
- IPv4 Exhaustion: Due to the limited number of available IPv4 addresses and the rapid growth of the Internet, IPv4 address exhaustion has become a concern. This has led to the adoption of IPv6 as the next-generation Internet Protocol, which uses 128-bit addressing and provides a vastly larger pool of IP addresses.
IPv4 addresses are expressed in four decimal numbers, each ranging from 0 to 255, and separated by periods (e.g., 192.168.1.1). Each of these decimal numbers represents an 8-bit octet of the 32-bit IPv4 address. Here’s a brief explanation of how IPv4 addresses are calculated:
- Binary Conversion: To calculate an IPv4 address, convert each decimal number in the address to its binary equivalent. For example, the decimal number 192 is equivalent to 11000000 in binary, and the decimal number 168 is equivalent to 10101000 in binary.
- Concatenation: Combine the binary representations of the four decimal numbers to form a 32-bit binary string. In the example given (192.168.1.1), the binary string would be the concatenation of the binary values of each octet: 11000000101010000000000100000001.
- Decimal Representation: Convert the 32-bit binary string back to decimal to obtain the IPv4 address in its familiar dotted-decimal format. In the example, the binary string corresponds to the IPv4 address 192.168.1.1.
IPv4 subnet calculations involve manipulating the bits within the address and subnet mask to determine the network address, broadcast address, and range of available host addresses within a given subnet. Subnetting allows network administrators to efficiently allocate and manage IP addresses. The process typically involves bitwise AND operations between the IPv4 address and subnet mask to determine the network portion of the address and the host portion.