[EN] TCP: The Engineering of Reliability and Flow Control on the Internet
The functioning of the modern internet depends on a basic but extremely difficult premise to execute: reliability. When you download a file, send an email, or load a web page, every bit of information must reach its destination exactly as it was sent, in the correct order and without loss. The one responsible for this invisible feat is the Transmission Control Protocol or simply TCP.
While the IP Protocol (Internet Protocol) handles addressing and routing, functioning like the system of streets and avenues, TCP is the express delivery service that ensures each packet not only arrives but is signed and checked. Without TCP, the world wide web would be a chaotic flow of fragmented data, where images would arrive scrambled and documents would have paragraphs out of place.
Engineering Specifications
| Base Protocol | Creator | Creation Date | OSI Layer | Standard Ports | Format |
| : | : | : | : | : | : |
| TCP | Vint Cerf and Bob Kahn | 1974 (RFC 675) | 4 (Transport) | 80, 443, 22, 25 | Segmented (20-60 bytes) |
Operation and Internal Structure: TCP
TCP operates at the transport layer of the OSI model and is classified as a connection-oriented protocol. This means that before any useful data is transmitted, the protocol establishes a logical session between the sender and the receiver. This process is technically known as the Three-Way Handshake.
The Three-Way Handshake (SYN, SYN-ACK, ACK)
Low-level mechanics begin with sending a segment containing the SYN (Synchronize) flag. The client requests the synchronization of sequence numbers. The server, upon receiving it, responds with a SYN-ACK (Synchronize-Acknowledgment), indicating it received the request and also wishes to synchronize. Finally, the client sends an ACK (Acknowledgment), confirming receipt. From this state, the connection is considered Established and payload transfer begins.
Sequence Numbers and Acknowledgment
Unlike simpler protocols, TCP assigns a sequence number to each byte sent. This allows the receiver to reorganize segments that arrive out of order due to fluctuations in IP routes. If a segment is lost, the receiver notices the gap in numbering and does not send the acknowledgment (ACK) for that specific block, which triggers an automatic retransmission by the sender.
Flow Control and Sliding Window
One of the most critical fields in the TCP header is the Window Size. It informs the sender how many bytes the receiver is capable of processing before becoming overwhelmed. If the receiver's buffer starts to fill up, it decreases the window value in the next ACK packet. The sender, in turn, reduces the sending speed. This dynamic feedback mechanism prevents network congestion and memory overflow in end devices.
The Meticulous Messenger Analogy
To understand TCP without having to look at binary codes, imagine you are building a house and need 10,000 numbered bricks to be delivered by a truck driver to a site on the other side of town.
The IP Protocol would be the truck driver, who knows the way and the streets. However, the driver doesn't care if the bricks fall out of the truck bed or if they arrive out of order. TCP, in this scenario, would be an engineer sitting next to the driver with a clipboard.
Before leaving, the engineer calls the foreman at the site (Three-Way Handshake) and asks: "Can we start the shipment?". The foreman replies: "Yes, I'm ready". The engineer confirms: "Ok, the first truck is leaving".
During the trip, if the truck goes through a pothole and brick number 452 falls out, the foreman at the destination will notice that he received 451 and then 453. He immediately informs the engineer: "I received up to 451, but 452 didn't arrive". The engineer then arranges for the exclusive resending of the lost brick.
Additionally, if the foreman at the site realizes that the helpers are not able to unload fast enough, he signals the engineer to decrease the frequency of the trucks (Flow Control). TCP ensures that at the end of the day, the house is built exactly with the 10,000 bricks, with no missing pieces and in the correct position.
Writing for the user, but thinking like an engineer
1. How does the TCP protocol manage flow and error control in saturated networks?
[Search on Google](https://www.google.com/search?q=TCP+protocol+flow+control+engineering)
2. What are the main security vulnerabilities documented for TCP recently?
[Search on Google](https://www.google.com/search?q=TCP+protocol+security+vulnerabilities+CVE)
3. How did the evolution of TCP impact the scalability of the modern internet?
[Search on Google](https://www.google.com/search?q=TCP+protocol+history+scalability+impact)
Comentários
Postar um comentário