What is TCP? Advantages and How Does it Work?
The Internet has become an indispensable part of our daily lives. However, not everyone fully understands how the Internet works. The transmission method that the Internet uses is TCP/IP, one of the most popular transmission methods today. Let's learn more about the TCP/IP method with TipsMake in the article below.
What is TCP?
TCP (Transmission Control Protocol) is an important network protocol used in transmitting data over a network. A protocol in the network scope is a set of rules and procedures that control the implementation of data transmission so that everyone in the world regardless of geographical location, regardless of the application, software they are using can operate in the same way called TCP.
TCP is often paired with IP (Internet Protocol) in a pair called TCP/IP. You may have seen this term in the network settings of your computer, smartphone, or handheld device. IP handles addressing and forwarding packets from source to destination while TCP controls the reliability of transmission.
TCP is an important network protocol used in data transmission.
Structure of TCP
The structure of a TCP packet includes the following fields:
Source Port (16 bits): The port number of the computer sending the data. This information is necessary to identify the session of a specific protocol at the application layer.
Destination Port (16 bits): The port number of the computer receiving the data. Similar to the Source Port, it helps identify the protocol session on the application layer.
Sequence Number (32 bits): Used to number packets in order. Using this sequence number, the number of bytes transmitted can be calculated.
Acknowledgment Number (32 bits): Used to acknowledge receipt of the packet and to indicate what byte is expected next.
Data Offset (4 bits): Specifies the length of the entire header, in words (1 word = 4 bytes)23.
Reserved (4 bit): Always set to 023.
Flags (9 bits):
- URG: Prioritize this data over other data.
- ACK: Used for confirmation.
- PSH: Segment requires push function.
- RST: Used to terminate the connection.
Window Size (16 bits): Number of bytes the device is willing to accept.
Checksum (16 bit): Checks the entire TCP segment for errors.
Urgent Pointer (16 bit): Used when data priority is required.
Options (up to 32 bits): Allows additional features to be added to TCP.
Data: Data from the upper layer is transmitted.
TCP Header: Length is 20 Bytes = 160 bits
TCP's mission
Establish connection
TCP establishes a connection between the sending and receiving machines before transmitting data through a process called handshaking to synchronize information between machines. This process includes:
- Send SYN packet: The sender initiates the connection request by sending a SYN packet to the receiver.
- Response with SYN-ACK packet: The receiver receives the packet and responds with a SYN-ACK packet.
- Connection confirmation: The sender sends back an ACK packet to confirm that the connection has been successfully established.
Fragmentation and packaging of messages
Large data is fragmented into smaller packets before transmission. Each packet includes destination address, source address, sequence number, and checksum to ensure integrity.
Data flow control
TCP uses a sliding window mechanism to adjust the rate at which data is transmitted between the sender and receiver. This helps avoid network overload and ensures that data is not lost during transmission.
Reliability
TCP ensures reliability in data transmission through mechanisms such as:
- Error checking: Uses a checksum algorithm to detect errors in packets.
- Acknowledgement and retransmission: If a packet is lost or corrupted, TCP will request that the packet be resent to ensure data integrity.
Quick connect closure
When the data transfer is complete, TCP uses a process called the four-way handshake to close the connection. This process involves sending a FIN packet from the sender, receiving an ACK response from the receiver, and finally an acknowledgement from the sender.
How does TCP work?
TCP labels packets with numbers. TCP also ensures that data arrives at its destination within a specified time (a few hundred milliseconds called a timeout) and adheres to a number of other technical rules. For each packet received, the sending device is notified via a packet called an acknowledgement. After the timeout expires, if no acknowledgement is received, the source sends a copy of the lost or delayed packet. Out-of-sequence packets are also not acknowledged. This ensures that all data packets are always assembled in order, without gaps, within a specified and acceptable timeout.
TCP Address
While IP has a complete mechanism for assigning addresses called IP addresses, TCP does not have such a complex addressing system. Rather, TCP does not need this system. TCP simply uses numbers provided by the device it is running on to determine where to receive and transmit packets, for which service. These numbers are called ports. For example, web browsers often use port 80 for TCP, port 25 for email, etc. Port numbers are often accompanied by IP addresses to indicate a service, for example: 192.168.66.5:80.
Applications of TCP protocol
TCP/IP is used to connect information on the Internet. Users can provide information remotely, send emails, transfer files, images or distribute web pages on the Internet. This method also allows remote access to servers, changing the status of information transmitted in the Internet environment. With the TCP/IP protocol, users can easily change the way information is expressed through basic protocols or protocols at each layer when information is transmitted. Thanks to that, information transmission operations will be more accurate and efficient.
You should read it
- 15 great tips to help defeat insomnia and easily wake up in the morning
- How to handle when YouTube videos loaded with IDM is corrupted
- How to get back excess money on Amazon after buying
- Cheap laptops - Hope for poor children
- Web Module in Node.js
- Instructions for installing Windows XP
- 10 new features of Linux Ubuntu 19.04
- Good Lock 2020 already exists, supports Android 10 and One UI 2.0 with many interesting changes
May be interested
- What is Selenium? Overview of information you need to know about Seleniumselenium is a free, open source, cross-browser, cross-platform automated testing toolkit for web applications.
- What is Microsoft Access? Instructions on how to use Microsoft Accessmicrosoft access is a relational database management system that enables users to store and manage information.
- What is Comodo Positive SSL? Comparison between Positive SSL and Essential SSLcomodo positive ssl is a type of ssl security certificate provided by sectigo, formerly known as comodo.
- What is Subnetting and its advantages and disadvantages?subnetting, also known as 'network fragmentation', is the process of dividing a large network into several smaller subnets.
- What is DAS? Concept and how Direct Attached Storage worksdas (direct attached storage) is a type of storage method where storage devices such as hard drives, ssds or external storage devices are directly connected to the computer.
- What is ACID? Learn about 4 important properties in databasesacid is an acronym that includes four basic properties: atomicity, consistency, isolation, and durability.