Module 4
Module 4
Presentation Material
Department of Computer Science & Engineering
Semester
Course Code: 19CS3602 VI
:
Course Title: Computer Networks Year: 3rd
Faculty Name:
Step-01: SYN-
35
Step-02: SYN + ACK-
Step-03: ACK-
38
TCP Connection Release
• One way to avoid data loss is to use symmetric release, in which each
direction is released independently of the other one.
• One can envision a protocol in which host 1 says: I am done. Are you
done too? If host 2 responds: I am done too. Goodbye, the
connection can be safely released.
• Unfortunately, this protocol does not always work.
• window management in TCP decouples the issues of acknowledgement of the correct receipt
of segments and receiver buffer allocation. For example, suppose the receiver has a 4096-byte
buffer, as shown in Fig. 6-40.
• If the sender transmits a 2048-byte segment that is correctly received, the receiver will
acknowledge the segment. However, since it now has only 2048 bytes of buffer space (until
the application removes some data from the buffer), it will advertise a window of 2048
starting at the next byte expected.
∙ Now the sender transmits another 2048 bytes, which are acknowledged, but the advertised
window is of size 0.
∙ The sender must stop until the application process on the receiving host has removed some
data from the buffer, at which time TCP can advertise a larger window and more data can be
sent.
∙ When the window is 0, the sender may not normally send segments, with two exceptions.
∙ First, urgent data may be sent, for example, to allow the user to kill the process running on
the remote machine.
COMPUTER NETWORKS - 19CS3602 47
COMPUTER NETWORKS - 19CS3602 48
∙ Second, the sender may send a 1-byte segment to force the receiver to
reannounce the next byte expected and the window size. This packet is called a
window probe. The TCP standard explicitly provides this option to prevent
deadlock if a window update ever gets lost.
∙ Senders are not required to transmit data as soon as they come in from the
application. Neither are receivers required to send acknowledgements as soon as
possible.
∙ For example, in Fig. 6-40, when the first 2 KB of data came in, TCP, knowing that it
had a 4-KB window, would have been completely correct in just buffering the data
until another 2 KB came in, to be able to transmit a segment with a 4-KB payload.
This freedom can be used to improve performance.