1 / 29

TCP

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

shayla
Download Presentation

TCP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TCP Lecture 13 November 13, 2000

  2. TCP Background • Transmission Control Protocol (TCP) • TCP provides much of the functionality that IP lacks: reliable service

  3. 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

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

  5. 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.

  6. 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.

  7. 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.

  8. 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).

  9. 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.

  10. 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.

  11. 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.

  12. A TCP/IP Visualization

  13. 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?

  14. Packet Loss and Retransmission

  15. 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

  16. 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.

  17. Retransmission (cont.)

  18. Retransmission (cont.) • In general, adaptive retransmission sets the actual retransmission delay to be slightly longer than the actual round-trip estimate.

  19. 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.

  20. TCP Windowing

  21. 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.

  22. Handshaking & Communication Shutdown

  23. 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).

  24. 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.

  25. 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.

  26. The TCP Segment Format

  27. 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)

  28. 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

  29. 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.

More Related