Network

What is IPv4 and IPv6 and how does it work?

A brief overview of IPv4 and IPv6, their structure, and how they function in networking.

What is IPv4 and IPv6 and how does it work?

IPv4

IP stands for Internet Protocol and v4 stands for Version Four. IPv4 was the primary version brought into action for production within the ARPANET in 1983 IP version four addresses are 32-bit integers which will be expressed in decimal notation.

IPv4 address structure:

  • Its a 32-bit long value
  • In binary, its a 32-bit long string of onez and zeros

It has 4 octets, each octet 8-bit long string Example: 11111111.11111111.11111111.00000000

  • In decimal format, it consits of 4 decimal numbers separated by a dot. Example: 192.134.34.11
Screenshot 2024-06-26 at 2 13 47 PM
  • Class A -> start from| 0 = 0

  • Class B -> start from| 0 + 128 = 128

  • Class C -> start from| 0 + 128 + 64 = 192

  • Class D -> start from| 0 + 128 + 64 + 32 = 224

  • Class E -> start from| 0 + 128 + 64 + 32 + 16 = 240

  • Class A -> ends at| 127

  • Class B -> ends at| 191

  • Class C -> ends at| 223

  • Class D -> ends at| 239

  • Cladd E -> ends at| 255

First Octet in Decimal

Screenshot 2024-06-26 at 2 19 52 PM

IP range

x.255.255.255 - Where x is the octet value

Screenshot 2024-06-26 at 2 47 18 PM

Subnet Mask

Class D and E dont have a subnet.

Screenshot 2024-06-26 at 2 48 22 PM

# Of hosts per Network ID ^ # Of networks

h = 2^x-2
  • h is the no. of hosts
  • x is the number of zeros in the binary representation of the IP address
n = 2^y

n is the no. of networks, and y is the no. of ones in the binary representation of the IP address. Thus, we get:

Screenshot 2024-06-26 at 2 50 30 PM