3.-第三章课后习题及答案
- 格式:docx
- 大小:545.62 KB
- 文档页数:28
第三章连接课后习题参考答案第三章连接课后习题参考答案焊接连接参考答案一、概念题3.1 从功能上分类,连接有哪几种基本类型?3.2 焊缝有两种基本类型—对接坡口焊缝和贴角焊缝,二者在施工、受力、适用范围上各有哪些特点?3.3 对接接头连接需使用对接焊缝,角接接头连接需采用角焊缝,这么说对吗?3.4 h和lw相同时,吊车梁上的焊缝采用正f面角焊缝比采用侧面角焊缝承载力高?3.5 为何对角焊缝焊脚尺寸有最大和最小取值的限制?对侧面角焊缝的长度有何要求?为什么?【答】(1)最小焊脚尺寸:角焊缝的焊脚尺寸不能过小,否则焊接时产生的热量较小,致使施焊时冷却速度过快,导致母材开裂。
《规范》规定:h f≥1.5t,式中:t2——较厚焊件厚度,单2位为mm。
计算时,焊脚尺寸取整数。
自动焊熔深较大,所取最小焊脚尺寸可减小1mm;T形连接的单面角焊缝,应增加1mm;当焊件厚度小于或等于4mm时,则取与焊件厚度相同。
(2)最大焊脚尺寸:为了避免焊缝区的主体金属“过热”,减小焊件的焊接残余应力和残余变形,角焊缝的焊脚尺寸应满足12.1t h f式中: t 1——较薄焊件的厚度,单位为mm 。
(3)侧面角焊缝的最大计算长度侧面角焊缝在弹性阶段沿长度方向受力不均匀,两端大而中间小,可能首先在焊缝的两端破坏,故规定侧面角焊缝的计算长度l w ≤60h f 。
若内力沿侧面角焊缝全长分布,例如焊接梁翼缘与腹板的连接焊缝,可不受上述限制。
3.6 简述焊接残余应力产生的实质,其最大分布特点是什么? 3.7 画出焊接H 形截面和焊接箱形截面的焊接残余应力分布图。
3.8 贴角焊缝中,何为端焊缝?何为侧焊缝?二者破坏截面上的应力性质有何区别?3.9 规范规定:侧焊缝的计算长度不得大于焊脚尺寸的某个倍数,原因何在?规范同时有焊缝最小尺寸的规定,原因何在? 3.10 规范禁止3条相互垂直的焊缝相交,为什么。
3.11 举3~5例说明焊接设计中减小应力集中的构造措施。
计算机网络课后习题答案(第三章)(2009-12-14 18:16:22)转载▼标签:课程-计算机教育第三章数据链路层3-01 数据链路(即逻辑链路)与链路(即物理链路)有何区别? “电路接通了”与”数据链路接通了”的区别何在?答:数据链路与链路的区别在于数据链路出链路外,还必须有一些必要的规程来控制数据的传输,因此,数据链路比链路多了实现通信规程所需要的硬件和软件。
“电路接通了”表示链路两端的结点交换机已经开机,物理连接已经能够传送比特流了,但是,数据传输并不可靠,在物理连接基础上,再建立数据链路连接,才是“数据链路接通了”,此后,由于数据链路连接具有检测、确认和重传功能,才使不太可靠的物理链路变成可靠的数据链路,进行可靠的数据传输当数据链路断开连接时,物理电路连接不一定跟着断开连接。
3-02 数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点.答:链路管理帧定界流量控制差错控制将数据和控制信息区分开透明传输寻址可靠的链路层的优点和缺点取决于所应用的环境:对于干扰严重的信道,可靠的链路层可以将重传范围约束在局部链路,防止全网络的传输效率受损;对于优质信道,采用可靠的链路层会增大资源开销,影响传输效率。
3-03 网络适配器的作用是什么?网络适配器工作在哪一层?答:适配器(即网卡)来实现数据链路层和物理层这两层的协议的硬件和软件网络适配器工作在TCP/IP协议中的网络接口层(OSI中的数据链里层和物理层)3-04 数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?答:帧定界是分组交换的必然要求透明传输避免消息符号与帧定界符号相混淆差错检测防止合差错的无效数据帧浪费后续路由上的传输和处理资源3-05 如果在数据链路层不进行帧定界,会发生什么问题?答:无法区分分组与分组无法确定分组的控制域和数据域无法将差错更正的范围限定在确切的局部3-06 PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不能使数据链路层实现可靠传输?答:简单,提供不可靠的数据报服务,检错,无纠错不使用序号和确认机制地址字段A 只置为0xFF。
大学物理第三章 课后习题答案3-1 半径为R 、质量为M 的均匀薄圆盘上,挖去一个直径为R 的圆孔,孔的中心在12R 处,求所剩部分对通过原圆盘中心且与板面垂直的轴的转动惯量。
分析:用补偿法〔负质量法〕求解,由平行轴定理求其挖去部分的转动惯量,用原圆盘转动惯量减去挖去部分的转动惯量即得。
注意对同一轴而言。
解:没挖去前大圆对通过原圆盘中心且与板面垂直的轴的转动惯量为:2112J MR =① 由平行轴定理得被挖去部分对通过原圆盘中心且与板面垂直的轴的转动惯量为:2222213()()2424232c M R M R J J md MR =+=⨯⨯+⨯= ②由①②式得所剩部分对通过原圆盘中心且与板面垂直的轴的转动惯量为:2121332J J J MR =-=3-2 如题图3-2所示,一根均匀细铁丝,质量为M ,长度为L ,在其中点O 处弯成120θ=︒角,放在xOy 平面内,求铁丝对Ox 轴、Oy 轴、Oz 轴的转动惯量。
分析:取微元,由转动惯量的定义求积分可得 解:〔1〕对x 轴的转动惯量为:2022201(sin 60)32Lx M J r dm l dl ML L ===⎰⎰ 〔2〕对y 轴的转动惯量为:20222015()(sin 30)32296Ly M L M J l dl ML L =⨯⨯+=⎰〔3〕对Z 轴的转动惯量为:22112()32212z M L J ML =⨯⨯⨯=3-3 电风扇开启电源后经过5s 到达额定转速,此时角速度为每秒5转,关闭电源后经过16s 风扇停止转动,已知风扇转动惯量为20.5kg m ⋅,且摩擦力矩f M 和电磁力矩M 均为常量,求电机的电磁力矩M 。
分析:f M ,M 为常量,开启电源5s 内是匀加速转动,关闭电源16s 内是匀减速转动,可得相应加速度,由转动定律求得电磁力矩M 。
解:由定轴转动定律得:1f M M J β-=,即11252520.50.5 4.12516f M J M J J N m ππβββ⨯⨯=+=+=⨯+⨯=⋅ 3-4 飞轮的质量为60kg ,直径为0.5m ,转速为1000/min r ,现要求在5s 内使其制动,求制动力F ,假定闸瓦与飞轮之间的摩擦系数0.4μ=,飞轮的质量全部分布在轮的外周上,尺寸如题图3-4所示。
《编译原理》课后习题答案第三章第3 章文法和语言第1 题文法G=({A,B,S},{a,b,c},P,S)其中P 为:S→Ac|aBA→abB→bc写出L(G[S])的全部元素。
答案:L(G[S])={abc}第2 题文法G[N]为:N→D|NDD→0|1|2|3|4|5|6|7|8|9G[N]的语言是什么?答案:G[N]的语言是V+。
V={0,1,2,3,4,5,6,7,8,9}N=>ND=>NDD.... =>NDDDD...D=>D......D或者:允许0 开头的非负整数?第3题为只包含数字、加号和减号的表达式,例如9-2+5,3-1,7等构造一个文法。
答案:G[S]:S->S+D|S-D|DD->0|1|2|3|4|5|6|7|8|9第4 题已知文法G[Z]:Z→aZb|ab写出L(G[Z])的全部元素。
盛威网()专业的计算机学习网站 1《编译原理》课后习题答案第三章答案:Z=>aZb=>aaZbb=>aaa..Z...bbb=> aaa..ab...bbbL(G[Z])={anbn|n>=1}第5 题写一文法,使其语言是偶正整数的集合。
要求:(1) 允许0 打头;(2)不允许0 打头。
答案:(1)允许0 开头的偶正整数集合的文法E→NT|DT→NT|DN→D|1|3|5|7|9D→0|2|4|6|8(2)不允许0 开头的偶正整数集合的文法E→NT|DT→FT|GN→D|1|3|5|7|9D→2|4|6|8F→N|0G→D|0第6 题已知文法G:<表达式>::=<项>|<表达式>+<项><项>::=<因子>|<项>*<因子><因子>::=(<表达式>)|i试给出下述表达式的推导及语法树。
(5)i+(i+i)(6)i+i*i盛威网()专业的计算机学习网站 2 《编译原理》课后习题答案第三章答案:<表达式><表达式> + <项><因子><表达式><表达式> + <项><因子>i<项><因子>i<项><因子>i( )(5) <表达式>=><表达式>+<项>=><表达式>+<因子>=><表达式>+(<表达式>)=><表达式>+(<表达式>+<项>)=><表达式>+(<表达式>+<因子>)=><表达式>+(<表达式>+i)=><表达式>+(<项>+i)=><表达式>+(<因子>+i)=><表达式>+(i+i)=><项>+(i+i)=><因子>+(i+i)=>i+(i+i)<表达式><表达式> + <项><项> * <因子><因子> i<项><因子>ii(6) <表达式>=><表达式>+<项>=><表达式>+<项>*<因子>=><表达式>+<项>*i=><表达式>+<因子>*i=><表达式>+i*i=><项>+i*i=><因子>+i*i=>i+i*i盛威网()专业的计算机学习网站 3《编译原理》课后习题答案第三章第7 题证明下述文法G[〈表达式〉]是二义的。
⾦属学及热处理课后习题答案第三章第三章⼆元合⾦的相结构与结晶3-1 在正温度梯度下,为什么纯⾦属凝固时不能呈树枝状⽣长,⽽固溶体合⾦却能呈树枝状成长?答:原因:在纯⾦属的凝固过程中,在正温度梯度下,固液界⾯呈平⾯状⽣长;当温度梯度为负时,则固液界⾯呈树枝状⽣长。
固溶体合⾦在正温度梯度下凝固时,固液界⾯能呈树枝状⽣长的原因是固溶体合⾦在凝固时,由于异分结晶现象,溶质组元必然会重新分布,导致在固液界⾯前沿形成溶质的浓度梯度,造成固液界⾯前沿⼀定范围内的液相其实际温度低于平衡结晶温度,出现了⼀个由于成分差别引起的过冷区域。
所以,对于固溶体合⾦,结晶除了受固液界⾯温度梯度影响,更主要受成分过冷的影响,从⽽使固溶体合⾦在正温度梯度下也能按树枝状⽣长。
3-2 何谓合⾦平衡相图,相图能给出任⼀条件下合⾦的显微组织吗?答:合⾦平衡相图是指在平衡条件下合⾦系中合⾦的状态与温度、成分间关系的图解,⼜称为状态图或平衡图。
由上述定义可以看出相图并不能给出任⼀条件下合⾦的显微组织,相图只能反映平衡条件下相的平衡。
3-3 有两个形状、尺⼨均相同的Cu-Ni 合⾦铸件,其中⼀个铸件的W Ni =90%,另⼀个铸件的W Ni =50%,铸后⾃然冷却。
问凝固后哪⼀个铸件的偏析严重?为什么?找出消除偏析的措施。
答:W Ni =50%铸件凝固后偏析严重。
解答此题需找到Cu-Ni 合⾦的⼆元相图。
原因:固溶体合⾦结晶属于异分结晶,即所结晶出的固相化学成分与母相并不相同。
由Cu-Ni 合⾦相图可以看出W Ni =50%铸件的固相线和液相线之间的距离⼤于W Ni =90%铸件,也就是说W Ni =50%铸件溶质Ni 的k 0(溶质平衡分配系数)⾼,⽽且在相图中可以发现Cu-Ni 合⾦铸件Ni 的k 0是⼤于1,所以k 0越⼤,则代表先结晶出的固相成分与液相成分的差值越⼤,也就是偏析越严重。
消除措施:可以采⽤均匀化退⽕的⽅法,将铸件加热⾄低于固相线100-200℃的温度,进⾏长时间保温,使偏析元素充分扩散,可达到成分均匀化的⽬的。
计算机网络课后习题答案(第三章)(2009-12-14 18:16:22)转载▼标签:课程-计算机教育第三章数据链路层3-01 数据链路(即逻辑链路)与链路(即物理链路)有何区别? “电路接通了”与”数据链路接通了”的区别何在?答:数据链路与链路的区别在于数据链路出链路外,还必须有一些必要的规程来控制数据的传输,因此,数据链路比链路多了实现通信规程所需要的硬件和软件。
“电路接通了”表示链路两端的结点交换机已经开机,物理连接已经能够传送比特流了,但是,数据传输并不可靠,在物理连接基础上,再建立数据链路连接,才是“数据链路接通了”,此后,由于数据链路连接具有检测、确认和重传功能,才使不太可靠的物理链路变成可靠的数据链路,进行可靠的数据传输当数据链路断开连接时,物理电路连接不一定跟着断开连接。
3-02 数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点.答:链路管理帧定界流量控制差错控制将数据和控制信息区分开透明传输寻址可靠的链路层的优点和缺点取决于所应用的环境:对于干扰严重的信道,可靠的链路层可以将重传范围约束在局部链路,防止全网络的传输效率受损;对于优质信道,采用可靠的链路层会增大资源开销,影响传输效率。
3-03 网络适配器的作用是什么?网络适配器工作在哪一层?答:适配器(即网卡)来实现数据链路层和物理层这两层的协议的硬件和软件网络适配器工作在TCP/IP协议中的网络接口层(OSI中的数据链里层和物理层)3-04 数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?答:帧定界是分组交换的必然要求透明传输避免消息符号与帧定界符号相混淆差错检测防止合差错的无效数据帧浪费后续路由上的传输和处理资源3-05 如果在数据链路层不进行帧定界,会发生什么问题?答:无法区分分组与分组无法确定分组的控制域和数据域无法将差错更正的范围限定在确切的局部3-06 PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不能使数据链路层实现可靠传输?答:简单,提供不可靠的数据报服务,检错,无纠错不使用序号和确认机制地址字段A 只置为0xFF。
第三章人类社会及其发展规律(课后练习题)一、单项选择题1 .人类社会历史发展的决定力量是( )A .生产方式B .地理条件C .社会意识D .人口因素2 .社会意识相对独立性的最突出表现是它( )A .同社会存在发展的不同步性B .具有历史的继承性C .对社会存在具有能动的反作用D .同社会经济的发展具有不平衡性3 .在生产关系中起决定作用的是( )A .生产资料所有制B .产品的分配和交换C .在生产中人与人的关系D .管理者和生产者的不同地位4 . “手推磨产生的是封建主的社会,蒸汽磨产生的是工业资本家的社会” , 这句话揭示了( )A .生产工具是衡量生产力水平的重要尺度B .科学技术是第一生产力C .社会形态的更替有其一定的顺序性D .物质生产的发展需要建立相应的生产关系5 .十一届三中全会以来,我党制定的一系列正确的路线、方针、政策促进了我国经济的迅猛发展,这说明( )A .经济基础发展的道路是由上层建筑决定的B .上层建筑的发展决定经济基础的发展方向C .上层建筑对经济基础具有积极的能动作用D .社会主义社会的发展不受经济基础决定上层建筑规律的制约6 .一定社会形态的经济基础是( )A .生产力B .该社会的各种生产关系C .政治制度和法律制度D .与一定生产力发展阶段相适应的生产关系的总和7 .上层建筑是指( )A .社会的经济制度B .科学技术C .社会生产关系D .建立在一定社会经济基础之上的意识形态及相应的制度和设施8 .社会形态是( )A .生产力和生产关系的统一B .同生产力发展一定阶段相适应的经济基础和上层建筑的统一体C .社会存在和社会意识的统一D .物质世界和精神世界的统一9 .人类社会发展的一般规律是( )A .生产方式内部的矛盾规律B .生产力和生产关系、经济基础和上层建筑之间的矛盾运动规律C .社会存在和社会意识的矛盾规律D .物质生产和精神生产的矛盾规律10 .阶级斗争对阶级社会发展的推动作用突出表现在( )A .生产力的发展B .生产关系的变革C .社会形态的更替D .科技的进步11 .社会革命根源于( )A .人口太多B .少数英雄人物组织暴动C .先进思想和革命理论的传播D .社会基本矛盾的尖锐化12 .社会主义改革的根本目的在于( )A .改变社会主义制度B .完善社会主义制度C .解放和发展生产力D .实现社会公平13 . “蒸汽、电力和自动纺织机甚至是比巴尔贝斯、拉斯拜尔和布朗基诸位公民更危险万分的革命家。
第三章处理机调度与死锁1,高级调度与低级调度的主要任务是什么?为什么要引入中级调度?【解】(1)高级调度主要任务是用于决定把外存上处于后备队列中的那些作业调入内存,并为它们创建进程,分配必要的资源,然后再将新创建的进程排在就绪队列上,准备执行。
(2)低级调度主要任务是决定就绪队列中的哪个进程将获得处理机,然后由分派程序执行把处理机分配给该进程的操作。
(3)引入中级调度的主要目的是为了提高内存的利用率和系统吞吐量。
为此,应使那些暂时不能运行的进程不再占用宝贵的内存空间,而将它们调至外存上去等待,称此时的进程状态为就绪驻外存状态或挂起状态。
当这些进程重又具备运行条件,且内存又稍有空闲时,由中级调度决定,将外存上的那些重又具备运行条件的就绪进程重新调入内存,并修改其状态为就绪状态,挂在就绪队列上,等待进程调度。
3、何谓作业、作业步和作业流?【解】作业包含通常的程序和数据,还配有作业说明书。
系统根据该说明书对程序的运行进行控制。
批处理系统中是以作业为基本单位从外存调入内存。
作业步是指每个作业运行期间都必须经过若干个相对独立相互关联的顺序加工的步骤。
作业流是指若干个作业进入系统后依次存放在外存上形成的输入作业流;在操作系统的控制下,逐个作业进程处理,于是形成了处理作业流。
4、在什么情冴下需要使用作业控制块JCB>其中包含了哪些内容?【解】每当作业进入系统时,系统便为每个作业建立一个作业控制块JCB根据作业类型将它插入到相应的后备队列中。
JCB包含的内容通常有:1)作业标识2)用户名称3)用户账户4)作业类型(CPU 繁忙型、I/O 芳名型、批量型、终端型)5)作业状态6)调度信息(优先级、作业已运行)7)资源要求8)进入系统时间9)开始处理时间10)作业完成时间11)作业退出时间12)资源使用情况等5.在作业调度中应如何确定接纳多少个作业和接纳哪些作业?【解】作业调度每次接纳进入内存的作业数,取决于多道程序度。
第三章1. (Q1) 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 getapplication 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 thecore of the computer network.Answer:a. Call this protocol Simple Transport Protocol (STP). At the sender side, STPaccepts from the sending process a chunk of data not exceeding 1196 bytes,a destination host address, and a destination port number. STP adds a four-byte header to each chunk and puts the port number of the destination process in this header. STP then gives the destination host address and the resulting segment to the network layer. The network layer delivers the segment to STP at the destination host. STP then examines the port number in the segment, extracts the data from the segment, and passes the data to the process identified by the port number.b. The segment now has two header fields: a source port field and destinationport field. At the sender side, STP accepts a chunk of data not exceeding 1192 bytes, a destination host address, a source port number, and a destination port number. STP creates a segment which contains the application data, source port number, and destination port number. It then gives the segment and the destination host address to the network layer. After receiving the segment, STP at the receiving host gives the application process the application data and the source port number.c. No, the transport layer does not have to do anything in the core; thetransport layer “lives” in the e nd systems.2. (Q2) 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 form source house to destination house. The mail service requires that (i) the letter be in an envelope and that (ii) 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 Q1 above as inspiration, describe a protocolthat 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 andexamine the letter in order to provide its service.Answer:a.For sending a letter, the family member is required to give the delegate theletter itself, the address of the destination house, and the name of therecipient. The delegate clearly writes the recipient’s name on the top of the letter. The delegate then puts the letter in an envelope and writes the address of the destination house on the envelope. The delegate then gives the letter to the planet’s mail service. At the receiving side, the delegate receives the letter from the mail service, takes the letter out of the envelope, and takes note of the recipient name written at the top of the letter. The delegate than gives the letter to the family member with this name.b.No, the mail service does not have to open the envelope; it only examines theaddress on the envelope.3. (Q3) Describe why an application developer might choose to run an application over UDP rather than TCP.Answer:An application developer may not want its application to use TCP’s congestion control, which can throttle the application’s sending rate at times of congestion. Often, designers of IP telephony and IP videoconference applications choose to run their applications over UDP because they want to avoid TCP’s congestion control. Also, some applications do not need the reliable data transfer provided by TCP.4. (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 fora. The segment sent from A to B.b. The segment sent from B to S.c. The segment sent from S to A.d. The segment sent from S to B.e. If A and B are different hosts, is it possible that the source port numberin the segment from A to S is the same as that from B to Sf. How about if they are the same hostAnswer:e Yes.f No.5. (P2) Consider Figure What are the source and destination port values in thesegments flowing form the server back to the clients’ processes What are the IP addresses in the network-layer datagrams carrying the transport-layer segmentsAnswer:Suppose the IP addresses of the hosts A, B, and C are a, b, c, respectively.(Note that a,b,c are distinct.)To host A: Source port =80, source IP address = b, dest port = 26145, dest IP address = aTo host C, left process: Source port =80, source IP address = b, dest port = 7532, dest IP address = cTo host C, right process: Source port =80, source IP address = b, dest port = 26145, dest IP address = c6. (P3) UDP and TCP use 1s complement for their checksums. Suppose you have thefollowing three 8-bit bytes: 01101010, 01001111, 01110011. 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 sue 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 errorAnswer:One's complement = 1 1 1 0 1 1 1 0.To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one-bit errors will be detected, but two-bit errors can be undetected ., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1).7. (P4) Suppose that the UDP receiver computes the Internet checksum for thereceived 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.Answer:No, the receiver cannot be absolutely certain that no bit errors have occurred. This is because of the manner in which the checksum for the packet is calculated. 0 1 0 1 0 1 0 1 + 0 1 1 1 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 0 1 + 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 1If the corresponding bits (that would be added together) of two 16-bit words in the packet were 0 and 1 then even if these get flipped to 1 and 0 respectively, the sum still remains the same. Hence, the 1s complement the receiver calculates will also be the same. This means the checksum will verify even if there was transmission error.8. (P5) a. Suppose you have the following 2 bytes: 01001010 and 01111001. Whatis the 1s complement of sum of these 2 bytesb. Suppose you have the following 2 bytes: and 01101110. What is the 1scomplement of sum of these 2 bytesc. For the bytes in part (a), give an example where one bit is flipped ineach of the 2 bytes and yet the 1s complement doesn’t change.Answer:a. Adding the two bytes gives . Taking the one’s complement gives 01100010b. Adding the two bytes gives 00011110; the one’s complement gives .c. first byte = 00110101 ; second byte = 01101000.9. (P6) Consider our motivation for correcting protocol . Show that the receiver,shown inthe figure on the following page, when operating with the sender show in Figure , can lead the sender and receiver to enter into a deadlock state, where each is waiting for an event that will never occur.Answer:Suppose the sender is in state “Wait for call 1 from above” and the receiver (the receiver shown in the homework problem) is in state “Wait for 1 from below.” The sender sends a packet with sequence number 1, and transitions to “Wait for ACK or NAK 1,” waiting for an ACK or NAK. Suppose now the receiverreceives the packet with sequence number 1 correctly, sends an ACK, and transitions to state “Wait for 0 from below,” waiting for a data packet with sequence number 0. However, the ACK is corrupted. When the sender gets the corrupted ACK, it resends the packet with sequence number 1. However, the receiver is waiting for a packet with sequence number 0 and (as shown in the home work problem) always sends a NAK when it doesn't get a packet with sequence number 0. Hence the sender will always be sending a packet with sequence number 1, and the receiver will always be NAKing that packet. Neither will progress forward from that state.10. (P7) Draw the FSM for the receiver side of protocolAnswer:The sender side of protocol differs from the sender side of protocol in thattimeouts have been added. We have seen that the introduction of timeouts adds the possibility of duplicate packets into the sender-to-receiver data stream. However, the receiver in protocol can already handle duplicate packets. (Receiver-side duplicates in rdt would arise if the receiver sent an ACK that was lost, and the sender then retransmitted the old data). Hence the receiver in protocol will also work as the receiver in protocol rdt .11. (P8) In protocol , the ACK packets flowing from the receiver to the senderdo not have sequence numbers (although they do have an ACK field that contains the sequence number of the packet they are acknowledging). Why is it that our ACK packets do not require sequence numbersAnswer:To best Answer this question, consider why we needed sequence numbers in the firstplace. We saw that the sender needs sequence numbers so that the receiver can tell if a data packet is a duplicate of an already received data packet. In the case of ACKs, the sender does not need this info ., a sequence number on an ACK) to tell detect a duplicate ACK. A duplicate ACK is obvious to the receiver, since when it has received the original ACK it transitioned to the next state. The duplicate ACK is not the ACK that the sender needs and hence is ignored by the sender.12. (P9) Give a trace of the operation of protocol when data packets andacknowledgment packets are garbled. Your trace should be similar to thatused in FigureAnswer: Suppose the protocol has been in operation for some time. The sender is in state “Waitfor call from above” (top left hand corner) and the receiver is in state “Wait for 0 from below”. The scenarios for corrupted data and corrupted ACK are shown in Figure 1.13. (P10) Consider a channel that can lose packets but has a maximum delay thatis known. Modify protocol to include sender timeout and retransmit.Informally argue why your protocol can communicate correctly over thischannel.Answer:Here, we add a timer, whose value is greater than the known round-trip propagation delay. We add a timeout event to the “Wait for ACK or NAK0” and “Wait for ACK or NAK1” states. If the timeout event occurs, the most recently transmitted packet is retransmitted. Let us see why this protocol will still work with the receiver.• Suppose the timeout is caused by a lost data packet, ., a packet on the senderto- receiver channel. In this case, the receiver never received the previous transmission and, from the receiver's viewpoint, if the timeoutretransmission is received, it look exactly the same as if the original transmission is being received.• Suppose now that an ACK is lost. The receiver will eventually retransmit the packet on a timeout. But a retransmission is exactly the same action that is take if an ACK is garbled. Thus the sender's reaction is the same with a loss, as with a garbled ACK. The rdt receiver can already handle the case of a garbled ACK.14. (P11) Consider the protocol. Draw a diagram showing that if the networkconnection between the sender and receiver can reorder messages (thatis, that two messages propagating in the medium between the sender andreceiver can be reordered), then the alternating-bit protocol will notwork correctly (make sure you clearly identify the sense in which itwill not work correctly). Your diagram should have the sender on theleft and the receiver on the right, with the time axis running down thepage, showing data (D) and acknowledgement (A) message exchange. Makesure you indicate the sequence number associated with any data oracknowledgement segment.Answer:15. (P12) The sender side of simply ignores (that is, takes no action on) allreceived packets that are either in error or have the wrong value inthe ack-num field of an acknowledgement packet. Suppose that in suchcircumstances, were simply to retransmit the current data packet .Would the protocol still work (hint: Consider what would happen if therewere only bit errors; there are no packet losses but premature timeoutcan occur. Consider how many times the nth packet is sent, in the limitas n approaches infinity.)Answer:The protocol would still work, since a retransmission would be what would happen if the packet received with errors has actually been lost (and from the receiver standpoint, it never knows which of these events, if either, will occur). To get at the more subtle issue behind this question, one has to allow for premature timeouts to occur. In this case, if each extra copy of the packet is ACKed and each received extra ACK causes another extra copy of the current packet to be sent, the number of times packet n is sent will increase without bound as n approaches infinity.16. (P13) Consider a reliable data transfer protocol that uses only negativeacknowledgements. Suppose the sender sends data only infrequently. Woulda NAK-only protocol be preferable to a protocol that uses ACKs Why Nowsuppose the sender has a lot of data to send and the end to end connectionexperiences few losses. In this second case , would a NAK-only protocolbe preferable to a protocol that uses ACKs WhyAnswer:In a NAK only protocol, the loss of packet x is only detected by the receiver when packetx+1 is received. That is, the receivers receives x-1 and then x+1, only when x+1 is received does the receiver realize that x was missed. If there is a long delay between the transmission of x and the transmission of x+1, then it will be a long time until x can be recovered, under a NAK only protocol.On the other hand, if data is being sent often, then recovery under a NAK-only scheme could happen quickly. Moreover, if errors are infrequent, then NAKs are only occasionally sent (when needed), and ACK are never sent – a significant reduction in feedback in the NAK-only case over the ACK-only case.17. (P14) Consider the cross-country example shown in Figure . How big wouldthe window size have to be for the channel utilization to be greaterthan 80 percentAnswer:It takes 8 microseconds (or milliseconds) to send a packet. in order for the senderto be busy 90 percent of the time, we must have util = = / or n approximately 3377 packets.18. (P15) Consider a scenario in which Host A wants to simultaneously sendpackets to Host B and C. A is connected to B and C via a broadcastchannel—a packet sent by A is carried by the channel to both B and C.Suppose that the broadcast channel connecting A, B, and C canindependently lose and corrupt packets (and so, for example, a packetsent from A might be correctly received by B, but not by C). Design astop-and-wait-like error-control protocol for reliable transferringpackets from A to B and C, such that A will not get new data from theupper layer until it knows that B and C have correctly received thecurrent packet. Give FSM descriptions of A and C. (Hint: The FSM for Bshould be essentially be same as for C.) Also, give a description ofthe packet format(s) used.Answer:In our solution, the sender will wait until it receives an ACK for a pair of messages (seqnum and seqnum+1) before moving on to the next pair of messages. Data packets have a data field and carry a two-bit sequence number. That is, the valid sequence numbers are 0, 1, 2, and 3. (Note: you should think about why a 1-bit sequence number space of 0, 1 only would not work in the solution below.) ACK messages carry the sequence number of the data packet they are acknowledging.The FSM for the sender and receiver are shown in Figure 2. Note that the sender state records whether (i) no ACKs have been received for the current pair, (ii) an ACK for seqnum (only) has been received, or an ACK for seqnum+1 (only) has been received. In this figure, we assume that the seqnum is initially 0, and that the sender has sent the first two data messages (to get things going). A timeline trace for the sender and receiver recovering from a lost packet is shown below:Sender Receivermake pair (0,1)send packet 0Packet 0 dropssend packet 1receive packet 1buffer packet 1send ACK 1receive ACK 1(timeout)resend packet 0receive packet 0deliver pair (0,1)send ACK 0receive ACK 019. (P16) Consider a scenario in which Host A and Host B want to send messagesto Host C. Hosts A and C are connected by a channel that can lose andcorrupt (but not reorder)message. Hosts B and C are connected by anotherchannel (independent of the channel connecting A and C) with the sameproperties. The transport layer at Host C should alternate in deliveringmessages from A and B to the layer above (that is, it should firstdeliver the data from a packet from A, then the data from a packet fromB, and so on). Design a stop-and-wait-like error-control protocol forreliable transferring packets from A to B and C, with alternatingdelivery at C as described above. Give FSM descriptions of A and C.(Hint: The FSM for B should be essentially be same as for A.) Also, givea description of the packet format(s) used.Answer:This problem is a variation on the simple stop and wait protocol . Because the channel may lose messages and because the sender may resend a message that one of the receivers has already received (either because of a premature timeout or because the other receiver has yet to receive the data correctly), sequence numbers are needed. As in , a 0-bit sequence number will suffice here.The sender and receiver FSM are shown in Figure 3. In this problem, the sender state indicates whether the sender has received an ACK from B (only), from C (only) or from neither C nor B. The receiver state indicates which sequence number the receiver is waiting for.20. (P17) In the generic SR protocol that we studied in Section the sendertransmits a message as soon as it is available (if it is in the window)without waiting for an acknowledgment. Suppose now that we want an SRprotocol that sends messages two at a time. That is , the sender willsend a pair of messages and will send the next pair of messages onlywhen it knows that both messages in the first pair have been receivercorrectly.Suppose that the channel may lose messages but will not corrupt or reorder messages. Design an error-control protocol for theunidirectional reliable transfer of messages. Give an FSM descriptionof the sender and receiver. Describe the format of the packets sentbetween sender and receiver, and vice versa. If you use any procedurecalls other than those in Section (for example, udt_send(),start_timer(), rdt_rcv(), and so on) ,clearly state their actions. Givean example (a timeline trace of sender and receiver) showing how yourprotocol recovers from a lost packet.Answer:21. (P18) Consider the GBN protocol with a sender window size of 3 and a sequencenumber range of 1024. Suppose that at time t, the next in-order packetthat the receiver is expecting has a sequence number of k. Assume thatthe medium does not reorder messages. Answer the following questions:a. What are the possible sets of sequence number inside the sender’swindow at time t Justify your Answer.b .What are all possible values of the ACK field in all possible messagescurrently propagating back to the sender at time t Justify your Answer. Answer:a.Here we have a window size of N=3. Suppose the receiver has received packetk-1, and has ACKed that and all other preceeding packets. If all of these ACK's have been received by sender, then sender's window is [k, k+N-1].Suppose next that none of the ACKs have been received at the sender. In this second case, the sender's window contains k-1 and the N packets up to and including k-1. The sender's window is thus [k- N,k-1]. By these arguments, the senders window is of size 3 and begins somewhere in the range [k-N,k]. b.If the receiver is waiting for packet k, then it has received (and ACKed)packet k-1 and the N-1 packets before that. If none of those N ACKs have been yet received by the sender, then ACK messages with values of [k-N,k-1] may still be propagating back. Because the sender has sent packets [k-N, k-1], it must be the case that the sender has already received an ACK for k-N-1.Once the receiver has sent an ACK for k-N-1 it will never send an ACK that is less that k-N-1. Thus the range of in-flight ACK values can range from k-N-1 to k-1.22. (P19) Answer true or false to the following questions and briefly justifyyour Answer.a. With the SR protocol, it is possible for the sender to receive anACK for a packet that falls outside of its current window.b. With CBN, it is possible for the sender to receiver an ACK for apacket that falls outside of its current window.c. The alternating-bit protocol is the same as the SR protocol with asender and receiver window size of 1.d. The alternating-bit protocol is the same as the GBN protocol with asender and receiver window size of 1.Answer:a.True. Suppose the sender has a window size of 3 and sends packets 1, 2, 3 att0 . At t1 (t1 > t0) the receiver ACKS 1, 2, 3. At t2 (t2 > t1) the sender times out and resends 1, 2, 3. At t3 the receiver receives the duplicates and re-acknowledges 1, 2, 3. At t4 the sender receives the ACKs that the receiver sent at t1 and advances its window to 4, 5, 6. At t5 the sender receives the ACKs 1, 2, 3 the receiver sent at t2 . These ACKs are outside its window.b.True. By essentially the same scenario as in (a).c.True.d.True. Note that with a window size of 1, SR, GBN, and the alternating bitprotocol are functionally equivalent. The window size of 1 precludes the possibility of out-of-order packets (within the window). A cumulative ACK is just an ordinary ACK in this situation, since it can only refer to the single packet within the window.23. (Q4) Why is it that voice and video traffic is often sent over TCP ratherthan UDP in today’s Internet. (Hint: The Answer we are looking for hasnothing to do with TCP’s congestion-control mechanism. )Answer:Since most firewalls are configured to block UDP traffic, using TCP for video and voice traffic lets the traffic though the firewalls24. (Q5) Is it possible for an application to enjoy reliable data transfer evenwhen the application runs over UDP If so, howAnswer:Yes. The application developer can put reliable data transfer into the application layer protocol. This would require a significant amount of work and debugging, however.25. (Q6) Consider a TCP connection between Host A and Host B. Suppose that theTCP segments traveling form Host A to Host B have source port number xand destination port number y. What are the source and destination portnumber for the segments traveling form Host B to Host AAnswer:Source port number y and destination port number x.26. (P20) Suppose we have two network entities, A and B. B has a supply of datamessages that will be sent to A according to the following conventions.When A gets a request from the layer above to get the next data (D)message from B, A must send a request (R) message to B on the A-to-Bchannel. Only when B receives an R message can it send a data (D) messageback to A on the B-to-A channel. A should deliver exactly one copy ofeach D message to the layer above. R message can be lost (but notcorrupted) in the A-to-B channel; D messages, once sent, are alwaysdelivered correctly. The delay along both channels is unknown andvariable.Design(give an FSM description of) a protocol that incorporates the appropriate mechanisms to compensate for the loss-prone A-to-B channeland implements message passing to the layer above at entity A, asdiscussed above. Use only those mechanisms that are absolutely necessary.Answer:Because the A-to-B channel can lose request messages, A will need to timeout and retransmit its request messages (to be able to recover from loss). Because the channel delays are variable and unknown, it is possible that A will send duplicate requests ., resend a request message that has already been received by B). To be able to detect duplicate request messages, the protocol will use sequence numbers. A 1-bit sequence number will suffice for a stop-and-wait typeof request/response protocol.A (the requestor) has 4 states:•“Wait for Request 0 from above.” Here the requestor is waiting for a call from above to request a unit of data. When it receives a request from above, it sends a request message, R0, to B, starts a timer and makes a transition to the “Wait for D0” state. When in the “Wait for Request 0 from above” state, A ignores anything it receives from B.•“Wait for D0”. Here the requestor is waiting for a D0 data message from B.A timer is always running in this state. If the timer expires, A sends another R0 message, restarts the timer and remains in this state. If a D0 message is received from B, A stops the time and transits to the “Wait for Request 1 from above” state. If A receives a D1 data message while in this state, it is ignored.•“Wait for Request 1 from above.” Here the requestor is again waiting for a call from above to request a unit of data. When it receives a request from above, it sends a request message, R1, to B, starts a timer and makes a transition to the “Wait for D1” state. When in the “Wait for Request 1 from above” state, A ignores anything it receives from B.•“Wait for D1”. Here the requestor is waiting for a D1 data message from B.A timer is always running in this state. If the timer expires, A sends another R1 message, restarts the timer and remains in this state. If a D1 message is received from B, A stops the timer and transits to the “Wait for Request 0 f rom above” state. If A receives a D0 data message while in this state, it is ignored.The data supplier (B) has only two states:•“Send D0.” In this state, B continues to respond to received R0 messages by sending D0, and then remaining in this state. If B receives a R1 message, then。