IPv4 子网划分
- 每个子网的主机数
- 2(32 − prefix) − 2 (/31: 2, /32: 1)
- 块大小
- 256 − (mask octet)
- 网络地址
- IP AND 掩码
- 广播地址
- IP OR (NOT 掩码):主机位全部置 1
- 借用 n 位得到的子网数
- 2n
公式表、每个专题的关键方法步骤和 6 道练习题,完整解答附在最后。
网络 192.168.58.0/24 被划分为若干 /26 子网,从最低地址起编号为 1、2、3、…(子网 1 从 .0 开始)。子网 3 的广播地址的第四个八位组 x 是多少?
一台主机的地址为 172.20.243.194/18。其所在子网广播地址的第三个八位组 x 是多少?
使用偶校验时,给数据位 1011001 添加的校验位是什么?
BGP 在互联网中的主要作用是什么?
设置各位,使其以 8 位补码存储 −72。按无符号数读取,该位模式的值 U 是多少?
把各位设置为 0111 0101 << 1 的 8 位结果。该结果的十进制值 R 是多少?
答案: x = 191
IPv4 subnetting: an address has 32 bits. The prefix /p says how many leading bits identify the network; the remaining 32 − p bits number the hosts. A subnet has 2³²⁻ᵖ addresses, but the first (network address) and last (broadcast address) cannot be given to hosts, so 2³²⁻ᵖ − 2 hosts fit. Exceptions: a /31 (point-to-point link, RFC 3021) uses both of its 2 addresses for hosts, and a /32 is one single address (a single host or a loopback).
答案: x = 255
IPv4 subnetting: an address has 32 bits. The prefix /p says how many leading bits identify the network; the remaining 32 − p bits number the hosts. A subnet has 2³²⁻ᵖ addresses, but the first (network address) and last (broadcast address) cannot be given to hosts, so 2³²⁻ᵖ − 2 hosts fit. Exceptions: a /31 (point-to-point link, RFC 3021) uses both of its 2 addresses for hosts, and a /32 is one single address (a single host or a loopback).
答案: C · 0
1011001 中有四个 1,已经是偶数,所以校验位是 0。若使用奇校验,则校验位为 1。
答案: C · 在自治系统之间交换路由信息
BGP 是域间路由协议;自治系统(AS)通告可达前缀,并根据策略选择路径。
答案: U = 184
设置比特位:每一位对应 2 的一个幂(128、64、…、1)。一个十六进制数字恰好是四位,在 8 位补码中最左边的位权重为 −128。按位运算对每个位位置分别进行。
答案: R = 234
设置比特位:每一位对应 2 的一个幂(128、64、…、1)。一个十六进制数字恰好是四位,在 8 位补码中最左边的位权重为 −128。按位运算对每个位位置分别进行。
左移 1 位,把每一位向左移动 1 个位置;从左端移出的位丢失,右侧补入 0。
ExamProblems · examproblems.com/courses/computer-networks