15
Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion control

Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Embed Size (px)

Citation preview

Page 1: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Transport Control Protocol (TCP)

Features of TCP, packet loss and retransmission, adaptive

retransmission, flow control, three way handshake, congestion control

Page 2: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Reliable transport

• IP is unreliable• Application programmers typically require

reliability (although not always)• The Transmission Control Protocol (TCP)

establishes a reliable end-to-end communication service on top of IP

Page 3: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Seven major features of TCP

1. Connection oriented2. Point to point3. Complete reliability - delivered as sent4. Full duplex communication5. Stream interface6. Reliable connection startup7. Graceful connection shutdown

Page 4: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

End to end communication

• TCP has no knowledge of the underlying Internet structure

Page 5: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Fundamental reliability problems

• Unreliable delivery by the communication system (IP)

• Unreliable end hosts (e.g., crashes and reboots

• TCP handles these through a variety of techniques

Page 6: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Packet loss and retransmission• Sender sets a

timer• Receiver sends a

acknowledgement

• Timeout results in retransmission

Page 7: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Adaptive retransmission• Sensible timer values vary greatly on an

Internet• TCP monitors the delay on a connection

and adapts the timer– notes time taken to receive

acknowledgements– computes weighted average and variance

over many transmissions and uses these to set the timer

Page 8: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Two different timeouts

Page 9: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Flow control• TCP uses a window mechanism• Each end of the connection allocates a buffer

and notifies the other end of its size• Receiver sends available window size in each

acknowledgement (window advertisement)• Receiver sends window advertisement when

the application consumes some data• Zero window advertisement tells the sender

to stop transmitting until further notice

Page 10: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion
Page 11: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Three way handshake

• Uses special synchronisation (SYN) and finish (FIN) messages to open and close connections

• Also confirms that all data has been received at both sides

• Each end of each new connection randomly generates a 32 bit connection identifier

Page 12: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion
Page 13: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

Congestion control

• TCP monitors congestion through message loss– first lost message, TCP backs right off and sends

just one small message – if this is not lost, doubles data size and sends two– continues exponential growth until half receiver’s

window size is reached then slows down rate of increase

Page 14: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

TCP segment format

• TCP messages are called segments

Page 15: Transport Control Protocol (TCP) Features of TCP, packet loss and retransmission, adaptive retransmission, flow control, three way handshake, congestion

• Example exam question:

http://www.cs.nott.ac.uk/~mvr/3-ccn.doc