Tutorials Logic, IN +91 8092939553 info@tutorialslogic.com
FAQs Support
Navigation
Home About Us Contact Us Blogs FAQs
Tutorials
All Tutorials
Services
Academic Projects Resume Writing Interview Questions Website Development
Compiler Tutorials

IP Addressing

IPv4 Addressing

An IPv4 address is a 32-bit number written in dotted decimal notation — four octets (8-bit groups) separated by dots. Each octet ranges from 0 to 255.

Example: 192.168.1.100 = 11000000.10101000.00000001.01100100 in binary

IPv4 Address Classes

ClassFirst Octet RangeDefault Subnet MaskNetworksHosts/NetworkUse
A1 – 126255.0.0.0 (/8)12616,777,214Large organizations
B128 – 191255.255.0.0 (/16)16,38465,534Medium organizations
C192 – 223255.255.255.0 (/24)2,097,152254Small organizations
D224 – 239N/AN/AN/AMulticast
E240 – 255N/AN/AN/AReserved/Experimental

Special IP Addresses

Address/RangePurpose
127.0.0.0 – 127.255.255.255Loopback (localhost) — 127.0.0.1 is most common
10.0.0.0 – 10.255.255.255Private Class A (RFC 1918)
172.16.0.0 – 172.31.255.255Private Class B (RFC 1918)
192.168.0.0 – 192.168.255.255Private Class C (RFC 1918)
169.254.0.0 – 169.254.255.255APIPA (Automatic Private IP Addressing) — when DHCP fails
0.0.0.0Default route / unspecified address
255.255.255.255Limited broadcast (all hosts on local network)

Unicast, Multicast, and Broadcast

  • Unicast: One-to-one communication. A packet is sent from one source to one specific destination. Most common type.
  • Broadcast: One-to-all communication. A packet is sent to all devices on a network. Example: 192.168.1.255 (directed broadcast for 192.168.1.0/24).
  • Multicast: One-to-many communication. A packet is sent to a group of interested receivers. Uses Class D addresses (224.0.0.0 – 239.255.255.255).
  • Anycast: One-to-nearest communication. A packet is sent to the nearest node in a group. Used in IPv6 and CDNs.

IPv6 Addressing

IPv6 uses 128-bit addresses written as 8 groups of 4 hexadecimal digits separated by colons.

Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Abbreviation rules:

  • Leading zeros in each group can be omitted: 0db8db8
  • One consecutive group of all-zero groups can be replaced with ::: 2001:db8::8a2e:370:7334

IPv4 vs IPv6

FeatureIPv4IPv6
Address Size32 bits128 bits
Address FormatDotted decimal (192.168.1.1)Hexadecimal colon notation
Total Addresses~4.3 billion~340 undecillion
Header Size20-60 bytes (variable)40 bytes (fixed)
NAT RequiredYes (address exhaustion)No (enough addresses)
SecurityOptional (IPSec)Built-in (IPSec mandatory)
BroadcastYesNo (uses multicast/anycast)
Auto-configurationDHCPSLAAC (Stateless Address Autoconfiguration)

Ready to Level Up Your Skills?

Explore 500+ free tutorials across 20+ languages and frameworks.