TCP packets

I’m using QNX Neutrino 2.0 and i’ve noticed if I send data calling send()
routine ttcpip manager sending to network two TCP frames. When I seek my
data in captured frame i see there is few last bytes into second TCP frame
but i’ve sent data calling only once routine send(). Can you explain how
it’s happen and how to prevent dividing data into separate packets?
Thanks in advance.

Sebastian

“seba” <sebastian@psi.mikronika.com.pl> wrote in message
news:akvc4k$huc$1@inn.qnx.com

I’m using QNX Neutrino 2.0 and i’ve noticed if I send data calling send()
routine ttcpip manager sending to network two TCP frames. When I seek my
data in captured frame i see there is few last bytes into second TCP frame
but i’ve sent data calling only once routine send(). Can you explain how
it’s happen and how to prevent dividing data into separate packets?

You cannot, if you think you can then you’ve misunderstood TCP.
Basicaly TCP is a streaming protocol and it may do what ever it please
with the data (all according to fancy algorithm(), split in in as many
packets it wants. I’m guessing the extra packet you see are ACK/NAK
packet.

For complete control of packet format look into UDP.

Thanks in advance.

Sebastian

seba wrote:

I’m using QNX Neutrino 2.0 and i’ve noticed if I send data calling send()
routine ttcpip manager sending to network two TCP frames. When I seek my
data in captured frame i see there is few last bytes into second TCP frame
but i’ve sent data calling only once routine send(). Can you explain how
it’s happen and how to prevent dividing data into separate packets?
Thanks in advance.

Sebastian

You have no control of what TCP does with your data :slight_smile: It can be divided
into several packets, it is only guaranted that you will receive them in right
order (its streaming protocol). The best way is to pack the data in a struct
with length parameter at the beginning, and then at the receiver end collect
incoming chunks of data until length is reached.

Pozdrowienia,
gw

wrobel@no-spam.zdania.com.pl Experimental Department of Scientific
phone: (+48 12) 617-2883 Equipment and Automation
fax: (+48 12) 634-2205 30-059 Krakow, al.Mickiewicza 30, Poland