Computer Network Tutorial

Introduction of Computer Network Types of Computer Network Network Topology Computer Networking Architecture Transmission Modes (Data Flow) Basic Networking Devices Integrate Services Digital Network (ISDN)


OSI Model TCP/IP Model

Physical Layer

Digital Transmission Analog Transmission Transmission Media Switching

Data Link Layer

Error detection and Error correction Data Link Control Multiple Access Aloha

Network Layer

Network Layer - Logical Address Address Mapping Unicast Routing Protocol

Transport Layer

Process to Process Delivery User Datagram Protocol Transmission Control Protocol Stream Control Transmission Protocol Session Layer and Presentation Layer

Application Layer

Domain Name System Application Protocol E-mail Cryptography


Classes of Routing Protocols Classification of Routing Algorithms Controlled Access Protocols in Computer Networks Differences between IPv4 and IPv6 Fixed and Flooding Routing Algorithms Advantages and Disadvantages of Fibre Optics Cable APIPA Difference between Active and Passive FTP Fiber Optics and its Types Method of Joining and Fusion of Fiber Optic Cable Define Framing in Computer Network Disadvantages of Computer Network Mesh Topology Diagram in Computer Network Ring Topology in Computer Network Star Topology in Computer Networks 4G Mobile Communication Technology Advantages and Disadvantages of LAN Advantages and Disadvantages of MAN Advantages and Disadvantages of WAN Application Layer in OSI Model Cyclic Redundancy Check Example Data link layer in OSI model Difference between Transport and Network Layer Hamming Code Example Network Layer in OSI Model Session Layer in OSI Model Transport Layer in OSI Model Two Port Network in Computer Networks Uses of Computer Networks What is Computer Network What is Framing in a Computer Network Advantages and Disadvantages of Bus Topology Difference between Star Topology and Bus Topology Subnetting in Computer Network Subnetting Questions and Answers What is Bus Topology What is Network Topology and Types in Computer Networks Access Control in Networking Basic Characteristics of Computer Network Benefits of SOCKS5 Proxy in Computer Networks Computer Network viva Questions Difference between BOOTP and RARP Difference Between Network Topologies and Network Protocols Difference between NFC and RFID Difference Between Point-to-Point Link and star Topology Network Differences Between MSS and MTU Differences Between Trunk Port and Access Port Different Modes of Communication in Computer Networks MIME Protocol in Computer Networks Modes of Communication in Computer Networks Network Attack in Computer Network Port Address in Networking Simplest Protocol in Computer Network Sliding Window Protocol in Computer Network Stop And Wait Protocol in Computer Networks TCP 3-Way Handshake Process in Computer Networks What is a Proxy Server What is APPN What is ICMP Protocol What is Point-to-Point Protocol What is Port Address in Networking What is the HDLC Protocol What is VRRP Protocol Difference Between Analog and Digital Signals Difference Between Hub and Repeater Difference between Repeater and Switch Difference Between Transparent Bridge and Source Routing Bridge Source Routing Bridge in Computer Networks Transparent Bridge in Computer Networks Transport Protocol in Computer Networks Types of CSMA in Computer Networks What is Wired and Wireless Networking


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.


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.


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.


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.


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.