| 大家好!以前我学习网络,只会用Class C network,就是255.255.255.0 or /24。 
 如果一些新入行的人对这两组表达模式可能会陌生,但是不要紧,请你看继续看就明白。
 
 所以问题答案就是从二进制开始(binary number),255d (decimal)= 11111111b(binary)
 从左手面的位置开始:
 
 Let a, b, c, d, e, f, g, and h be the binary position of a binary number abcdefgh. The value of each abcdefgh is either 0 or 1.
 
 The decimal value of a binary abcdefgh
 
 a x 2^7 = a x 128
 b x 2^6 = b x 64
 c x 2^5 = c x 32
 d x 2^4 = d x 16
 e x 2^3 = e x 8
 f x 2^2 = f x 4
 g x 2^1 = g x 2
 h x 2^0 = h x 1
 
 如果大家有了这个概念,那么后面的讨论就比较容易。
 
 第一试试,就是Network Mask(IP4 32 bit), 从左手边开始都是1,直到看到0位置。例如255.255.255.0为什么可以是network mask呢?
 
 255.225.255.0(d) = 11111111.11111111.11111111.00000000(b)
 
 从上面的binary number,从左手边到右手边共有24个1’s,所以我们/24来代表整个个network的怎样的。
 好了,后面问题就是我们怎样使用subnet呢?就是把两个subnets连起来,怎样把两个subnets连起来?当然用routers。
 
 如果每个subnet的number of hosts不多,动不动就用整个Class C subnet用coverage,那么就有点浪费,如果我们能处理好一点,在Class C下都可以分成很多歌subnets的,怎样分,那么主要看subnet mask怎样设。
 
 /24 1 set of 256 hosts (0-255), where 0 and 255 are not used for hosts/routers
 /25 2 sets of 128 hosts  (0-127, 128-255), where 0, 127, 128, 255 are not used for hosts/routers
 /26 4 sets of 64 hosts (0-63, 64-127, 128-191, 192-255), where 0, 63, 64, 127, 128, 191, 192,255 are not used for hosts/routers
 /27 8 sets of 32 hosts (0-31, 32-63, 64-95, 96-127, 128-159, 160-191, 192-223, 224-255), where 0, 31, 32, 63, 64, 95, 96, 127, 128, 159, 160, 191, 192, 223, 224 and 255 are not used for hosts/routers
 /28
 /29
 /30
 /31
 /32
 
 subnets分得太少怎样没有必要。如果公司不大,就用Class C去分就好,没有必要用一些数字游戏去分,那么可以把问题简单化(可能不对,如果是真,请跟帖讨论)。
 |