Sunteți pe pagina 1din 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
there is no process listening to port Q, then B is to send back an ICMP Port
Unreachable message to A. Like all ICMP messages, this is addressed to A as
a whole, not to port P on A.
(a) Give an example of when an application might want to receive such ICMP
messages.
(b) Find out what an application has to do, on the operating system of your
choice, to receive such messages.
(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, when sending initial connection requests,
might want to know the server isn t accepting connections.
(b) On typical Unix systems, one needs to open a socket with attribute IP RAW
(traditionally requiring special privileges) and receive all ICMP traffic.
(c) A receiving application would have no way to identify ICMP messages as
such, or to distinguish between these messages and protocol-specific data.
Q2:
Consider a simple UDP-based protocol for requesting files (based somewhat
loosely on the Trivial File Transfer Protocol, TFTP). The client sends an initia
l
request, and the server answers (if the file can be sent) with the first data pa
cket.
Client and server continue with a stop and wait transmission mechanism.
(a) Describe a scenario by which a client might request one file but get another
;
you may allow the client application to exit abruptly and be restarted with the
same port.
ANSWER:
1. The client sends a request for file foo
2. The request arrives at the server
3. The client abort locally, but restarts with the same port
4. The client sends a new request for file goo
5. The second request is lost
6. The server responds with the first data packet of foo , answering the only
request is has actually received
7. The client start receiving foo thinking its goo
(b) Propose a change in the protocol that will make this situation much less
likely.
ANSWER: Requiring the client to use a new port number for each separate
request would solve the problem. To do this, however, the client would have to
trust the underlying operating system to assign a new port number each time a
new socket was opened. Having the client attach a timestamp or random number
to the file request, to be echoed back in each data packet from the server,
would be another approach fully under the applications control (something like
in TCP, but see last problem).
Q2 (Again) part b)
b. Propose a change to the protocol that will make this situation much less
likely.
Answers:
Instead of first data packet, 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.
Q5. When closing a TCP connection, 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
on has been
opened with the same source and destination IP and same source and destination p
orts.
This can only happen if both sides have reached the CLOSED state and relinquishe
d both ports.
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.
But no more FINs can be sent once the other side has left state FIN_WAIT_1.

Q14 (a)
If host A receives two SYN packets from the same port from remote host B, the se
cond may be
either a retransmission of the original or else, if B has crashed and rebooted,
an entirely new
connection request. Describe the difference as seen by host A between these two
cases.
If a SYN packet is simply a duplicate, its ISN value will be the same as the ini
tial ISN. If the SYN
is not a duplicate, and ISN values are clockgenerated, then the second SYN s ISN w
ill be
different.

Q4
4. This chapter explains three sequences of state transitions during TCP connec
tion teardown.
There is a fourth possible sequence, which traverses an additional arc from FIN
_WAIT_1 to TIME_WAIT and labeled
FIN+ACK/ACK.
Explain the circumstances that result in this fourth teardown sequence.
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, received the Close from the
application but
hadn t processed it until after receiving the FIN). In other words, TCP processes
the application
close and the FIN at the same time, so that both flags are included in the segme
nt header.

The user would type ahead 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblind


lytelnet/sshhttp/httpsnewsfeedrandomly at times. Characters would be echoed bet
ween 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlytelnet/sshhttp/http
snewsfeedrandomly and 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlyte
lnet/sshhttp/httpsnewsfeedrandomly seconds late, and echoing would come in chunk
s of 14820TCPsRTTsTTLspropertyalgorithminertiasmoothlyblindlytelnet/sshhttp/http
snewsfeedrandomly or so. Such behavior is quite common over 14820TCPsRTTsTTLspr
opertyalgorithminertiasmoothlyblindlytelnet/sshhttp/httpsnewsfeedrandomly connec
tions, even those with much more modest

S-ar putea să vă placă și