Professional Documents
Culture Documents
Chapter 06
(version June 8, 2007)
01 Introduction
02 Physical Layer
03 Data Link Layer
04 MAC Sublayer
05 Network Layer
06 Transport Layer
07 Application Layer
08 Network Security
00 – 1 /
Transport Layer (1/2)
Application Application
(or session) Application/transport (or session)
layer Transport interface layer
address
TPDU
Transport Transport
entity Transport entity
protocol
Network
address Transport/network
Network layer interface Network layer
socket() socket()
bind()
listen()
accept() connect()
write()
read()
write()
read()
close() close()
TPDU payload
Packet payload
Frame payload
PASSIVE ACTIVE
ESTABLISHMENT ESTABLISHMENT
PENDING PENDING
Disconnection Disconnect
request TPDU primitive
PASSIVE received ACTIVE
executed
DISCONNECT DISCONNECT
PENDING PENDING
IDLE
Disconnect Disconnection request
primitive executed TPDU received
Physical
communication channel Host
(a) (b)
• explicit addressing
Host 1 Host 2
Server 1 Server 2
Application TSAP 1208 Application
process layer
Transport
Transport layer TSAP 1522 TSAP1836
connection
NSAP Network
layer NSAP
Data link
layer
Physical
layer
Time-
of-day
Layer server
Process Process
User User
Server Server
4
TSAP
(a) (b)
T 2k–1
Forbidden T
message
Sequence numbers
120
Sequence numbers
n
on de
gi id
re orb
F
80
70
Restart after
60 crash with 70
Actual sequence
numbers used
0
0 30 60 90 120 150 180
Time Time
(a) (b)
= x) x)
CK AC K=
Time
= y, A = y,
(seq (seq
ACK ACK
DAT
A (s REJEC
eq = T (AC
x, AC K = y)
K=
y)
(a) (b)
Host 1 Host 2
CR (
seq
= x)
Old duplicate
)
K =x
, AC
q =y
K (se
AC
DAT
A (s
ACK eq = x,
= z)
Old duplicate
REJ
ECT
(ACK
= y)
(c)
Host 1 Host 2
CR
ACK
DATA
Time
DATA
DR
No data are
delivered after
a disconnect
request
Send DR Send DR
+ start timer
DR DR + start timer
Release Release
connection connection
(a) (b)
(c) (d)
Transport address
Layer
Network
4 address
2 Router lines
To router
(a) (b)
Strategy used by
sending host AC(W) AWC C(AW) C(WA) W AC WC(A)
State of a Connection
IDLE Not yet established
WAITING CONNECT called; CALL REQ. sent
QUEUED CALL REQ. arrived; LISTEN not called
ESTABLISHED Connection established
SENDING Waiting for permission to send TPDU
RECEIVING RECEIVE has just been called
DISCONNECTING DISCONNECT ahs just been called
P4: A5/Idle
DISCONNECT P4: A6/Disc
P5: A7/Estab
SEND P5: A8/Send
RECEIVE A9/Receiving
P3: A1/Estab
Call_req P3: A4/Queu'd
Call_acc ∼/Estab
Incoming packets
Clear_conf ∼/Idle
DataPkt A12/Estab
Timeout ∼/Idle
Predicates Actions
P1: Connection table full A1: Send Call_acc A7: Send message
P2: Call_req pending A2: Wait for Call_req A8: Wait for credit
P3: LISTEN pending A3: Send Call_req A9: Send credit
P4: Clear_req pending A4: Start timer A10: Set Clr_req_received flag
P5: Credit available A5: Send Clear_conf A11: Record credit
A6: Send Clear_req A12: Accept message
CONNECT TIMEOUT
IDLE
DISCONNECT
CALL REQ
LISTEN,
WAITING QUEUED
SEND DATA,
SENDING RECEIVING
CLEAR REQ
DISCON-
NECTING
32 Bits
Client Server
1 5
stub stub
Client
Server
2 4
Operating system Operating system
Network
UDP
OS
IP UDP payload
Kernel
Ethernet IP payload
Ethernet payload
(a) (b)
Sequence number
Acknowledgement number
TCP U A P R S F
header R C S S Y I Window size
length G K H T N N
Data (optional)
RST/– SEND/SYN
SYN SYN
RCVD SENT
SYN/SYN + ACK (simultaneous open)
CLOSE/FIN FIN/ACK
(Active close) (Passive close)
FIN/ACK
FIN CLOSE
CLOSING
WAIT 1 WAIT
FIN + ACK/ACK
FIN TIME LAST
WAIT 2 WAIT ACK
FIN/ACK
(Timeout/)
ACK/–
CLOSED
2K
ACK = 2048 WIN = 2048
Application
does a 2K
write 2K SEQ = 2048
Full
Sender is Application
IN = 0
blocked 096 W
ACK = 4 reads 2K
048
96 W IN = 2
AC K = 40
2K
Sender may
send up to 2K
1K
SEQ =
4096
1K 2K
36
Threshold
32
Congestion window (kilobytes)
28
24 Threshold
20
16
12
0
0 2 4 6 8 10 12 14 16 18 20 22 24
Transmission number
0.2 0.2
Probability
Probability
0.1 0.1
0 0
0 10 20 30 40 50 0 10 20 30 40 50
Round-trip time (msec) Round-trip time (msec)
(a) (b)
Mobile
host
Router Antenna