Reputation: 1
Why BGP protocol restict its packet size less than 4096 octet?
If the BGP packet size exceeds 4096 bytes,how should I handle this?
Upvotes: 0
Views: 735
Reputation: 116
"Why BGP protocol restict its packet size less than 4096 octet?"
Tony Li gave the official answer in this IDR thread. To quote his answer:
- First, an implementation should NOT be using a message size that
is different than the specified 4k message size limit. If an
implementation sends messages more than 4k, then other
implementations will not be able to parse them. If an implementation
cannot receive 4k messages, then it will also not be able to
interoperate.1a) Having a fixed size is good because it makes the protocol
implementations easy. There is no point to having complexity in an
implementation if it provides no benefit. Large messages don't
provide a wonderful benefit, as they need to be large enough to carry
the path attributes and associated prefixes. For this purpose 4k is
probably adequate to date.1b) Historically, 4k was considered a bit wasteful. Of course, it
was wonderfully simple compared to EGP which used fragmented
packets. Care to parse a 16k jumbo-gram? Care to debug that? Trust
me, it's not fun.
- The 4k message size is completely independent of the TCP window
size. An implementation is perfectly free to compose any number of
messages, each of which is within the 4k limit. The implementation
can then cram any number of messages into its TCP socket, up to the
buffering limits of that TCP.2a) Thus, the message size is NOT performance limiting, except when
an implementation could actually overfill a message. Folks
maintaining current implementations might chime in here as to whether
or not they see this. So, in summary, yes, a 4k message size limit is a fine situation for
BGP, for the way that it behaves and the job that it does. This
does NOT necessarily generalize to other protocols, (e.g. OSPF)
where 4k exceeds the most common MTUs. In those cases, you'd end up
with fragmentation, and that's bad.
how to handle a BGP packet with a size exceeds 4096?
In the real world, we deal with this scenario by logging a BGP malformed message and then terminate the session by sending a BGP notification with code Message Header Error(1), and subcode Bad Message Length(2). Terminating the session is one of the approaches of BGP error handling. You may refer to BGP error handling rfc7606.
Upvotes: 3
Reputation: 825
Just how the spec was written. Check out http://www.faqs.org/rfcs/rfc1771.html for more details. This means you shouldn't, in theory, ever receive a BGP packet greater than 4k. Perhaps they were thinking that large packets sent containing large routing table updates and the likes shouldn't interfere with large data transfers so they break up the packets to utilize different queues. That's a total SWAG though. :)
Upvotes: 0