Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 896
Rohit Banga Avatar asked Feb 08 '10 10:02

Rohit Banga


People also ask

How many packets can TCP send?

The absolute limitation on TCP packet size is 64K (65535 bytes), but in practicality this is far larger than the size of any packet you will see, because the lower layers (e.g. ethernet) have lower packet sizes.

Can TCP send packets out of order?

One of the functions of TCP is to prevent the out-of-order delivery of data, either by reassembling packets into order or forcing retries of out-of-order packets. Oversubscription: Oversubscribing of devices or links also causes OOO packets.

How many packets are sent when obtaining a new IP address?

Here is what one of the four packets would contain: Each packet's header will contain the proper protocols, the originating address (the IP address of your computer), the destination address (the IP address of the computer where you are sending the e-mail) and the packet number (1, 2, 3 or 4 since there are 4 packets).

How does TCP handle out of order packets?

Handling out of order packets. TCP connections can detect out of order packets by using the sequence and acknowledgement numbers. Diagram of two computers with arrows between. Arrow goes from Computer 1 to Computer 2 and shows a box of binary data with the label "Seq #1".


4 Answers

Tcp doesn't send packets: it is a continuous stream. You send messages.
Udp, being packet based, will only send one packet at a time.

The protocol itself does not allow it. It won't break, it just won't happen.

The suggestion to use tunneling is valid, but so is the warning.

like image 133
IAbstract Avatar answered Oct 22 '22 00:10

IAbstract


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.

like image 31
Will Avatar answered Oct 22 '22 02:10

Will


You might want to try tunneling tcp over tcp, although it's generally considered a bad idea. Depending on your needs, your mileage may vary.

like image 35
lorenzog Avatar answered Oct 22 '22 00:10

lorenzog


You may want to take a look at the Stream Control Transmission Protocol which allows multiple data streams across a single TCP connection.

EDIT - I wasn't aware that TCP doesn't have it's own header field so there would be no way of doing this without writing a custom TCP equivalent that contains this info. SCTP may still be of use though so I'll leave that link.

like image 34
Paolo Avatar answered Oct 22 '22 00:10

Paolo