BGP Messages

Hi Chris,

Length of attribute value is the total path attribute length. It’s the sum of all attributes for a single NLRI. In the screenshot above, it’s 25 bytes.

The attribute length is where we store this value (and we can use 2 octets for that).

Rene

Hi Reene
Why Do we need keepalive then if update messages are sent every 30 seconds, we can use update for keepalive.

Samit

Hello Samit

It is true that for eBGP, the update timer is set to 30 by default and the keepalive is set to 60 seconds by default. It would be possible to have BGP reset the holddown timer every time an update was received as well, because if an update is received, then the neighbour must be up and running, right?

BGP has been designed so that the update and keepalives are two separate mechanisms. This is because you may want to adjust the keepalives to 15 seconds, the holddown to 45 and the updates to 60. If only the updates functioned as keepalives, you wouldn’t be able to do that. Keeping them separate gives you more control over the timers and how BGP will function.

BGP however is smart enough to send keepalives and holddown messages together within the same packet if they happen to be sent at the same time. This saves on bandwidth and resources in general.

I hope this has been helpful!

Laz

Rene, can you tell us what filter you used to capture this data in Wireshark? I tried just bgp but couldn’t see anything. I’m trying to capture on a serial link. I see you’re using Ethernet.

Thanks,

Andy

Hi Andy,

I probably just used the “bgp” filter in Wireshark to grab all BGP traffic. I usually just do a right mouse click on whatever I need, then update the filter later:

In this case, I change the filter from “bgp.type ==3” to “bgp.type” so that I get everything.

Rene

Hi René and staff,
perhaps, i missed something, and i am new in BGP
but basically i want to be sure which NLRI are advertised from one peer to another: do a peer advertise all the valid paths it knows () OR do a peer advertise only his best paths (>) to the other peer. If only the best path is advertised may we consider that BGP look like a distance vector IGP ? (with extra feature to select the best path, and filtering paths)
I read your lesson to find the answer but i don’t find it, perhaps i missed something (?)
Thank you, regards

Hello Dominique

BGP by default will always advertise the single best path, for a particular destination, to its neighbours. There is a way to change this behaviour, and this is further discussed in the following lesson:

A distance vector routing protocol determines the best path based on distance where distance is usually measured by the number of routers to be traversed (e.g. RIP), or by another metric that involves additional parameters (e.g. EIGRP). BGP on the other hand is a path vector protocol which maintains the path information to the destination as well, including all of the autonomous systems that have to be traversed to get there. Apart from all of the additional parameters that can be configured on BGP, it will find the shortest path based on the number of ASs it must traverse to get to a destination.

BGP and IGPs are the same only in the fact that the best path is chosen and placed in the routing table. The way it is measured in each case differs substantially.

I hope this has been helpful!

Laz

Hi Laz ,

Lets say R1-R2-R3 is forming Ibgp neighborship & running fine.

one day someone change the interface MTU value of R2 towards R3 , will the neighborship between R1 to R3 Impact ?

Thanks

Hello Tanmoy

If the MTU of this interface changes, then the exchange of BGP messages between R1 and R3 will be affected in the same way as any data traffic would be affected between these two routers. If the exchanged messages have a larger IP MTU than that of the interface MTU, communication will fail. However, in order to ensure that such changes will not affect a BGP peering, best practice dictates to use BGP Per Session Path MTU Discovery (PMTUD). You can enable this feature on a Cisco device following the instructions in this Cisco documentation.

I hope this has been helpful!

Laz

Hi Laz,

I was doing a capture of an eBGP session between two routers, and I don’t see any Update messages being exchanged… Only Keepalives. Shouldn’t Update messages be sent every 30 seconds?

image

Thanks,
LP

How accurate is this statement
“The marker field on top is used to indicate if we use MD5 authentication or not. When it’s filled with 1’s then we are not using authentication.”

When I wireshark between two routers and remove the “neighbor passowrd <##>” I do not have the marker field change from all ‘f’ to all ‘1’. There is an option under the TCP packets which is removed when the password/MD5 is removed. However my Marker field does not change. Was anyone else able to have the marker field change?

Hello Luis

Thank you for this question, it identifies what I missed in my previous post. I didn’t make clear that the UPDATE messages are not sent every 30 seconds by default. They are only sent when the neighbor peering is established, and when there are changes in the network topology. Notice what the output of your command states:

Default minimum time between advertisement runs is 30 seconds.

This timer, which defines when UPDATE messages should be sent, defines the minimum time not the maximum time. Therefore, you may have hours or even days pass without an UPDATE. But the keepalives must be sent periodically. This is why you only see keepalives and not updates.

The minimum is defined in order to avoid instability in the BGP routing topology in the event that there are flapping routes. A flapping route is one that continually changes over a small amount of time (on the order of several seconds). This usually happens due to bad network design, or incorrect redistribution of routes between routing protocols. This would cause BGP to continue to attempt to reconverge, sending UPDATE messages continually, and thus causing network instability and ultimately network failure. This is especially important for eBGP, and that is why the default is 30 seconds for eBGP, but there is no such minimum set for the default of iBGP, which has a minimum UPDATE timer of 0 seconds.

Remember also that whenever an UPDATE is sent, this acts as a keepalive as well, so for that particular cycle, no additional keepalive need be sent.

I hope this has been helpful!

Laz

1 Like

Hello Ale

Rene states that this field is filled with all 1’s. Note however, that in the wireshark capture, the value of the marker is in hex. Since the field is 16 octets (128 bits) in length, if it is all 1’s then this can be represented in hex by 32 f’s. So a value of ffffffffffffffffffffffffffffffff seen in wireshark is indeed a marker field of “all 1’s”.

Indeed, according to RFC4271 the marker field MUST be set to all ones, and the use of the marker field for authentication has been deprecated. Even so, this field is kept there for compatibility reasons.

So, to answer your question, the behaviour that you saw in your configuration is normal. The marker field will always be composed of 128 ones in binary, or 32 f’s in hex.

I hope this has been helpful!

Laz

Hi Laz,

1)please define the attributes and differentiate thoroughly like what are the main attributes and what attributes come under these and so on…

2)second thing in wire shark what is the withdrawn route length unit ? please explore this like how many value can come under this?

Hello Pradyumna

The attributes included within the update message are the well-known BGP attributes used in the path selection algorithm. More about these can be found in the following lesson:

Rene further describes the information made available in the update message for each individual BGP attribute. If you want to see more detail about what information is included within the update message, and its structure, you can see this in section 4.3 Update Message Format of RFC 4271 where BGP is described.

According to the RFC mentioned above, the Update message has the following fields:

  +-----------------------------------------------------+
  |   Withdrawn Routes Length (2 octets)                |
  +-----------------------------------------------------+
  |   Withdrawn Routes (variable)                       |
  +-----------------------------------------------------+
  |   Total Path Attribute Length (2 octets)            |
  +-----------------------------------------------------+
  |   Path Attributes (variable)                        |
  +-----------------------------------------------------+
  |   Network Layer Reachability Information (variable) |
  +-----------------------------------------------------+

Note that the first field is the Withdrawn Routes Length field is a fixed size field of 2 octets, while the second, the Withdrawn Routes field, has a variable length. The Withdrawn Routes Length field contains an integer that indicates the total length of the Withdrawn Routes field in octets.

I hope this has been helpful!

Laz

what is the total BGP messages Length are in Bytes Like open,Update,Notification and keep alive??

Why the path attribute length is 0 in this below pic ??

When the neighbor gets down our we manually shut the peer which message is sent ??

Hello,

Is there a limit on number of routes advertised within BGP within a particular update message ?

Context for this question:

  • Have BGP site to site connection from my Gateway to AWS
  • Need to know how many routes at a time I can advertise within single BGP update message. For example: if I have new BGP connection with more than 50 networks(let’s assume I cannot summarise owing to discontagious network). Will all 50 be advertised at once using Updaye message or is there any limit.
    Not able to find this in RFC

Hello Rinat

According to RFC4271, the maximum BGP message size is 4096 bytes. However, RFC8654 updates this to 65535 bytes. In order for this to function, both peers must have this extended message capability, and this is advertised between the peers using a Capabilities Advertisement.

Now if the size of your BGP table and the number of prefixes being advertised result in a BGP notification message that is larger than that, then the information is segmented into multiple BGP messages.

Now you must keep in mind that BGP is considered an Application layer protocol, and uses TCP to transport its updates. If the BGP message is too large for the underlying network infrastructure, it will still segment the message into multiple TCP segments, which will then be placed in mutiple IP packets and so on to be sent.

According to the RFCs above, A BGP message, when received, will not be processed until it is received in its entirety and reassembled.

Now having said all of that, the question that comes to my mind, and probably to yours is, how much space within a BGP notification does a route take? The answer is it depends because each path can have a whole slew of information attached to it. However, to get an idea, you can take a look at some packet captures. I took a look at this one and found a BGP update with a length of 132 bytes (in total). It contained a single route of 1.3.0.0/4, but also included a lot of path attributes.

So this might help you to gauge what size your BGP notifications will be.

I hope this has been helpful!

Laz

1 Like

Hello Laz,

Thanks for this interesting information about 65535 bytes within RFC 8654.

Also in simple words it would depend upon how a particular route has been advertised by the peer using the path attributes. For example: within the pcap there are some updates of 96 bytes(path attribute length 7)/ 114 bytes (path attribute length 21)and one that you mentioned at 132 bytes(path attribute length 43) as well. Looking at them they all have more or less same attribute value but different subnets are advertised. So definitely different attributes length or rote withdrawal (89bytes) would make a difference.

Thanks for the pcap which answers my question to the point.

Question arises fro lm my LAB setup using BGP between Cisco CSR and AWS Virtual Gateway
Also to add context I had an interesting LAB setup using CSRv as Customer gateway and VPN with AWS Virtual gateway. Wanted to test the capability of 2 vpns using BGP to same Virtual gateway. I was checking the BGP updates by adding more than 100 routes (only testing) and that’s when I stumbled upon this question with regards to number of advertisements swnt at a time over BGP.

Hello Rinat

I’m glad your question was answered clearly. Thank you very much for your clarification of your scenario, as it adds further understanding to your requirements and the reasoning behind the question. Glad to be of help!

Laz