Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 103
  • Last Modified:

TCP/IP

I'm building client server application over TCP. The order of the arrival of the messages from the client to the server is important. Does TCP assure me that all the messages (packets) that I will send from the client to server will arrived at the same order they had been send?

Thank you.
0
bachar
Asked:
bachar
1 Solution
 
jjeff1Commented:
No, packets can arrive out of order. They are reordered, but I am not sure at what layer.
0
 
stevenlewisCommented:
packets can also be dropped, requiring a resend
0
 
BrettNemCommented:
Typically the re-ordering of packets is done at a layer that won't make a difference to an application. By the time it hits the application, the packets should be back in order. What is your application? If it is voice or video, I would be more concerned about jitter than packet order. (jitter is the delta in the lag)
-Brett
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
OttaCommented:
> No, packets can arrive out of order.

Yes, IP-packets can arrive out of order.

> They are reordered, but I am not sure at what layer.

I am sure that it is the TCP (Transmission Control Protocol) running _OVER_ the IP (Internet Protocol) --
read it as "Tea See Pea over Eye Pea" -- which
re-requests "missing" packets, and orders the IP-packets
0
 
andyalderSaggar makers bottom knockerCommented:
You are right, it's TCP (layer 4) that re-orders the packets and requests re-transmission of any missing packets (it knows that a packet is missed because of sequence numbers in the session).

If on the other hand you were to use UDP then you would have to build the reliability into your application. TCP is less efficient but it's reliable.
0
 
ErikKruijswijkCommented:
As long as you are using tcp, and not udp, al your packets will arrive..
tcp wiats for an aknowledgement, before he sends the next packet..
Udp, does not, thats why it faster, but less relyable
gr

Erik Kruijswijk
0
 
fathallafaCommented:
The answer is simply YES. Providing that your application is using TCP protocol. In that case you don't have to be woried about the mesages order. Your distination host will receive it in the same order your source host is sending with error recovery and this is one of the TCP fruits if we compare it with UDP.
I Hope that this will satisfy your needs.
Regards,
Fathalla
0
 
OttaCommented:
> TCP waits for an acknowledgement before sending the next packet..

Not always true -- a "windowing" technique is often used.
TCP will send, say, five packets, and then wait to receive
the acknowledgment of the _FIRST_ packet before sending
the _SIXTH_ packet.  
Obviously, this increases "throughput" of the connection.
0
 
adrianwatkinsCommented:
If you use TCP in your application all of the stuff mentioned above will be carried out for you by NIC/NIC Driver/ Opperating system and WINSOCK.

You will therefore gain a error corrected, in order data pipe between your client and server without needing to get involved in the underlying layers.

A word of warning though, if you mishandle using tcp you can cause issues with the underlyiong layers. I have seen some socket dlls do pretty weird things on the network if for example you put some data in the send buffer and then cxlose the socket before waiting for the send buffer to empty.
0
 
Asta CuCommented:
Greetings.

This question remains open today; perhaps just overlooked this or it just got lost in the volumes.  If you've been helped to resolve this, please accept the comment which helped you as the accepted answer to then grade and close so that others may benefit from this information as it migrates to our PAQ Database.  If more is needed, please update here via comments so that you can achieve your goal.

Your attention to finalizing this is very much appreciated.

Asta
0
 
NetminderCommented:
bachar,

These questions are still open and our records show you logged in recently. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days. Please note that the recommended minimum for an "Easy" question is 50 points.
http://experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=20186509
http://experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=20100277
http://experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=20005648
http://experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=11452298
http://experts-exchange.com/jsp/qShow.jsp?ta=progsoftgen&qid=11404058
http://experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20141685
http://experts-exchange.com/jsp/qShow.jsp?ta=cplusprog&qid=20093290
http://experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20145151
http://experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20116236
http://experts-exchange.com/jsp/qShow.jsp?ta=mfc&qid=20094685
http://experts-exchange.com/jsp/qShow.jsp?ta=networkgen&qid=20032846

EXPERTS: Please leave your thoughts on this question here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
NetminderCommented:
Admin notified of user neglect. Force/accepted by

Netminder
Community Support Moderator
Experts Exchange
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now