资源描述:
《计算机网络理论教学资料chapter3homework》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.UDPandTCPuse1*scomplementfortheirchecksums.Supposeyouhavethefollowingthree8-bitwords:01010101,01110000,11001100.Whatisthe1'scomplementofthesumofthesewords?Showallwork.WhyisitthatUDPtakethe1*scomplementofthesum,i.e.,whynotjustusethesum?Withthe1*scomplementscheme
2、,howdoesthereceiverdetecterrors.Isitpossiblethata1・biterrorwillgoundetected?Howabouta2-biterror?答:①计算校验和:01010101+01110000=11000101而11000101+11001100=110010001=>回卷得:100100101*scomplement:01101101②UDP用1'scomplementofthesum作为校验和的原因:不依赖大端还是小端系统。原码或?scomplement补码,在使用
3、大端规则或小端规则时,相加会使结果产生不同,而Vscomplement反码则不存在此问题。③接收方检测错误:发送方发送此种校验和,若无差错,在接收方将校验和与数据一起相加将得到每一比特均为1的结果,假如有一个比特是0,就可知传输时数据发生了错误。④有一位错误必圧会被检测出来。但有两位错误时,则不一泄能够被检测出来。2.ConsidertransferringanenormousfileofLbytesfromhostAtohostB.AssummeanMSSof1220bytes.a)Whatisthemaximumle
4、ngthofLsuchthatTCPsequencenumbersarenotexhausted?RecallthattheTCPnumberfieldhasfourbytes.b)FortheLyouobtainin(a),findhowlongittakestotransmitthefile.Assmethatatotalof66bytesoftransport,networkanddata-linkheaderareaddedtoeachsegmentbeforetheresultingpacketissentou
5、tovera10Mbpslink.Ignoreflowcontrolandcongestioncontrol,soAcanpumpoutthesegmentsback-to-backandcontinilously.答:a)与MSS无关,4bytes=32bits,山于每一位可山0或1表示,即可标记的TCPnumber最多可以有2A32=4,294,967,296个,即L的最大长度为2八32bytes。b)已知:L=2A32bytes:MSS=1220bytes;R=10Mbps=10A7bps=1.25*10A6Bps
6、stepl需分割为n=L/MSS~3,520,465个数据包step2每个包的实际大小:s=MSS+66bytes=1286bytesstep3实际需传输的总数据大小为:T=n*s=3,520,465*1286=4,527,317,990bytesstep4传输时间为:t=T/R心3621.854s〜60.36min2.TrueorFalse.a)IfaWebpageconsistsofexactlyoneobject,thennon-persistentandpersistentconnectionshaveexact
7、lythesameresponsetimeperformsnee?False.还需考虑对于HTML文件的传输。对于non-persistent:2RTT+2RTT=4RTT;对于persistent:2RTT+1RTT=3RTTb)ConsidersendingoneobjectofsizeOfromservertobrowseroverTCP.IfO>S,whereSisthemaximumsegmentsize,thentheserverwillstallatleastonce?False•—次都无法执行。c)Sup
8、poseaWebpageconsistsof10objects,eachofsizeObits.ForpersistentHTTP,theRTTportionoftheresponsetimeis20RTT?False.首先建立连接时需要1RTT,请求和接收HTML文件需要1RTT,请求和接收10个对象共需要10RT