Information Technology Reference
In-Depth Information
CLOSE
CLOSE
Passive
OPEN
CLOSE
LISTEN
Active
OPEN
LISTEN
CLOSE
Receive SYN
and SYN, ACK
SEND and
SYN
SYN
RECEIVED
SYN
SENT
SYN
RECEIVED
SYN
SENT
Receive SYN
and SYN, ACK
Receive ACK
of SYN
FIN
WAIT-1
CLOSE
WAIT
FIN
WAIT-1
CLOSE
WAIT
ESTABLISH
ESTABLISH
Receive FIN
and ACK
CLOSE and
FIN
Receive ACK
of FIN
CLOSE and
FIN
FIN
WAIT-2
FIN
WAIT-2
Receive FIN
and ACK
CLOSING
LAST-ACK
CLOSING
LAST-ACK
Receive ACK
of FIN
CLOSE and
FIN
Timeout = 2MSL
Receive FIN
and ACK
TIME WAIT
CLOSED
TIME WAIT
CLOSED
Figure 24.6
TCP connection states
24.6.1 Sequence numbers
TCP packets contain a 32-bit sequence number (0 to 4 294 967 295), which relates to every
byte sent. It uses a cumulative acknowledgement scheme, where an acknowledgement with a
value of VAL, validates all bytes up to, but not including, byte VAL. Each byte at which the
packet starts is numbered consecutively, at the first byte.
When sending data, TCP should receive acknowledgements for the transmitted data. The
required TCB parameters will be:
SND.UNA
Oldest unacknowledged sequence number.
SND.NXT
Next sequence number to send.
Acknowledgement from the receiving TCP (next sequence num-
ber expected by the receiving TCP).
SEG.ACK
First sequence number of a segment.
SEG.SEQ
SEG.LEN
Number of bytes in the TCP packet.
SEG.SEQ+SEG.LEN-1
Last sequence number of a segment.
On receiving data, the following TCB parameters are required:
RCV.NXT Next sequence number expected on an incoming segment, and is
the left or lower edge of the receive window.
RCV.NXT+RCV.WND-1 Last sequence number expected on an incoming segment, and is
Search WWH ::




Custom Search