McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Transmission Control Protocol (TCP)
-
Upload
brittany-wheeler -
Category
Documents
-
view
214 -
download
0
Transcript of McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Transmission Control Protocol (TCP)
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCPTCP• TCP is a connection-oriented protocol, it TCP is a connection-oriented protocol, it
creates a virtual connection between two TCPs creates a virtual connection between two TCPs to send data.to send data.
• TCP uses flow and error control mechanisms TCP uses flow and error control mechanisms at the transport level. at the transport level.
• It adds connection-oriented and reliability features to the services of IP.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP Services
• Process-to-Process Communication.
• Stream Delivery Service.
• Full-Duplex Communication.
• Connection-Oriented Service.
• Reliable Service.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP ServicesProcess-to-Process Communication
Like UDP, TCP provides process-to-process communication using port numbers.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP Services
Stream Delivery Service ‘Sending and
receiving buffers’
• TCP needs buffers for storagethe sending and the receiving processes may not
write or read data at the same speed.
• There are the sending buffer and the receiving buffer, one for each direction.
• It is necessary for flow and error control mechanisms.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Figure 12-5
Sending and receiving buffers
Stream of bytes
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP Services Stream Delivery Service ‘TCP segments’
• The IP layer, as a service provider for TCP, needs to send data in packets, not as a stream of bytes.
• At the transport layer, TCP groups a number of bytes together into a packet called a segment.
• TCP adds a header to each segment (for control purposes) and delivers the segment to the IP layer for transmission.
• The segments are encapsulated in IP datagrams and transmitted.
• the segments are not necessarily the same size.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
The bytes of data being transferred The bytes of data being transferred in each connection are numbered by TCP. in each connection are numbered by TCP.
The numbering starts with The numbering starts with a randomly generated number.a randomly generated number.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Example 1Example 1
Suppose a TCP connection is transferring a file of 5,000 bytes. The first byte is numbered 10,001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1,000 bytes?
SolutionThe following shows the sequence number for each segment:
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
The value of the sequence number field in a segment defines the number
of the first data byte contained in that segment.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP Connection
• In TCP, connection-oriented transmission requires three phases:
1. connection establishment.
2. data transfer.
3. and connection termination.
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
TCP Connection
Connection establishment:
• Three-way Handshaking