TCP 能否处理在单个连接中永不结束的流?
这更多的是一个理论问题。假设有一个无限的数据源,它每秒不断地推送数据。某些设备监视“太阳事件”,并每纳秒连续向后端系统发送事件(这意味着它是连续流)。后端系统希望通过 TCP 将实时数据传输到另一个远程系统。 TCP 能否处理单个 TCP 连接中的无限数据流?
我知道序列号限制,但使用 TCP 时间戳,序列号将正确环绕,并且不会造成问题。另外,假设系统有几 TB 的内存(可以认为接近无限内存模型)。如果我只给出流开始的基地址,TCP 是否能够在单个 TCP 连接中连续进行(分段、传输、重新传输等),而不必担心数据是否结束?
我的猜测是,由于 TCP 从不期望任何流长度参数,因此它应该是可能的。我说得对吗?
This is more of a theoretical question. Let us say that there is an infinite data source, which keeps pushing data every second. Some device which monitors "Solar events", and sends events to a back-end system continuously, every nanosecond ( to mean its a continuous stream ). And the back-end system wants to transmit the live data to another remote system over TCP. Can TCP handle the infinite data stream in a single TCP connection ?
I'm aware of the sequence number limitation, but with TCP timestamps, the sequence numbers will properly wrap around, and it should not pose a problem. Also, assume that the system has several terabytes of memory ( which can be considered close to an infinite memory model ). If I just give the base address of where the stream starts, will TCP able to proceed ( segmenting, transmitting, re-transmitting .. etc ) continuously in a single TCP connection, without bothering on whether the data ever ends ?
My guess is that since TCP never expects any stream length parameter, it should be possible. Am I right ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,是的。只要数据是字节(“八位字节”)对齐的,TCP 流上的数据就可以通过管道传送到任何地方(参见任何路由器)。 TCP 通信是字节流 - 它不关心消息边界。窗口协议具有内置的流量控制,因此它应该可以正常工作。
Basically, yes. As long as the data is byte, ('octet'), aligned, data on TCP streams can be piped anywhere, (see any router). TCP comms is a byte stream - it doesn't care about message boundaries. The windowed protocol has built-in flow-control, so it should all work.