来自RFC 791 出版物中的协议 IPv4 规范:
Address Formats:
High Order Bits Format Class
--------------- ------------------------------- -----
0 7 bits of net, 24 bits of host a
10 14 bits of net, 16 bits of host b
110 21 bits of net, 8 bits of host c
111 escape to extended addressing mode
-- RFC 791 - Addressing
所以,对于C类
地址 | N.N.N.H(N 网络位,H 主机位)
面具 | 11111111.11111111.11111111.0000000 (/24)
地址编号 | 256 (2^
8)
# 主机数 | 256 (2
^8 – 2)
更新
在重新检查与 OP 帖子相关联的 image 后,我注意到他的困惑来自 Reserved IP addresses 概念,而恰恰是 192.168.0.0/16address 块。我接受的答案并没有正确解释^^"
TL;DR:
192.168.0.0/16 不是带有 /16 主机掩码的单个 C 类网络号,而是一组 256 个 C 类网络号
说明
给出我原来的答案。
C类地址形式:
110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
+------------------------+.+------+
net host
C类地址范围
net host
+-------------------------+.+------+
from: 110 00000.00000000.00000000.00000000 (192.0.0.0)
to : 110 11111.11111111.11111111.11111111 (223.0.0.0)
+++ -----.--------.--------.--------
在整个范围内,都有保留的 IP 地址块,供各种建议使用。参看。 reserved IP addresses blocks
在这些保留块中有:
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
根据RFC 1918为Private Network保留,定义为:“一组256个连续的C类网络号”。所以:
- 192.168/16
- 192.168.0.0/24(254 主机)
- ...
- 192.168.255.0/24(254主机)
你可以把它想象成:
net host
+-------------------------+.+------+
+++ -----.--------.--------.-------- <- C class
from: 110 00000.10101000.00000000.00000000 (192.168.0.0)
to : 110 11111.10101000.11111111.11111111 (192.168.255.255)
+++ +++++.++++++++.--------.-------- <- /16 mask