1 / 8

CSCE 515 : Computer Network Programming

This article provides an overview of the Transmission Control Protocol (TCP), a reliable and connection-oriented transport layer protocol used to transmit byte streams between endpoints. It explains how TCP ensures reliability through segmentation, acknowledgement, retransmission, and flow control. TCP connection establishment and termination processes are also discussed. Suitable for students studying computer network programming.

hambrick
Download Presentation

CSCE 515 : Computer Network Programming

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. CSCE 515:Computer Network Programming Chin-Tser Huang huangct@cse.sc.edu University of South Carolina

  2. Transmission Control Protocol (TCP) • A connection-oriented transport layer protocol • Transmit byte streams between both ends of connection • Full-duplex service • Provide reliable service

  3. Reliability of TCP • Application data is broken into best sized chunks to send, called TCP segment • TCP sends acknowledgment for data received from other end of connection • TCP maintains a timer for each segment • Segment retransmitted if no acknowledgment in time • TCP maintains an end-to-end checksum on its header and data • If checksum of received segment is invalid, discard the segment

  4. Reliability of TCP (cont’d) • TCP resequences out-of-order data before passing them to the application • TCP discards duplicate data • TCP provides flow control • TCP only allows other end to send as much data as it has buffer for

  5. TCP Header 0 15 16 31 source port number destination port number sequence number acknowledgment number 20 bytes header length reserved U R G A C K P S H R S T S Y N F I N window size TCP checksum urgent pointer option (if any) data (if any)

  6. TCP Connection Establishment • Three-way handshake • Client sends a SYN segment specifying server’s port number and client’s initial sequence number (ISN) • Server responds with a SYNACK segment containing server’s ISN and acknowledging client’s SYN (client’s ISN+1) • Client responds with an ACK segment acknowledging server’s SYN (server’s ISN+1)

  7. TCP Connection Termination • Need four segments to terminate a connection because of TCP’s half-close • Either end can send a FIN when it finishes sending data • The end sending first FIN performs active close and the other end performs passive close • A TCP can still send data after receiving FIN • When receiving a FIN, respond with an ACK of received sequence number plus 1

  8. Next Class • TCP data flow • Read TI Ch. 19, 20

More Related