私有 IP 地址 类

private IP address classes

根据一些参考资料Class 例如C可以提供2^8个主机(掩码/24),根据其他人它可以提供2^16个主机(掩码/16)。?

那么C的真正掩码是什么class ??

来自 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

所以,对于class C

      address       |  N.N.N.H  (N network bit, H hosts bit)
      mask          |  11111111.11111111.11111111.0000000 (/24)
      # of address  |  256 (2^8)
      # of hosts    |  256 (2^8 – 2) 

更新

在重新检查 image that was associated with the OP post, I noticed that his confusion comes from Reserved IP addresses 概念后,正是 192.168.0.0/16 地址块。我接受的答案没有正确解释 ^^"

长话短说:

192.168.0.0/16 不是具有 /16 主机掩码的单个 C class 网络号,而是一组 256 class C 网络号

解释

给出我原来的答案。

C class 地址形式:

  110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
  +------------------------+.+------+
             net               host

C class 地址范围

                 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)

Private Network according to RFC 1918保留,定义为:“一组256个连续的class 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