1

I have some issues getting information about the acknowledgement of a TCP connection.

I've implemented a basic TCP Socket Server (socket(), listen(), bind(), accept(), send()) using Windows sockets. The communication works fine but now I want to retrieve and observe the incoming acknowledgements of the TCP packet.

Does anyone knows how I can get this information programmatically?

Chad Nouis
  • 6,861
  • 1
  • 27
  • 28
Lynguistic
  • 141
  • 1
  • 2
  • 9
  • 2
    You may use [Wireshark](https://www.wireshark.org/) to observe the incoming/outgoing packet. – ymonad Jan 11 '17 at 08:42
  • These are being handled for you by the networking layer you're using. As @ymonad said, you can capture and view them with wireshark. I don't believe windows sockets allows you to access them though. – Colin Jan 11 '17 at 09:03
  • You can't, unless you use raw sockets. Why do you think you need this? In general, acknowledgements in TCP are only detected via the absence of subsequent failures. – user207421 Jan 11 '17 at 09:10
  • Thank you for your support. I already figured out how to sniff the connection via raw sockets. I also considered Wireshark but unfortunately I need to analyse a communication via WLAN and Bluetooth under Windows and there is no support for Bluetooth. – Lynguistic Jan 20 '17 at 06:18

1 Answers1

1

If your application needs to know when the data is received, or even in the case of failure, how much was received, you need an application-level acknowledgement.

The TCP ACK does not belong to the Application layer, it is purely layer-4 book-keeping information. If layer7 needs an ACK you need to add one at layer 7.

Related, the same goes for keep-alives: Asyncsockets and "silent" disconnections

Community
  • 1
  • 1
Ben
  • 34,935
  • 6
  • 74
  • 113
  • 1
    Thank you Ben! For my analysis I send added an ACK on layer 7, cause I can't find a solution that works for both Bluetooth and WLAN socket under windows. – Lynguistic Jan 20 '17 at 06:21