您的位置:首页 > 理论基础 > 计算机网络

掩码的1必须连续?关于像255.255.0.255这样的非连续子网掩码

2012-09-13 07:19 330 查看

掩码的1必须连续?关于像255.255.0.255这样的非连续子网掩码

2009-10-28 18:36:13| 分类: IT|字号 订阅百度上搜索的都是说255.255.0.255的掩码不合法,其实这些人没有读过RFC,也就大惊小怪了
RFC950的内容:
3.  A Class C Network Case (illustrating non-contiguous subnet bits)

For this case, assume that the requesting host is on class C
network 192.1.127.0, has address 192.1.127.19, that there is a
gateway at 192.1.127.50, and that on network an 3-bit subnet field
is in use (01011000), that is, the address mask is 255.255.255.88.

The host sends the ICMP request to 255.255.255.255:

Source address:          192.1.127.19
Destination address:     255.255.255.255
Protocol:                ICMP = 1
Type:                    Address Mask Request = AM1
Code:                    0
Mask:                    0
//19的二进制是00010011
//88的二进制是01011000
AND的结果是00010000

The gateway can then respond directly to the requesting host.

Source address:          192.1.127.50
Destination address:     192.1.127.19
Protocol:                ICMP = 1
Type:                    Address Mask Reply = AM2
Code:                    0
Mask:                    255.255.255.88.
//50的二进制是00110010
//88的二进制是01011000
AND的结果是00010000、
所以这两个机器在一个子网内,destination address直接就是192.1.127.19

In the diskless workstation case the host sends:

Source address:          0.0.0.0
Destination address:     255.255.255.255
Protocol:                ICMP = 1
Type:                    Address Mask Request = AM1
Code:                    0
Mask:                    0

192.1.127.50 will hear the datagram, and should respond with this
datagram:

Source address:          192.1.127.50
Destination address:     255.255.255.255
Protocol:                ICMP = 1
Type:                    Address Mask Reply = AM2
Code:                    0
Mask:                    255.255.255.88.

Read more: http://www.faqs.org/rfcs/rfc950.html#ixzz0VE0qJANw

另外一篇:
相信读过TCP-IP详解的都知道这个问题,位于中文版vol 1 004里面
10. (3.5) Is the subnet mask 255.255.0.255 valid for a class A address?  See
RFC 1219 [Tsuchiya 1991] for more info.  This is available from the
Networking I web page, as well as from the usual sources.

It's valid and it's called a noncontiguous subnet mask since the 16 bits for
the subnet mask are not contiguous.  The RFC's, however, recommend against
using noncontiguous subnet masks.
//看到没,只是反对使用,没说不连续的子网掩码是非法的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐