tcp

35
TCP

Upload: melvin-taylor

Post on 03-Jan-2016

23 views

Category:

Documents


1 download

DESCRIPTION

TCP. Reliable Transport in TCP TCP flow and Congestion Control. Learning objectives. TCP. Application. Application. byte stream. byte stream. segments. Transmitter. Receiver. Send buffer. Receive buffer. ACKs. TCP: Overview. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: TCP

TCP

Page 2: TCP

Learning objectives

• Reliable Transport in TCP

• TCP flow and Congestion Control

Page 3: TCP

TCP

Page 4: TCP

- TCP passed block of data to IP, consisting of the TCP header and application layer data, called segment- Stream of octets passed between sender/ receiver Deliver in same octate sequence- Connection-oriented service - Full duplex - Reliable service

byte stream

Send buffer

segments

Receive buffer

byte stream

Application Application

ACKs

Transmitter Receiver

TCP: Overview

Page 5: TCP

TCP Segment

Source Port Destination Port

Sequence Number

Acknowledgement Number

Checksum Urgent Pointer

Options Padding

0 4 10 16 24 31

URG

ACK

PSH

RST

SYN

FIN

HeaderLength Reserved Window Size

Data

Page 6: TCP

• Source, Destination port: 16 bits - identify applications at ends of the connection

• Client Program allocates a port (usually above 1023)

• Servers are known by ports number - FTP 20, TELNET 23, SMTP 25, HTTP 80

• Port numbers are generally allocated by -- 0 -- not used -- 1- 255 -- Reserved ports for well- known services -- 256- 1023 -- Other reserved ports -- 1024- 65535 -- user- defined server ports

• Unix store general used ports in /etc/ services

TCP header fields

Page 7: TCP

Socket

• Connection identification by 5 tuple --- 2 IP address, 2 port, protocol number (TCP=6) -- Socket

• IP address is unique to a node, the port is unique on a node

• A connection is identified by the socket address at its to ends: - client socket: 158. 108.33. 3, 3000; 158.108.2.71,21 - server socket: 158.108.2.71,21; 158.108.33.3,3000;

Page 8: TCP

Socket: Multiple connection

• Server’s unique socket address can be accessed simultaneously by clients

Page 9: TCP

TCP: Reliable Transport

• Send and wait for acknowledgment with sequence number ---sender reset timer when receives ACK

• No ACK within a certain time, retransmit the packet

---Error Recovery

Page 10: TCP

TCP: Reliable Transport

Set the appropriate size of sliding window size adaptively

• Use for flow control : - Prevent sender from overloading receiver with data, e. g. high- performance server to slow PC - Congestion inside network, e. g. router performance, slow link speed

• How to provide flow control?

Page 11: TCP

• Receiver “ advertises” it’s windows size in acknowledgments - Window size specifies how many bytes the receiver is willing to accept - Limited by congestion window

• Sender will adjusts buffer pointer as receiver’s advertisement

Sliding window/ Transmission window

• A larger window size allows more data to be transmitted with pending acknowledgment

• Need not to wait for acknowledgment every segment

Page 12: TCP

Sliding/ Send window buffer

Page 13: TCP

Connection Concept

• Before data could be transferred, a connection must be opened ---servers do passive open (listen) ---clients do active open (connect)

• When it finished, the connection is closed

• TCP has general 3 phases -- connection setup phase -- data phase -- connection close phase

• Socket is stored in „TCP control block“ TCB - with sequence number and timer values

Page 14: TCP

3-way Handshake for connection establishment

Host A Host B

SYN, Seq_no = x

SYN, Seq_no = y, ACK, Ack_no = x+1

Seq_no = x+1, ACK, Ack_no = y+1

Active open

Closed

Listen

Established

Established

Page 15: TCP

Seq_no = 2000, Ack_no = 1, Win = 1024, Data = 2000-3023

Seq_no = 1, Ack_no = 4048, Win = 512, Data = 1-128

Seq_no = 3024, Ack_no = 1, Win = 1024, Data = 3024-4047

Seq_no = 4048, Ack_no = 129, Win = 1024, Data = 4048-4559

t1

t2

t3

t4

Seq_no = 1, Ack_no = 2000, Win = 2048, No Data t0

TCP Window control

Page 16: TCP

FIN, seq = 5086

ACK = 5087

Data, seq. = 303, ACK = 5087Deliver 150 bytes

FIN, seq. =453, ACK = 5087

ACK = 454

Host B

ACK = 453

Connection Termination

Host A

Page 17: TCP

Retransmission Timer

Page 18: TCP

Retransmission Timer

• With RTT, Timeout increase

Page 19: TCP

RTT Measurement and Timer Backoff

Page 20: TCP

TCP Flow and Congestion Control

Page 21: TCP

Principle

Page 22: TCP

Zero Window Probing

Page 23: TCP

Silly Window Syndrome

Page 24: TCP

Solutions: Silly Window Syndrome

Page 25: TCP

Delayed Acknowledgment

Page 26: TCP

Delayed Transmission

Page 27: TCP

TCP Congestion Control Algorithm

Page 28: TCP

Multiplicative Decrease

Page 29: TCP

Additive Increase

Page 30: TCP

Congestion Avoidance

Page 31: TCP

Congestion Control Algorithms

Page 32: TCP

Congestion Control Algorithms

Page 33: TCP

TCP Congestion Control figure

Page 34: TCP

TCP Performance Measure

Page 35: TCP

Thank You