Reliable Stream Transport Service (TCP)
Reliable Stream Transport Service (TCP)
Reliable Stream Transport Service (TCP)
Service (TCP)
Need for Stream Delivery
Lowest Level
• Packets are lost or destroyed
• Network hardware fails
• Network too heavily loaded
• Packet switching changes routes dynamically
– Packets out of order
– Deliver them after substantial delay
– Deliver duplicates
Highest Level
• Large volume of data
– Complex
– Build error detection and recovery into each
application program
Properties of The Reliable Delivery
Service
• Interface between application programs and
TCP reliable delivery service can be
characterized by 5 features
– Stream orientation
– Virtual Circuit Connection
– Buffered Transfer
– Unstructured Stream
– Full duplex connection
Providing Reliability
• Reliable protocol use a single fundamental
technique known as positive
acknowledgement with retransmission
• Sender keeps a record of each packet it sends
& waits for the acknowldement
• Sender starts a timer when it sends a packet
• Retransmits the packet if the timer expires
before ack arrives
Connection Establishment
CS 640 6
Connection Termination
Active participant Passive participant
(server) (client)
FIN, S
equen
ceNu
m=
x
n t = x+1
l ed gme
Ackn
ow u m = y
N
eq u ence
S
FIN,
Ackno
wledg
ment
=y + 1
CS 640 7
State Transition Diagram
CLOSED
Active open/SYN
Passive open Close
Close
LISTEN
Close/FIN ESTABLISHED
Close/FIN FIN/ACK
FIN_WAIT_1 CLOSE_WAIT
AC FIN/ACK
ACK K Close/FIN
+
FI
FIN_WAIT_2 N/
AC CLOSING LAST_ACK
K
ACK Timeout after two ACK
segment lifetimes
FIN/ACK
TIME_WAIT CLOSED
CS 640 8