Класове IP адреси

⚡ Умно обобщение

IP Address Classes divide the IPv4 address space into five groups, A through E, based on the first octet. Each class defines its own address range, default subnet mask, and intended network size.

  • 📊 Five Classes: Class A covers first octets 1 to 126, Class B covers 128 to 191, and Class C covers 192 to 223.
  • 🎯 Special Ranges: Class D handles multicast, Class E remains experimental, and the 127 block is reserved for loopback.
  • 🔧 Quick Identification: Reading the first octet of any address reveals its class and default subnet mask.
  • 🔒 Private Blocks: RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 for internal networks.
  • ???? Evolution: CIDR replaced classful addressing in 1993 to slow address exhaustion and improve allocation efficiency.

Класове IP адреси

Какво е IP адрес?

IP (интернет протокол) адрес е цифров етикет, присвоен на устройствата, свързани към компютърна мрежа, която използва IP за комуникация.

An IP address acts as an identifier for a specific machine on a particular network. It also helps you to establish a virtual connection between a destination and a source. The IP address is also called an IP number or internet address. It helps you to specify the technical format of the addressing and packet scheme. Most networks combine TCP with IP.

An IP address consists of four numbers, and each number contains one to three digits. A single dot (.) separates each number or set of digits, as the image below illustrates.

Части от IP адреса

An IP Адрес се разделя на две части:

  • префикс: The prefix part of an IP address identifies the physical network to which the computer is attached. The prefix is also known as the network address.
  • Наставка: The suffix part identifies the individual computer on the network. The suffix is also called the host address.

Как работи IP адресът?

An IP address works like a postal address. A postal address combines your area, represented by a PIN code, and your house address. The area address is shared by every house in that locality, while the house address is unique to your home.

In the same way, the network address identifies all hosts that belong to a specific network, while the host address uniquely identifies a particular host within it.

Next, let us see how this address space was organized into classes.

Какво е класово адресиране?

Classful addressing is the network addressing architecture the Internet used from 1981 until Classless Inter-Domain Routing (CIDR) was introduced in 1993.

This addressing method divides the IPv4 address space into five separate classes based on the leading bits of the first octet.

Here, classes A, B, and C offer addresses for networks of three distinct sizes. Class D is only used for multicast, and Class E is reserved exclusively for experimental purposes, as the image below shows.

Types of IPv4 Classes

IP Header Classes

The following table summarizes the first octet range, default subnet mask, and typical application of each IPv4 class:

клас First Octet Range Default Subnet Mask Примерно IP Leading Bits Max Number of Networks Хостове на мрежа Приложение
IP Клас А 1 да 126 255.0.0.0 1.1.1.1 0 126 16,777,214 Used for very large networks.
IP клас B 128 да 191 255.255.0.0 128.1.1.1 10 16,384 65,534 Used for medium-size networks.
IP клас C 192 да 223 255.255.255.0 192.1.11.1 110 2,097,152 254 Used for local area networks.
IP клас D 224 да 239 NA 224.0.0.1 1110 NA NA Reserved for multicasting.
IP клас E 240 да 255 NA 240.0.0.1 1111 NA NA Reserved for research and development purposes.

Note: First octet 0 is reserved, and the 127 block is reserved for loopback, so the usable Class A range is 1 to 126.

Let us look at each class in detail:

Мрежа клас А

This IP address class is used when a network contains a large number of hosts. In a Class A network, the leading bit is 0, the first 8 bits (also called the first octet) identify the network, and the remaining 24 bits identify the host within that network.

An example of a Class A address is 102.168.212.226. Here, “102” helps you identify the network and “168.212.226” identifies the host.

Class A addresses from 127.0.0.0 to 127.255.255.255 cannot be assigned to devices because this block is reserved for loopback and diagnostic functions.

Мрежа от клас B

In a Class B IP address, the binary address starts with the leading bits 10, so the decimal value of the first octet falls between 128 and 191. The first 16 bits (known as two octets) help you identify the network. The remaining 16 bits indicate the host within the network.

An example of a Class B IP address is 168.212.226.204, where “168.212” identifies the network and “226.204” identifies the host on that network.

Мрежа от клас C

Class C is a type of IP address that is used for small networks. In this class, three octets are used to identify the network, and the first octet ranges between 192 and 223.

In this type of network addressing method, the leading bits are set to 110, which makes the first 24 bits of the address the network address and the remaining 8 bits the host address. Most local area networks use Class C IP addresses to connect with the network.

Example of a Class C IP address:

192.168.178.1

Клас D мрежа

Class D addresses are only used for multicasting applications and never for regular networking operations. In this class, the first three bits are set to “1” and the fourth bit is set to “0”, giving the leading bits 1110. All the values within the range 224.0.0.0 to 239.255.255.255 are used to identify multicast groups uniquely.

Therefore, there is no need to extract a host address, so Class D does not have any subnet mask.

Example of a Class D IP address:

227.21.6.173

Мрежа от клас E

A Class E IP address is defined by the first four bits of the address being set to 1, which covers addresses from 240.0.0.0 to 255.255.255.255. However, Class E is reserved and its usage has never been defined, so many network implementations discard these addresses as undefined or illegal.

Example of a Class E IP address:

243.164.89.28

How to Identify the Class of an IP Address

You do not need software to find the class of an IPv4 address. The first octet alone tells you the class, the default subnet mask, and how the address splits into network and host portions. Follow these steps:

  1. Read the first octet: Take the number before the first dot. For the address 172.20.10.5, the first octet is 172.
  2. Match it to a class range: A first octet of 1 to 126 means Class A, 128 to 191 Class B, 192 to 223 Class C, 224 to 239 Class D, and 240 to 255 Class E.
  3. Apply the default subnet mask: Since 172 falls in the Class B range, the default mask is 255.255.0.0.
  4. Split the address: With a Class B mask, the network portion is 172.20 and the host portion is 10.5.
💡 Съвет: In binary, the leading bits identify the class: 0 = Class A, 10 = Class B, 110 = Class C, 1110 = Class D, and 1111 = Class E.

Private and Reserved IP Address Ranges

Within Classes A, B, and C, RFC 1918 sets aside one block each as private address space. Public Internet routers do not forward packets from these ranges, making them ideal for home and office networks. Network Address Translation (NAT) maps them to a public address for Internet access.

клас Private Address Range CIDR нотация Number of Addresses
A 10.0.0.0 да 10.255.255.255 10.0.0.0/8 16,777,216
B 172.16.0.0 да 172.31.255.255 172.16.0.0/12 1,048,576
C 192.168.0.0 да 192.168.255.255 192.168.0.0/16 65,536

Two other reserved ranges: 127.0.0.0/8 for loopback testing and 169.254.0.0/16, which devices assign themselves when no DHCP server responds.

Правила за присвояване на мрежов идентификатор

Идентификаторът на мрежата ще бъде присвоен въз основа на дадените по-долу правила:

  • The network ID cannot start with 127 because 127 belongs to the Class A range and is reserved for internal loopback functions.
  • A network ID with all bits set to 1 is reserved for use as an IP broadcast address and cannot be assigned.
  • A network ID with all bits set to 0 denotes a particular host on the local network and should not be routed. Admins who want to скриване на IP адрес details from external scans usually combine these reserved ranges with a privacy tool.

Ограничения на класовото IP адресиране

Here are the drawbacks/cons of the classful IP addressing method:

  • Риск от скорошно изчерпване на адресното пространство
  • Границите на класа не насърчават ефективното разпределение на адресното пространство

These inefficiencies are why CIDR replaced classful addressing in 1993.

Въпроси и Отговори

IPv4 uses 32-bit addresses written as four decimal numbers and supports about 4.3 billion addresses. IPv6 uses 128-bit hexadecimal addresses, and does not use address classes.

The Internet Assigned Numbers Authority (IANA) allocates blocks to five Regional Internet Registries, which distribute them to Internet Service Providers (ISPs) for end users.

CIDR notation expresses the network prefix length after a slash, such as 192.168.1.0/24. It replaced fixed class boundaries with flexible prefix lengths.

AI-powered IP address management (IPAM) tools analyze allocation patterns, predict subnet exhaustion, automate assignments, and flag conflicts before they disrupt the network.

Yes. Machine learning models analyze traffic by source IP, flag unusual ranges, detect spoofed or blacklisted addresses, and identify botnet behavior in real time.

Обобщете тази публикация с: