Page 183 - DCAP207_NETWORKS_DCAP406_COMPUTER_NETWORKS
P. 183

Computer Networks/Networks




                    Notes          acknowledgement, timers are used. When a response to a FIN is not forthcoming within two
                                   maximum packet lifetimes, the sender of the FIN releases the connection. Eventually, the other
                                   host notices that nobody seems to be listening to it any more and that host also time out. The
                                   procedure followed for releasing and establishing a connection is represented as follows:

                                    S. No       State                           Description
                                      1    CLOSED          Indicates no connection is active or pending.
                                      2    LISTEN          The server is waiting for an incoming call.
                                      3    SYN RECEIVED    A connection request has arrived; wait for acknowledgement.
                                      4    SYN SENT        The application or process has started to open a connection.
                                      5    ESTABLISHED     Indicates normal data transfer state.
                                      6    FIN WAIT 1      The process or application has finished.
                                      7    FIN WAIT 2      The hosts agreed to release the connection.
                                      8    TIMED WAIT      Indicates wait for all packets die off.
                                      9    CLOSING         Indicates that both hosts have attempted to close simultaneously.
                                     10    CLOSE WAIT      One of the host has initiated a release.
                                     11    LAST ACK        Indicates wait for all packets die off.

                                   TCP Transmission Policy

                                   Window management in TCP is not directly related to the acknowledgement. When the window
                                   is set to 0, the host machine at the sending end may not normally send  segments. We may
                                   consider an example in which the receiving host has a 4096-byte buffer and sending host transmits
                                   a 2048-byte  segment. The  2048-byte  segment  is  correctly  received  and  the receiving  host
                                   acknowledges the segment. However, the buffer left with only 2048 of buffer space and the host
                                   at receiving side advertises a window of 2048 bytes starting at the next byte expected. Now the
                                   host at sending end transmits another 2048 bytes, which is acknowledged and the advertised
                                   window is 0. The host at sending end has to stop until the application process on the host at
                                   receiving end has removed some data from the buffer so that the TCP can advertise a larger
                                   window. It is observed if the window is zero, the host at sending side may not send segments.
                                   There are two exceptions. One of them is related to the urgent data that may be sent. Example of
                                   urgent data is to  enable the  host machine  to finish the process running on  the remote host
                                   machine. Figure 11.9 illustrates this concept.
                                   Another exception is that the host machine at the sending may send a 1-byte segment to make
                                   the receiver re announce the next byte expected and the size of window. This is quite important
                                   in preventing deadlock if a window announcement ever gets lost. Senders are not required to
                                   transmit data immediately when they appear from the application as well as the remote host
                                   machine is not required to send acknowledgements as soon as possible. For example, consider
                                   a telnet connection to an interactive editor that reacts to every keystroke. In the worst case, if a
                                   character arrives at the TCP software, a 21-byte TCP segment is provided to IP to send as a 41-
                                   byte datagram.  At  the  remote  host  machine  at  the receiving  side, TCP  returns a  40-byte
                                   acknowledgement (20-byte TCP header + 20-byte IP header). If the editor reacts to the character,
                                   it echoes it as a 41-byte packet, which is acknowledged with a 40-byte packet. Thus, 162 bytes and
                                   four segments are sent for each character typed. There are a number of issues that can degrade
                                   TCP performance. One of them is the silly window syndrome in which when data are passed in
                                   large blocks, but an application on the host machine at receiving side reads data one byte at a
                                   time. This is illustrated in Figure 11.9.








          176                               LOVELY PROFESSIONAL UNIVERSITY
   178   179   180   181   182   183   184   185   186   187   188