UDP packets are deleted when its size is less than 12 bytes on a specific PC. How do I understand the reason?

I am stuck in a problem I have never heard of.

I am making an online game that uses UDP packets in a specific character action. after I developed the udp module, it works fine. although most of our team members have no problems, but the person who is my boss told me that something is wrong with this module.

I investigated the problem, and finally I found that ... on my PC, if the udp packet size is less than 12, the packet was never delivered to another host.

following additional information:

  • 1 ~ 11 bytes. Deleted packets are deleted, 12 bytes and more than 12 byte packets are in order.
  • O / S: Microsoft Windows Vista Business
  • Network adapter: Giant Ethernet 10/100 / 1000Base-T controller of the Attansic L1 controller
  • WSASendTo returns TRUE.
  • the loopback udp package works fine.

what do you think about this problem? and what do you think ... what causes this problem? What should I do for the next step for a reason?

PS. I do not want to fill in, which makes the length of all packets up to 12 bytes.

+4
source share
5 answers

Just to get one of the unobvious answers in: perhaps the UDP checksum offload breaks on this card, that is, packets are sent but deleted by the recipient?

You can verify this by looking at the received packets using Wireshark.

+3
source

IF you have already checked the firewall, antivirus, network firewall, network intrusion. read it

For UDP packet ethernet_header (14 bytes) + IPv4_header (20 bytes per minute) + UDP_header (8 bytes) = 42 bytes
Now, since it is less than 64 bytes or 60 on linux, the network driver will download a packet with (64-42 = 22) zeros to make it 60 bytes before sending the packet.

what is the minimum length for a UDP packet.
theoretically you can send 0 bytes of data, but have not tried it yet.

since for your problem this is an OS problem. Check the network driver manual or contact the manufacturer. because it is not destined to happen.

REF: http://www.freesoft.org/CIE/Course/Section4/8.htm
REF: http://en.wikipedia.org/wiki/User_Datagram_Protocol

+2
source

Launch Wireshark on your PC and on the destination PC.

Does the log show that the udp package leaves his machine? Does it indicate that it is arriving at the destination computer?

What equipment or router switches are between the PC and the destination? Can you remove them and tie the two with a cross cable? (or replace the destination with a laptop and a link to his PC using a crossover cable?)

Have you removed or at least listed all the antivirus and firewalls on your machine and everything that installs Winsock LSP?

Remove ALL 12-byte or less packages, or just some of them, can you create packages with random content and see if it causes something in the content, and not just the size that causes the problem.

+2
source

Assuming your problem is sending from your PC: first, run the packet sniffer on the problematic PC to see if it arrives in the network adapter. If this happens, there may be a problem with the NIC or NIC driver.

Then check for any firewall software. Try turning it off and see what happens.

If this does not work, clear all Winsock Layered Service Providers with the netsh winsock catalog reset .

If this does not work, I'm at a standstill :)

Finally, you are likely to find other customers with the same problem; you can think of this workaround anyway. Try sending a few small UDP packets to the connection, and if they fail in succession, enable a workaround. For hosts where trial packets pass, you do not need to unload them.

+1
source

Pure hypothesis: RTP, which is a very common packet for sending over UDP, defines a 12-byte header . I wonder if some level of network software suggests that something less is the wrong RTP packet and discards it?

+1
source

Source: https://habr.com/ru/post/1335042/


All Articles