Bad UDP length 736 > IP payload length Len = 728 packet drop
-
I am unable to transfer UDP packets with payload length (736) 46 bytes. The wireshark traces shows BAD UDP payload length( 736) greater than IP payload length (728). But UDP payload length 736 is less than MTU (1500) so why I am getting this error. As per my understanding only if the packet length > MTU then it should result in transmission error. My client program should be sending UDP datagrams for IPv4 protocol.UDP server program is unable to receive UDP messages from the socket. Shouldn't the packet simply be fragmented if the UDP length exceeds the IP Payload Length? IP Payload length max should be MTU value isn't it ? How to debug this issue further with respect to UDP client and Server?
-
I am unable to transfer UDP packets with payload length (736) 46 bytes. The wireshark traces shows BAD UDP payload length( 736) greater than IP payload length (728). But UDP payload length 736 is less than MTU (1500) so why I am getting this error. As per my understanding only if the packet length > MTU then it should result in transmission error. My client program should be sending UDP datagrams for IPv4 protocol.UDP server program is unable to receive UDP messages from the socket. Shouldn't the packet simply be fragmented if the UDP length exceeds the IP Payload Length? IP Payload length max should be MTU value isn't it ? How to debug this issue further with respect to UDP client and Server?
Send packets of various lengths and see which ones work and which don't. Then there's pattern from which you can formulate a theory which may lead to a solution. Or not.
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal
-
I am unable to transfer UDP packets with payload length (736) 46 bytes. The wireshark traces shows BAD UDP payload length( 736) greater than IP payload length (728). But UDP payload length 736 is less than MTU (1500) so why I am getting this error. As per my understanding only if the packet length > MTU then it should result in transmission error. My client program should be sending UDP datagrams for IPv4 protocol.UDP server program is unable to receive UDP messages from the socket. Shouldn't the packet simply be fragmented if the UDP length exceeds the IP Payload Length? IP Payload length max should be MTU value isn't it ? How to debug this issue further with respect to UDP client and Server?
sarali wrote:
How to debug this issue further with respect to UDP client and Server?
I used bing/google to search for your Wireshark error code. Amazingly the top 10 results are mostly garbage and incorrect information. Even the response on the wireshark forum was wrong regarding this error message. Welcome to the misinformation age. Here is an accurate response: In your case the error message is telling you that the IP header (total packet length - IP header length) is 728. The error message is also telling you that the UDP payload length is 736 which is 8 bytes greater than the IP tot_len value. It's probably not a coincidence that you are off by 8 bytes... that happens to be the exact length of the UDP header. Look through your code for the packet length calculation. I am willing to bet you missed adding the UDP header length. Even if you forced sending this packet over the wire via raw socket... it will be dropped by the receiving side because it's considered corrupt when the packet lengths are mismatched. [TL;DR](https://en.wikipedia.org/wiki/Wikipedia:Too\_long;\_didn't\_read) You promised to send 728 but sent 736 instead. Best Wishes, -David Delaune
-
sarali wrote:
How to debug this issue further with respect to UDP client and Server?
I used bing/google to search for your Wireshark error code. Amazingly the top 10 results are mostly garbage and incorrect information. Even the response on the wireshark forum was wrong regarding this error message. Welcome to the misinformation age. Here is an accurate response: In your case the error message is telling you that the IP header (total packet length - IP header length) is 728. The error message is also telling you that the UDP payload length is 736 which is 8 bytes greater than the IP tot_len value. It's probably not a coincidence that you are off by 8 bytes... that happens to be the exact length of the UDP header. Look through your code for the packet length calculation. I am willing to bet you missed adding the UDP header length. Even if you forced sending this packet over the wire via raw socket... it will be dropped by the receiving side because it's considered corrupt when the packet lengths are mismatched. [TL;DR](https://en.wikipedia.org/wiki/Wikipedia:Too\_long;\_didn't\_read) You promised to send 728 but sent 736 instead. Best Wishes, -David Delaune
Hi, I tied to print the packet length calculation in my program before sending it out. I think the UDP payload length and IP length length calculation looks fine. APP: INFO: ip header checksum:f9b9 udp checksum:0 size_udp:736 sizeof(struct udp_hdr):8,size_ApplMsg:728udphdr->dgram_len:57346 m->data_len:770 size_ip:756 l2_data_shift:14 Further I am able to transfer UDP packets of size 20bytes,40 bytes using the same program.No issues observed.So right now I do not suspect the program. But I donot understand why the wireshark says "Bad UDP payload length". Not sure how the packet length can go wrong.Whether UDP packet is hardware offloaded ? We may be dropping the packet at the Kernel level due to this bad UDP length. So I tried to increase the UDP buffer size in kernel but of no use. The netstat -su output shows 0 send/receive buffer errors. [root@ATCAC06_100 /]# netstat -su IcmpMsg: InType0: 233961 InType3: 213187 InType8: 14 OutType0: 14 OutType3: 213187 OutType8: 17 OutType69: 233944 Udp: 592800 packets received 1439 packets to unknown port received. 0 packet receive errors 501661 packets sent 0 receive buffer errors 0 send buffer errors UdpLite: IpExt: In my program I am trying to read the return value of "recvFrom" call is -1 and in that case I tried to print the strerror(errno). But I could get prints only for the successful case ( return value > 0) and not for unsuccessful case.So mostly the packet is getting dropped at the Kernel level but how do I confirm this.Any debugging steps please share. I am using DPDK 18.08 version( on RHEL 7.6 platform) for packet forwarding.Please suggest how to resolve this issue.
-
Hi, I tied to print the packet length calculation in my program before sending it out. I think the UDP payload length and IP length length calculation looks fine. APP: INFO: ip header checksum:f9b9 udp checksum:0 size_udp:736 sizeof(struct udp_hdr):8,size_ApplMsg:728udphdr->dgram_len:57346 m->data_len:770 size_ip:756 l2_data_shift:14 Further I am able to transfer UDP packets of size 20bytes,40 bytes using the same program.No issues observed.So right now I do not suspect the program. But I donot understand why the wireshark says "Bad UDP payload length". Not sure how the packet length can go wrong.Whether UDP packet is hardware offloaded ? We may be dropping the packet at the Kernel level due to this bad UDP length. So I tried to increase the UDP buffer size in kernel but of no use. The netstat -su output shows 0 send/receive buffer errors. [root@ATCAC06_100 /]# netstat -su IcmpMsg: InType0: 233961 InType3: 213187 InType8: 14 OutType0: 14 OutType3: 213187 OutType8: 17 OutType69: 233944 Udp: 592800 packets received 1439 packets to unknown port received. 0 packet receive errors 501661 packets sent 0 receive buffer errors 0 send buffer errors UdpLite: IpExt: In my program I am trying to read the return value of "recvFrom" call is -1 and in that case I tried to print the strerror(errno). But I could get prints only for the successful case ( return value > 0) and not for unsuccessful case.So mostly the packet is getting dropped at the Kernel level but how do I confirm this.Any debugging steps please share. I am using DPDK 18.08 version( on RHEL 7.6 platform) for packet forwarding.Please suggest how to resolve this issue.
Listen, You are posting this same question all over the internet. I've even seen you over on the Intel forums. My prior analysis is completely correct. Here is the screenshot you posted over on the [Intel forums](https://software.intel.com/pt-br/node/808416). [https://software.intel.com/sites/default/files/managed/80/b4/bad\_udp\_length.png\](https://software.intel.com/sites/default/files/managed/80/b4/bad\_udp\_length.png) * Your packet length calculation is incorrect. * Also... your UDP checksum is missing. The UDP checksum might be OK if you have enabled checksum offloading on your network card. But the packet length calculation is absolutely your problem. Best Wishes, -David Delaune
-
Listen, You are posting this same question all over the internet. I've even seen you over on the Intel forums. My prior analysis is completely correct. Here is the screenshot you posted over on the [Intel forums](https://software.intel.com/pt-br/node/808416). [https://software.intel.com/sites/default/files/managed/80/b4/bad\_udp\_length.png\](https://software.intel.com/sites/default/files/managed/80/b4/bad\_udp\_length.png) * Your packet length calculation is incorrect. * Also... your UDP checksum is missing. The UDP checksum might be OK if you have enabled checksum offloading on your network card. But the packet length calculation is absolutely your problem. Best Wishes, -David Delaune
-
Thanks David.The issue got resolved it was indeed the packet len which was not getting set correctly.