Search code examples
tcpudpip-protocol

sending multiple tcp packets in an ip packet


is it possible to send multiple tcp or udp packets on a single ip packet? are there any specifications in the protocol that do not allow this.

if it is allowed by the protocol but is generally not done by tcp/udp implementations could you point me to the relevant portion in the linux source code that proves this.

are there any implementations of tcp/udp on some os that do send multiple packets on a single ip packet. (if it is allowed).


Solution

  • It is not possible.

    The TCP seqment header does not describe its length. The length of the TCP payload is derived from the length of the IP packet(s) minus the length of the IP and TCP headers. So only one TCP segment per IP packet.

    Conversely, however, a single TCP segment can be fragmented over several IP packets by IP fragmentation.