What is an IP address, and how is it structured?

Let's delve into more technical details about IP addresses:

IPv4 Address Structure:

  1. Binary Representation:
    • An IPv4 address is a 32-bit binary number.
    • Example: 11000000101010000000000100000001
  2. Dotted-Decimal Notation:
    • To make it more human-readable, IPv4 addresses are expressed in dotted-decimal format.
    • Example:
    • Each octet (8 bits) is represented by a decimal number.
  3. Classes (Historical):
    • IPv4 originally had classes (A, B, C, D, E) with predefined network and host portions.
    • Class A: to
    • Class B: to
    • Class C: to
    • Class D: to (Multicast)
    • Class E: to (Reserved)
  4. Subnetting and CIDR:
    • Classful addressing is largely replaced by CIDR.
    • CIDR allows more flexible allocation of IP addresses.
    • Example CIDR notation:
  5. Reserved Addresses:
    • Some IP addresses are reserved for special purposes:
      • Loopback (localhost)
      • Unspecified address
      • Broadcast (limited broadcast)

IPv6 Address Structure:

  1. Binary Representation:
    • IPv6 addresses are 128-bit binary numbers.
    • Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334
  2. Hexadecimal Notation:
    • IPv6 addresses are expressed in hexadecimal with colons separating each 16-bit group.
    • Shortening consecutive groups of zeros is allowed (e.g., ::1 for 0000:0000:0000:0000:0000:0000:0000:0001).
  3. Address Types:
    • Global Unicast: Routable on the Internet.
    • Link-Local: Used for communication on a single network segment.
    • Site-Local (deprecated): Restricted to a specific site.
  4. IPv4-Mapped Addresses:
    • IPv6 can represent IPv4 addresses for compatibility.
    • Example: ::ffff:
  5. Reserved Addresses:
    • Similar to IPv4, IPv6 has reserved addresses, including the loopback (::1) and unspecified (::).
  6. IPv6 Prefixes:
    • IPv6 addresses include a prefix to denote the network and subnet.
    • Example Prefix: 2001:0db8:85a3::/48