The MPLS-OPS Archive

Cell Relay Retreat>MPLS-OPS Archive>month:2002-Feb> msg00116



[Date Prev][Date Next][Thread Prev][Thread Next]  
  [Date Index][Thread Index][Author Index][Subject Index]

RE: TCP state machine

  • From: Pradeepa Shastry <Pshastry@in.huawei.com>
  • Date: Mon, 18 Feb 2002 16:54:41 +0530
  • Cc: "'ahussain@eng.utoledo.edu'" <ahussain@eng.utoledo.edu>
  • Resent-Date: Mon, 18 Feb 2002 07:05:10 -0500
  • To: Santosh Kumar <santosh1914@yahoo.com>, "'mpls-ops@mplsrc.com'" <mpls-ops@mplsrc.com>

Title: RE: TCP state machine

Hi,


Answer to your question is two fold

1) If you are waiting for SYN_SENT state and waiting for SYN + ACK from peer...

In this case if application says close, FIN will not be send to peer since state is not established (see function TCP_Disconnect ()) and it closes all the resources.

2) If you are in a SYN_SENT state and received SYN + ACK from peer...
Then you moved to ESTABLISHED state and sent final ACK, if that got lost other side still in SYN_RECVD state.
At this point if application running at your end tries to close the session, then you will send a FIN to other side. But the point here is it is not just FIN it is FIN+ACK.

Peer which is in SYN_RCVD state receives a FIN+ACK ,you process the ACK first and moved to ESTABLISHED state and then process the FIN.

I hope this answer to your question.


Thanks and Regards
-Pradeep Shastry

-----Original Message-----
From: Santosh Kumar [mailto:santosh1914@yahoo.com]
Sent: Saturday, February 16, 2002 9:55 PM
To: 'mpls-ops@mplsrc.com'
Cc: 'ahussain@eng.utoledo.edu'
Subject: RE: TCP state machine


To add to Ken's response:
TCP state machine specifies that the only valid
transitions out of "SYN_SENT" state are when you
receive a SYN, an ACK, or when you timeout. Any other
event or message should have no effect on this state.
So, the fact that you received a FIN when you are in
SYN_SENT state has no relevance. It has no meaning to
this state. Hope this helps.

Have a nice day,
Santosh Kumar
Ohio State University

--- "Hull, Kenneth A." <KHULL@alleghenyenergy.com>
wrote:
> I would suggest you build a timer to take either end
> of the session back to
> the previous state if the an appropriate response is
> not received in the
> timer window, and be sure your software ignores any
> extra messages
> corresponding to move form the previous state it may
> receive for the same
> session (same source TCP port) once it moves to the
> next state.
>
> -----Original Message-----
> From: Mohammed [mailto:ipswitching@yahoo.com]
> Sent: Wednesday, February 13, 2002 11:08 AM
> To: mpls-ops@mplsrc.com
> Cc: ahussain@eng.utoledo.edu
> Subject: TCP state machine
>
>
> Hi all,
>
>  I was writing the code for TCP state machine so
> that
> i could use it for running LDP over TCP. This would
> just be a component of the simulator that i am
> working
> on.
>
>  I was looking at the state transition diagram given
> in TCP/IP illustrated Vol 1 by Richard Stevens.
>
>  Please consider the following scenario --
>
>  A TCP software on a peer working on passive open
> mode
> is in "SYN-RCVD" state. It is waiting for an 'ACK'
> from its peer on the other end of the connection.
> There are two things that might happen here ...
>
>  (1) SYN + ACK sent before transition to this state
> was lost, so the other side never received it and
> hence never ACK.
>
>  (2) The other side have received it and had ACk but
> the ACk was lost.
>
>  Anyways 'SYN-RCVD' i waiting for an ACK. But during
> its wait period or even before its time oust and
> sends
> RST ... if it receives an appl:close interrupt then
> it
> is supposed to send a FIN to its peer.
>
>  Now if the peer on the other side is in
>
>  -- "ESTB" state then this would be okay.

>  But if it is "SYN SENT" state .. then how am i
> supposed to handle this FIN.
>
>  Any pointers from TCP developers or any other
> interested professionals are welcome.
>
>  Thanks for your time and help!!!
>  Abrar.

>
> =====
> Abrar Hussain.
> Graduate Student/Network Designer.
> The University of Toledo.
> Toledo,OH.
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE Valentine eCards with Yahoo! Greetings!
> http://greetings.yahoo.com
>
> -------
> The MPLS-OPS Mailing List
> Subscribe/Unsubscribe:
> http://www.mplsrc.com/mplsops.shtml
> Archive:
> http://www.mplsrc.com/mpls-ops_archive.shtml
>
> -------
> The MPLS-OPS Mailing List
> Subscribe/Unsubscribe:
> http://www.mplsrc.com/mplsops.shtml
> Archive:
http://www.mplsrc.com/mpls-ops_archive.shtml


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

-------
The MPLS-OPS Mailing List
Subscribe/Unsubscribe:  http://www.mplsrc.com/mplsops.shtml
Archive: http://www.mplsrc.com/mpls-ops_archive.shtml

--------------------------------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please notify the
originator of the message.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of Huawei Technologies India Pvt. Ltd.