You are on page 1of 3

Final Homeworks

:
I will post online answer sheet, but you can get started on the following
chapter 5 homework exercises. Note: as we agreed in class, I am assigning larg
er point value homeworks to cover the rest of the semester instead of other work
.
homework #5, due Saturday Nov 13, 1159PM, 40 pts
#1 a, b, c
#2 a, b
#4
#5

#14 a, b

#20 a, b, c
#21 b extra credit 5 pts

homework #6, due Wednesday Nov 17, 1159PM, 40 pts
chapter 5 homework exercises
#25 a, b
#26
#28
homework #7, due Monday Nov 22, 1159PM, 40 pts
#32
#33 a, b
#43 a, b, c

homework #8, due Wednesday Nov 25, 1159PM, 40 pts
#47
#49 a, b
#51
#54
********************************************************************************
********
1/
If a UDP datagram is sent from host A, port P to host B, port Q, but at host B

on the operating system of your choice. Client and server continue with a stop and wait transmission mechanism. When closing a TCP connection. to receive such messages. TFTP). not to port P on A. Having the client attach a timestamp or random number to the file request. but restarts with the same port 4. you may allow the client application to exit abruptly and be restarted with the same port. (c) Why might it not be a good idea to send such messages directly back to the originating port P on A? Answer: (a) An application such as TFTP. ANSWER: 1. then B is to send back an ICMP Port Unreachable message to A. The client sends a request for file foo 2. Answers: Instead of first data packet. this is addressed to A as a whole. Like all ICMP messages. one needs to open a socket with attribute IP RAW (traditionally requiring special privileges) and receive all ICMP traffic. (a) Describe a scenario by which a client might request one file but get another . or to distinguish between these messages and protocol-specific data. but see last problem). and the server answers (if the file can be sent) with the first data pa cket. (c) A receiving application would have no way to identify ICMP messages as such. The client start receiving foo thinking its goo (b) Propose a change in the protocol that will make this situation much less likely. however. might want to know the server isn t accepting connections. Q2 (Again) part b) b. The client sends an initia l request. (a) Give an example of when an application might want to receive such ICMP messages. Q5. To do this. to be echoed back in each data packet from the server. The client abort locally. the client would have to trust the underlying operating system to assign a new port number each time a new socket was opened. The second request is lost 6. Propose a change to the protocol that will make this situation much less likely. (b) Find out what an application has to do. answering the only request is has actually received 7. The request arrives at the server 3.there is no process listening to port Q. send name of requested file Use a different port for each instance of TFTP Send the pid in the initial request and return the pid before the first data pac ket. Q2: Consider a simple UDP-based protocol for requesting files (based somewhat loosely on the Trivial File Transfer Protocol. The server responds with the first data packet of foo . (b) On typical Unix systems. ANSWER: Requiring the client to use a new port number for each separate request would solve the problem. would be another approach fully under the applications control (something like in TCP. why is the two-segment-lifetime timeout not necessary on the transition from LAST_ACK to CLOSED? Answer: Consider first that a delayed FIN is a only problem when a new connecti . The client sends a new request for file goo 5. when sending initial connection requests.

Q14 (a) If host A receives two SYN packets from the same port from remote host B. Answer: The other side of the connection received the FIN but didn t process it u ntil after the application issued the Close (or alternatively. This chapter explains three sequences of state transitions during TCP connec tion teardown. In other words. Q4 4. which traverses an additional arc from FIN _WAIT_1 to TIME_WAIT and labeled FIN+ACK/ACK. But no more FINs can be sent once the other side has left state FIN_WAIT_1. so that both flags are included in the segme nt header. an entirely new connection request. Such behavior is quite common over 14820TCPsRTTsTTLspr opertyalgorithminertiasmoothlyblindlytelnet/sshhttp/httpsnewsfeedrandomly connec tions. if B has crashed and rebooted. If the SYN is not a duplicate. even those with much more modest . received the Close from the application but hadn t processed it until after receiving the FIN). If a SYN packet is simply a duplicate. its ISN value will be the same as the ini tial ISN. then the second SYN s ISN w ill be different. This can only happen if both sides have reached the CLOSED state and relinquishe d both ports. Explain the circumstances that result in this fourth teardown sequence. There is a fourth possible sequence. TCP processes the application close and the FIN at the same time. Describe the difference as seen by host A between these two cases. and ISN values are clockgenerated. and echoing would come in chunk s of 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlytelnet/sshhttp/http snewsfeedrandomly or so. the se cond may be either a retransmission of the original or else. The user would type ahead 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblind lytelnet/sshhttp/httpsnewsfeedrandomly at times. If one side is in the LAST_ACK state. it must receive the ACK generated in the t ransition out of FIN_WAIT_1 or later. Characters would be echoed bet ween 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlytelnet/sshhttp/http snewsfeedrandomly and 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlyte lnet/sshhttp/httpsnewsfeedrandomly seconds late.on has been opened with the same source and destination IP and same source and destination p orts.