Pular para o conteúdo principal

[EN] TCP: The Engineering of Reliability and Flow Control on the Internet


[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

Postagens mais visitadas deste blog

[ES] QUIC: La Evolución de la Capa de Transporte y el Fin del Bloqueo de Fila

El protocolo QUIC representa la evolución definitiva de la capa de transporte, fusionando la agilidad del UDP con la confiabilidad del TCP y la seguridad nativa de TLS 1.3 en una única pila integrada. Diseñado originalmente por Google y ahora estandarizado como RFC 9000, QUIC resuelve la mayor limitación estructural de la internet moderna: el bloqueo de inicio de línea (Head-of-Line Blocking), permitiendo que la web sea no solo más rápida, sino fundamentalmente más resiliente en redes inestables. Arquitectura de Conocimiento: Estudie Antes Para comprender la complejidad de QUIC, es imperativo que haya asimilado los conceptos de: UDP: El motor de transporte sin estado que QUIC utiliza como vehículo. TCP: El paradigma de conexión que QUIC busca optimizar y reemplazar. TLS 1.3: El protocolo de cifrado que es inseparable del transporte en QUIC. Concepto: La Eliminación del Head-of-Line Blocking En el TCP clásico, si un solo paquete de una conexión multiplexada (que cont...

[PT] TCP: O Arquiteto da Confiabilidade em Redes de Dados

Enquanto o Protocolo de Internet (IP) é frequentemente comparado ao sistema de endereçamento de envelopes, o Transmission Control Protocol (TCP) é o serviço de correio registrado que garante que o conteúdo não apenas chegue ao destino, mas chegue na ordem correta e sem corrupção de dados. Em uma rede inerentemente não confiável e baseada em melhor esforço, o TCP atua como a camada lógica que transforma o caos da comutação de pacotes em um fluxo contínuo e ordenado de informações. Ele é um protocolo orientado à conexão, o que significa que antes de qualquer dado ser transmitido, uma sessão formal deve ser estabelecida e mantida entre as duas extremidades. Pré-requisitos e Contexto Técnico Para compreender profundamente o funcionamento do TCP, é recomendável que o leitor esteja familiarizado com os conceitos de endereçamento e roteamento do IP (Internet Protocol) , conforme explorado em nossas publicações anteriores. O TCP opera sobre a camada IP, adicionando a inteligência de contro...

[ES] Jitter: La Ingeniería de la Resiliencia contra la Inestabilidad de la Red

[ES] Jitter: La Ingeniería de la Resiliencia contra la Inestabilidad de la Red El Jitter, técnicamente conocido como Variación del Retraso de Paquetes (PDV), es el enemigo invisible de las comunicaciones en tiempo real, representando la inestabilidad en el tiempo de llegada de los datos al destino. Mientras que una latencia alta y constante (RTT estable) puede compensarse, el Jitter ,la oscilación impredecible de ese retraso, causa distorsiones fatales en flujos de audio y vídeo, exigiendo estrategias sofisticadas de búfer para garantizar la inteligibilidad de la información. Arquitectura de Conocimiento Estudie Antes RTT La base de tiempo sobre la cual se mide el Jitter. UDP El transporte que expone la aplicación directamente al Jitter de la red. Concepto El Origen de la Inconsistencia El Jitter ocurre principalmente en los búferes de los enrutadores intermedios. Cuando el tráfico de internet oscila, los paquetes de una misma llamada de vídeo pueden enfrentar colas de tamaños difer...