Explain The TCP Services in The Computer Network.: Stream Delivery Service
Explain The TCP Services in The Computer Network.: Stream Delivery Service
Following are some of the services offered by the Transmission Control Protocol (TCP) to the processes at
the application layer:
All the above mentioned TCP services are explained below in detail.
TCP creates a working environment so that the sending and receiving procedures are connected by an
imaginary "tube", as shown in the figure below:
Sending and Receiving Buffers
The sending and receiving processes cannot produce and receive data at the same speed. Hence, TCP
needs a buffer for storage.
There are two methods of buffers used in each dissection, which are as follows:
Sending Buffer
Receiving Buffer
A buffer can be implemented by using a circular array of 1-byte location, as shown in the figure below. The
figure shows the movement of data in one direction on the sending side.
Empty Locations.
Locations that contain the bytes which have been sent, but not acknowledged. These bytes are kept in the
buffer till an acknowledgment is received.
The location that contains the bytes which are to be sent by the sending TCP
In practice, the TCP may send only a port of data due to the slowness of the receiving process or congestion
in the network.
The buffer at the receiver is divided into two parts as mentioned below:
The part was containing empty locations.
The part was containing the received bytes, which the sending process can consume.
We need one more step before sending the data on the Internet Protocol (IP) layer as a TCP service
provider. It needs to send data in the form of packets and not as a stream of bytes.
At the transport layer, TCP groups several bytes into a packet and this is called a segment. A header is
added to each segment to exercise control.
The segment is encapsulated in an IP diagram and then transmitted. The entire operation is transparent to
the receiving process. The segment may be deceived out of order, lost or corrupted when it receives the
receiving end.
The figure given below shows how the segments are created from the bytes in the buffers:
The segments are not of the same size. Each segment can carry hundreds of bytes.
Full-Duplex Service
TCP offers a full-duplex service where the data can flow in both directions simultaneously. Each TCP will
then have a sending buffer and receiving buffer. The TCP segments are sent in both directions.
Connection-Oriented Service
We are already aware that the TCP is a connection-oriented protocol. When a process wants to
communicate (send and receive) with another process (process -2), the sequence of operations is as follows:
The type of connection in TCP is not physical, but it is virtual. The TCP segment encapsulated in an IP
datagram can be sent out of order. These segments can get lost or corrupted and may have to be resend.
Each segment may take a different path to reach the destination.
Reliable Service
TCP is a reliable transport protocol. It uses an acknowledgment mechanism for checking the safe and sound
arrival of data.