When will a TCP network packet be fragmented at the application layer?

后端 未结 10 1787
借酒劲吻你
借酒劲吻你 2020-11-30 02:59

When will a TCP packet be fragmented at the application layer? When a TCP packet is sent from an application, will the recipient at the application layer ever receive the p

10条回答
  •  [愿得一人]
    2020-11-30 03:54

    The question makes an assumption that is not true -- TCP does not deliver packets to its endpoints, rather, it sends a stream of bytes (octets). If an application writes two strings into TCP, it may be delivered as one string on the other end; likewise, one string may be delivered as two (or more) strings on the other end.

    RFC 793, Section 1.5:

    "The TCP is able to transfer a continuous stream of octets in each direction between its users by packaging some number of octets into segments for transmission through the internet system."

    The key words being continuous stream of octets (bytes).

    RFC 793, Section 2.8:

    "There is no necessary relationship between push functions and segment boundaries. The data in any particular segment may be the result of a single SEND call, in whole or part, or of multiple SEND calls."

    The entirety of section 2.8 is relevant.

提交回复
热议问题