Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP Transport Control Protocol. 2003-2004 - Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection.

Similar presentations


Presentation on theme: "TCP Transport Control Protocol. 2003-2004 - Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection."— Presentation transcript:

1 TCP Transport Control Protocol

2 2003-2004 - Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection less, unreliable, datagram service TCP provides the connection oriented, reliable, byte stream service

3 2003-2004 - Information management 3 Groep T Leuven – Information department 3/35 TCP Services Best sized chunks Adaptive timeout and retransmission strategy Acknowledgements Checksums Re-sequencing Discard duplicates Flow control

4 2003-2004 - Information management 4 Groep T Leuven – Information department 4/35 TCP Header IP Header IP Header TCP Header TCP Header TCP data TCP segment IP datagram 20 bytes

5 2003-2004 - Information management 5 Groep T Leuven – Information department 5/35 TCP Header 20 bytes 16-bit Source port number 32-bit sequence number 16-bit urgent pointer Options (if any) Data (if any) 16-bit Destination port number 32-bit acknowledgement number 16-bit window size 16-bit TCP checksum header length reserved URGURG PSHPSH RSTRST SYNSYN FINFIN ACKACK 0 151631

6 2003-2004 - Information management 6 Groep T Leuven – Information department 6/35 Connection establishment : 3-way handshake SYN 12345:12345 (0) Client Ack 67891 SYN 67890:67890 (0) ack 12346 Server Segment 2 Segment 1 Segment 3 SYN 12345:12345 (0) SYN seq# : (seq#+#bytes)(#bytes) option

7 2003-2004 - Information management 7 Groep T Leuven – Information department 7/35 Best Sized Chunks Option MSS (maximum segment size) Announced on session establishment Interactive data --> byte per byte (Nagle algorithm) Bulk data uses MSS

8 2003-2004 - Information management 8 Groep T Leuven – Information department 8/35 Connection Termination Client ack 67891 FIN 67890:67890 (0) ack 12345 Server Segment 2 Segment 4 Segment 3 FIN 12345:12345 (0) ack 67891 Ack 12346 Segment 4

9 2003-2004 - Information management 9 Groep T Leuven – Information department 9/35 Reset a connection SYN 12345:12345 (0) win 4096 ClientServer Segment 2 Segment 1 RST 0:0 (0) ACK 12346 Win 0 No ICMP !!! Server is NOT Running Service on Port 2000

10 2003-2004 - Information management 10 Groep T Leuven – Information department 10/35 Half open connections SYN 12345:12345 (0) Client ack 67891 SYN 67890:67890 (0) ack 12346 Server Segment 2 Segment 1 Segment 3 P 12346:12350 (4) ack 67891 P 67891:67899 (8) ack 12351 Segment 4 Segment 5 REBOOT ??????

11 2003-2004 - Information management 11 Groep T Leuven – Information department 11/35 Adaptive timeout and retransmission strategy Exponential backoff –t, 2t, 4t, 8t, 16t, 32t, 64t seconds until 9 min TCP calculates rrt --> used for timeout value (t)

12 2003-2004 - Information management 12 Groep T Leuven – Information department 12/35 Acknowledgements & Flow Control Overview Full duplex Piggy backing Controls for the receiver –Sliding window protocol Controls for the sender –slow start : congestion window –Congestion avoidance :slow start treshold

13 2003-2004 - Information management 13 Groep T Leuven – Information department 13/35 Full duplex ClientServer Full duplex traffic possible because sequence number and acknowledge number  efficient

14 2003-2004 - Information management 14 Groep T Leuven – Information department 14/35 Sliding window protocol Client Fast Sender Server Slow Receiver Slow receiver controls the flow by resizing the Window ack 67891, win 0 PSH 67890, win 4096 PSH 55890, win 4096 PSH 44890, win 4096 ack 67891, win 4096 PSH 99890, win 4096 PSH 88890, win 4096 PSH 77890, win 4096 Slow receiver shifts the window (same seq nr) ack 99891, win 0 Slow receiver acknowledges (seq nr + 1)

15 2003-2004 - Information management 15 Groep T Leuven – Information department 15/35 Slow Start - Window size – buffer size ack 1 1 1 1 1 receiver sender ack 1 ack 2 & 3 2 2 2 2 receiver sender ack 2 & 3 ack 2 time 0 time 8 time 1 time 2 time 3 time 4 time 5 time 6 time 7 time 10 time 12 time 13 time 15 time 14 3 3 3 3time 9 ss-window=1 ss-window=2

16 2003-2004 - Information management 16 Groep T Leuven – Information department 16/35 Slow Start - Window size – buffer size (continued) ss-window=4 ss-window=8

17 2003-2004 - Information management 17 Groep T Leuven – Information department 17/35 Increasing the congestion window will not improve the system anymore, in effect, it will get worse ! receiver sender time 32 time 33 time 34 ss-window=16 Slow Start - Window size – buffer size (continued) 13141516141516171516171816171819...

18 2003-2004 - Information management 18 Groep T Leuven – Information department 18/35 How big should the window be ? 8 segments outstanding And unacknowledged Capacity (bits) = bandwidth (bits/sec) x round-trip-time (sec) OR

19 2003-2004 - Information management 19 Groep T Leuven – Information department 19/35 Capacity = bandwidh x delay 431243128756 double RTT RTT 4312 43 12

20 2003-2004 - Information management 20 Groep T Leuven – Information department 20/35 Congestion 1243 12 43 12 43 ACK Bottleneck  Congestion R1R2 Fast LAN Slow WAN ss-window=16 congestion-window=16 - no ack - time out

21 2003-2004 - Information management 21 Groep T Leuven – Information department 21/35 0 5 10 15 20 25 30 35 40 45 0 10 20 3040 50 Slow Start Exponential Growth Congestion Avoidance Phase Linear Growth Congestion Avoidance


Download ppt "TCP Transport Control Protocol. 2003-2004 - Information management 2 Groep T Leuven – Information department 2/35 Introduction UDP provides the connection."

Similar presentations


Ads by Google