0

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?

op g
  • 9
  • 6

1 Answers1

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