Sending large packets (>5000 bytes) over UDP

563 views
Skip to first unread message

Cosmos

unread,
May 18, 2017, 10:19:55 AM5/18/17
to ns-3-users
I am new to NS3 and I'm running the simple program 'third.cc' that appears in the tutorial. When I increase the packet size (in bytes) to around 4000 (Line 168), the server does not receive the request from the client. After checking the PCAP file, I realized that the error is due to: "[BAD UDP LENGTH 3753 > IP PAYLOAD LENGTH]  Len=3745" and "An error occurred while reading from the file "third-0-0.pcap": Less data was read than was expected." Although IP fragmentation is happening (as can be seen in the PCAP file), there is still an error of 'bad UDP length'. Shouldn't the packet simply be fragmented if the UDP length exceeds the IP Payload Length?

What can be done to fix this? If this can't be fixed, would TCP work better instead (as a byte stream)? Even if TCP did work, I would not prefer that because I want to simulate a system that does not work on TCP; it is a sensor network that simply broadcasts data to the server, and I felt that UDP would work well to simulate that effect. Perhaps there is a way to hard-code and increase this IP payload limit to avoid the above problem?

Varun
third-0-0.pcap
third-1-1.pcap
third.cc

Tommaso Pecorella

unread,
May 20, 2017, 1:53:18 PM5/20/17
to ns-3-users
Hi,

you actually found a bug (thanks).
I already patched it in the last ns-3-dev, just update it.

As a side note, you need to add this line somewhere before the internet stack is installed:
  Config::SetDefault("ns3::ArpCache::PendingQueueSize", UintegerValue (10));
Otherwise you'll have the last fragment dropped in the CSMA section.

Cheers,

T.
Message has been deleted

Cosmos

unread,
May 21, 2017, 11:04:38 AM5/21/17
to ns-3-users
Hi,

Thank you for your response. I am not able to locate the exact patches on ns-3-dev (http://code.nsnam.org/ns-3-dev/log?rev=udp). Can you help me do so? Are you referring to this particular attachment, corresponding to Bug 454?

https://www.nsnam.org/bugzilla/show_bug.cgi?id=454
https://www.nsnam.org/bugzilla/attachment.cgi?id=1371&action=diff

Thank you for your time.

Tommaso Pecorella

unread,
May 21, 2017, 7:32:45 PM5/21/17
to ns-3-users
Hi,

the diff is here:

I didn't upload a patch in bugzilla, I just updated the main code.

Cheers,

T.
Reply all
Reply to author
Forward
0 new messages