Date: Tue, 9 Feb 2010 12:41:07 -0800 From: Nerius Landys <nlandys@gmail.com> To: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Max UDP packet size + Java: weirdness Message-ID: <560f92641002091241h65d4fb70sa7daafca885a2b1d@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
I'm trying to send large UDP packets between 2 programs written in the Java programming language. These 2 programs will be running on 2 different hosts which are far apart. The "test" code for these programs is only a few lines and is here: http://daffy.nerius.com/temp/BigUDPPacketTestClient.java http://daffy.nerius.com/temp/BigUDPPacketTestServer.java First, I noticed that I was able to send data that is 9216 in length between 2 FreeBSD 7.1 hosts ("far apart" in network distance) running Sun JDK 1.5.0_16-p9 (compiled myself from /usr/ports/java/jdk15). Any packet greater than this in length would not be sent, with the following error: Exception in thread "main" java.io.IOException: Message too long at java.net.PlainDatagramSocketImpl.send(Native Method) at java.net.DatagramSocket.send(DatagramSocket.java:612) at BigUDPPacketTestClient.main(BigUDPPacketTestClient.java:24) I then repeated these tests between 2 Linux hosts ("far apart" in network distance). One Linux host (the "server") was running OpenJDK 1.6.0-b09, and the other (the "client") was running Sun JDK 1.6.0_14-b08. This time, I was able to send 35512 bytes in a UDP packet before it crapped out. For my particular application, I would really benefit from being able to send large UDP packets. Does anyone know how to increase the max allowed size of UDP packets in a Java program? I assume it's something outside of the Java program, in the system or kernel or whatnot. Any help from network gurus would be appreciated. Should I post this in the freebsd-net mailing list instead? - Nerius
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?560f92641002091241h65d4fb70sa7daafca885a2b1d>