Lecture16 TCPOverview
Lecture16 TCPOverview
Lecture16 TCPOverview
Connection-oriented, byte-stream
sending process writes some number of bytes
TCP breaks into segments and sends via IP
receiving process reads some number of bytes
Overview of TCP
Overview of TCP
Full duplex
Implements both flow and congestion controls
Flow control: keep sender from overrunning
receiver
Congestion control: keep sender from
overrunning network
Flow control is an end-to-end issue and
congestion control is concerned with how hosts
and network interact
Overview of TCP
Overview of TCP
Potentially
need
Potentially
need
TCP header
TCP
data is encapsulated in an IP
datagram
The
TCP header
TCP services
TCP
no
segment
Acknowledgment, SequenceNumber,
AdvertisedWindow fields are all involved in
TCPs sliding window algorithm
Each data byte has a sequence number
The Sequence Number field contains the #
for the first byte of data
Acknowledgment and AdvertisedWindow
fields carry information about the opposite
flow
The
Three-way handshake
client
Three-way handshake
Why
several purposes:
it
Receiver
<= LastByteRcvd + 1
and MaxRcvBuffer
Receiver
AdvertisedWindow =
MaxRcvBuffer - (LastByteRcvd - LastByteRead)
- LastByteAcked <=
MaxSendBuffer
if the sending process tries to write y bytes
to TCP and
(LastByteWritten - LastByteAcked) + y >
MaxSendBuffer
TCP blocks
TCP ensures that a slow receiving process
can stop a fast sending process
Adaptive Retransmissions in
TCP
Largest
Assuming
Adaptive Retransmissions in
TCP
TCP
Adaptive Retransmissions in
TCP
TimeOut
= 2 x EstimatedRTT
Karn/Partridge Algorithm:
Adaptive Retransmissions in
TCP
The
Adaptive Retransmissions in
TCP
Jacobson/Karels Algorithm
Only the aspect of the algorithm that deals with
timeout and retransmit is discussed here
Main problem with the original scheme
it does not consider the variation of the sampleRTTs
into account
if the variation is small, then EstimatedRTT can be
better trusted
if large variation then, timeout should not be tightly
coupled to EstimatedRTT
10
Adaptive Retransmissions in
TCP
TCP Extensions
TCP timeout estimation:
TCP reads the actual system clock and
puts it in the segment header
Receiver echo the timestamp back to the
sender
Sender can estimate the RTT by
subtracting the current time from the
received timestamp
TCP Extensions
Measuring
TCP Extensions
Sequence number wrap around:
Two segments with the same sequence
number
Differentiate the two segments by putting
the timestamp value in the option field
Timestamps monotonically increasing;
helps in distinguishing the segments
11
TCP Extensions
Larger Pipe:
AdvertisedWindow may not be sufficient to
fully utilize the pipe -- Delay * bandwidth
product may very large compared to the
AdvertisedWindow
We can use a scaling factor
AdvertisedWindow is left shifted by that
many places before using its contents
12