Upload
lio-messi
View
228
Download
0
Embed Size (px)
Citation preview
8/19/2019 Tc Pip Pocket Guide 1
1/2
IP Header
32-bit source IP address
32-bit destination IP address
options (if any)
data
4-bitversion
4-bit headerlength
8-bit type of service(TOS)
16-bit total length (in bytes)
16-bit identification 0 DF
MF
13-bit f ragment off set
8-bit time to live(TTL)
8-bit protocol 16-bit header checksum
0 15 16 31
20 bytes
UDP Header
data (if any)
16-bit source port number 16-bit destination port number
16-bit UDP length 16-bit UDP checksum
0 15 16 31
8 bytes
TCP Header
32-bit sequence number
32-bit ack nowledgment number
options (if any)
data (if any)
16-bit source port number 16-bit destination port number
16-bit TCP check sum 16-bit urgent pointer
4-bit headerlength
reserved(6 bits)
URG
AC
K
P
S
H
RS
T
S
Y
N
FI
N16-bit window size
0 15 16 31
20 bytes
Reprinted f rom TC P/ I P Ill ust r a t e d, V o l ume 1: The P r o t o c o ls
by W. Richard Stevens,
Copyright © 1994 by Addison-Wesley Publishing Company, Inc.
8/19/2019 Tc Pip Pocket Guide 1
2/2
CLOSED
LISTEN
SYN_RCVD SYN_SENT
ESTABLISHED
FIN_WAIT_1
CLOSE_WAIT
FIN_WAIT_2
CLOSING
TIME_WAIT
LAST_ACK
da t a t r a nsf e r st a t e
st a r t i ng p o i nt
2 M S L t ime o ut
passiv e o p e n
a c t iv e o p e n
simul t a ne o us c l o se
appl: passive open
send: a p p
l : a c t i v
e o p
e n
s e n d
: S Y N
a p p l :
s e n
d d
a t a
s e n d : S Y N
r e c v
: S Y N
; s e n d
: S Y N
, A C K
r e c v
: R S T
timeoutsend: RST
recv: SYN
send: SYN, ACKsimul t a ne o us o p e n
r e c v
: S Y N
, A C K
s e n d
: A C K
appl: closesend: FIN
recv: ACKsend:
recv: FIN
send: ACK
recv: ACKsend:
r e c v : F I N
, A C K
s e n d : A
C K
r e c v : A C K
s e n d :
a p p l
: c l o
s e
s e n d
: F I N
recv: FIN
send: ACK
recv: FIN
send: ACK
appl: closesend: FIN
appl: close
or timeout
recv: ACK
send:
a c t iv e c l o se
passiv e c l o se
no r mal t r a nsi t i o ns f o r c li e nt no r mal t r a nsi t i o ns f o r se r v e r
appl: st a t e t r a nsi t i o ns t a k e n whe n appli c a t i o n issue s o p e r a t i o nrecv: st a t e t r a nsi t i o ns t a k e n whe n se gme nt r e c e iv e d send: wha t is se nt f o r t his t r a nsi t i o n
TCP state transition diagram.
Reprinted f rom TC P/ I P Ill ust r a t e d, V o l ume 2 : The Impl e me nt a t i o n
by Gary R.Wright and W. Richard Stevens,
Copyright © 1995 by Addison-Wesley Publishing Company, Inc.