路由table解释
Routing table interpretation
鉴于以下 table,其中网络使用 8 位主机地址,我被要求计算每个接口的目标主机地址的关联范围。然后我还被问到每个范围内的地址数。
Table:
prefix match Interface
00 0
010 1
011 2
10 2
11 3
我确定我得到了 8 位二进制 IP 的前缀,并得出结论:
00000000 to 00111111 (0-63 in decimal) uses interface 0
范围内的地址 = 2 的次方(8 - 前缀中的位数,所以 2)= 64
01000000 to 01011111 (64-95 in decimal) uses interface 1
范围内的地址 = 2^(8-3) = 32
01100000 to 10111111 (96-191 in decimal) uses interface 2
范围内的地址 = 2^5 = 32
11000000 and higer (192+ in decimal) uses interface 3
范围内的地址 = 2^5 = 32
我的推理是否正确?
每个范围内的地址数为2(8 - prefixlen)。所以如果前缀有2位,那么地址的个数就是26 = 64.
鉴于以下 table,其中网络使用 8 位主机地址,我被要求计算每个接口的目标主机地址的关联范围。然后我还被问到每个范围内的地址数。
Table:
prefix match Interface
00 0
010 1
011 2
10 2
11 3
我确定我得到了 8 位二进制 IP 的前缀,并得出结论:
00000000 to 00111111 (0-63 in decimal) uses interface 0
范围内的地址 = 2 的次方(8 - 前缀中的位数,所以 2)= 64
01000000 to 01011111 (64-95 in decimal) uses interface 1
范围内的地址 = 2^(8-3) = 32
01100000 to 10111111 (96-191 in decimal) uses interface 2
范围内的地址 = 2^5 = 32
11000000 and higer (192+ in decimal) uses interface 3
范围内的地址 = 2^5 = 32
我的推理是否正确?
每个范围内的地址数为2(8 - prefixlen)。所以如果前缀有2位,那么地址的个数就是26 = 64.