tcp - TCP/IP中的Nagle算法

标签 tcp packet

你能举例解释一下tcp/ip中nagle算法的概念吗?

最佳答案

我认为Wikipedia它的开头段落做得很好。

Nagle's document, Congestion Control in IP/TCP Internetworks (RFC 896) describes what he called the 'small packet problem', where an application repeatedly emits data in small chunks, frequently only 1 byte in size. Since TCP packets have a 40 byte header (20 bytes for TCP, 20 bytes for IPv4), this results in a 41 byte packet for 1 byte of useful information, a huge overhead. This situation often occurs in Telnet sessions, where most keypresses generate a single byte of data which is transmitted immediately. Worse, over slow links, many such packets can be in transit at the same time, potentially leading to congestion collapse.

Nagle's algorithm works by combining a number of small outgoing messages, and sending them all at once. Specifically, as long as there is a sent packet for which the sender has received no acknowledgment, the sender should keep buffering its output until it has a full packet's worth of output, so that output can be sent all at once.

关于tcp - TCP/IP中的Nagle算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3494807/

相关文章:

linux - 简单的原始数据包捕获和发送程序

tcp - 服务器发送了 FIN 但在客户端保持事件状态后未接受任何数据,导致 503 错误

c# - 无法通过 TCP 连接连接到 Android

sockets - 在 Windows 中如何检测哪个程序正在监听 TCP/IP 端口?

C# 读取字节数组

c - Linux下C语言包生成率测量

java - 使用 Java 测量数据包丢失

python - 使用 Scapy 获取 TCP 标志

Java Spring-集成TCP刷新控制

JQuery GET 请求 TCP 套接字服务器