Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.

Similar presentations


Presentation on theme: "CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina."— Presentation transcript:

1 CSCE 515: Computer Network Programming Chin-Tser Huang huangct@cse.sc.edu University of South Carolina

2 2/24/20052 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 2/24/20053 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 2/24/20054 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 2/24/20055 TCP Header 0151631 20 bytes destination port number urgent pointerTCP checksum option (if any) source port number window size sequence number acknowledgment number header length reserved URGURG ACKACK PSHPSH RSTRST SYNSYN FINFIN data (if any)

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

7 2/24/20057 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 2/24/20058 Next Class TCP data flow Read TI Ch. 19, 20


Download ppt "CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina."

Similar presentations


Ads by Google