What is IP Address? IPv4 vs IPv6

Anvesh
SilentTech
Published in
2 min readMay 28, 2024

IP stands for Internet Protocol.

IP Address: IP Address is a numerical label assigned to each device participating in computer network.

Network Prefix: It’s a portion of IP address indicated how many bits from the left of the IP address represent the network address. The remaining bits represent host address.

A network prefix is a number that identifies the network portion of an IP address. It helps devices decide if an IP address is on the same network or needs to be sent elsewhere. The prefix is shown as a number after a slash, like “/24” which tells how many bits are used for the network.

Prefix Length: It a suffix following the (/) for IPV4 it can range from 0 to 32 and for IPV6 it can range from 0 to 128.

CIDR: CIDR notation combines Ip address, and network prefix separated by (/), Classless Inter-Domain Routing (CIDR) is an IP address allocation method that improves data routing efficiency on the internet. Organizations use CIDR to allocate IP addresses flexibly and efficiently in their networks.

Networks are categorized into different classes, labeled A through E. Class A networks can connect millions of devices. Class B networks and Class C networks are progressively smaller in size. (Class D and Class E networks are not commonly used.)

Every IP address has two parts. The first part indicates which network the address belongs to. The second part specifies the device within that network. However, the length of the “first part” changes depending on the network’s class.

IPv4: An IPv4 address consists of 32 bits. Each string of numbers separated by the period consists of 8 bits, represented by 0 to 255 in numerical forms.

IPv6: IPv6 is a networking addressing system designed to replace IPv4. IPv6 uses a 128-bit unique identifier, which allows it to hold more IP addresses than IPv4.
An IPv6 address consists of 8 colon-separated hexadecimal values. IPv6 allows a much larger address space to accommodate the increasing number of devices that are connecting to the internet today.
Under Classless Inter-Domain Routing (CIDR), IPv6 addresses can be aggregated with prefixes of arbitrary bit length, similar to IPv4 addresses. For example, 2001:0db8:/32 is an IPv6 CIDR address, with the first 32 bits, or 2001:db8, as the network address.

Calculation of number of IPs in each Address:

for IPv4 we can calculate number of Ip address using formula 2 power of (32-prefix length)

for IPv6 we can calculate number of Ip address using formula 2 power of (128-prefix length)

Thank you for reading
you can follow me at LinkedIn and Medium

--

--