RU | EN | DE

Types of IP Addresses

Public IP Addresses

Public IP addresses are used for unique identification of devices on the internet and allow them to interact directly with each other. The distribution of public addresses is managed by a hierarchical system of organizations: IANA (Internet Assigned Numbers Authority) at the global level, regional internet registries (RIR) at the continental level, and local internet registries (LIR), such as internet service providers and hosting companies, at the local level.

Private IP Addresses

Private IP addresses are used to identify devices within local networks and cannot be used for direct internet access without using network address translation (NAT) technologies. Reserved ranges of private addresses:

  • 10.0.0.0 - 10.255.255.255
  • 172.16.0.0 - 172.31.255.255
  • 192.168.0.0 - 192.168.255.255

Subnet Mask

The subnet mask determines which part of the IP address belongs to the network and which belongs to devices (hosts) in that network. It also consists of four octets and is represented as, for example, 255.255.255.0. The IP address and subnet mask are used together to determine network boundaries.

CIDR Prefix

The CIDR (Classless Inter-Domain Routing) prefix specifies the number of bits used for the network part of the IP address. It is written as a slash and number after the IP address, for example /24. The CIDR prefix allows flexible distribution of IP addresses, creating networks of different sizes.

IP Address Classes (obsolete)

In the past, a classful addressing system was used that divided IP addresses into classes A, B, and C depending on the network size. Each class had a fixed prefix length and a range of values for the first octet:

  • Class A:
    • First octet range: 1-126
    • Network prefix: /8 (8 bits for network, 24 bits for hosts)
    • Capacity: ~16 million hosts
    • Purpose: very large networks (e.g., national providers)
  • Class B:
    • First octet range: 128-191
    • Network prefix: /16 (16 bits for network, 16 bits for hosts)
    • Capacity: ~65,000 hosts
    • Purpose: medium and large networks (e.g., universities, corporations)
  • Class C:
    • First octet range: 192-223
    • Network prefix: /24 (24 bits for network, 8 bits for hosts)
    • Capacity: 254 hosts
    • Purpose: small networks (e.g., home or office) However, this system was recognized as inefficient and replaced by classless CIDR routing.

Subnet Mask Table

The complete subnet mask table contains all possible CIDR prefixes, their corresponding subnet masks, the number of IP addresses in the network, and the number of usable addresses (minus network address and broadcast address):

PrefixSubnet MaskNumber of IP AddressesNumber of Usable IP Addresses
/00.0.0.04,294,967,2964,294,967,294
/1128.0.0.02,147,483,6482,147,483,646
/2192.0.0.01,073,741,8241,073,741,822
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (special case)
/32255.255.255.25511 (special case)

This table is a handy reference for quickly determining network parameters from a given prefix.

  1. Prefix /31 (255.255.255.254):
    • This prefix allows creating a network consisting of only two IP addresses.
    • Normally, one address is used for network identification and the other for the broadcast address, making host address assignment impossible.
    • However, in the special case of the /31 prefix, both addresses can be used for hosts, as no broadcast address is required.
    • This approach is typically used for point-to-point connections, where only two IP addresses are needed, for example for a direct connection between two routers.
  2. Prefix /32 (255.255.255.255):
    • This prefix creates a network consisting of only one IP address.
    • Normally, one address cannot be used as it is reserved for network identification.
    • However, in the special case of the /32 prefix, this single address can be assigned to a host.
    • This approach is often used for loopback addresses (e.g., 127.0.0.1) or to identify a specific host in the network.

Examples of IP Address Distribution

Example 1

IP address block: 192.168.1.0/24

  1. Find prefix /24 in the table.
  2. Subnet mask: 255.255.255.0
  3. Number of IP addresses: 256
  4. Number of usable IP addresses: 254

Address distribution:

  • Network address: 192.168.1.0
  • Usable addresses: 192.168.1.1 - 192.168.1.254
  • Broadcast address: 192.168.1.255

Example 2

IP address block: 10.0.0.0/22

  1. Prefix /22 in the table.
  2. Subnet mask: 255.255.252.0
  3. Number of IP addresses: 1024
  4. Number of usable IP addresses: 1022

Address distribution:

  • Network address: 10.0.0.0
  • Usable addresses: 10.0.0.1 - 10.0.3.254
  • Broadcast address: 10.0.3.255

Converting an IP Address from Decimal to Binary:

An IP address consists of four octets, each of which is a number from 0 to 255. To convert an IP address to binary, you need to convert each octet to an 8-bit binary number, then combine them.

Conversion example for octet 192 to binary:

  • 192 / 2 = 96 (remainder 0)
  • 96 / 2 = 48 (remainder 0)
  • 48 / 2 = 24 (remainder 0)
  • 24 / 2 = 12 (remainder 0)
  • 12 / 2 = 6 (remainder 0)
  • 6 / 2 = 3 (remainder 0)
  • 3 / 2 = 1 (remainder 1)
  • 1 / 2 = 0 (remainder 1)

Remainders in reverse order: 11000000

Example of converting IP address 192.168.1.100 to binary:

  • 192: 11000000
  • 168: 10101000
  • 1: 00000001
  • 100: 01100100

Combined: 11000000.10101000.00000001.01100100