2

My understanding is that a tcp socket is uniquely identified by the tuple src ip:port and dst ip:port.

Imagine I have a simple client/server application where the client can send some data request message and the server responds uniquely to that request over one single tcp socket.

Say the client asynchronously fires off a bunch of requests in a row before the server can respond to any of them. The client then receives a bunch of responses back some time later; one for each request.

Is there some kind of mechanism in the tcp/ip stack that lets you relate one packet with another, aka the request and the response? Is the identification task the responsibility of the protocol in the data payload itself? Or is this just not how TCP works at all?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 12 '17 at 5:30
1

TCP/IP will reassemble a TCP segment that was broken into IP packets. Reassembling other datagrams from the individual TCP segments is left to the upper layer protocols.

1

TCP will not just blindly send a bunch of requests to a server; besides the initial three way hand shake, there are some flow control mechanisms in place.

Given a scenario where a connection is established and the client sends data to the server, the servers response will include sequence numbers so that the client can put the data back together before handing to the application.

  • Thanks for pointing me towards seq and ack numbers. I'll look into this further. – anders Sep 2 '15 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.