Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UDP packets are dropped when its size is less than 12 byte in a certain PC. how do i figure it out the reason?

i've stuck in a problem that is never heard about before.

i'm making an online game which uses UDP packets in a certain character action. after i developed the udp module, it seems to work fine. though most of our team members have no problem, but a man, who is my boss, told me something is wrong for that module.

i have investigated the problem, and finally i found the fact that... on his PC, if udp packet size is less than 12, the packet is never have been delivered to the other host.

the following is some additional information:

  • 1~11 bytes udp packets are dropped, 12 bytes and over 12 bytes packets are OK.
  • O/S: Microsoft Windows Vista Business
  • NIC: Attansic L1 Gigabit Ethernet 10/100/1000Base-T Controller
  • WSASendTo returns TRUE.
  • loopback udp packet works fine.

how do you think of this problem? and what do you think... what causes this problem? what should i do for the next step for the cause?

PS. i don't want to padding which makes length of all the packets up to 12 bytes.

like image 871
waan Avatar asked Dec 22 '22 19:12

waan


2 Answers

Just to get one of the non-obvious answers in: maybe UDP checksum offload is broken on that card, i.e. the packets are sent, but dropped by the receiver?

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

like image 143
Simon Richter Avatar answered Dec 24 '22 08:12

Simon Richter


IF you already checked firewall, antivirus, network firewall, network intrusion. read this

For a UDP packet ethernet_header(14 bytes) + IPv4_header(20 bytes min) + UDP_header (8 bytes) = 42 bytes
Now since its less than the 64 bytes or 60 on linux, network driver will pad the packet with (64-42 = 22 ) zeros to make it 60 bytes before it send out the packet.

that's the minimum length for a UDP packet.
theoretically you can send 0 data bytes packet, but haven't tried it yet.

as for your issue it must be an OS issue . check your network's driver's manual or check with manufacturer. because this isn't suuposed to happen.

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

like image 41
VirusEcks Avatar answered Dec 24 '22 07:12

VirusEcks