四川大学林峰计算机网络第三次作业

上传人:痛*** 文档编号:146743711 上传时间:2022-08-31 格式:DOC 页数:7 大小:59.50KB
收藏 版权申诉 举报 下载
四川大学林峰计算机网络第三次作业_第1页
第1页 / 共7页
四川大学林峰计算机网络第三次作业_第2页
第2页 / 共7页
四川大学林峰计算机网络第三次作业_第3页
第3页 / 共7页
资源描述:

《四川大学林峰计算机网络第三次作业》由会员分享,可在线阅读,更多相关《四川大学林峰计算机网络第三次作业(7页珍藏版)》请在装配图网上搜索。

1、 Chapter 3 Review QuestionsR3.Describe why an application developer might choose to run an application over UDP rather than TCP? 答:An application developer may not want its application to useTCPs congestion control, which can throttle the applications sending rate at times of congestion. Often, desi

2、gners of IP telephony and IP videoconference applications choose to run their applications over UDP because they want to avoid TCPs congestion control. Also, some applications do not need the reliable data transfer provided by TCP. R5.Is it possible for an application to enjoy reliable data transfer

3、 even when the application runs over UDP? If so, how?答:是的,在UDP的协议上添加验证的数据,例如给每个包传输时加个头,并且设置返回值。R6.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 destin

4、ation port numbers for the segments traveling from Host B to Host A?答:The source port number is y, the destination port number is x.R7.Suppose a process in Host C has a UDP socket with port number 6789. Suppose both Host A and Host B each sends a UDP segment to Host C with destination port number 67

5、89. Will both of these segments be directed to the same socket at Host C? If so, how will the process at Host C know that these two segments originated from two different hosts?答:正确,两个部分将针对同一接口。在套接字接口,对于每个收到的片段,操作系统将提供过程与IP地址确定各段的起源。R8.Suppose that a Web server runs in Host C on port 80. Suppose thi

6、s 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.答:对于每个坚持

7、的连接,web服务器会创建一个连接套接字,每个连接套接字由4个数组定义。当主机C收到一个请求的时候,它会检查数据报和段中的4个区域,以此决定用哪个区域来接收TCP段。因此,A和B传输的套接字是不一样的。每一个套接字的标识符都使用80端口作为目的的,但是不同的资源有不同的IP地址。和UDP不同的是,当传输层传输一个TCP段至应用层的时候,它并不需要明确指定IP地址,因为套接字标识符会协助它指定。R14.Suppose Host A sends two TCP segments back to back to Host B over a TCP connection. The first segm

8、ent has sequence number 90; the second has sequence number 110.a. How much data is in the first segment?答:110-90=20b. Suppose that the first segment is lost but the second segment arrives at B. In the acknowledgment that Host B sends to Host A, what will be the acknowledgment number?答:90R15. True or

9、 false?(F) a. The size of the TCP RcvWindow never changes throughout the duration of the connection.(T) b. 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.(F) c. Host A is sending Host B

10、 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.(T) d. The TCP segment has a field in its header for RcvWindow .(F) e. Suppose Host A is sending a large file to H

11、ost 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.(F) f. Suppose that the last Sample RTT in a TCP connection is equal to 1 sec. The current value of Timeout Interval for the connec

12、tion will necessarily be 1 sec. (T) 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.R17.True or false?Consider congestion control in TCP.When the timer expires at the sen

13、der,the threshold is set to one half of its previous value.ProblemsP1. 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 segments sent from A to S.T

14、he source port number is 467, destination number is 23.b. The segments sent from B to S.The source port is 513, the destination number is 23.c. The segments sent from S to A.The source port is 23, the destination number is 467.d. The segments sent from S to B.The source port is 23, the destination n

15、umber is 513.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?Yes.f. How about if they are the same host?No.P2.Consider Figure 3.5. What are the sources and destination port values in the segments flowing from t

16、he server back to the clients processes?What are the IP addresses in the network-layer datagrams carrying the transport-layer segments?答:(1)返回值包含了客户端和服务器的IP地址以及port码,还有用户索求的内容。(2)网络层数据报中携带的IP地址包含目的端口的IP地址、port码、传输层添加的头(message)、网络层添加的段(segment)。P5. a. Suppose you have the following 2 bytes: 01011100

17、 and 01010110. What is the 1s complement of the sum of these 2 bytes?01011100 + 01010110 = 10110010 取反 = 0110010b. Suppose you have the following 2 bytes: 11011010 and 00110110. What is the 1s complement of the sum of these 2 bytes?11011010 + 00110110 = 100010000去首位补至末位 = 00010001 取反 = 11101110c. Fo

18、r the bytes in part (a), give an example where one bit is flipped in each of the 2 bytes and yet the 1s complement doesnt change.P18.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 ex

19、pecting has a sequence number of k. Assume that the medium does not reorder messages. Answer the following questions:a. What are the possible sets of sequence numbers inside the senders window at time t? Justify your answer.答:因为窗口大小为3,接收方期待的下一列序号为k,所以t时刻发送窗口中序列号应为k,k+1,k+2。b. What are all possible v

20、alues of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer.答:由于序列号为0-1024,所以在t时刻,所有可能的ACK 序号应为0 ACK number 1024.P19.Answer true or false to the following questions and briefly justify your answer:(T) a. With the SR protocol, it is possible

21、 for the sender to receive an ACK for a packet that falls outside of its current window.(T) b. With GBN, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.(T) c. The alternating-bit protocol is the same as the SR protocol with a sender and receiver

22、 window size of 1.(T) d. The alternating-bit protocol is the same as the GBN protocol with a sender and receiver window size of 1.P21. 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 prob

23、lems such as that in Figure 3.27 for each of these protocols?答:首先我们必须保证发送窗口和接受窗口中序列号都不重复。假设窗口的序列号为x,那么序列号n必须保持n= 2x,才能使窗口中的序列号不重复。P22. We have said that an application may choose UDP for a transport protocol because UDP offers finer application control (than TCP) of what data is sent in a segment an

24、d when.a. Why does an application have more control of what data is sent in a segment?答:Consider sendingan applicationmessage over a transport protocol. With TCP, theapplicationwritesdatato the connections send buffer and TCP will grab bytes without necessarily putting a single message in the TCP se

25、gment; TCP may putmoreor less than a single message in a segment. UDP, on the other hand, encapsulates in a segment whatever theapplicationgives it; so that, if theapplicationgives UDPan applicationmessage, this message will be the payloadofthe UDPsegment.Thus,withtheUDP, an applicationhasmorecontro

26、lofwhatdatais sent in a segment.b. Why does an application have more control on when the segment is sent?答:With TCP, due to flowcontroland congestioncontrol, there may be significant delay from the time whenanapplicationwritesdatato its send buffer until when thedatais given to the network layer. UD

27、Pdoesnothavedelays due to flow controland congestioncontrol.P23. Consider transferring an enormous file of L bytes from Host A to Host B. Assume an MSS (management support system) of 1460 bytes.a. What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP se

28、quence number field has 4 bytes.答:因为TCP序号范围有4bytes,所以L最大为232 bytesb. 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 155 Mbps

29、 link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously.答:传输速度为155 Mbps,每段加66 bytes大小的头,首先计算一共分多少段:232 bytes / 1460 bytes = 2941758 段每段加一个头,则头大小的和为:2941758 X 66 bytes = 194156028 bytes,总共需传输 194156028 bytes + 232 bytes = 4489123324 bytes = 35912

30、986592 bits 的数据。用10Mbps的速度传输则时间为35912986592 bits / Mbps = 3591s = 59.85 min。P24. Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-to-back. The first and second segments co

31、ntain 70 and 50 bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acknowledgement whenever it receives a segment from Host A.a. In the second segment sent from Host A to B, what are the

32、 sequence number, source port number, and destination port number?答:The sequence number is 247, the source number is 302, the destination number is 80.b. If the first segment arrives before the second segment, in the acknowledgement of the first arriving segment, what is the acknowledgment number, t

33、he source port number, and the destination port number?答:The acknowledge number is 197, the source number is 80 and the destination number is 302.c. If the second segment arrives before the first segment, in the acknowledgement of the first arriving segment, what is the acknowledgment number?答:The a

34、cknowledge number is 197.d. Suppose the two segments sent by A arrive in order at B. The first acknowledgement is lost and the second acknowledgement arrives after the first timeout interval. Draw a timing diagram, showing these segments and all other segments and acknowledgements sent. (Assume ther

35、e is no additional packet loss.) For each segment in your figure, provide the sequence number and the number of bytes of data; for each acknowledgement that you add, provide the acknowledgement number.P30. In Section 3.5.4, we saw that TCP waits until it has received three duplicate ACKs before perf

36、orming a fast retransmit. Why do you think the TCP designers chose not to perform a fast retransmit after the first duplicate ACK for a segment is received?答:太快响应会造成不必要的重传,过快地AIMD会拖慢传输的速度。P31.What is the relationship between the variable LastByteRcvd in Section 3.5.5 and the variable y in Section 3.

37、5.5?答:LastByteRcvd LastByteRead RcvBuffery 1 LastByteRcvdP35. In Section 3.5.4, we discussed the doubling of the timeout interval after a timeout event. This mechanism is a form of congestion control. Why does TCP need a window-based congestion-control mechanism (as studied in Section 3.7) in additi

38、on to this doubling-timeout-interval mechanism?答:TCP provides flow control by having the sender maintain a variable called the receive window. Informally, the receive window is used to give the sender an idea of how much free buffer space is available at the receiver. Because TCP is full-duplex, the

39、 sender at each side of the connection maintains a distinct receive window. P36. Consider sending a large file from a host to another over a TCP connection that has no loss.a. Suppose TCP uses AIMD for its congestion control without slow start. Assuming CongWin increases by 1 MSS every time a batch

40、of ACKs is received and assuming approximately constant round-trip times, how long does it take for CongWin increase from 5 MSS to 11 MSS (assuming no loss events)?11-5-1=5RTTb. What is the average throughout (in terms of MSS and RTT) for this connection up through time = 6 RTT?(1+2+3+4+5) MSS/5 RTT =3 MSS/RTT.

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!