From owner-freebsd-questions@FreeBSD.ORG Tue Feb 9 20:41:08 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC061106566C for ; Tue, 9 Feb 2010 20:41:08 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 7B10E8FC13 for ; Tue, 9 Feb 2010 20:41:08 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1049878qwd.7 for ; Tue, 09 Feb 2010 12:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=bTtHcoGw9iyy7z9z/JP2DoQFWkemL7fzJxyqbZ6VMQQ=; b=xj7caTJf+OCFmiWUIRFpxtKgvxvB5g1UG9LM5IT4VhsAdqoeVq+JI3Rb22w24dH9CX KNfeXuqHqKVyEUwcxS7kWzFkJQSyTVqAACYN7aD2QbTPkjvVCkZY9AiJ46cY8aJDEvxa ukPasAHKzNKQQEbdTR7FqqD5oymBg7CbmEOXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LTGQ2/cEEkhoREBhsig9O1RlvzUFkanRBh9BWt8sN70jvIkUFYuddN4Q+psmyJV/9u tBhvjBlabTZN4gQkRR0Ul/sytEDpNn978NJ9qlzXSsLkFa4ax6v+kf5T66fRgJPBtnCv Kj6mdgtsXhZv04CBc0zzWbrlKGmkqZl6IrH0g= MIME-Version: 1.0 Received: by 10.229.62.71 with SMTP id w7mr1370326qch.92.1265748067376; Tue, 09 Feb 2010 12:41:07 -0800 (PST) Date: Tue, 9 Feb 2010 12:41:07 -0800 Message-ID: <560f92641002091241h65d4fb70sa7daafca885a2b1d@mail.gmail.com> From: Nerius Landys To: FreeBSD Mailing List Content-Type: text/plain; charset=ISO-8859-1 Subject: Max UDP packet size + Java: weirdness X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 20:41:08 -0000 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