1
votes

I have an application for video streaming over UDP and it works completely success. I changed the socket to TCP. When it is running after a few packets transferring, receiver sends RST and it stops working. (The packet with a large length is also strange which transferred from sender to receiver while MTU is 1400 - what is this packet?)

enter image description here

I checked receiver and sender log. The last packet that was received by receiver has a large and strange sequence number (dump packet). It makes an error and then application stops. Sender is not sending such a packet. Where is this packet come from? Is it transport layer that makes it?

enter image description here

When I added a sleep time (0.1 second) to the sender after each packet sending. The program works without any strange large length packets in Wireshark or strange sequence number But this is not a reasonable solution for video. What is your suggestion now? what could be the problem? How could analyze this network? How could solve it?

1
What's a rationale behind changing socket type from TCP to UDP?szulak
from UDP to TCP. I am going to research the difference and later i am going to try to implement a new protocol based on TCP.Samira Afzal
Typically, the MTU on the loopback interface (the one with address 127.0.0.1) is 64K on linux (16K on MAC -- not sure about Windows). And your application buffer size does not directly determine the amount of data sent in each TCP packet. The OS is free to put as much data into a TCP payload as it has available at the time it decides to send (subject to the MTU, the receiver's window, etc). You might want to look into the TCP_NODELAY option (see tcp(7) man page).Gil Hamilton
I read about TCP_NODELAY as you suggested. So this large TCP packet is not a problem and RST has another reason yes?Samira Afzal

1 Answers

0
votes

This isn't a strange length. This is likely tcp offload. See ethtool -k interface . Turn off offloading, and try again. The rst is probably unrelated. This is likely an application issue.