tcp (part 1) - reliable stream transport service d.e. comer “internetworking with tcp/ip:...
Post on 15-Jan-2016
222 views
TRANSCRIPT
![Page 1: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/1.jpg)
TCP (Part 1)
- Reliable Stream Transport Service
D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall, 2000
Presented by Ming [email protected]
![Page 2: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/2.jpg)
2
Content TCP Introduction Issue in TCP --- Flow Control
Sliding window protocol TCP acknowledgement scheme TCP segment TCP timeout
Summary
![Page 3: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/3.jpg)
TCP Introduction
![Page 4: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/4.jpg)
4
Introduction - TCP TCP
Transmission Control Protocol TCP is not a software
Purpose Providing reliable stream delivery Isolating application programs from the details of
networking
![Page 5: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/5.jpg)
5
TCP Conceptual Layering
Application
Reliable Stream (TCP)User Datagram (UDP)
Internet (IP), ICMP
Network Interface
![Page 6: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/6.jpg)
6
Properties of the reliable delivery service Stream Orientation
data as a stream of bits, divided into 8-bit octets Virtual Circuit Connection Buffered Transfer
transfer more efficiently & minimize network traffic Unstructured Stream Full Duplex Connection
Two-way connection
![Page 7: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/7.jpg)
Issues in TCP
![Page 8: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/8.jpg)
8
Two issues in TCP Flow Control
End-to-end flow control problem Congestion control problem
Virtual Circuit Connection
![Page 9: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/9.jpg)
Flow Control
- Sliding window protocol
![Page 10: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/10.jpg)
10
End-to-end flow control Problem
Sender can send more traffic that receiver can handle. (Too fast)
Solution variable sliding window protocol each acknowledgement, which specifies how
many octets have been received, contains a window advertisement that specifies how many additional octets receiver are prepared to accept.
![Page 11: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/11.jpg)
11
Variable Window Size
… …
Transmitter Receiver
Window Advertisement
Transmitter Window Size Value of
Window Advertisement
Free space in buffer to fill
increase bigger increase
decrease smaller decrease
Stop transmissions 0 full
![Page 12: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/12.jpg)
12
Sliding window protocol in TCP TCP allows the window size to vary over
time. Window size changes at the time it slides
forward. Advantage: it provides flow control as well as
reliable transfer.
![Page 13: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/13.jpg)
Flow Control
- TCP acknowledgement scheme
![Page 14: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/14.jpg)
14
Acknowledgements and Retransmission
Cumulative acknowledgement scheme is used in TCP.
A TCP ACK specifies “the sequence number of the next octet that the receiver expects to receive”.
![Page 15: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/15.jpg)
15
Acknowledgements and Retransmission
Adv. Easy to generate and unambiguous. The lost ACKs don’t force retransmission.
Disadv. No information about all successful transmissions
for the sender, but only a single position in the stream.
![Page 16: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/16.jpg)
Flow Control
- TCP segment
![Page 17: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/17.jpg)
17
TCP segment format
Source Port
Sequence Number
Acknowledge Number
HLEN
Checksum
Options (if any)
Data
…
Destination Port
Reserved Code Bits Window
Urgent Pointer
Padding
4 3116 240
![Page 18: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/18.jpg)
Flow Control
- TCP timeout
![Page 19: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/19.jpg)
19
Timeout and Retransmission Question
How to determine timeout? Is the timeout always a constant?
![Page 20: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/20.jpg)
20
Timeout and Retransmission An adaptive retransmission algorithm is used
in TCP. TCP monitors the performance of each
connection and adjust its timeout parameter accordingly Timeout value may change.
Timeout is adjusted when a new round trip sample ( RTT ) is obtained.
![Page 21: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/21.jpg)
21
Timeout and Retransmission
RTT =
(α * Old_RTT) + ((1 – α) * new_RTT_sample ) 0 < α < 1 α close to 1 => no change in a short time α close to 0 => RTT changes too quickly
Timeout = β * RTT β >1 Recommended setting, β= 2
![Page 22: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/22.jpg)
22
Accurate Measurement of Round Trip Samples TCP acknowledgements are ambiguous.
It is caused by the cumulative acknowledgement scheme. It happens when retransmission. It causes the question that the first received ACK does corr
espond the original datagram or the retransmitted datagram. RTT couldn’t be measured accurately if the above question
cannot be answered.
How to do?
![Page 23: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/23.jpg)
23
Accurate Measurement of Round Trip Samples --- Karn’s Algorithm and Timer Backoff
Karn’s algorithm: when computing the round trip estimate, ignore samples that correspond to retransmitted segments, but use a back-off strategy, and retain the timeout value from a retransmitted packet for subsequent packets until a valid sample is obtained.
Timer back-off strategy: New_timeout = γ * timeout ( typically, γ =2 ) Each time timer expires (retransmit happens), TCP increa
ses timeout value.
![Page 24: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/24.jpg)
24
Karn’s Algorithm Use RTT to compute Timeout When retransmission happens, Timeout increases in
γtimes continuously, until transfer successfully. [Backoff strategy]
Use the timeout in the final turn of the last step to send next segment. [Backoff strategy]
When an acknowledgement arrives corresponding to a segment that did not require retransmission, then TCP re-computes the RTT and reset the timeout accordingly
![Page 25: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/25.jpg)
25
Responding to High Variance in Delay
Queuing theory: variation in round trip delay is proportional to 1/(1-L), where L is the current network load, 0<L<1
( Timeout = β * RTT ) & (β=2 ) => L < 30% Not efficient
1989 TCP specification requires to use estimated variance in place of β
![Page 26: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/26.jpg)
26
New RTT and Timeout Algorithm DIFF = sample – old_RTT Smoothed_RTT = old_RTT + d * DIFF DEV = old_DEV + p (|DIFF| - old_DEV) Timeout = Smoothed_RTT + g * DEV
DEV estimated mean deviation d, a fraction between 0 and 1 to control how quickly the new sample
affects the weighted average p, a fraction between 0 and 1 to control how quickly the new sample
affects mean deviation g, a factor controls how much deviation affects round trip timeout Research suggests: d=1/8, p=1/4 and g=4
![Page 27: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/27.jpg)
27
Summary Purpose of TCP End-end Flow Control issue
Variable Sliding window protocol in TCP TCP acknowledgement scheme TCP segment TCP timeout
RTT-Timeout Calculation and Karn’s Algorithm New RTT and Timeout Algorithm
![Page 28: TCP (Part 1) - Reliable Stream Transport Service D.E. Comer “Internetworking with TCP/IP: Principles, Protocols and Architectures”, Ch. 13, Prentice Hall,](https://reader035.vdocument.in/reader035/viewer/2022062301/56649d225503460f949f8894/html5/thumbnails/28.jpg)
Thanks