Subnet and IPv4 Classes

Last updated on August 13, 2024 am

Subnet & IPv4 Classes

Subnet & Subnet Mask

For a random IP address a.b.c.d/x, x denotes the number of 1s in the subnet mask, starting from the most significant bits.

Divided by the subnet mask, the whole IP address can be seen as two parts: the network prefix and the host identifier.

For example, 192.168.19.123/20 is:

Address Type Decimal Binary
IP Address 192.168.19.123 11000000.10101000.00010011.01111011
Subnet Mask 255.255.240.0 11111111.11111111.11110000.00000000
Host Identifier 0.0.3.123 00000000.00000000.00000011.01111011
Network Prefix 192.168.16.0 11000000.10101000.00010000.00000000
First Available Address 192.168.16.1 11000000.10101000.00010000.00000001
Last Available Address 192.168.31.254 11000000.10101000.00011111.11111110
Broadcast Address 192.168.31.255 11000000.10101000.00011111.11111111

The subnet is always referred as its network prefix. It is used for routing outside the subnet.

Inside the subnet, connection and communication only care about the host identifier.

This two-layer separation makes routing more efficient and convenient.

IPv4 Classes

It’s wroth to note that IPv4 classes are already deprecated.

Class Decimal Binary
A Start 1.0.0.0 00000001.00000000.00000000.00000000
A Private Start 10.0.0.0 00001010.00000000.00000000.00000000
A Private End 10.255.255.255 00001010.11111111.11111111.11111111
A End 127.0.0.0 01111111.00000000.00000000.00000000
A Mask 255.0.0.0 11111111.00000000.00000000.00000000
B Start 128.0.0.0 10000000.00000000.00000000.00000000
B Private Start 172.16.0.0 10101100.00010000.00000000.00000000
B Private End 172.31.255.255 10101100.00011111.11111111.11111111
B End 191.255.0.0 10111111.11111111.00000000.00000000
B Mask 255.255.0.0 11111111.11111111.00000000.00000000
C Start 192.0.0.0 11000000.00000000.00000000.00000000
C Private Start 192.168.0.0 11000000.10101000.00000000.00000000
C Private End 192.168.255.255 11000000.10101000.11111111.11111111
C End 223.255.255.0 11011111.11111111.11111111.00000000
C Mask 255.255.255.0 11111111.11111111.11111111.00000000
D Start 224.0.0.0 11100000.00000000.00000000.00000000
D End 239.255.255.255 11101111.11111111.11111111.11111111
E Start 240.0.0.0 11110000.00000000.00000000.00000000
E End 255.255.255.255 11111111.11111111.11111111.11111111

Quote

拥塞如果不加控制的话,它坏的程度会非常坏,就是这个概念。你不在适合的节点,和传染病一样切入一下,它传染的速度会非常快,扩张的速度会非常快。这是一个非线性的思维。那么人啊,基本上都是线性的思维。有些事情是非线性的。所以说人啊,不管是人本身,还是机器本身,在处理这些非线性的时候,通常会造成一些误判。

References


Subnet and IPv4 Classes
https://lingkang.dev/2023/05/16/subnet/
Author
Lingkang
Posted on
May 15, 2023
Licensed under