Asia/Seoul
BlogJune 18, 2025 | 2 min read

What is IPv4 and IPv6 and how does it work?

Alisher Togayev
What is IPv4 and IPv6 and how does it work?
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
Screenshot 2024-06-26 at 2 19 52 PM x.255.255.255 - Where x is the octet value Screenshot 2024-06-26 at 2 47 18 PM Class D and E dont have a subnet. Screenshot 2024-06-26 at 2 48 22 PM
Java
h = 2^x-2
  • h is the no. of hosts
  • x is the number of zeros in the binary representation of the IP address
Java
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
Share this post:
Alisher Togayev백엔드 · 클라우드 엔지니어
LinkedIn
GitHub
Email
로봇과 IoT 디바이스를 클라우드로 연결하는 3년 차+ 백엔드·클라우드 엔지니어입니다. 뉴욕·애틀랜타·서울·인천국제공항의 300대 이상 스마트팜 모듈을 가동률 99.9%로 운영하고 있습니다.