IPv4 子网划分
- 每个子网的主机数
- 2(32 − prefix) − 2 (/31: 2, /32: 1)
- 块大小
- 256 − (mask octet)
- 网络地址
- IP AND 掩码
- 广播地址
- IP OR (NOT 掩码):主机位全部置 1
- 借用 n 位得到的子网数
- 2n
公式表、每个专题的关键方法步骤和 6 道练习题,完整解答附在最后。
一个子网使用掩码 255.255.255.224。它有多少个可用主机地址 H?
一台主机的地址为 172.20.148.201/18。其所在子网广播地址的第三个八位组 x 是多少?
HTTP 方法 GET 和 POST 的主要区别是什么?
在具有冗余交换机链路的网络中,哪种机制可以防止广播环路?
8 位模式 1011 1011 以补码形式存储一个有符号整数。它的十进制值 N 是多少?
某系统要为 4405 个项目中的每一个分配一个长度相同的独立二进制编码。最少需要多少位 b?
答案: H = 30
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 = 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).
答案: B · GET 获取资源,POST 在请求体中提交数据
GET 请求一个资源,不应改变服务器状态。POST 在请求体中发送数据(例如表单),供服务器处理。
答案: B · 生成树协议(Spanning Tree Protocol)
STP 选举根桥并阻塞冗余路径,当活动链路故障时再解除阻塞。
答案: N = −69
位置计数制:每个数位的值等于该数字乘以基数的某次幂。二进制各位的权为 1、2、4、8、16、……;十六进制为 1、16、256、……,A–F 代表 10–15。在 8 位补码中,最左边一位的权是 −128 而不是 +128,负数就是这样存储的。
其余各位保持正常的正权值。
答案: b = 13 bit
位置计数制:每个数位的值等于该数字乘以基数的某次幂。二进制各位的权为 1、2、4、8、16、……;十六进制为 1、16、256、……,A–F 代表 10–15。在 8 位补码中,最左边一位的权是 −128 而不是 +128,负数就是这样存储的。
ExamProblems · examproblems.com/courses/computer-networks