Re: data packet split problem in socket networking
- From: Vic <Vic@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 9 Jan 2007 09:15:02 -0800
Thanks Arkady,
When i set the sendSize = recvSize = 3000 bytes, which is already bigger
than the 1500 bytes that you metioned, there was no split, but when i set
them bigger, say 30,000 bytes, the split happened a lot.
Victor
"Arkady Frenkel" wrote:
Just as addition to previous answers. Victor, be aware that physical network.
have max size of the packet it can transmit at once ( MTU ), for ethernet
that 1500 bytes.
Arkady
"Vic" <Vic@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DC75258F-2EB9-4929-A9D7-A86A16650827@xxxxxxxxxxxxxxxx
Hi Guru,
I am new with socket applications, and now trying to build a client-server
application to use socket for data transportation.
I am using VC6 on PC, included ws2_32.lib in my project.
I found that *sometimes* the packet received at the client side is split
and
MAYBE *re-organized* (I am sure the packets were often split, but need to
confirm if the packets are re-organized or not).
I have several data sources, e.g., each data source is a file, to be sent
to
the SAME client.
One way for the implementation is: for each data source, we build a
socket,
and send its data to the client at a unique port.
This will make the different data sources independent, but needs many
connections.
Another way is just to use one Server-Client connection, and the server
sends the data from each source one by one.
Each packet of data has a header, which indicates to which data source
this
packet belongs, e.g., SourceID.
Hopefully, the server will receive the packets of data in exactly the same
packet as the client sent it.
But if the packets are split and re-organized, special process will be
needed to separate the data in the receiver buffer.
I have following questions and hope you can give me the answers:
1. The socket split can be avoided or not? Say, if we use smaller packet
size, will we be sure that the socket will not be split?
2. What should be the suitable packet size be set?
3. Is it for sure that if a packet is split, the data will be sent in the
succeeded packet? We should be sure that the data should be received in
order.
4. Will the socket packet be split and re-organized? For example, if the
previous packet is split, will the next socket packet contain the rest
part
of the previous packet plus some of the data from the next packet?
If it is true, the header info may not be at the beginning of the packet.
5. Generally, where in a packet will the split happen? Are there any rules
for this?
6. The SourceID takes 2 bytes in our case, is it possible that the split
happens exactly between the the 2 bytes of SourceID, say the 1st byte of
SourceD is in one packet, and the 2nd byte of SourceID is sent in the
another
packet (hope it is in the next packet)? If this happens, it will be even
more
difficult for me to process the received data.
Please tell me the answer or tell me the souce where i can find more info.
Thanks in advance!
Victor
- Follow-Ups:
- Re: data packet split problem in socket networking
- From: Arkady Frenkel
- Re: data packet split problem in socket networking
- References:
- Re: data packet split problem in socket networking
- From: Arkady Frenkel
- Re: data packet split problem in socket networking
- Prev by Date: Re: How can I extract the destination IP address from incoming req
- Next by Date: Re: data packet split problem in socket networking
- Previous by thread: Re: data packet split problem in socket networking
- Next by thread: Re: data packet split problem in socket networking
- Index(es):
Relevant Pages
|