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

后端 未结 10 1763
借酒劲吻你
借酒劲吻你 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:43

    Different network segments can have different MTU values. In that case fragmentation can occur. For more information see TCP Maximum segment size

    This (de)fragmentation happens in the TCP layer. In the application layer there are no more packets. TCP presents a contiguous data stream to the application.

    0 讨论(0)
  • 2020-11-30 03:52

    Correct - the most informative way to see this is using Wireshark, an invaluable tool. Take the time to figure it out - has saved me several times, and gives a good reality check

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-30 03:57

    If a packet exceeds the maximum MTU of a network device it will be broken up into multiple packets. (Note most equipment is set to 1500 bytes, but this is not a necessity.)

    The reconstruction of the packet should be entirely transparent to the applications.

    0 讨论(0)
提交回复
热议问题