(b) Interface 0 (c) Router 2 (d) Router 1 (e) Router 2
47.Describe a way to reassemble IP fragments at the destination.
In the general case, the problem is nontrivial. Fragments may arrive out oforder and some may be missing. On a retransmission, the datagram may befragmented in different-sized chunks. Furthermore, the total size is notknown until the last fragment arrives. Probably the only way to handlereassembly is to buffer all the pieces until the last fragment arrives and thesize is known. Then build a buffer of the right size, and put the fragmentsinto the buffer, maintaining a bit map with 1 bit per 8 bytes to keep track ofwhich bytes are present in the buffer. When all the bits in the bit map are 1,the datagram is complete.
51. IPv6 uses 16-byte addresses. If a block of 1 millionaddresses is allocated every
picosecond, how long will the addresseslast?
With 16 bytes there are 2128 or 3.4 × 1038 addresses. If we allocate them at arate of 1018 per second, they will last for 1013 years. This number is 1000times the age of the universe. Of course, the address space is not flat, so theyare not allocated linearly, but this calculation shows that even with an allocationscheme that has an efficiency of 1/1000 (0.1 percent), one will never runout.
Chapter 6
5. Why does the maximum packet lifetime, T, have to be large enough to ensurethat not only the packet but also its acknowledgements have vanished?(M)
首先看三次握手过程是如何解决延迟的重复到达的分组所引起的问题的。
正常情况下,当主机1 发出连接请求时,主机1 选择一个序号x,并向主机2 发送一个包含该序号的请求TPDU;接着,主机2 回应一个接受连接的TPDU,确认x,并声明自己所选用的初始序列号y;最后,主机1 在其发送的第一个数据TPDU中确认主机2 所选择的初始序列号。 当出现延迟的重复的控制TPDU 时,一个TPDU 是来自于一个已经释放的连接的延迟重复的连接请求( CONNECTION REQUEST),该TPDU 在主机1 毫不知情的情况下到达主机2。 主机2 通过向主机1 发送一个接受连接的TPDU(CONNECTION ACCEPTED)来响应该TPDU,而该接受连接的TPDU 的真正目的是证实主机1 确实试图建立一个新的连接。在这一点上,关键在于主机2 建议使用y 作为从主机2 到主机1 交通的初始序列号,从而说明已经不存在包含序列号为y 的TPDU,也不存在对y 的应答分组。当第二个延迟的TPDU 到达主机2 时,z 被确认而不是y 被确认的事实告诉主机2 这是一个旧的重复的TPDU,因此废止该连接过程。在这里。三次握手协议是成功的。
最坏的情况是延迟的“连接请求”和对“连接被接收”的确认应答都在网络上存活。可以设想,当第2 个重复分组到达时,如果在网上还存在一个老的对序列号为y 的分组的确认应答,显然会破坏三次握手协议的正常工作,故障性的产生一条没有人真正需要的连接,从而导致灾难性的后果。
(The reason why T must be large enough to ensure that both the packets and acknowledgements have vanished is to deter duplicate packets from being introduced into the network.)
6. Imagine that a two-way handshake rather than a three-way handshake were used to set up connections. In other words, the third message was not required. Are deadlocks now possible? Give an example or show that none exist.(M)
我们知道,3 次握手完成两个重要功能,既要双方做好发送数据的准备工作(双方都知道彼此已准备好),也要允许双方就初始序列号进行协商,这个序列号在握手过程中被发送与确认。
现在把三次握手改成仅需要两次握手,死锁是可能发生的。例如,考虑计算机A和B 之间的通信。假定B 给A 发送一个连接请求分组,A 收到了这个分组,并发送了确认应答分组。按照两次握手的协定,A 认为连接已经成功的建立了,可以开始发送数据分组。 可是,B 在A 的应答分组在传输中被丢失的情况下,将不知道A 是否已经准备好,不知道A 建议什么样的序列号用于A 到B 的交通,也不知道A 是否同意A 所建议的用于B 到A交通的初始序列号,B 甚至怀疑A 是否收到自己的连接请求分组。在这种情况下,B 认为连接还未建立成功,将忽略A 发来的任何数据分组,只等待接收连接确认应答分组。而A在发出的分组超时后,重复发送同样的分组。这样就形成了死锁。
(Deadlocks are possible. For example given the following scenario: A packet arrives at destination A, out of the blue, A acknowledges it and the acknowledgement gets lost. B also gets a package out of the blue, B also acknowledges it and the acknowledgement also gets lost. Therefore A and B now have connections left open. Since both are now expecting different sequence numbers and are open waiting, a deadlock situation has occurred.)
14. Why does UDP exist? Would it not have been enough to just let user processessend raw IP packets?(E)
仅仅使用IP 分组还不够。IP 分组包含IP 地址,该地址指定一个目的地机器。一旦这样的分组到达了目的地机器,网络控制程序如何知道该把它交给哪个进程呢?UDP 分组包含一个目的地端口,这一信息是必须的,因为有了它,分组才能够被投递给正确的进程。
16. A client sends a 128-byte request to a server located 100 km away over a
1-gigabit optical fiber. What is the efficiency of the line during the remote procedure call?(E)
128 字节等于1024位,在1Gb/s的线路上发送1000位需要1 的时间。光在光导纤维中的传播速度是200km/ms,请求到达服务器需要传输0.5ms的时间,应答返回又需要0.5ms 的传输时间。总的看来,1000 位在1ms 的时间内传输完成。这等效于占用带宽1Mb/s,即线路效率是0.1%。
17. Consider the situation of the previous problem again. Compute the minimum possible response time both for the given 1-Gbps line and for a 1-Mbps line. What
conclusion can you draw?(E)
在 1Gb/s,响应时间由光的速度决定。可以取得的最好情况是1ms。在1Mb/s,发
射1024 位需要大约1ms 的时间,再经过0.5ms 最后一位到达服务器,还需要另外0.5ms 应
答才能返回,这是最好的情况。因此,最好的RPC 时间是2ms。结论是,线路速度改善到1000倍,性能仅改善到2倍。对于这种应用,除非千兆位线路特别便宜,否则是不值得拥有的。
20. Datagram fragmentation and reassembly are handled by IP and are invisibleto TCP. Does this mean that TCP does not have to worry about data arriving in thewrong order?(E) 不能这样认为。尽管到达的每个数据报都是完整的,但可能到达的数据报的顺序是错误的,因此,TCP必须准备适当的重组报文的各个部分。
23. A process on host 1 has been assigned port p, and a process on host 2 has beenassigned port q. Is it possible for there to be two or more TCP connections betweenthese two ports at the same time?
不可以。一条连接仅仅用它的套接口标识。因此,(1,p)-(2,q)是在这两个端口之间唯一可能的连接。
25. The maximum payload of a TCP segment is 65,495 bytes. Why was such astrange number chosen?(E)
整个TCP报文段必须适配IP分组65,515 字节的载荷段。因为TCP头最少20 个字节,所以仅剩下65,495字节用于TCP数据。
26. Describe two ways to get into the SYN RCVD state of Fig. 6-33.(E)
一条途径是从LISTEN 开始。如果收到一个SYN,那么协议进入SYN RECD 状态。
另一条途径是一个进程试图做一个主动打开操作,并发送一个SYN。如果另一方也做打开操作,并收到一个SYN,那么也将进入SYN RECD 状态。
27. Give a potential disadvantage when Nagle's algorithm is used on a badly-congested network.(E)
Nagle 算法建议,当数据一次一个字节的来到发送方时,只发送第一个字节,并且缓冲所有其他内容,直到所发出的字节被确认为止。然后在一个TCP 报文段中发送所有缓冲的字符。接着又开始缓冲,直到前一个报文段中的所有字节又被确认。这样,如果用户键入的速度足够快,而网络比较慢的话,那么在每个报文段中都可以有相当数量的字符。该算法还允许输入足够的数据以填满半个窗口或一个最大报文段的情况下发送一个新的分组。在这种运行方
式下,尽管用户是以均匀的速度键入,而字符却是以突发的方式回印。用户可能敲击了好几个键,而屏面上什么都没有显示,然后突然的在屏幕上显示出所有已键入的字符。人们可能对此感到恼火。
29. Suppose that the TCP congestion window is set to 18 KB and a timeout occurs.How big will the window be if the next four transmission bursts are all successful?Assume that the maximum segment size is 1 KB.(E)
由于发生了超时,下一次传输将是1个最大报文段,然后是2个、4个、8个最大报文段,所以在4 次突发量传输后,拥塞窗口将是8K 字节最终窗口大小应该为9KB。当第一次发送成功后, 1KB->2KB,第二次成功后,2KB->4KB,第三次成功后,4KB->8KB,第四次成功后,窗口大小8KB->9KB
31. A TCP machine is sending full windows of 65,535 bytes over a 1-Gbps channelthat has a 10-msec one-way delay. What is the maximum throughput achievable?What is the line efficiency?(E)
每 10ms*2=20ms可以发送一个窗口大小的交通量,因此每秒50 个窗口。 65536×8×50=26.2Mb/s; 26.2/1000=2.6 %
所以,最大的数据吞吐率为26.2Mb/s,线路效率为2.6%。
33. In a network that has a maximum TPDU size of 128 bytes, a maximum TPDUlifetime of 30 sec, and an 8-bit sequence number, what is the maximum data rate perconnection?(M) 具有相同编号的TPDU 不应该同时在网络中传输,因此必须保证当序列号循环回来重复使用的时候,具有相同序列号的TPDU 已经从网络中消失。现在存活时间是30 秒,那么在30 秒的时间内发送方发送的TPDU 的数目不能多于255个。 255×128×8/30=8738b/s
所以,每条连接的最大数据速率是8738b/s。
42. What is the bandwidth-delay product for a 50-Mbps channel on ageostationary satellite? If the packets are all 1500 bytes (including overhead), howbig should the window be in packets?
同步卫星的往返延迟大约540 msec,所以一个50 Mbps 带宽的带宽延迟乘积是27 Mb= 3.375Mbytes. 若每个分组1500 bytes,则3.375Mbytes /1500=2250个分组就可以充满管道。所以窗口应该至少容纳2250 个分组。
(补充题)36. 若路由器R因为拥塞丢弃IP分组,则此时R可向发出该IP分组的源主机发送的ICMP报文类型是
A. 路由重定向B. 目的不可达 C. 源抑制D. 超时 ○
(补充题)37. 某网络的IP地址空间为192.168.5.0/24,采用定长子网划分,子网掩码为255.255.255.248,则该网络中的最大子网个数、每个子网内的最大可分配地址个数分别是 A. 32、8 ○B. 32、6 C. 8、32 D. 8、30
(补充题)38. 下列网络设备中,能够抑制广播风暴的是 I. 中继器II.集线器III. 网桥IV. 路由器
A. 仅I和II B. 仅III C. 仅III和IV ○D.仅IV
(补充题)39. 主机甲和主机乙之间已建立了一个TCP连接,TCP最大段长度为1000字节。若主机甲的当前拥塞窗口为4000字节,在主机甲向主机乙连续发送两个最大段后,成功收到主机乙发送的对第一个段的确认段,确认段中通告的接收窗口大小为2000字节,则此时主机甲还可以向主机乙发送的最大字节数是
A. 1000 B. 2000 C. 3000 D. 4000 ○
(Chapter 5,5题)Four hops means that five routers are involved. The virtual-circuit implementation requires tying up 5 × 8 = 40 bytes of memory for 1000 sec. The datagram implementation requires transmitting 12 × 4 × 200 = 9600 bytes of header over and above what the virtual-circuit implementation needs. Thus, the question comes down to the relative cost of 40,000 byte-sec of memory versus 9600 byte-hops of circuit capacity.
If memory is depreciated over 2 × 52 × 40 × 3600 = 1.5 × 107 sec, a byte-sec costs 6.7 × 10?8 cents, and 40,000 of them cost just over 2 millicents. If a byte-hop costs 10?6 cents, 9600 of them cost 9.6 millicents. Virtual circuits are cheaper for this set ofparameters.
(Chapter 5,40题)To start with, all the requests are rounded up to a power of two. Organizations A, B, C and D want to have 4000, 2000, 4000, and 8000 addresses, respectively, so the address for them must have a host-id of 12, 11, 12 and 13 bits long, the net-prefix is 20, 21, 20, 19 bits long, respectively. Therefore, The starting address, ending address, and mask are as follows: A: 198.16.0.0 –198.16.15.255 written as 198.16.0.0/20
B: 198.16.16. 0--198.16.23.255 written as 198.16.16. 0/21
C: 198.16.32. 0--198.16.47.255 written as 198.16.32. 0/20;
D: 198.16.64. 0--198.16.95.255 written as 198.16.64. 0/19