Answer the question
In order to leave comments, you need to log in
How to avoid packet loss when relaying TCP packets from a fast interface to a slow one?
Problem:
When transmitting data over a communication channel that includes a packet relay from a fast interface to a slow one, packets are lost. The TCP protocol resends these packets, but the transmission speed drops.
Transfer in the opposite direction occurs without errors.
Communication channel:
[ PC, Windows ]------EthOverUSB------>[ STM32, LWIP ]-------PPPoS------->[ ARM, Linux ]
EthOverUSB - FullSpeed USB (12 Mbit/s)
PPPoS - RS422 (921600 bit/s)
Details:
The TCP protocol resends lost packets, with a ~5% speed drop. At the same time, 3.7% of broken packets are fixed on the receiver side (Linux).
Causes:
The sender sends packets to the fast interface (USB), but the slow one (PPP) does not have time to transmit packets at such a speed and they accumulate in the buffer on the repeater (STM32). When this buffer overflows, the packet is lost.
Solutions:
1. The first thing that comes to mind is to lower the USB speed, but the STM32 LowSpeedUSB (1.5 Mbit/s) is not supported, and I did not find another way to limit the speed. Maybe he is?
2. Somehow configure the Window Size parameter of the TCP protocol. But how? and where?
3.???
It seems to me that this problem should somehow be normally solved. But so far I can't find the solution.
I will be grateful for help.
Answer the question
In order to leave comments, you need to log in
something like this
https://networkguru.ru/kakie-parametri-vliyaut-na-...
you send the size of the receive window to your receive buffer and the source will send data only to the size of the window and then it will wait for confirmation of receipt.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question