繁体   English   中英

TCP FIN 字节值?

[英]TCP FIN byte value?

我的问题实际上是两个部分:

从发件人的角度来看,

  1. in addition to TCP header FIN flag, is it true that TCP layer injects (or more like appending since it should be at the end of the stream) an artificial byte in the stream, meaning this byte is part of the TCP payload?
  2. 如果是这样,这个字节的值是多少?

从接收者的角度来看,

  1. TCP 层和应用程序都需要知道这个 FIN 标志/字节。 那么TCP层真的只看FIN标志,没有对stream中的字节进行特殊处理吗?
  2. 申请如何通知? 通过 FIN 标志,或者,通过 stream 中的这个特殊字节?
  3. 什么时候通知申请? 就在 TCP 层接收带有 FIN 标志的段时,或者,当该段最终冒泡接收器的 TCP 缓冲区时?
  4. If the application does not get special notification until the segment that has the FIN flag eventually bubbles up TCP buffer, it means TCP layer has to somehow mark the buffer, since the TCP header should be stripped already. 那么它是如何标记FIN的呢?

in addition to TCP header FIN flag, is it true that TCP layer injects (or more like appending since it should be at the end of the stream) an artificial byte in the stream, meaning this byte is part of the TCP payload?

没有。没有实际的字节注入,只是增加了 TCP 序列号,因此很明显 ACK 是针对 FIN 而不是一些先前的数据。

这也意味着如果接收到 FIN,则不会将特殊字节放入套接字缓冲区并传递给应用程序,而是将套接字缓冲区标记为完成。 应用程序对空且“完成”的套接字缓冲区的读取将返回缓冲区中没有更多数据并且永远不会,因此应用程序知道对等方已停止发送(即套接字关闭以写入或套接字关闭) .

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM