Trusted answers to developer questions

What is TCP?

Get the Learn to Code Starter Pack

Break into tech with the logic & computer science skills you’d learn in a bootcamp or university — at a fraction of the cost. Educative's hand-on curriculum is perfect for new learners hoping to launch a career.

Transmission Control Protocol (TCP) is a transport layer protocol used to create a connection between applications so that they can exchange data over a communication network.

Key features

  • TCP provides a process for communication. Port numbers are appended in the header of the packet to enable this.

  • A three-way handshaking process takes place to open a connection in TCP; hence, it is called a connection-oriented protocol.

  • A packet (called a segment in case of TCP) contains a checksum field used for error control.

  • TCP prevents the sender from sending in more data than the receiver can handle with the window size provided by the receiver.

  • It guarantees the reliable delivery of segments. Incase of segment loss or corruption, segments are re-transmitted.

  • It reassembles the packets in the correct order at the receiver side.

  • It uses a congestion avoidance algorithm to avoid the network from being congested.

TCP segment

The TCP segment consists of a header and data. The following illustration goes over its structure:

A TCP segment
A TCP segment

Applications that use TCP

TCP is used where reliable in-order delivery of packets is needed. Such applications include:

  • Web surfing

  • Sending and receiving emails

RELATED TAGS

networks
protocols
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?