You are on page 1of 2

IP Header

0 4-bit version 4-bit header length 8-bit type of service (TOS) 0 D M F F 16 16-bit total length (in bytes) 13-bit fragment offset 16-bit header checksum 20 bytes 31

16-bit identication 8-bit time to live (TTL) 8-bit protocol

32-bit source IP address 32-bit destination IP address options (if any)

data

UDP Header
0 16-bit source port number 16-bit UDP length 16 16-bit destination port number 8 bytes 16-bit UDP checksum 31

data (if any)

TCP Header
0 16-bit source port number 16 16-bit destination port number 32-bit sequence number 32-bit acknowledgment number 4-bit header length reserved (6 bits) U A P R S F R C S S Y I G K H T N N 16-bit window size 16-bit urgent pointer options (if any) 20 bytes 31

16-bit TCP checksum

data (if any)

Reprinted from TCP/IP Illustrated, Volume 1: The Protocols by W. Richard Stevens, Copyright 1994 by Addison-Wesley Publishing Company, Inc.

starting point CLOSED

appl: passive open send: <nothing>

n pe eo N tiv ac : SY pl: d ap sen

timeout send: RST

LISTEN

v rec

:S

N;

sen

S d:

YN
v:

C ,A

passive open

ap se

pl

rec

T RS

nd

:s en d : S da YN ta

SYN_RCVD
se r nd ecv: :< A no CK th in g>

recv: SYN send: SYN, ACK simultaneous open

SYN_SENT active open


CK ,A YN CK :S A cv end: re s

appl: close or timeout

appl: close send: FIN


se lo : c FIN pl ap nd: se

ESTABLISHED data transfer state

recv: FIN send: ACK

CLOSE_WAIT

appl: close send: FIN simultaneous close

FIN_WAIT_1

recv: ACK send: <nothing>

recv: FIN send: ACK re cv : se FIN nd : A , AC CK K recv: FIN send: ACK active close

CLOSING

LAST_ACK passive close

recv: ACK send: <nothing>

recv: ACK send: <nothing>

FIN_WAIT_2

TIME_WAIT 2MSL timeout

appl: recv: send:

normal transitions for client normal transitions for server state transitions taken when application issues operation state transitions taken when segment received what is sent for this transition

TCP state transition diagram.

Reprinted from TCP/IP Illustrated, Volume 2: The Implementation by Gary R. Wright and W. Richard Stevens, Copyright 1995 by Addison-Wesley Publishing Company, Inc.

You might also like