Transmission Control Protocol (TCP) Chuan-Ming liu CSIE NTUT Spring 04, TAIWAN CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 1 Transmission Control Protocol (TCP) Chuan-Ming Liu CSIE, NTUT Spring ’04, TAIWAN
CONTENTS TCP SERVICES NUMBERING BYTES FLOW CONTROL SILLY WINDOW SYNDROME ERROR CONTROL TCP TIMERS CONGESTION CONTROL SEGMENT OPTIONS CHECKSUM CONNECTION TCP OERATION CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 2 CONTENTS • TCP SERVICES • NUMBERING BYTES • FLOW CONTROL • SILLY WINDOW SYNDROME • ERROR CONTROL • TCP TIMERS • CONGESTION CONTROL • SEGMENT • OPTIONS • CHECKSUM • CONNECTION • TCP OERATION
Position of TcPin TcP/IP protocol suite Application SMTP‖FTP TETP DNS SNMP ··| BOOTP ayer Transport TCP UDP IGMP ICMP Network IP nyer ARP RARP Data link Underlying lan or WAN technolo Physical layer CSIE NTUT TANAN Figure 12-1
CSIE, NTUT, TAIWAN 3 Figure 12-1 Position of TCP in TCP/IP protocol suite
12.2 TCP SERVICES CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 4 TCP SERVICES 12.2
TCP Services Stream Delivery Service TCP is a stream-oriented protocol Uses imaginary tube to communicate Uses sending and receiving buffers to synchronize Group a number of bytes into a packet called segment Full-duplex Service Connection-oriented Service Reliable service CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 5 TCP Services • Stream Delivery Service – TCP is a stream-oriented protocol – Uses imaginary “tube” to communicate – Uses sending and receiving buffers to synchronize – Group a number of bytes into a packet called segment • Full-duplex Service • Connection-oriented Service • Reliable Service
123 NUMBERING BYTES CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 9 NUMBERING BYTES 12.3
Numbering Bytes TCP uses the following two fields to track the segments Sequence number Acknowledgment number These two fields use byte number, not the segment number CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 10 Numbering Bytes • TCP uses the following two fields to track the segments – Sequence number – Acknowledgment number • These two fields use byte number, not the segment number
Byte Numbers TCP numbers all the data transmitted in a connection Numbering is independent in each direction The numbering does not necessarily start from 0: it starts randomly The random number is between 0 and 232-1 For flow and error control CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 11 Byte Numbers • TCP numbers all the data transmitted in a connection • Numbering is independent in each direction • The numbering does not necessarily start from 0; it starts randomly • The random number is between 0 and 232 -1 • For flow and error control
Sequence number After bytes numbered TCP assigns a sequence number to each segment The sequence number for each sequence is the number of the first byte in that segment CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 12 Sequence Number • After bytes numbered, TCP assigns a sequence number to each segment • The sequence number for each sequence is the number of the first byte in that segment
Example 1 Imagine a TCP connection is transferring a file of 6000 bytes The first byte is numbered 10010. What are the sequence numbers for each segment if data is sent in five segments with the first four segments carrying 1, 000 bytes and the last segment carrying 2,000 bytes? CSIE NTUT TANAN
CSIE, NTUT, TAIWAN 13 Example 1 Imagine a TCP connection is transferring a file of 6000 bytes. The first byte is numbered 10010. What are the sequence numbers for each segment if data is sent in five segments with the first four segments carrying 1,000 bytes and the last segment carrying 2,000 bytes?