Top Banner
Autumn 2000 John Kristoff 1 Transport Layer Computer Networks
34

Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 1

Transport Layer

Computer Networks

Page 2: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 2

Where are we?

Page 3: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 3

Recall

Network Layer Provides host-to-host communication Source and destination addresses

identify host interfaces Machine-to-machine networking

Page 4: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 4

Transport Protocols

Provide application-to-application communication

Need extended addressing mechanism to identify applications

Called end-to-end Optionally provide:

Reliability Flow Control Congestion Control

Page 5: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 5

Example Transport Layer:Transmission Control Protocol (TCP)

Standardized by IETF as RFC 793 Most popular layer 4 protocol Connection-oriented protocol Conceptually between applications and IP Full-duplex operation Byte-stream interface Of utmost importance for this class!

The book: TCP/IP Illustrated, Volume I - W.R. Stevens Also see: http://condor.depaul.edu/~jkristof/tcp.html

Page 6: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 6

TCP Feature Summary

Provides a completely reliable (no data duplication or loss), connection-

oriented, full-duplex stream transport service that allows two application programs to form a connection, send data in either

direction and then terminate the connection.

Page 7: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 7

Relationship Between TCP and Other Protocols

TCP on one computer uses IP to communicate with TCP on another computer

Page 8: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 8

Apparent Contradiction

IP offers best-effort (unreliable) delivery

TCP uses IP TCP provides completely reliable

transfer How is this possible?

Page 9: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 9

Achieving Reliability

Reliable connection setup Reliable data transmission Reliable connection shutdown

Page 10: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 10

Reliable Data Transmission

Positive Acknowledgement Receiver returns short message when data

arrives Call an acknowledgement

Retransmission Sender starts timer whenever message is

transmitted If timer expires before acknowledgement

arrives, sender retransmits message

Page 11: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 11

Retransmission Illustrated

Page 12: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 12

How Long Should TCP Wait Before Retransmitting?

Time for acknowledgement to arrive depends on Distance to destination Current traffic conditions

Multiple connections can be open simultaneously

Traffic conditions change rapidly

Page 13: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 13

Important Point

The delay required for data to reach a destination and an acknowledgement to return depends on traffic in the internet as well as the distance to

the destination. Since it allows multiple application programs to communicate with

multiple destinations concurrently, TCP must handle a variety of delays that can change

rapidly.

Page 14: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 14

Solving the Retransmission Problem

Keep estimate of round trip time on each connection

Use current estimate to set retransmission timer

Known as adaptive retransmission Key to TCPs success

Page 15: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 15

Adaptive Retransmission Illustrated

Timeout depends on current round-trip estimate

Page 16: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 16

TCP Flow Control

Receiver Advertises available buffer space Called the window

Sender Can send up to entire window before

ACK arrives

Also called a sliding window protocol

Page 17: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 17

Window Advertisement

Each acknowledgement carries new window information Called window advertisement Can be zero (called closed window)

Interpretation: I have received up through X and can take Y more octets

Page 18: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 18

Window Advertisement Illustrated

Page 19: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 19

Another View: Sliding Window Illustrated

Page 20: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 20

Startup and Shutdown

Connection Startup Must be reliable

Connection Shutdown Must be graceful

Difficult

Page 21: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 21

Why Startup/Shutdown is Difficult

Segments can be lost duplicated delayed delivered out of order either side can crash either side can reboot

Need to avoid duplicate shutdown "message from affecting later connection

Page 22: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 22

TCPs Startup Solution

Use three-message exchange Known as the 3-way handshake Necessary and sufficient for

unambiguous, reliable startup SYN messages used for connection

establishment

Page 23: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 23

3-Way Handshake Illustrated

Page 24: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 24

TCPs Shutdown Illustrated

Page 25: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 25

Byte Stream Sequencing

Segments are labeled with a sequence number

Protects from out-of-order delivery 32-bit number Limited size of byte stream? Initial Sequence Numbers (ISNs) must be

exchanged at TCP connection establishment

Page 26: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 26

More Complete Illustration of the 3-Way Handshake

Page 27: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 27

Application Multiplexing

Cannot extend IP address No unused bits

Cannot use OS dependent quantity Process ID Task number Job name

Must work on all computer systems

Page 28: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 28

Application Multiplexing Illustrated

Page 29: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 29

Protocol Ports

Each application assigned a unique integer

Server Follows standard Always uses same port number Usually uses lower port numbers

Client Obtains unused port from protocol software Usually uses higher port numbers

Page 30: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 30

Protocol Port Example

Web server application is assigned port 80 Web client application obtains port 32938 TCP segment sent from client to server has

source port number 32938 destination port number 80

When web server responds, TCP segment has source port number 80 destination port number 32938

Page 31: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 31

Standard Protocol Ports

See http://www.iana.org for standard protocol port assignments See /etc/services in UNIX systems and \winnt\system32\drivers\etc\services in Windows NT

Page 32: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 32

TCP Segment Format

Page 33: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 33

Example Transport Layer: User Datagram Protocol (UDP)

Unreliable message delivery Connectionless protocol No flow control (no window) No error recovery (no ACKs) Provides application multiplexing Error detection optional (checksum

field)

Page 34: Autumn 2000John Kristoff1 Transport Layer Computer Networks.

Autumn 2000 John Kristoff 34

UDP Message Format