Reset Flag Usage

Purpose of RESET (RST)

Reset Flag is set in segment to achieve synchronized state, when connection goes in un-synchronized state. Reset is sent when an entity receives an segment that is not  yet acknowledge. Simplest, RESET is sent when a segment is received that is not in context with current connections.

Format of RESET Segment

RESET format is same as other TCP segment with some RST flag enabled and some minor changes that are in context with the usage of reset segment. Initiated RESET shall contain sequence number as ZERO except if the RESET is triggered in reply UN-acknowledged ACK, In case of ACK reset shall take the sequence number of ACK.
ACK field of RESET segment shall contain sum of the sequence number and segment length incoming segment(in reply of which RESET is triggered), so that receiving end can verify that RESET is received in response of previous segment and within the valid  [window] range.


RESET Cases:

Some of the possible cases to trigger reset segment are as follow:
1) TCP segment received on CLOSED connection, RESET is triggered and connection shall remain in Close state. If received segement is a RESET segmentfrom other end then nothing is sent.

2)Connection is in Un-synchronized state (LISTEN,SYN-SENT, SYN-RECEIVED) and incoming segment acknowledges something not yet sent then Reset to be triggered and connection remains in same state.

3)Connection is in Synchronized state and incoming segment yet not acknowledged then RESET segment is triggered with sequence number taken from ACK Field of incoming message and Connection goes to CLOSED state.


Un-Acknowledged Segment Received
Current State
(Segment Received In)
Changed State
(State after transformation)
Segment Triggered
CLOSED
CLOSED
RESET(RST)
Un-synchronized state (LISTEN,SYN-SENT, SYN-RECEIVED)
Un-synchronized state (LISTEN,SYN-SENT, SYN-RECEIVED)
RESET(RST)
Synchronized States
CLOSED
RESET(RST)


RESET(RST) Processing at receiving end

All RESET segments are validated by checking their sequence number field except SYN-SENT state, Reset is valid if sequence number in the window(valid range). IF connection is in SYN-STATE then RESET segment is acceptable if the ACK field acknowledges the SYN initially sent.

After successful Validation connection changes states. if receiver is in LISTEN state then it ignores RESET segment. If receiver is in SYN-RECEIVED state then goes back to LISTEN if previously in LISTEN.  In all other states connection aborts and goes in CLOSED state
                   

RESET Segment Received
Current State
(Segment Received In)
Changed State
(State after transformation)
LISTEN
LISTEN
SYN-RECEIVED
LISTEN
(Previous State)
All Other States
CLOSED

Your Comments /Suggestions and Questions are always welcome. We would try to clarify doubts with best of our knowledge. So feel free to put Questions.

No comments:

Post a Comment