Return-Path: Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by krbdev.mit.edu (Postfix) with ESMTP id 54E38CCA04 for ; Wed, 16 Sep 2009 04:35:37 +0000 (UTC) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id n8G4ZZ6N015549; Wed, 16 Sep 2009 00:35:35 -0400 (EDT) Received: from [10.0.0.158] ([76.119.237.235]) (authenticated bits=0) (User authenticated as raeburn@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id n8G4ZYAA028225 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 16 Sep 2009 00:35:34 -0400 (EDT) Message-ID: From: Ken Raeburn To: rt@krbdev.mit.edu In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Subject: Re: [krbdev.mit.edu #6566] UDP datagrams > 4K do not work. MIME-Version: 1.0 (Apple Message framework v936) Date: Wed, 16 Sep 2009 00:35:34 -0400 References: X-Mailer: Apple Mail (2.936) X-Scanned-BY: MIMEDefang 2.42 X-Spam-Flag: NO X-Spam-Score: 0.00 RT-Send-Cc: X-RT-Original-Encoding: us-ascii Content-Length: 1882 On Sep 15, 2009, at 22:02, elric@mournblade.imrryr.org via RT wrote: > Unfortunately, if you receive a datagram of over sizeof(pktbuf) > you will succeed with cc == sizeof(pktbuf) not detecting the fact > that there was additional data. This results in an ASN.1 parse > error. What should happen is that the KDC should return an > appropriate error to the client indicating that TCP should be used. Regardless of other options, it sounds like cc==sizeof(pktbuf) should trigger the use-TCP error, since we can't distinguish between a packet equal in size to the buffer and a packet that was larger but got truncated. Either that, or we could peek at the size of the next datagram and grow the buffer as needed, but I'm not sure that peeking can be done portably. > Or maybe the buffer size should be increased to the maximum allowable > for UDP. I prefer the second option as there is nothing inherently > wrong with 64K UDP packets. With jumbograms, UDP messages larger than 64K are possible. (RFC 2675) Still, 64K does seem like a reasonable limit (i.e., way larger than we would normally expect). > I noticed this while debugging a JGSS problem. Apparently, the > Java Kerberos libraries do not fail over from UDP to TCP unless > the KDC specifically tells them to. And they have no default > setting for udp_preference_limit. And so, if you are constructing > tickets of over 4K because, let's say, a user is in a lot of groups > in Windows, JGSS will just fail against an MIT KDC. From what I've read, the common wisdom still seems to be that some gateways/routers/NAT boxes/firewalls/whatever will not properly process UDP fragments, so UDP traffic over ~1500 bytes (or less) may never get to the KDC. So this sounds like a bug in the Java Kerberos libraries. Ken -- Ken Raeburn / raeburn@mit.edu / no longer at MIT Kerberos Consortium