I an simulating http client traffic with RAW socket. I send a SYN packet then get the SYN-ACK from the server. Finally I send an ACK+request packet and waits for the response. I noticed that when using wget or curl, the first ACK and the request are sent in two different packets. why is that, and is that relevant to anything?
Asked
Active
Viewed 1,462 times
0
-
I think your question is being answered [here](http://stackoverflow.com/questions/3761276/when-should-i-use-tcp-nodelay-and-when-tcp-cork) – DaSourcerer May 20 '16 at 16:01
-
It is because that is the way they work, and no it isn't relevant to anything. – user207421 May 21 '16 at 08:40
1 Answers
0
A client application that uses a TCP socket typically calls socket() then connect() then send(). The connect() function establishes the TCP connection, and to do this the TCP protocol requires 3 packets: SYN, SYN+ACK, ACK. After that the send() call sends the first data. Therefore the ACK and data are sent separately.
I think your packet flow probably does satisfy the TCP protocol (see https://www.rfc-editor.org/rfc/rfc793), but it is unusual.

Community
- 1
- 1

Nick Weeds
- 98
- 3