计网个人作业03

news/2024/5/8 22:52:47/文章来源:https://blog.csdn.net/JamSlade/article/details/128160036

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

TimeoutInterval=EstimatedRTT+4×DevRTTTimeout\ Interval = Estimated RTT+4\times DevRTTTimeout 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 11 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 和包含一个0reciever知道存在 “一位错误”
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+1x+1x+1的时候,receiver才检测数据包x的丢失

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

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

  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等待第kkk个数据,那么k−3,k−2,k−1k-3,k-2,k-1k3,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+3x+1,x+2,x+3x+1,x+2,x+3的数据
    举个例子:若第k−3,k−1k-3,k-1k3,k1数据丢包,sender
    窗口中应为k−1,k,k+1k-1,k,k+1k1,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 正在等待第kkk个数据, 即 sender 已经发出了第k−1k-1k1个数据,说明sender至少收到了第k−4k-4k4个数据的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?

窗口大小www应该满足w≤⌊k2⌋w\le\lfloor \frac k2\rfloorw2k

当前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−1x-w-1xw1的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)modk∈[x,x+w]modk(x-w)\ mod\ k\in [x,x+w]\ mod\ k(xw) mod k[x,x+w] mod k,当sender重发x−wx-wxw就会被receiver当作新的数据接收,因此窗口大小www应该满足w≤⌊k2⌋w\le\lfloor \frac k2\rfloorw2k

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.

232bytes=4Gbytes2^{32}bytes = 4Gbytes232bytes=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.

假设MTU=1460bytesMTU = 1460bytesMTU=1460bytes一共会产生⌈2321460⌉\lceil \frac{2^{32}}{1460}\rceil1460232个报文,头部数据一共有66×⌈2321460⌉66\times \lceil \frac{2^{32}}{1460}\rceil66×1460232

共需要时间
8×(232+66×⌈2321460⌉)10×220=3425s\frac{8\times(2^{32}+66\times \lceil \frac{2^{32}}{1460}\rceil)}{10\times 2^{20}} = 3425s10×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)大小的一半
也就是
422=21\frac{42}{2}=21242=21

b

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

23th处CongWin变为慢启动状态,也就是超时事件,所以Threshold应该是发生这个事件前CongWin(22th处)大小的一半
262=13\frac{26}{2}=13226=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 处)⼤⼩的⼀半, 即
82=4\frac82=428=4
⽽ CongWin ⼤⼩应被设为 Threshold 的值, 即444

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=631+2+4+8+16+32=631+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,211,2,4,8,16,211,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=151+2+3+4+5=151+2+3+4+5=15MMS
平均值为153=5\frac{15}{3}=5315=5

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

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

世界连续动作预测模型-方向模型

🍿*★,*:.☆欢迎您/$:*.★* 🍿 正文 <

[附源码]JAVA毕业设计家庭理财管理系统(系统+LW)

[附源码]JAVA毕业设计家庭理财管理系统&#xff08;系统LW&#xff09; 目运行 环境项配置&#xff1a; Jdk1.8 Tomcat8.5 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术…

[附源码]计算机毕业设计医院挂号住院管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

[附源码]计算机毕业设计学生在线考试系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

[附源码]计算机毕业设计医疗器械公司公告管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

[附源码]JAVA毕业设计健身房管理系统(系统+LW)

[附源码]JAVA毕业设计健身房管理系统&#xff08;系统LW&#xff09; 目运行 环境项配置&#xff1a; Jdk1.8 Tomcat8.5 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&a…

python使用opencv画圣诞树和画小星星函数

画星星函数&#xff1a; #img 图片 #x y 坐标 #size 大小 def darw_star(img,x,y,color,size40):poly_linenp.array([[x, y-size], [xint(size/4), y-int(size/4)], [xsize, y-int(size/4)],[xint(0.375*size),yint(size/4)],[xsize,ysize],\[x,yint(0.625*size)],[x-size,ysi…

uni-app入门:自定义tabbar

本文介绍如何使用vant Weapp定义自定义tabbar.按照自定义图标的方式进行添加: 自定义tabbar微信官方链接: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/custom-tabbar.html 1.导入vant weapp并构建npm 项目根目录右键选择外部终端窗口中打开 …

VS系列多通道无线采发仪

VS101/104/208/416/432 是以振弦、温度传感信号为主的多通道无线采发仪&#xff0c;并可扩展其它模拟&#xff08;电流、 电压、电阻&#xff09;信号和数字信号&#xff08;RS485、RS232&#xff09;传感器通道&#xff0c;内置电池&#xff0c;可外接太阳能电池板。最多可实…

【学习记录】Dynaslam源代码魔改-替换MaskRCNN为YoloV5

这两天接了个小任务&#xff0c;需求是替换Dynaslam里面的动态物体识别模块&#xff0c;将MaskRCNN换为YoloV5&#xff0c;这里记录一下过程中遇见的问题。 一、运行Dynaslam Dynaslam本身是一个基于ORBSLAM2的视觉SLAM框架&#xff0c;论文并没有仔细看过&#xff0c;简单来…

期末测试——H5方式练习题

期末考试——H5完成方式——练习题 前言 本练习训练了孩子们的栅格化布局&#xff0c;H5标签&#xff0c;CSS样式&#xff0c;并对列表与菜单进行了强化训练。使孩子们更好的掌握H5布局&#xff0c;为后面的框架教学打好基础。 素材下载地址&#xff1a; 链接&#xff1a;htt…

UltraISO 制作U盘启动盘

1、 从Ubuntu官网http://cn.ubuntu.com/download/下载系统的iso文件 用来制作的U盘需要是FAT32格式的&#xff0c;可以通过格式化U盘更改&#xff08;注意&#xff0c;如果U盘已经写入过隐藏分区了&#xff0c;需要在磁盘管理里面删除相关隐藏分区然后合并为一个大分区后…

open label file.(This can be normal only if you use MScoco)

E:\yolov4-rubish\darknet\our_data\ImagesAug 把标签的txt文件和Jpg文件放在同一个文件夹

12月2日:thinkphp中数据库完结

数据库的查询 聚合查询 聚合查询的几种方法其中将count作为重点来说&#xff0c;由图所示&#xff0c;即为使用count()方法中需要注意的点 count(*)的使用count()中字段名为具体值的使用方法时间查询 官方文档中列举的是使用wheretime()进行查询的方法&#xff0c;但是在日常的…

C++11标准模板(STL)- 算法(std::set_difference)

定义于头文件 <algorithm> 算法库提供大量用途的函数&#xff08;例如查找、排序、计数、操作&#xff09;&#xff0c;它们在元素范围上操作。注意范围定义为 [first, last) &#xff0c;其中 last 指代要查询或修改的最后元素的后一个元素。 计算两个集合的差集 std:…

历史名人鲁迅介绍HTML个人网页作业作品下载 历史人物介绍网页设计制作 大学生英雄人物网站作业模板 dreamweaver简单个人网页制作

&#x1f389;精彩专栏推荐&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb;&#x1f447;&#x1f3fb; ✍️ 作者简介: 一个热爱把逻辑思维转变为代码的技术博主 &#x1f482; 作者主页: 【主页——&#x1f680;获取更多优质源码】 &#x1f393; web前端期末大作业…

【历史上的今天】12 月 3 日:世界上第一条短信;Fortran 语言之父诞生;百度贴吧上线

整理 | 王启隆 透过「历史上的今天」&#xff0c;从过去看未来&#xff0c;从现在亦可以改变未来。 今天是 2022 年 12 月 3 日&#xff0c;在 21 年前的今天&#xff0c;电动平衡车&#xff08;Segway&#xff09;问世&#xff1b;电动平衡车是一种电力驱动、具有自我平衡能力…

Win11的两个实用技巧系列之如何关闭文字热门搜索、任务栏上的应用

目录 in10和Win11 22H2如何关闭文字热门搜索? Win11 22H2关闭文字热门搜索 Win10 22H2关闭文字热门搜索 Win11中如何不用鼠标打开已固定在任务栏上的应用 鼠标的操作方式如下&#xff1a; 点击拿去 in10和Win11 22H2如何关闭文字热门搜索? 不管是Win10还是Win11&#…

Compose 动画艺术探索之属性动画

本篇文章是此专栏的第三篇文章&#xff0c;如果想阅读前两篇文章的话请点击下方链接&#xff1a; Compose 动画艺术探索之瞅下 Compose 的动画Compose 动画艺术探索之可见性动画 Compose的属性动画 属性动画是通过不断地修改值来实现的&#xff0c;而初始值和结束值之间的过…

TensorFlow之文本分类算法-6

1 前言 2 收集数据 3 探索数据 4 选择模型 5 准备数据 6 模型-构建训练评估 构建输出层 构建n-gram模型 构建序列模型 GloVe&#xff08;英文全称是Global Vectors for Word Representation&#xff09;是一个全球化的英语语境的单词表示的向量集&#xff0c;其使用非…