TCP Acknowledgement

47 views
Skip to first unread message

Raul

unread,
Mar 4, 2022, 3:26:21 PM3/4/22
to openthread-users
Hello,

I am trying to print the acknowledgement received by the TCP sender on the CLI but I couldn't make it work. Can anyone help point me in the right direction? Thanks!

Jonathan Hui

unread,
Mar 4, 2022, 3:31:19 PM3/4/22
to Raul, openthread-users
You can add a call to OutputLine() in TcpExample::HandleTcpSendDone().

--
Jonathan Hui



On Fri, Mar 4, 2022 at 12:26 PM Raul <raulpri...@gmail.com> wrote:
Hello,

I am trying to print the acknowledgement received by the TCP sender on the CLI but I couldn't make it work. Can anyone help point me in the right direction? Thanks!

--
You received this message because you are subscribed to the Google Groups "openthread-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openthread-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openthread-users/f26cf006-3105-4fd5-8981-49609caff0c8n%40googlegroups.com.

Raul

unread,
Mar 4, 2022, 4:27:06 PM3/4/22
to openthread-users
Hi Jonathan,

I tried OutputLine("%s", aData->mData); and it looks like mData is the data being sent and not the acknowledgement.

So I tried OutputLine("%s", aEndpoint->mReceiveAvailableCallback); and it printed some weird characters. Is this the correct buffer for the acknowledgement and I just need to convert them into ASCII or is it something else?

Jonathan Hui

unread,
Mar 4, 2022, 4:41:39 PM3/4/22
to Raul, openthread-users
The TCP API does not provide the actual TCP packets. If you really want to dump the contents of the packet, I would suggest using OpenThread log packet dump capabilities and add some code to src/core/net/tcp6.cpp to dump the contents of the packets.

--
Jonathan Hui


Raul

unread,
Mar 6, 2022, 7:49:40 PM3/6/22
to openthread-users
Hi Jonathan,

I am just looking for a way to read the additional data appended in the ACK by the listening TCP endpoint.

For context, in our project, our server (the listening TCP endpoint) sends a custom string (e.g., "complete") as sort of an acknowledgement to the connecting TCP endpoint (in our case, a full-thread device) to inform it that all the TCP packets have been received. Currently, when I send a message to the server (e.g., tcp send hello), what is displayed on the cli of the full-thread device is this:

> tcp send hello
Done
> TCP: Reached end of stream

The custom string "complete" is missing.

Jonathan Hui

unread,
Mar 7, 2022, 1:54:29 PM3/7/22
to Raul, openthread-users
The TCP CLI should output any received bytes before reaching the end of stream (see TcpExample::HandleTcpReceiveAvailable())

Can you provide a pcap file (from tcpdump or sniffer) that shows the TCP packets?

--
Jonathan Hui



Raul

unread,
Mar 10, 2022, 12:36:26 PM3/10/22
to openthread-users
Hi Jonathan,

We made a mistake on the string sent by the server. It is fixed now and the TCP CLI did output our expected received bytes. Thank you!

Reply all
Reply to author
Forward
0 new messages