×

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

Unicast Routing Protocol

Unicast Routing Protocol: Unicast is a point to point communication arrangement that only occurs between the sender and receiver. Routing Information Protocol RIP is an open standard protocol that can work with...

3 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.

Network Layer: Logical Address

Network Layer - Logical Address The IP address is a 32 bit long, and it provides us a maximum of 232 addresses. These addresses are known as IPv4 addresses. The IP address...

5 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.

APIPA: Automatic Private IP Addressing

What is APIPA? APIPA stands for Automatic Private IP Addressing. It is a word used by Microsoft to describe address auto configuration, which enables a Local Area Network (LAN) computer to...

3 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.

Advantages and Disadvantages of MAN

Before we move to advantages and disadvantages of MAN, first we discuss about what is MAN and what are its examples. A network that encircles a city or a sizable university...

3 minutes read.

Error Correction and Error Detection

Error Correction and Error Detection Error correction and error detection techniques are work on the data-link layer. The data link layer ensures the frames are sent from the sender to the...

16 minutes read.

Advantages and Disadvantages of LAN

Before we move to advantages and disadvantages of LAN, first we discuss about what is LAN. Local area network is referred to by its abbreviation, LAN. A system that connects PCs...

3 minutes read.

Digital Transmission

Line Coding Digital signal is converted in the digital data that process is known as the Line Coding. That data is stored in the computer in the form of text, audio,...

4 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.

Classes of Routing Protocols

In this tutorial, we will discuss about the classes of the routing protocols. Routing: What is it? Routing in computer networks is a procedure in which the layer 3 or network layer...

7 minutes read.

Difference between Transport and Network Layer

When it comes to the Internet, it is essential to understand the different layers that make up the network. The two most important layers are Transport Layer and Network Layer....

7 minutes read.

Integrated Services Digital Network (ISDN)

Integrated Services Digital Network (ISDN): ISDN means Integrated Services Digital Network. ISDN was developed by ITU-T in the 1980s. These are digital telephony and data transport services offered by regional...

3 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.

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.

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.

Star Topology in Computer Networks

Star topology comes from or is a part of the network topology which was invented by Dr.Howard Frank. It is also to be known as star network because of its...

4 minutes read.

Analog Transmission

Digital to Analog Transmission The data is sent one device to another via analog carrier, and firstly it is converted into the analog signals. It modifies the analog signals to represent...

3 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.