传送门:《计算机网络自顶向下方法第7版》英文×习题汇总
collected by:蛋卷超人

SECTION 3.1-3.3
R1. Suppose the network layer provides the following service. The network layer in the source
host accepts a segment of maximum size 1,200 bytes and a destination host address from the transport layer. The network layer then guarantees to deliver the segment to the transport layer at the destination host. Suppose many network application processes can be running at the destination host.
a. Design the simplest possible transport-layer protocol that will get application data to the desired process at the destination host. Assume the operating system in the destination host has assigned a 4-byte port number to each running application process.
b. Modify this protocol so that it provides a “return address” to the destination process.
c. In your protocols, does the transport layer “have to do anything” in the core of the computer network?

Answer:
a.称这个简单的运输层协议为STP,在发送端,STP接受应用程序要发送的数据(不超过1196字节),然后STP添加4字节头部信息,也就是端口号。将这1200字节的报文段连通目的地址交付给网络层;在接收端,STP提取端口和数据,将数据发送给端口所标志的程序。
b.在头部信息中增加 4 字节的源端口号,将数据减少为 1192 字节。也就是源端口号4字节,目的端口号4字节,数据1192字节。
c. 不需要,计算机网络核心是网络层的事情,因此运输层在网络核心中不需要做任何事。

解释:这里其实就是考察对运输层最基本功能的掌握。还有一点不太明白,为什么端口号是4字节呢?

R2. Consider a planet where everyone belongs to a family of six, every family lives in its own house, each house has a unique address, and each person in a given house has a unique name. Suppose this planet has a mail service that delivers letters from source house to destination house. The mail service requires that (1) the letter be in an envelope, and that (2) the address of the destination house (and nothing more) be clearly written on the envelope.
Suppose each family has a delegate family member who collects and distributes letters for the other family members. The letters do not necessarily provide any indication of the recipients of the letters.
a. Using the solution to Problem R1 above as inspiration, describe a protocol that the delegates can use to deliver letters from a sending family member to a receiving family member.
b. In your protocol, does the mail service ever have to open the envelope and examine the letter in order to provide its service?
Answer:
a. 可以使用R1中b的协议。发送信件时,写信的家庭成员是应用层,必须向家庭老大哥(也就是运输层)提供信件内容、目的住所地址和收件人姓名。老大哥在信的顶部清楚地写上收信人的姓名(也就是目的端口号)。然后,老大哥将信件放在信封中,并在信封上写下目的地房屋的地址(目的IP地址),再把信交给邮政服务。
在接收方,接受方老大哥从邮件服务部门接收信件,将信件从信封中取出,并记下写在信件顶部的收件人姓名(也就是源端口号),再将该信交给使用此名称的家庭成员。
b. 不,邮件服务不需要打开信封,它只检查信封上的地址。

R3. Consider a TCP connection between Host A and Host B. Suppose that the TCP segments traveling from Host A to Host B have source port number x and destination port number y. What are the source and destination port numbers for the segments traveling from Host B to Host A?
Answer:源端口号是x,目的端口号是y。

SECTION 3.4
R4. Describe why an application developer might choose to run an application over UDP rather than TCP.
Answer:
1)应用程序不需要使用TCP的拥塞控制,因为这可能导致应用程序的发送速率受限制
2)应用程序不需要TCP提供的可靠数据传输。

R5. Why is it that voice and video traffic is often sent over TCP rather than UDP in today’s
Internet? (Hint: The answer we are looking for has nothing to do with TCP’s congestion-control mechanism.
Answer:由于大多数防火墙配置为阻止UDP通信,因此将TCP用于视频和语音通信可以使通信通过防火墙。
解释:记住就好啦。

R6. Is it possible for an application to enjoy reliable data transfer even when the application runs over UDP? If so, how?
Answer: 这是可能的。开发人员可以将可靠的数据传输到应用层协议中。但这需要大量的工作和调试。

R8. Suppose that a Web server runs in Host C on port 80. Suppose this Web server uses persistent connections, and is currently receiving requests from two different Hosts, A and B. Are all of the requests being sent through the same socket at Host C? If they are being passed through different sockets, do both of the sockets have port 80? Discuss and explain.
答:
对于每个持久连接,Web服务器将创建一个单独的“连接套接字”。每个连接套接字由四个元组标识:(源IP地址、源端口号、目标IP地址、目标端口号)。当主机C接收IP数据报时,它会检查数据报/数据段中的这四个字段,以确定应将TCP数据段的有效负载传递到哪个套接字。因此,来自A和B的请求通过不同的套接字。这两个套接字的标识符的目标端口都为80;但是,这些套接字的标识符对于源IP地址具有不同的值。
与UDP不同,当传输层将TCP段的有效负载传递到应用程序进程时,它不会指定源IP地址,因为这是由套接字标识符隐式指定的。

R10. In our rdt protocols, why did we need to introduce timers定时器?
答:为了解决传输过程中的损耗。如果在计时器的持续时间内未接收到所发送包的ACK,则假定该包(或其ACK或NACK)已丢失。因此,数据包被重新传输。
也就是说,加入计时器,是为了让发送方确认分组丢失:如果发送方在确定时间内没有收到请求,则认为分组已经丢失,则会重发分组。

R11. Suppose that the roundtrip delay between sender and receiver is constant and known to the sender. Would a timer still be necessary in protocol rdt 3.0 , assuming that packets can be lost? Explain.
答:仍然需要,因为如果没有定时器,即使发送发知道了往返时延,仍然无法知道一个分组从发送时刻起,过了多久的时间。往返时延的确定只是能够更合理地设置这个倒计时计时器,而不能缺少这个计时器。(每个分组对应一个到机器计时器,即每次发送一个分组,就启动一个倒计时计时器,包括第一次分组和重传分组)。

P1. Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet session with Server S. Provide possible source and destination port numbers for
a. The segments sent from A to S.
b. The segments sent from B to S.
c. The segments sent from S to A.
d. The segments sent from S to B.
e. If A and B are different hosts, is it possible that the source port number in the segments from A to S is the same as that from B to S?
f. How about if they are the same host?
Answer:
设主机A的telnet会话端口号为x,主机B的telnet会话端口号为y
a. 源端口号:x,目的端口号:23
b. 源端口号:y,目的端口号:23
c. 源端口号:23,目的端口号:x
d. 源端口号:23,目的端口号:y
e. 可能相同
f. 不可能相同

P2. Consider Figure 3.5 . What are the source and destination port values in the segments flowing from the server back to the clients’ processes? What are the IP addresses in the network-layer datagrams carrying the transport-layer segments?

Answer:
服务器到客户A:
源端口号:80, 目的端口号:26145, 源IP:B, 目的IP:A
服务器到客户C,会话1:
源端口号:80, 目的端口号:7532, 源IP:B, 目的IP:C
服务器到客户C,会话2:
源端口号:80, 目的端口号:26145, 源IP:B, 目的IP:C

注意:这道题要仔细审题!是“flowing from the server back to the clients’ processes”,也就是从服务端到客户端的流向,不要看着图中的箭头稀里糊涂就写错了。

P3. UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 01010011, 01100110, 01110100. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums.) Show all work. Why is it that UDP takes the 1s complement of the sum; that is, why not just use the sum? With the 1s complement scheme, how does the receiver detect errors? Is it possible that a 1-bit error will go undetected? How about a 2-bit error
Answer:

反码为 11010001.
使用反码对接收方非常方便,只需将所有数据包含校验码加起来,计算和为全1即可。
如果不是全1则说明出现了差错。因此,为了检测错误,接收方应该包含四个字(三个原始字和校验和),且能够检测到所有的一位错误,但是不一定检测得到两位错误.

解释:我不明白,为了加的时候要把进位1也要算上?
虽然不明白,但是还是应该记住:计算checksum时,把所有16位的字相加,如果遇到进位,则将高于16字节的进位部分的值加到最低位上,举例,0xBB5E+0xFCED=0x1 B84B,则将1放到最低位,得到结果是0xB84C.
此外,还应仔细读这段的英文。
(1)one’s complement:反码(反码:正数的反码就是其原码;负数的反码是将原码中,除符号位以外,每一位取反。)

(2)two’s complement:补码(补码:正数的补码表示就是其本身,负数的补码就是取反加一)

P4.
a. Suppose you have the following 2 bytes: 01011100 and 01100101. What is the 1s complement of the sum of these 2 bytes?
b. Suppose you have the following 2 bytes: 11011010 and 01100101. What is the 1s complement of the sum of these 2 bytes?
c. For the bytes in part (a), give an example where one bit is flipped in each of the 2 bytes and yet the 1s complement doesn’t change
a. 00111110
b. 10111111
c. 两个字节的最后一位变化: 01011101 01100100
解释:omg最后一道没有看懂…

《计算机网络自顶向下方法第7版》第三章习题解答相关推荐

  1. 《计算机网络自顶向下方法-第七版》第一章总结

    1. 什么是Internet 1.1.1 Internet概述 Internet用于将世界上各种各样的终端设备(hosts或者end systems)连接到一起,各种设备通过communication ...

  2. 计算机网络 自顶向下方法 第七版中文 读书笔记 目录

    计算机网络 自顶向下方法 第七版中文 读书笔记 目录 计算机网络 自顶向下方法 第七版中文 读书笔记 目录 第 1 章 计算机网络和因特网 第 2 章 应用层 第 3 章 运输层 第 4 章 网络层 ...

  3. DIP第三章习题解答

    数字图像处理 第三章课后作业 下载地址:https://download.csdn.net/download/qq_44143405/1254953https://download.csdn.net/ ...

  4. 计算机网络自顶向下方法(第六版) 课后题答案 | 第三章

    复习题 R1. a. 将此协议称为简单传输协议(STP).在发送方端,STP 从发送过程中接收不超过 1196 字节的数据块.目标主机地址和目标端口号.STP 向每个块添加一个 4 字节的报头,并将目 ...

  5. 计算机网络自顶向下方法(第六版) 课后题答案 | 第五章

    复习题 R1. 公共汽车.火车.汽车 R2. 虽然每个链路都保证通过链路发送的IP数据报将在链路的另一端接收到,没有错误,但不能保证IP数据报将以正确的顺序到达最终目的地.有了IP,同一TCP连接中的 ...

  6. 【计算机网络-自顶向下方法第7版】学习笔记分享

    #前言 这些都是笔主上课和复习时的手写笔记,笔主也只是一名大三的学生,做此纯属分享给有同等需要的人也作为自己学习的一个记录,如出现纰漏请联系qq1586725168 # ps:如需要无水印pdf版本请 ...

  7. 计算机网络自顶向下方法(第六版) 课后题答案 | 第一章

    复习题 R1. 没什么不同,主机就是端系统,可互换使用:端系统包括PC 机,工作站,Web 服务器,邮件服务器,联网游戏机等. R2. 外交礼仪通常被描述为一套国际礼仪规则.这些建立已久.历史悠久的规 ...

  8. 计算机网络自顶向下方法(第六版) 课后题答案 | 第四章

    复习题 R1. 网络层的分组名称是数据报.路由器是根据包的 IP 地址转发包;而链路层是根据包的 MAC 地址来转发包. R2. 数据报网络中网络层两个最重要的功能是:转发,路由选择. 虚电路网络层最 ...

  9. 《计算机网络 自顶向下方法》读书笔记 第7章 无线网络和移动网络

    第7章 无线网络和移动网络 7.1概述 1.基站是无线网络基础设施的一个关键部分.基站在有线网络中没有明确的对应设备,它负责向与之关联的无线主机发送数据和从主机那里接收数据.基站通常负责协调与之相关联 ...

最新文章

  1. python elif 用法_Python入门高级教程--Python 条件语句
  2. HDU - 2063 过山车(二分图最大匹配)
  3. 洛谷——P1605 迷宫
  4. 能用c语言编写图形界面吗,「分享」C语言如何编写图形界面
  5. 读书笔记:Information Architecture for the World Wide Web, 3rd Edition 北极熊 第一部分 1-3...
  6. git 第二次提交_win10 将本地项目上传到github (第一次+再次上传)
  7. 游戏产业链:游戏分发/渠道商
  8. 用Android模拟器也可以开发和测试NFC应用
  9. PreScan传感器(二)——TIS传感器
  10. 3D游戏学习 案例游戏设计分析——英雄联盟设计浅析
  11. 如何查看服务器登录日志文件,服务器登录日志查看
  12. WMS(仓库管理系统)
  13. 基于国产芯片的刀片服务器,至强E5核心助力 5万左右刀片服务器导购
  14. 网红直播营销现状及对策研究
  15. java描述空间直线_java实验作业类的定义与描述
  16. 关键链项目管理(二) 关键链
  17. JAVA 开发命名规范——阿里巴巴Java开发手册
  18. Velocity是什么?
  19. audio: /dev/dsp: No such file or directory madplay
  20. 科大讯飞SDK的使用

热门文章

  1. 赫容俏的优势在哪里?
  2. html--图片的链接使用
  3. 数据库中数据长度到底代表什么呢?
  4. 郑州大学python程序设计试题及答案_C 语言程序设计(2016 年秋季学期课程)
  5. oracle dump 源码,AIX 下的 core dump 分析入门
  6. 七大设计原则Java实战之个人理解和图解
  7. 在印度,越来越多的女性游戏开发者参与其中
  8. 万维网服务器把信息组织成,万维网与因特网有什么关系
  9. 计算机课中的隐藏,合理利用组策略--隐藏计算机中的某个磁盘
  10. 类的数据成员与成员函数