×

TCP

TCP is a transport layer protocol that helps to establish connections. TCP means Transmission Control Protocol. It guarantees secure data transmission between two network-connected devices. The data can only be sent when a secure connection has been established.

The receiver sends an acknowledgment of receiving the data after receiving it. To transfer data between devices, it uses data blocks. It has more system functionalities, including flow control, error control, and congestion control, but it transmits data slowly. The TCP header is 20-60 bytes long and contains a variety of information to improve reliability.  TCP is used by protocols like HTTP, FTP, etc. for secure data transmission over networks because of its dependability.

Working Of TCP

To ensure that every message reaches its destination without being affected, the TCP/IP model breaks the data up into small bundles, which are then reassembled into the original message on the other end.

Instead of sending everything at once, sending the information in smaller bundles of information makes it easier to maintain efficiency. When a message is divided into bundles, if one route is cramped and the destination is the same, then the bundles may travel along different routes.

For example, when a user wants to open a web page on the internet, the server processes that request and sends the user response in the form of an HTML page. The HTTP Protocol is the one that the server uses. To send the HTML file, the HTTP asks the TCP layer to establish the necessary connection.

The data is now divided into small packets by the TCP, which sends them to the IP layer. The packets are transmitted via various routes to their destination. When the transmission is completed and all packets have been received, the TCP layer in the user's system acknowledges.

Features of TCP

TCP has following features:

Stream Data Transfer

Applications at the Application Layer send a continuous stream of bytes to the lower layers. It is TCP's responsibility to divide this byte stream into packets called TCP segments, which are sent over the IP layer to the destination device. The application doesn't need to worry about the byte stream data packets being corrupted.

Reliable

TCP's most important feature is its ability to deliver data reliably. To ensure dependability, the data that is corrupted, misplaced, duplicated, or delivered by the Network Layer must be restored by TCP. Each byte sent over TCP has a unique sequence number, and the receiving TCP layer is required to respond for each byte. The data is retransmitted if acknowledgment is not received by the sender.

Addressing Of TCP

Port numbers are used for TCP communication between distant hosts (TSAPs). The port numbers, which can range from 0 to 65535, are divided as follows:

  • Device Ports (0 – 1023)
  • User Ports ( 1024 – 49151)
  • Dynamic/Private Ports (49152 – 65535)

Bandwidth Management

TCP employs the concept of window size to meet the need of bandwidth management. The window size tells the sender at the remote end that how many data byte segments can be received at this end.

The window size decreases to half, and the slow start phase resumes if an acknowledgment is missed.

Error Control and Free Control

The application process that the data segment is determined by TCP using the port numbers. It also uses sequence numbers to synchronize with the remote host. Each sent and received data segment has a unique sequence number. The sender is informed by the last data segment that the receiver has received when it receives an ACK. Using the sequence number of a recently received packet, the Receiver can determine the last segment that the Sender sent.

If the sequence number of a recently received segment does not match the sequence number expected by the receiver, the segment is discarded and NACK is returned.

Connection Management

TCP operates using a Server/Client model. The server either accepts or rejects the connection request made by the client. Connection management is accomplished through three-way handshaking.

Establishment of Connection

The client initiates the connection and sends the segment, which includes a Sequence number. The server responds with its Sequence number and an ACK of the client's segment that is greater than the client's Sequence number.

After receiving an ACK for its segment, the client sends an acknowledgment of the Server's response.

Release

TCP segments with the FIN flag set to 1 can be sent either by the server or the client. The TCP communication direction is closed and the connection is released when the receiving end responds with an acknowledging FIN.

Multiplex

Multiplexing is the process of combining two or more data streams into a single session. A well-defined port number that identifies the application process is always referred when a TCP client establishes a connection with a server. A port number is randomly selected by the client from a private port number pool.

TCP multiplexing allows a client to communicate with multiple application processes at once. For example, a customer requests a web page that contains different types of data (HTTP, SMTP, FTP, etc.) The TCP session timeout is extended and the session is kept open for longer time to avoid the overhead of the three-way handshake.

Because of this, the client system can receive multiple connections over a single virtual connection. If the timeout is excessively long, these virtual connections are bad for servers.

Congestion Control

Congestion occurs when a large amount of data is fed into a system that is incapable of handling it. TCP manages congestion using the Window mechanism. TCP specifies a window size that tells the other end how many data segments to send. TCP can use one of three algorithms to control congestion:

  • Additive increase, Multiplicative Decrease
  • Slow Start
  • Timeout React

Crash Recovery

TCP is a very dependable protocol. It assigns a sequence number to each byte sent in a segment. It provides a feedback mechanism, through which host acknowledges a packet when it arrives with the awaited next sequence number (if it is not the last segment).

A TPDU broadcast is sent to all of the hosts on a TCP Server when it restarts after crashing in the middle of a conversation. After that, the hosts can send the final data segment, which was never unacknowledged, and continue.

Advantages Of TCP

  • It is a dependable protocol.
  • It includes an error-checking mechanism as well as a recovery mechanism.
  • It regulates flow.
  • It ensures that the data arrives at its intended destination in the exact order in which it was sent.
  • No organization or individual owns the Open Protocol.

Disadvantages Of TCP

  • TCP was designed for Wide Area Networks, so its size may be an issue for small networks with limited resources.
  • TCP operates at several layers, which can slow down network performance.
  • It is not generic in any way. In other words, it can only represent the TCP/IP suite of protocols.

Conclusion

TCP is a transport layer protocol that helps to establish connections. TCP means Transmission Control Protocol. It guarantees secure data transmission between two network-connected devices. The data can only be sent when a secure connection has been established.


Related Topics

OSI Model

OSI Model: OSI stands for Open Systems Interconnection. The ISO (International Standards Organization) was introduced the OSI model in 1983. The OSI model is a standard reference model for communication between...

6 minutes read.

Data Link Control

Data Link Control Data-link control is the main function of the data link layer. It deals with the configuration and coordination for connection between two neighboring nodes: node-to-node communication. The task...

10 minutes read.

4G Mobile Communication Technology

What is 4G? 4G is a fourth-generation wireless or mobile communication system, succeeding 3G (third generation) wireless communication and preceding 5G (fifth generation) communication. It is based on the capabilities defined by...

4 minutes read.

Network Layer in OSI Model

This article will help you in getting a good understanding of the Network Layer in the OSI model. The network layer is the third layer of the OSI Model from the...

4 minutes read.

Advantages and Disadvantages of WAN

Before we move to advantages and disadvantages of WAN, first we discuss about what is WAN and what are its features. A wide area network is a vast network of information...

4 minutes read.

Advantages and Disadvantages of Fibre Optics Cable

What is Fibre Optics Cable? A fibre optics cable is made of plastic or fibre, which is used to transmit the data. In fibre optics cable, the data is sent along...

3 minutes read.

Transmission Control Protocol

Transmission Control Protocol: TCP stands for Transmission Control Protocol. It was introduced in 1974. It is a connection-oriented and reliable protocol. It establishes a connection between the source and destination...

3 minutes read.

Uses of Computer Networks

During the twentieth century, the most significant technology is information collecting, processing, and distribution. Computers and communications have been integrated, which has considerably influenced the organization of computer systems. The previous...

6 minutes read.

IPv4 vs IPv6

What is an IP? The process or protocol used to transmit data from one computer to another over the internet is known as Internet Protocol (IP). Every computer connected to the...

5 minutes read.

Types of Computer Network: LAN, MAN, WAN and PAN

PAN: Personal Area Network PAN stands for Personal Area Network. It is designed for a very short distance (1 to10 m), such as a single room. This type of network can...

3 minutes read.

Differences between IPv4 and IPv6

Introduction In this tutorial, we will discuss the basic differences between IPv4 and IPv6 protocols. Definition of Internet Protocols Vint Cerf and Bob Kahn's initial Transmission Control Program had a connectionless datagram service...

4 minutes read.

What is Computer Network?

 A computer network is a collection of interconnected devices, such as computers, servers, routers, and switches, that are connected together to share resources and exchange data. These devices use a...

6 minutes read.

TCP vs UDP

Transmission Control Protocol (TCP) and User Datagram Protocol are the two most popular Internet protocols (IPs). TCP is a connection-oriented protocol, which means that once a connection has been made,...

4 minutes read.

Computer Network Tutorial

What is Data Communication and Computer Network? Data Communication is the process of exchanging digital data between two or more computers that act as source and receiver through wireless media or...

7 minutes read.

Process-to-Process Delivery

Process-to-Process Delivery: A transport-layer protocol's first task is to perform process-to-process delivery. A process is an entity of the application layer which uses the services of the transport layer. Two...

2 minutes read.

Session Layer in OSI Model

This article will help you in getting a better understanding of the Session layer in the OSI model. The session layer is the fifth layer from the bottom in the OSI...

4 minutes read.

Cryptography in Computer Network

Cryptography: Cryptography is derived from the Greek word, which means "Hidden Secrets." In other words, it is an art in which we can protect our data and information. Through cryptography,...

2 minutes read.

Supernetting in Network Layer

Introduction Supernetting is one of the main topics in data communication networks or computer networks. The network aggregation goes by many names, such as supernetting, route aggregation, summarization, and so on....

6 minutes read.

Aloha

Aloha Norman Abramson and his colleagues were developed aloha at the University of Hawaii in the 1970s. ALOHA is a Multiple Access Protocol which is used for random access in the...

3 minutes read.

Method of Joining and Fusion of Fiber Optic Cable

What is Fiber Optics Cable? Fiber optics cable transforms the information at a light pulse. We can transfer voice, data, and video through the fiber optics cable. The fiber optics cable...

3 minutes read.