计网第五次作业Review Questions:1. What are some of the possible services that a link-layer protocol can offer to the network layer? Which of these link-layer services have corresponding services in IP? In TCP?链路层协议提供给网络层的服务有哪些?哪些是给IP的?哪些是给TCP的?Link access, framing, reliable delivery between adjacent nodes, flow control, error detection, error correction, half-duplex and full-duplex. In IP: framing, error detection.In TCP: framing, reliable delivery between adjacent nodes, error detection, half-duplex and full-duplex.2. If all the links in the Internet were to provide reliable delivery service, would the TCP reliable delivery service be redundant? Why or why not?不会多余,因为TCP保证的是传输层的数据传送,而link提供稳定可靠传输保证链路层的传输稳定,二者不完全重叠,所以TCP可靠传输也不会多余。
3. In Section 5.3, we listed four desirable characteristics of a broadcast channel. Which of these characteristics does slotted ALOHA have? Which of these characteristics does token passing have?4. Suppose two nodes start to transmit at the same time a packet of length Lover a broadcast channel of rate R. Denote the propagation delay between the two nodes as dprop. Will there be a collision if dprop< L / R? Why or why not?因为L / R = 包传递的时间,如果dprop < L / R,也就意味着A的信号跑到B的时候B的最后一个分组还没离开B,所以发生碰撞。
7. Suppose nodes A, B, and C each attach to the same broadcast LAN (through their adapters). If A sends thousands of IP datagrams to B with each encapsulating frame addressed to the MAC address of B, will C’s adapter process these frames? If so, will C’s adapter pass the IP datagrams in these frames to the network layer C? How would your answers change if A sends frames with the MAC broadcast address?不会,C会拆封帧从而读取报头的MAC,因为每一个host的MAC都唯一,C 读取到数据报中的MAC和自己的不一样就不会继续拆封数据报,不会投递给C。
当使用LAN口广播地址的时候,C的适配器就会拆封帧,向C传递数据。
8. How big is the MAC address space? The IPv4 address space? The IPv6 address space?2^48,2^32,2^128.9. Why is an ARP query sent within a broadcast frame? Why is an ARP response sent within a frame with a specific destination MAC address?因为新加入网络的主机是不知道路由器的IP的,自己也没有IP,所以只能广播才能得到IP。
因为每个主机的MAC地址都是唯一的,而ARP建立转发表的时候会带上MAC地址。
12.In CSMA/CD, after the fifth collision, what is the probability thata node chooses K = 4? The result K = 4 corresponds to a delay of how many seconds on a 10 Mbps Ethernet?可能,因为第五次K的取值范围是0-(2^5-1)即0-31。
Bit time = 1 bit / R = 1 bit / 10 Mbps = 1 msec,K = 4,wait time = 4 * 512 * 1 msec = 2048 msec。
Problems:1.Suppose the information content of a packet is the bit pattern1110 1100 1000 1010 and an even parity scheme is being used.What would the value of the field containing the parity bits be for the case of a two-dimensional parity scheme? Your answer should be such that a minimum-length checksum field is used.假设一个数据包的信息含量是XXX,使用偶校验方案。
采用二位奇偶校验方案的字段包含的奇偶校验位的字段的值是多少?答案要使用最小长度校验。
10100101001010010111000112. Suppose the information portion of a packet (D in Figure 5.4) contains 10 bytes consisting of the 8-bit unsigned binary ASCII representation of the integers 0 through 9. Compute the Internet checksum for this data.假设一个包的信息的一部分包括10bytes组成的8-bit无符号二进制码表示的整数0-9,计算该数据的网络校验。
算校验码先把0-9加起来0000 0000 0000 00010000 0010 0000 00110000 0100 0000 01010000 0110 0000 01110000 1000 0000 10010001 0100 0001 1001→→→→取反可得校验码为1110 1011 1110 01103. Consider the previous problem, but instead of containing thebinary of the numbers 0 through 9 suppose these 10 bytes contain. Compute the Internet checksum for this data.a. the binary representation of the numbers 1 through 10.0000 0001 0000 00100000 0011 0000 01000000 0101 0000 01100000 0111 0000 10000000 1001 0001 01000001 1011 0001 1110→→→→取反可得1110 0100 1110 0001b. the ASCII representation of the letters A through J (uppercase). 0100 0001 0100 00100100 0011 0100 01000100 0101 0100 01100100 0111 0100 10000100 1001 0100 10100101 1000 0101 1111→→→→取反可得1010 0111 1010 0000d. Consider sending an IP datagram from Host A to Host F. Suppose all of the ARP tables are up to date. Enumerate all the steps, as done for the single-router example in Section 5.4.2.1. host A发送一个数据报,通过转发表查询F的IP,向路由器1发送,其中destination IP为133.133.133.12,MAC未知,source IP为111.111.111.12,source MAC为aa-aa-aa-aa-aa-aa。
2. 适配器更改destination的IP为111.111.111.12,MAC地址变为gg-gg-gg-gg-gg-gg3. 路由器1发现目标IP和MAC不属于子网1中任何host,属于子网3(图中忘了画了,意会一下)。
于是根据转发表向路由器2进行转发。
Destination 的IP为122.122.122.20,MAC为ii-ii-ii-ii-ii-ii。
4. 路由器2收到了数据报,发现host F在自己的子网内,于是修改destination 的IP为133.133.133.12,MAC地址为ff-ff-ff-ff-ff-ff。
修改source IP为133.133.133.20,MAC为jj-jj-jj-jj-jj-jj,然后向F发送数据报。