计网个人作业03

news2024/9/23 23:24:42

R14. True or false?

a

a. Suppose Host A is sending a large file to Host B over a TCP connection. If the sequence number for a segment of this connection is m, then the sequence number for the subsequent segment will necessarily be m + 1.

假设主机A通过一条TCP连接向主机B发送一个大文件,如果对于这次连接的一个报文段序号为m,则对于后续报文段序列号必然为m+1

False
序号是根据TCP数据字节流大小决定而非保温序列,假定最大报文段大小为n,则后续报文段序号应为m+n

b

b. Host A is sending Host B a large file over a TCP connection. Assume Host B has no data to send Host A. Host B will not send acknowledgments to Host A because Host B cannot piggyback the acknowledgments on data.

主机A经过一条TCP连接向主机B发送一个大文件. 假设主机B没有数据发往主机A. 因为主机B不能随数据捎带确认, 所以主机B将不向主机A发送确认

False

主机B不向A发送确认这个行为会违背可靠数据传输协议基本原则。reciever向sender发送确定是报文协议的一个规则。

课本上提到的是:sender要发送一个字符,receiver返回该字符并回显,顺便把确认信息放入发送给sender的数据的报文段中,此为 捎带确定

c

c. Suppose that the last SampleRTT in a TCP connection is equal to 1 sec. The current value of TimeoutInterval for the connection will necessarily be ≥ 1 sec.

假定在一条TCP连接中最后的SampleRTT等于1秒, 那么对于该连接的TimeoutInterval的当前值必定大于等于1秒.

False

T i m e o u t   I n t e r v a l = E s t i m a t e d R T T + 4 × D e v R T T Timeout\ Interval = Estimated RTT+4\times DevRTT Timeout Interval=EstimatedRTT+4×DevRTT
TimeoutInterval数据和SampleRTT无关

d

d. Suppose Host A is sending Host B a large file over a TCP connection. The number of unacknowledged bytes that A sends cannot exceed the size of the receive buffer.

假设主机A通过一条TCP连接向主机B发送一个大文件。主机A发送的未被确认的字节数不会超过接收缓存的大小

True

TCP流量控制

e

e. The size of the TCP RcvWindow never changes throughout the duration of the connection.

在连接的整个过程中,TCP的RcvWindow的长度不会变化

RWND (Receiver Window) 滑动窗口

False

rwnd的值是动态的,其表示连接的缓存中还有多少空间

f

f. The TCP segment has a field in its header for RcvWindow.

TCP报文段在它的首部中有一个rwnd字段。

True

rwnd即接收窗口(receive window),用来告知发送方,自己在该TCP连接的缓存中还有多少可用空间

g

g. Suppose Host A sends one segment with sequence number 38 and 4 bytes of data over a TCP connection to Host B. In this same segment the acknowledgment number is necessarily 42.

假定主机A通过一条TCP连接向主机B发送一个序号为38的4字节报文段。这个报文段的确认号必定是42

False
A向B发送报文,B成功收到该报文段,然后向A发送确认报文段,确认报文段确认号为42

42是 确认报文段的确认号
而不是 报文段的确认号

P2.

UDP和TCP使用反码来计算它们的检验和。假设你有下面3个8比特字节:01010011,01100110,01110100。这些8比特字节和的反码是多少?(注意到尽管UDP 和 TCP 使用 16 比特的字来计算检验和,但对于这个问题,你应该考虑8比特和。)写出所有工作过程。UDP 为什么要用该和的反码,即为什么不直接使用该和呢?使用该反码方案,接收方如何检测出差错?1比特的差错将可能检测不出来吗?2比特的差错呢?

   0 1 0 1 0 0 1 1
 + 0 1 1 0 0 1 1 0
------------------
   1 0 1 1 1 0 0 1

   1 0 1 1 1 0 0 1
 + 0 1 1 1 0 1 0 0
 -----------------
   0 0 1 0 1 1 1 0
//溢出一位,第一位回卷

补码为: 1 1 0 1 0 0 0 1

若要检验错误,接收方添加四个单词(三个原始单词和校验和)

  1. 将反码1101 0001 放在检验和处
  2. 在接受方将全部的传输数据和检验和相加为1111 1111时,无差错
  3. 只要有任意一位为0,传输中就出现了差错

运用反码相加,全1的检测对于计算机来说更加方便,速度会更快

if 和包含一个0
    reciever知道存在 “一位错误”
if 两位错误出现在同一位置上无法被检验到

P5.

Consider our motivation for correcting protocol rdt2.1. Show that the receiver, shown in the following figure, when operating with the sender shown in Figure 3.11, can lead the sender and receiver to enter into a deadlock state, where each is waiting for an event that will never occur.

考虑我们改正协议rdt2.1的动机,试说明下图接收方与3。11所示发送方运行时,接收方可能会引起的发送方和接收方进入的死锁状态。
在这里插入图片描述

假设sender处于"等待来自上层的调用1", receiver处于"wait for 1 from below"的状态.

  1. sender发送序列号为1的数据包,转换"等待ACK或NAK1",等待ACK或NAK1。
  2. 若接收方正确接收序列号为1的数据包,发送ACK,转换为状态——“wait for 0 from below”等待序列号为0的数据包
  3. 然而ACK损坏,rdt2.1sender获取损坏的ACK时,它以序列号1重新发送数据包
  4. receiver正在等待序列号为0的数据包,并且当它没有得到序列号为0的数据包时,总是发送NAK
  5. 发送方将始终发送序列号为1的数据包,接收方将始终保持该数据包。死锁

P8.

Suppose that the UDP receiver computes the Internet checksum for the received UDP segment and finds that it matches the value carried in the checksum field. Can the receiver be absolutely certain that no bit errors have occurred? Explain.

不一定,有可能同时出现两个bits的错误

P13.

Consider a reliable data transfer protocol that uses only negative acknowledgments. Suppose the sender sends data only infrequently. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? Now suppose the sender has a lot of data to send and the end-to-end connection experiences few losses. In this second case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why?

  1. 问题1:

仅NAK协议中,只有receiver接受到分组 x + 1 x+1 x+1的时候,receiver才检测数据包x的丢失

考虑发生以下事件:
receiver接受 x − 1 {x-1} x1 然后接受 x + 1 {x+1} x+1,当reciver真正接收到 x + 1 x+1 x+1的时候,接收器才会意识到x被忽略了。

x x x x + 1 x+1 x+1传输之间存在很长的延迟,只是用NAK协议下,需要很长时间才可以获得数据 x x x

  1. 问题2:
    会表现得更好,这是sender要发送大量数据,sender可以即使得知数据丢失并重发。同时丢失量较少NAK数量也会较少,对比又ACK的协议,可以有效降低receiver到sender的流量占用

P14.

Consider the GBN protocol with a sender window size of 3 and a sequence number range of 1,024. Suppose that at time t, the next in-order packet that the receiver is expecting has a sequence number of k. Assume that the medium does not reorder messages. Answer the following questions:

考虑一个GBN协议,其发送方窗口为4,序号范围为1024。假设在时刻t,接收方期待的下一个有序分组的序号是k 。假设媒体不会对报文重新排序

a. What are the possible sets of sequence numbers inside the sender’s window at time t? Justify your answer.
a. 在f时刻,发送方窗口内的报文序号可能是多少?论证你的回答。

  1. 回答a:
    此时receiver等待第 k k k个数据,那么 k − 3 , k − 2 , k − 1 k-3,k-2,k-1 k3,k2,k1的数据的ACK报文中可能存在部分丢失.
    对于最大的抵达sender的ACK报文序号,记为 x ( k − 3 ≤ x ≤ k − 1 ) x(k-3\leq x\leq k-1) x(k3xk1),那么sender的窗口内为第 x + 1 , x + 2 , x + 3 x+1,x+2,x+3 x+1,x+2,x+3的数据
    举个例子:若第 k − 3 , k − 1 k-3,k-1 k3,k1数据丢包,sender
    窗口中应为 k − 1 , k , k + 1 k-1,k,k+1 k1,k,k+1

b. What are all possible values of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer.b. 在f时刻,在当前传播回发送方的所有可能报文中,ACK字段的所有可能值是多少?论证你的回答。

  1. 回答b:
    由于 receiver 正在等待第 k k k个数据, 即 sender 已经发出了第 k − 1 k-1 k1个数据,说明sender至少收到了第 k − 4 k-4 k4个数据的ACK报文(否则sender窗口中应为k-4,k-3,k-2数据),于是序号小于k-4的数据的ACK不会被重传,那么在传输中的ACK报文范围为 [ k − 4 , k − 1 ] [k-4,k-1] [k4,k1]

P22.

Consider the GBN and SR protocols. Suppose the sequence number space is of size k. What is the largest allowable sender window that will avoid the occurrence of problems such as that in Figure 3.27 for each of these protocols?

窗口大小 w w w应该满足 w ≤ ⌊ k 2 ⌋ w\le\lfloor \frac k2\rfloor w2k

当前receiver等待窗口为 [ x , x + w ] [x,x+w] [x,x+w],也就是receiver已经收到了 [ x − w − 1 , x − 1 ] [x-w-1,x-1] [xw1,x1]的数据,但最坏情况下,只有 x − w − 1 x-w-1 xw1的ACK到达sender,即sender窗口含有的数据为 [ x − w , x ] [x-w,x] [xw,x],那么若KaTeX parse error: Undefined control sequence: \re at position 12: (x+w)-(x-w)\̲r̲e̲ ̲k的时候,就有 ( x − w )   m o d   k ∈ [ x , x + w ]   m o d   k (x-w)\ mod\ k\in [x,x+w]\ mod\ k (xw) mod k[x,x+w] mod k,当sender重发 x − w x-w xw就会被receiver当作新的数据接收,因此窗口大小 w w w应该满足 w ≤ ⌊ k 2 ⌋ w\le\lfloor \frac k2\rfloor w2k

P24.

Consider transferring an enormous file of L bytes from Host A to Host B.

a. What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP sequence number field has 4 bytes.

2 32 b y t e s = 4 G b y t e s 2^{32}bytes = 4Gbytes 232bytes=4Gbytes

b. For the L you obtain in (a), find how long it takes to transmit the file. Assume that a total of 66 bytes of transport, network, and data-link header are added to each segment before the resulting packet is sent out over a 10 Mbps link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously.

假设 M T U = 1460 b y t e s MTU = 1460bytes MTU=1460bytes一共会产生 ⌈ 2 32 1460 ⌉ \lceil \frac{2^{32}}{1460}\rceil 1460232个报文,头部数据一共有 66 × ⌈ 2 32 1460 ⌉ 66\times \lceil \frac{2^{32}}{1460}\rceil 66×1460232

共需要时间
8 × ( 2 32 + 66 × ⌈ 2 32 1460 ⌉ ) 10 × 2 20 = 3425 s \frac{8\times(2^{32}+66\times \lceil \frac{2^{32}}{1460}\rceil)}{10\times 2^{20}} = 3425s 10×2208×(232+66×1460232)=3425s

P32.

Consider Figure 3.57.
在这里插入图片描述
Figure 3.57 TCP window size as a function of timeAssuming TCP Reno is the protocol experiencing the behavior shown above, answer the following questions. In all cases, you should provide a short discussion justifying your answer.

a

a. What is the value of Threshold ssthresh at the 18th transmission round?

在17th处CongWin大小减半,发生了3个冗余ACK时间,Threshold应该是发生该事件前CongWin(16th)大小的一半
也就是
42 2 = 21 \frac{42}{2}=21 242=21

b

b. What is the value of Threshold ssthresh at the 24th transmission round?

23th处CongWin变为慢启动状态,也就是超时事件,所以Threshold应该是发生这个事件前CongWin(22th处)大小的一半
26 2 = 13 \frac{26}{2}=13 226=13

c

c. Identify the intervals of time when TCP slow start is operating.

[1,6][23,26]

d

d. Assuming a packet loss is detected after the 26th round by the receipt of a triple duplicate ACK, what will be the values of the congestion window size and of Threshold ssthresh?

当收到 3 个冗余 ACK 时, Threshold 应该是发⽣该事件前 CongWin (即 16th 处)⼤⼩的⼀半, 即
8 2 = 4 \frac82=4 28=4
⽽ CongWin ⼤⼩应被设为 Threshold 的值, 即 4 4 4

e

e. After the 16th transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?

6th 后检测到 3 个冗余 ACK 事件

f

f. After the 22nd transmission round, is segment loss detected by a triple duplicate ACK or by a timeout?

22th 后检测到超时事件

g

g. Identify the intervals of time when TCP congestion avoidance is operating.
[6,16] [17,22]

h

h. What is the initial value of Threshold ssthresh at the first transmission round?

由于在 CongWin ⼤⼩为 32 时开始加性增, 所以初始值为32

i

i. During what transmission round is the 70th segment sent?

前6 round中,发送了 1 + 2 + 4 + 8 + 16 + 32 = 63 1+2+4+8+16+32=63 1+2+4+8+16+32=63个报文, 7th 共发送33个报文
所以7th时候发送第70个报文

j

j. Suppose TCP Tahoe is used (instead of TCP Reno), and assume that triple duplicate ACKs are received at the 16th round. What are the ssthresh and the congestion window size at the 19th round?

对于 Tahoe 版 TCP, 17th 时 Threshold 应为 21, ⽽ ChongWin ⼤⼩应为 1, 并处于慢启动状态, 所以19th 时 Threshold 为 21, ⽽ ChongWin ⼤⼩为 4

k

k. Again suppose TCP Tahoe is used, and there is a timeout event at 22nd round. How many packets have been sent out from 17th round till 22nd round, inclusive?

由于 Threshold 为 21, 所以从 17th 开始, CongWin ⼤⼩应为 1 , 2 , 4 , 8 , 16 , 21 1,2,4,8,16,21 1,2,4,8,16,21所以一共发送 52 个 52个 52

P36.

Consider sending a large file from a host to another over a TCP connection that has no loss.

a

a. Suppose TCP uses AIMD for its congestion control without slow start. Assuming CongWin increases by 1 MSS every time a batch of ACKs is received and assuming approximately constant round-trip times, how long does it take for CongWin increase from 1 MSS to 6 MSS (assuming no loss events)?

由于每 1 RTT 可以增⻓ 1 MSS, 所以共需5MSS

b

b. What is the average throughout (in terms of MSS and RTT) for this connection up through time = 5 RTT?

总共发送 1 + 2 + 3 + 4 + 5 = 15 1+2+3+4+5=15 1+2+3+4+5=15MMS
平均值为 15 3 = 5 \frac{15}{3}=5 315=5

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/57190.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

厉害了!阿里内部都用的Spring+MyBatis源码手册,实战理论两不误

目前大部分的 Java 互联网项目,都是用 Spring MVC Spring MyBatis 搭建平台的。 使用 Spring IoC 可以有效的管理各类的 Java 资源,达到即插即拔的功能;通过 Spring AOP 框架,数据库事务可以委托给 Spring 管理,消除…

slam学习 - 基本VO代码学习

本打算学习 orb -slam3 源码,但还是先把《slam 14》上的代码看完再说,至少把整个流程走一遍。 相关参考 https://blog.csdn.net/weixin_44684139/article/details/105305564 https://blog.csdn.net/qq_35590091/article/details/97111744 代码需求分析…

蚁群算法(ant system,AS)

蚁群算法蚂蚁系统(ant system,AS)由Dorigo于1996年发表,文章题目为[《The Ant System : optimization by a colony of cooperating agents》](https://www.docin.com/p-1565494487.html)。在耳熟能详的TSP旅行商问题上AS算法有着不错的效果,这也是被大多…

Dynamsoft Barcode Reader C, C++, .NET, Java SDK

Dynamsoft Barcode Reader 9.6.0 支持 win/mac/linux,没有Python版本提供 Adds support for handling barcode image orientation. November 30, 2022 - 16:06 New Version Features C, C, .NET, Java and Python SDK Added support for handling image orientation. With …

为什么数据库不应该使用外键

当我们想要持久化地存储数据时,使用关系型数据库往往都是最稳妥的选择,这不仅因为今天的关系型数据库种类非常丰富并且稳定,还因为不同社区对关系型数据库的支持都非常完备。我们在前面的文章中曾经分析过 为什么 MySQL 的自增主键不单调也不…

利用Python处理excel表格,pandas分割表格、拆分表格

前言 记录一下,在使用pandas处理excel表格表格时候,关于分割(切分)表格这一块儿的操作。 这个系列会有三篇左右文章,这是第一篇,excel表格切割 我们常说的 excel文件, 在广义上,是指以 xls 或 xlsx 为后缀…

Compose 动画艺术探索之灵动岛

本文为稀土掘金技术社区首发签约文章,14天内禁止转载,14天后未获授权禁止转载,侵权必究! 本篇文章是此专栏的第五篇文章,本篇文章应该是此专栏中最后一篇直接关于动画的文章了,之后文章中可能会提到&#…

SpringBoot @InitBinder注解实现Bean国际化校验

参考资料 参考: 妥当性チェックのエラーメッセージ出力方法 (需翻墙)springMVC之InitBinder的用法1springMVC之InitBinder的用法2springMVC之InitBinder 和 ValidatorSpring MVCにおけるフォームバリデーションの適用事例【後編】 目录一. 前期准备1.1 自定义校验注…

【spark】第一章——Spark简介及环境配置

文章目录1. Spark 概述1.1 Spark 是什么1.2 Spark and Hadoop1.3 Spark or Hadoop1.4 Spark 核心模块2. Spark 快速上手2.1 创建 Maven 项目2.1.1 增加 Scala 插件2.1.2 增加依赖关系2.1.3 WordCount2.1.4 异常处理3. Spark 运行环境3.1 Local 模式3.1.1 解压缩文件3.1.2 启动 …

MATLAB源码-GRABIT从图像文件中提取数据点。

源码链接: https://download.csdn.net/download/tgs2033/87238015https://download.csdn.net/download/tgs2033/87238015 GRABIT从图像文件中提取数据点。 GRABIT启动用于从图像文件中提取数据的GUI程序。它能够读取BMP、JPG、TIF、GIF和PNG文件(IMREAD…

12月3日:thinkphp模型与数据库相同的部分

定义 定义一个模型类 <?phpnamespace app\index\model; use think\Model;//定义一个User模型类 class User extends Model{//默认主键为自动识别&#xff0c;如果需要指定&#xff0c;可以设置属性//protected $pk uid; //$pk代表主键&#xff0c;primary key的缩写 } …

[附源码]Python计算机毕业设计Django基于JAVA技术的旅游信息交互系统

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

[附源码]Python计算机毕业设计Django基于Java酒店管理系统

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

特征解耦,torch.cumprod(),np.random.seed(),plt.scatter

1.infoGAN 通常&#xff0c;我们学到的特征是混杂在一起的&#xff0c;如上图所示&#xff0c;这些特征在数据空间中以一种复杂的无序的方式进行编码&#xff0c;但是如果这些特征是可分解的&#xff0c;那么这些特征将具有更强的可解释性&#xff0c;我们将更容易的利用这些特…

BI-SQL丨MEGRE

MEGRE MEGRE语句&#xff0c;在SQL的生态圈中&#xff0c;一直都隶属于一个比较重要的位置。 要知道&#xff0c;在实际的项目应用中&#xff0c;我们经常需要从上游数据源&#xff0c;进行原始数据的抽取、清洗、存储、分析等操作&#xff0c;特别是在存储这一环节&#xff…

SpringCloud Ribbon / Feign

文章目录什么是Ribbon&#xff1f;Ribbon的作用&#xff1f;什么是Feign&#xff1f;Feign的作用&#xff1f;什么是Ribbon&#xff1f; Spring Cloud Ribbon 是基于Netflix Ribbon实现的一套客户端负载均衡的工具. Ribbon是Netflix发布的开源项目&#xff0c;主要功能是提供…

介绍HTTP

介绍 HTTP HTTP 协议用于客户端和服务器端之间的通信。请求访问资源的一端被称为客户端&#xff0c; 而提供资源响应的一端被称为服务器端。 HTTP 是一种不保存状态的协议&#xff0c;即无状态&#xff08;stateless&#xff09; 协议&#xff0c;它不对之前发生过的请求和响…

Kotlin高仿微信-第54篇-扫一扫

Kotlin高仿微信-项目实践58篇详细讲解了各个功能点&#xff0c;包括&#xff1a;注册、登录、主页、单聊(文本、表情、语音、图片、小视频、视频通话、语音通话、红包、转账)、群聊、个人信息、朋友圈、支付服务、扫一扫、搜索好友、添加好友、开通VIP等众多功能。 Kotlin高仿…

安卓APP源码和报告——音乐播放器

课 程 设 计 报 告 院 系&#xff1a;专 业&#xff1a;题 目&#xff1a;科 目&#xff1a;学 生&#xff1a;指导教师&#xff1a;完成时间&#xff1a;目 录 1. 引言1 1.1 目的1 1.2 背景1 2. 需求分析1 3. 系统设计1 3.1总体设计1 3.2功能设计1 4. 系统开发2 4.1…

秋招经验分享:最终我还是选择了百度

点击进入—>3D视觉工坊学习交流群自我介绍感谢工坊的邀请&#xff0c;来做这次秋招经验的分享。本科和研究生都是自动化专业&#xff0c;研究生期间做移动机器人的定位方向&#xff0c;现在是百度的一名算法工程师&#xff0c;很喜欢现在的工作环境和氛围&#xff0c;强烈推…