# TCP/IP stack produces spuriouse retransmissions when using multiple sockets

**URL:** <https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212>\
**Category:** Libraries\
**Tags:** debug\
**Created:** [April 13, 2023, 1:28pm UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212 "2023-04-13T13:28:03Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [April 26, 2023, 6:40am UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/21 "2023-04-26T06:40:35Z")

</div>

Hello @Stonebull, I’m wondering if there is any news? Did you find a workable solution?

If not, you may want to send me an email so we can work together to find the cause.

My email address is unchanged: hein [at] htibosch [dot] net

Regards

---

<div class="post-metadata">

**Author:** ![Stonebull](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Stonebull](https://forums.freertos.org/u/Stonebull)\
**Post date:** [April 26, 2023, 12:08pm UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/22 "2023-04-26T12:08:25Z")

</div>

@htibosch Sorry for my late reply, this is due to not being able to track down the real cause for the issue.  
I’ll summarise what worked so far:

- Disabling windowing all together `#define ipconfigUSE_TCP_WIN ( 0 )`
- Disabling the topografy discovery protocols in windows

What I tried so far that did not help:

- Increase the ARP cache size to 32 `#define ipconfigARP_CACHE_ENTRIES ( 32 )`
- Change the window size to small / big size
- Increase the number of descriptors
- Try with/without a switch in between
- Change optimization level of compiler

The problem is I do not really know how to debug the issue.

When stepping through the IP stack code while the number of descriptors is decreasing fast, I felt like the packages causing the drop were ARPs - which led me to believe that there are too many ARP broadcasts in the network and in turn, to disable the windows topology discovery services.

This seemed to help, but I still don’t really know if the ARP packages are really the source of the problem. Is the TCP stack really not capable of processing these requests fast enough to handle two sockets streaming data in the simultaniously? Especially since on wireshark the number of ARPs was not exessive (like 3x second).

> [@htibosch](#):
>
> If not, you may want to send me an email so we can work together to find the cause.

That’s a very kind offer, I really appreciate your commitment regarding my problem. Although I don’t know what else to try. For now I’ll stick with disabling the windowing feature to be able to carry on. If I find some more insights to the problem I’ll happily come back to your offer and share what I found!

* * *

@RAc Thanks for your reply, it really looks like the Xilinx SDK (which is Eclipse-based) is responsible for generating those UDP packets!

---

<div class="post-metadata">

**Author:** ![Bhavya443](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/bhavya443/32/4363_2.png) [@Bhavya443](https://forums.freertos.org/u/Bhavya443)\
**Post date:** [March 21, 2024, 11:40am UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/23 "2024-03-21T11:40:50Z")

</div>

Hello @htibosch , I am facing same issue with FreeRTOS-TCP-4.0.0 with single socket but when I am running tuning tool I am seeing spuriouse retransmissions I have tried Window properties case also Can you please suggest me How issue resolved

---

<div class="post-metadata">

**Author:** ![htibosch](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/htibosch/32/62_2.png) [@htibosch](https://forums.freertos.org/u/htibosch)\
**Post date:** [March 22, 2024, 7:13am UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/24 "2024-03-22T07:13:24Z")

</div>

I would need to see a PCAP of the TCP connections.

In my experience, most retransmissions are caused by the fact that timeouts are set to short, so it is like inpatient behaviour.

So if you want, zip a PCAP file and post it here.

---

<div class="post-metadata">

**Author:** ![ActoryOu](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/actoryou/32/2880_2.png) [@ActoryOu](https://forums.freertos.org/u/ActoryOu)\
**Post date:** [March 22, 2024, 7:18am UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/25 "2024-03-22T07:18:36Z")

</div>

I believe the [new post](https://forums.freertos.org/t/in-freertos-tcp-4-0-0-facing-spurious-retransmission-while-running-awe-tuning-tool/19603) is relevant to this discussion. Perhaps it would be more appropriate and organized if we could continue the conversation within that thread, consolidating all related points and discussions in one place.

---

<div class="post-metadata">

**Author:** ![RAc](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rac/32/1389_2.png) [@RAc](https://forums.freertos.org/u/RAc)\
**Post date:** [March 22, 2024, 9:52am UTC](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212/26 "2024-03-22T09:52:53Z")

</div>

> [@htibosch](#):
>
> In my experience, most retransmissions are caused by the fact that timeouts are set to short, so it is like inpatient behaviour.

It is also important to point out that retransmissions are not erratic scenarios by themselves but a crucial part of the fabric that makes TCP a reliable protocol. At times packets DO get lost or delayed simply due to the underlying infrastructure, so I wouldn’t worry too much about occassional retransmissions as long as the overall performance is acceptable. Note that even if you WERE to eliminate all of them in your lab environment, very likely in the field they will come back, without a customer ever noticing.

[Previous page](https://forums.freertos.org/t/tcp-ip-stack-produces-spuriouse-retransmissions-when-using-multiple-sockets/17212.md?page=1)
