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

[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...

[ EN ] OSPF: The Mathematical Rigor of Link-State Routing Efficiency

[ EN ] OSPF: The Mathematical Rigor of Link-State Routing Efficiency OSPF stands as the deterministic heart of modern enterprise networks, utilizing the Dijkstra algorithm to transform raw link data into a loop-free topology of shortest paths. While distance-vector protocols rely on second-hand information, OSPF (Open Shortest Path First) demands a complete, synchronized map of the entire area, ensuring that every routing decision is based on an absolute global truth rather than neighbor-based rumors. Knowledge Architecture Study First Genesis and Historical Context Internal Functioning and Structure OSPF At the core of OSPF lies the Shortest Path First (SPF) algorithm, also known as Dijkstra's algorithm. To understand OSPF, one must understand that it does not simply "exchange routes"; it exchanges Link-State Advertisements (LSAs). These LSAs describe the state of every interface, the cost associated with it, and the neighbors connected to it. These advertisements are...

[ PT ] OSPF: A Engenharia de Estado de Enlace e a Eficiência do Algoritmo de Dijkstra

[ PT ] OSPF: A Engenharia de Estado de Enlace e a Eficiência do Algoritmo de Dijkstra O Open Shortest Path First (OSPF) é a espinha dorsal da conectividade dinâmica em redes corporativas, utilizando a inteligência do estado de enlace para garantir que cada roteador possua um mapa completo e sincronizado da topologia. Ao contrário de protocolos baseados em vetores de distância, o OSPF não confia cegamente no que seus vizinhos dizem, mas sim no que eles veem, processando essas informações através do rigor matemático do algoritmo de Dijkstra para determinar o caminho mais curto e eficiente para o tráfego de dados. Arquitetura de Conhecimento Estude Antes Funcionamento e Estrutura Interna OSPF Hello 10s / Dead: 40s (em redes Broadcast) Para aprender mais sobre o assunto [Clique aqui para investigar] a documentação oficial da RFC 2328 para OSPFv2. [Clique aqui para investigar] as diferenças detalhadas entre todos os tipos de LSAs e áreas Stub. [Clique aqui para investigar] como o OSPF...