【问题标题】:private IP address classes私有 IP 地址类
【发布时间】:2017-06-14 11:27:19
【问题描述】:

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

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

【问题讨论】:

标签: ip ip-address


【解决方案1】:

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

【讨论】:

  • 谢谢,你知道另一种观点的起源吗 (C class= /16)
  • a /16 mask 代表 class B 根据定义 IPv4 协议的人。检查我的答案中的链接。 :)
猜你喜欢
  • 1970-01-01
  • 2010-09-10
  • 2020-01-10
  • 2016-11-02
  • 2012-11-28
  • 1970-01-01
  • 1970-01-01
  • 2013-06-13
  • 2017-04-28
相关资源
最近更新 更多