Presentation is loading. Please wait.

Presentation is loading. Please wait.

- Reliable Stream Transport Service

Similar presentations


Presentation on theme: "- Reliable Stream Transport Service"— Presentation transcript:

1 - Reliable Stream Transport Service
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 Su

2 Content TCP Introduction Issue in TCP --- Flow Control Summary
Sliding window protocol TCP acknowledgement scheme TCP segment TCP timeout Summary

3 TCP Introduction

4 Introduction - TCP TCP Purpose Transmission Control Protocol
TCP is not a software Purpose Providing reliable stream delivery Isolating application programs from the details of networking

5 TCP Conceptual Layering
Application Reliable Stream (TCP) User Datagram (UDP) Internet (IP), ICMP Network Interface

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 Unstructured stream: application must understand stream content and agree on stream format before they initiate a connection.

7 Issues in TCP

8 Two issues in TCP Flow Control Virtual Circuit Connection
End-to-end flow control problem Congestion control problem Virtual Circuit Connection Congestion: router overload. There is trouble to route.

9 Flow Control - Sliding window protocol

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. Solution: sliding window protocol. TCP: variable sliding window protocol

11 Transmitter Window Size Free space in buffer to fill
Variable Window Size Window Advertisement Receiver Transmitter Transmitter Window Size Value of Window Advertisement Free space in buffer to fill increase bigger decrease smaller Stop transmissions full

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.

13 Flow Control - TCP acknowledgement scheme

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”. The scheme is called cumulative 渐增的;累加的 because it reports how much of the stream has accumulated. Go-Back-N protocols which retransmit all packets that follow a single erred packet. Selective Retransmission protocols which only retransmit erred packets using ACKs and NAKs (TCP).

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. ACK for p position loses, but the sender receive ACK for p+1 position, then sender doesn’t resend p. Disadv.: sends 5 segments, only first one loses. ACK only for 1st . Sender doesn’t know about 2nd to 5th segments successful.

16 Flow Control - TCP segment

17 TCP segment format Source Port Destination Port Sequence Number
4 16 24 31 Source Port Destination Port Sequence Number Acknowledge Number HLEN Reserved Code Bits Window Standard MSS = 536 IP datagram standard = 576 This allows 20 bytes for the IP header and the TCP header. HLEN: length of the segment header. The Options field varies in length. Sequence numbers go up to at least 2^{32} Code bits to determine the purpose and contents of the segment. Window: window advertisement. Checksum Urgent Pointer Options (if any) Padding Data

18 Flow Control - TCP timeout

19 Timeout and Retransmission
Question How to determine timeout? Is the timeout always a constant? A plot of internet round trip times as measured for 100 successive IP datagrams.

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.

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 Immune:免疫. α , βare constant weighting factor. If β=1, any small delay cause an unnecessary retransmission.

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 correspond the original datagram or the retransmitted datagram. RTT couldn’t be measured accurately if the above question cannot be answered. How to do? Cumulative ack. Refers to data received, and not to the instance of a specific datagram that carried the data. When time out, after resend, the first received ack corresponds the original or retransmitted datagram?

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 increases timeout value.

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

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 β E ∞ 1/(1-L) E=10 => L=80%; E=4 => L=50%;

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

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

28 Thanks


Download ppt "- Reliable Stream Transport Service"

Similar presentations


Ads by Google