tcp lecture 13 november 13, 2000. tcp background transmission control protocol (tcp) tcp provides...

29
TCP Lecture 13 November 13, 2000

Upload: emery-flynn

Post on 01-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP

Lecture 13

November 13, 2000

Page 2: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Background

Transmission Control Protocol (TCP) TCP provides much of the functionality that IP

lacks: reliable service

Page 3: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Service

TCP provides the following functionality– Connection Orientated– Point-to-Point Communication– Complete Reliability– Full Duplex Communication– Streaming– Reliable Connection Startup– Graceful Connection Shutdown

Page 4: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Connection Orientated

A new connection must be created on both the sender and receiver before communication may begin.

Page 5: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Point-to-Point Communication

With P-T-P Communication, a clear start and end point exist.

Data is more secure; people should not be able to modify the data between the two points.

Page 6: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Complete Reliability

TCP guarantees that the exact data sent will be received in proper order, without loss, at the destination.

UDP, on the other hand, makes no such guarantee.

Page 7: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Full Duplex Communication

TCP allows for data to flow from the sender to the receiver, and from the receiver to the sender.

Either side can transmit at any time, or at the same time.

TCP can buffer data to ensure a constant flow.

Page 8: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Stream Interface

“Streaming” is where an application sends a constant flow of data.

No guarantee is made that the data received is of the same size. (Think about MTU).

Page 9: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Reliable Connection Startup

New connections must exist on both the sender and receiver before transmission begins.

Both sender and receiver must agree to use the new connection.

This eliminates errant packets from previous transmissions.

Page 10: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Graceful Communication Shutdown

Either the sender or the receiver can shutdown the connection.

TCP guarantees that all data is transmitted before shutting down the connection.

Page 11: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

End-to-End Service

TCP is said to be end-to-end. TCP provides the end-to-end connectivity

between an application on the sender and an application on the receiver.

The connections between the two machines are virtual; the are implemented in software.

TCP data is encapsulated in an IP packet and transmitted.

Page 12: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

A TCP/IP Visualization

Page 13: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Reliability

Two major areas of concern– Unreliable delivery of the underlying medium

Messages can be lost, delayed, delivered out of order, etc. If a second connection is opened between machines, how

does the receiver determine if the messages are for the first or the second connection?

– Hardware reboot If two machines are communicating, and one reboots, the

other computer still sees an open connection. How does the computer that rebooted handle messages

from the time before the reboot?

Page 14: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Packet Loss and Retransmission

Page 15: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Determining Retransmission Delay

Consider the two examples– LAN communication

Low delay High throughput IDEAL: low retransmission delay

– Satellite communication High delay Low throughput IDEAL: high retransmission delay

Page 16: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Retransmission (cont.)

Because TCP is was designed to work efficiently in multiple environments, a static retransmission delay was not effective.

Adaptive retransmission was the workaround. – TCP estimates round-trip delay based on the time it takes for

the message to be sent, plus the time to receive the ACK.– The retransmission delay then becomes a linear combination

of the mean round-trip delay and the variance.

Page 17: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Retransmission (cont.)

Page 18: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Retransmission (cont.)

In general, adaptive retransmission sets the actual retransmission delay to be slightly longer than the actual round-trip estimate.

Page 19: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP & Windows, Buffers

TCP uses a similar scheme to the “sliding window” that was discussed earlier.

Buffer – total amount of memory allocated for the individual transmission.

Window – amount of data to send in one message.

Window Advertisement – amount of buffer remaining on the receiver’s side.

Page 20: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Windowing

Page 21: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Windowing (cont.)

If the receiving application can read data as fast as it arrives (or faster), it will send a window advertisement that is positive.

If the receiving application cannot read data as fast as it arrives, eventually the buffer will fill and the receiving application will send a zero window advertisement! Sending application will stop transmission until a nonzero window advertisement is received.

Page 22: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Handshaking & Communication Shutdown

Page 23: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Handshaking (cont.)

The handshaking process used to create a connection is referred to the synchronization segment (SYN).

The process used to close a connection is referred to the finalize segment (FIN).

Page 24: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Congestion Control

TCP contains built-in congestion control. As transmissions reach a busy node, they have

an increased chance of having their TTL expiring!

If all transmissions into a busy node timeout, imagine if all senders kept resending the messages! This is called congestion collapse.

Page 25: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

Congestion Control (cont.)

When TCP resends a message, it does so in the following manner:– If the message is the first in the retransmission, it

will send a single message window, and wait for an ACK.

– If the ACK is received w/o loss, it will double the amount of data to send (2 windows)

– The increase continues until TCP is sending half of the advertised window, at which point it will slow itself down.

Page 26: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

The TCP Segment Format

Page 27: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Segment Header

Source Port (16 bits) Destination Port (16 bits) Sequence Number (32 bits): used to combine

improperly received segments Acknowledgement Number (32 bits): the value of the

next ACK the sender is expecting to receive Data Offset (HLEN) (4 bits): the number of 32 bit words

in the header Reserved (6 bits)

Page 28: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Segment Header (cont.)

Control Bits (6 bits): (from left to right)– URG: Urgent Pointer field significant– ACK: Acknowledgement field significant– PSH: Push function– RST: Reset the connection– SYN: Synchronize sequence numbers– FIN: No more data from sender

Window (16 bits): The number of bytes the sender of this segment is willing to accept

Page 29: TCP Lecture 13 November 13, 2000. TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service

TCP Segment Header (cont.)

Checksum (16 bits): the 16 bit one’s compliment of the one’s complement sum of all 16 bit words in the header and text (payload).

Urgent Pointer (16 bits): current value of the urgent pointer as an offset from the sequence number of this segment.

Options (variable): multiples of 8 bits.