Re: [Idr] why has 4096 bytes limit on BGP messages size?

Curtis Villamizar <curtis@occnc.com> Fri, 15 June 2007 05:13 UTC

Return-path: <idr-bounces@ietf.org>
Received: from [127.0.0.1] (helo=stiedprmman1.va.neustar.com) by megatron.ietf.org with esmtp (Exim 4.43) id 1Hz47d-0006ph-BC; Fri, 15 Jun 2007 01:13:21 -0400
Received: from [10.91.34.44] (helo=ietf-mx.ietf.org) by megatron.ietf.org with esmtp (Exim 4.43) id 1Hz47b-0006pW-1H for idr@ietf.org; Fri, 15 Jun 2007 01:13:19 -0400
Received: from c-24-7-120-3.hsd1.ca.comcast.net ([24.7.120.3] helo=sailbum.orleans.occnc.com) by ietf-mx.ietf.org with esmtp (Exim 4.43) id 1Hz47a-0004UP-Gh for idr@ietf.org; Fri, 15 Jun 2007 01:13:19 -0400
Received: from sailbum.orleans.occnc.com (localhost [127.0.0.1]) by sailbum.orleans.occnc.com (8.13.6/8.13.6) with ESMTP id l5F5E1bw001879; Fri, 15 Jun 2007 01:14:01 -0400 (EDT) (envelope-from curtis@sailbum.orleans.occnc.com)
Message-Id: <200706150514.l5F5E1bw001879@sailbum.orleans.occnc.com>
To: Pekka Savola <pekkas@netcore.fi>
From: Curtis Villamizar <curtis@occnc.com>
Subject: Re: [Idr] why has 4096 bytes limit on BGP messages size?
In-reply-to: Your message of "Thu, 14 Jun 2007 18:59:47 +0300." <Pine.LNX.4.64.0706141854120.28323@netcore.fi>
Date: Fri, 15 Jun 2007 01:14:01 -0400
X-Spam-Score: 1.8 (+)
X-Scan-Signature: 538aad3a3c4f01d8b6a6477ca4248793
Cc: Tony Li <tli@cisco.com>, idr <idr@ietf.org>
X-BeenThere: idr@ietf.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: curtis@occnc.com
List-Id: Inter-Domain Routing <idr.ietf.org>
List-Unsubscribe: <https://www1.ietf.org/mailman/listinfo/idr>, <mailto:idr-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www1.ietf.org/pipermail/idr>
List-Post: <mailto:idr@ietf.org>
List-Help: <mailto:idr-request@ietf.org?subject=help>
List-Subscribe: <https://www1.ietf.org/mailman/listinfo/idr>, <mailto:idr-request@ietf.org?subject=subscribe>
Errors-To: idr-bounces@ietf.org

In message <Pine.LNX.4.64.0706141854120.28323@netcore.fi>
Pekka Savola writes:
>  
> On Wed, 13 Jun 2007, Tony Li wrote:
> > On Jun 13, 2007, at 10:01 PM, Fenggen Jia wrote:
> >> hi,all,
> >>       I am wondering why BGP has 4096 bytes limit on all its
> >>       messages,should we leave it to the implementator to decide,thanks!
> >
> >
> > Well, the problem with that is that a sender could then create an arbitrarily 
> > long message, which could be arbitrarily problematic for a receiver.
>  
> While this is an interesting historical perspective, I'm not sure how 
> relevant it is anymore.  How does BGP differ from other TCP 
> applications (almost none of which specify the maximum byte limit in 
> the application)?  Are routers so low-end that they cannot allocate 
> more than 4K memory per message, or that they cannot determine the 
> amount of memory to allocate depending on the message length? :-)
>  
> (The header fields already tell the length of the message, so 
> allocating 4K buffer for each BGP message (when most messages are much 
> smaller than 4K) is probably a waste in many cases.)
>  
> -- 
> Pekka Savola                 "You each name yourselves king, yet the
> Netcore Oy                    kingdom bleeds."
> Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings


Just from an efficiency standpoint it makes sense to read much more
than 4KB from the BGP socket.  If the router is busy, having a 16KB or
larger read buffer lets TCP do its thing more efficiently.  You then
typically get N BGP updates plus some fraction of an update which has
to be shuffled in the buffer and another large read issued.  If the
most you have to shuffle is 4KB that might be a good thing.  Less
system calls is generally better favoring big reads though it depends
on the OS.  This tends to matter when a big routing transient happens.

Older very memory challenged implementations may have allocated 4KB
and did a small read to get the header and then another read to get
the rest of the update but that can be fairly inefficient.  Back when
BGP was invented some routers had 4MB or less and a 68020 or worse (a
PC-RT).

4KB is big enough that the overhead of parsing the header and the
attributes more than once when a large number of prefixes have the
same attributes is not a big penalty.  That is something that anyone
doing an implementation could verify or dispute after doing a program
execution profile.

Curtis

_______________________________________________
Idr mailing list
Idr@ietf.org
https://www1.ietf.org/mailman/listinfo/idr