From nobody@FreeBSD.org  Fri Jan 26 15:37:17 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 7D85E16A405
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Jan 2007 15:37:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F2A513C458
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Jan 2007 15:37:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l0QFbF9v055364
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 26 Jan 2007 15:37:15 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l0QFbEHu055363;
	Fri, 26 Jan 2007 15:37:14 GMT
	(envelope-from nobody)
Message-Id: <200701261537.l0QFbEHu055363@www.freebsd.org>
Date: Fri, 26 Jan 2007 15:37:14 GMT
From: Vladimir Ivanov<wawa@yandex-team.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net.inet.raw.maxdgram shouldn't be less than MTU size.
X-Send-Pr-Version: www-3.0

>Number:         108375
>Category:       kern
>Synopsis:       net.inet.raw.maxdgram shouldn't be less than MTU size.
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 26 15:40:25 GMT 2007
>Closed-Date:    Tue Mar 27 17:27:06 GMT 2007
>Last-Modified:  Tue Mar 27 17:27:06 GMT 2007
>Originator:     Vladimir Ivanov
>Release:        RELENG_5, RELENG_6
>Organization:
Yandex LLC
>Environment:
FreeBSD mimino.yandex.net 5.5-PRERELEASE FreeBSD 5.5-PRERELEASE #17: Tue May  2 00:33:08 MSD 2006     root@mimino.yandex.net:/usr/obj/usr/src/sys/CORE-RTR-RELENG_5  i386

>Description:

Big packets failed to transmit thru raw socket if datasize exceed net.inet.raw.maxdgram but still less than interface's MTU.

Tnat's why strange bugs appears if we use Jumbo packets more than 8KB.
E.g ospf daemon of Quagga fails to send route updates: 
Nov 23 18:59:42 multiped ospfd[16187]: *** sendmsg in ospf_write to 224.0.0.6 failed with Message too long

>How-To-Repeat:

>Fix:
Workaround: 
adjust net.inet.raw.maxdgram to bigger value.

It will be nice if committers will increase defult buffer size as hotfix.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: bms 
State-Changed-When: Tue Mar 20 01:28:38 UTC 2007 
State-Changed-Why:  
Hi, 

Unfortunately we can't auto-tune the size of the mbuf allocation for 
a given socket based on interface MTU until the socket is bound. In 
many situations a socket may not be bound. 

udp_sendspace is used to call sbreserve() to reserve mbuf allocation 
on udp_attach. 

The legacy HARP ATM code does call sbreserve() to autotune socket buffers 
based on the SDU size used for an AAL5 connection but this is largely of 
historical interest and not relevant to UDP/IP. 

XORP, for example, does not suffer from this problem, as it uses SO_SNDBUF 
to allocate more receive buffers. So the problem you are seeing can 
actually be solved in the application; it is possible to discover the 
interface MTU by using SIOCGIFCONF and examining ifr_mtu and then 
autotune SO_SNDBUF based on that. 

Perhaps quagga's ospfd could be patched to do the same. 

Is it OK to close this PR? 

Thanks! 
BMS 


http://www.freebsd.org/cgi/query-pr.cgi?pr=108375 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/108375: commit references a PR
Date: Tue, 20 Mar 2007 13:15:35 +0000 (UTC)

 bms         2007-03-20 13:15:20 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netinet          raw_ip.c 
   Log:
   Increase default size of raw IP send and receive buffers to the same as
   udp_sendspace, to avoid a situation where jumbograms (datagrams > 9KB)
   are unnecessarily fragmented.
   
   A common use case for this is OSPF link-state database synchronization
   during adjacency bringup on a high speed network with a large MTU.
   
   It is not possible to auto-tune this setting until a socket is bound to
   a given interface, and because the laddr part of the inpcb tuple may be
   overridden, it makes no sense to do so. Applications may request a larger
   socket buffer size by using the SO_SENDBUF and SO_RECVBUF socket options.
   
   Certain applications such as Quagga ospfd do not probe for interface MTU
   and therefore do not increase SO_SENDBUF in this use case.
   XORP is not affected by this problem as it preemptively uses SO_SENDBUF
   and SO_RECVBUF to account for any possible additional latency in XRL IPC.
   
   PR:             kern/108375
   Requested by:   Vladimir Ivanov
   MFC after:      1 week
   
   Revision  Changes    Path
   1.170     +2 -8      src/sys/netinet/raw_ip.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->patched 
State-Changed-By: bms 
State-Changed-When: Tue Mar 20 13:23:31 UTC 2007 
State-Changed-Why:  
I have committed a change which makes sendspace consistent for udp and raw ip. 
However, this really is the application's problem -- it should probe for 
interface MTU and set socket send buffer size accordingly. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108375 
State-Changed-From-To: patched->closed 
State-Changed-By: bms 
State-Changed-When: Tue Mar 27 17:26:54 UTC 2007 
State-Changed-Why:  
mfc 

http://www.freebsd.org/cgi/query-pr.cgi?pr=108375 
>Unformatted:
