350-501 SPCOR Cisco CCNP Service Provider – BGP Attributes part 2
Weight and local preference. In this video, we’ll try to understand the two different two major attributes which are used for path manipulations. The first one is weight, which is a more Cisco proprietary attribute. Whereas local preference is a well known optional, well known discretionary attributes which are generally used for path manipulation. And they decide how how to exit the as. Now, these two attributes are used for a common purpose and they will decide how to exit the as part. Like take an example, this is my as and I got multiple routers. Or we can say I got multiple exit paths. I got one connection from connecting to one as probably to ISP one. Or I can say one more as connecting to ISP two. Or it can be connecting to two different autonomous systems.
I want to ensure that by default, this is the default exit path which is going to use. But let’s say I want to prefer this particular specific route. Now, what I can do is I can apply some higher weight on this route, or I can apply some higher local preference on this route, so that whenever my router decides to go outside the Is, it always prefer this route. So that is a major purpose of using these two attributes. So we’ll see how it works with some basic examples. The first we’ll start with weight and then we’ll move to local preference. Also once we understand weight. So both most of the things are in common, except some few differences, we’ll see those things. So first let us try to understand weight. As I said, weight is a Cisco proprietary attribute. So it tells how to exit the autonomous system number.
Like both weight and local preference will do the same thing. And path with highest weight is more desirable. Whichever the route is having highest weight, when you have to exit paths, whichever the route is having the higher weight, that route will be by default preferred to exit it’s local to the router. I’ll explain you this point in detail before I finish this video, but right now I’m just leaving to this point. And weight is a partial attribute and the default weight for all your locally originated routes. Nothing but locally originated routes are here which are nothing but directly connected networks will always have the weight of three to seven, six, eight for the routes which are not directly connected will have the default weight of zero, which means the routes coming from a different router.
Let’s see how this weight is going to affect the PGP path selection process. So first I’ll take one example. Here the similar diagram which I used in our previous videos. Take an example. I got a 20 dot network which is my destination. And I have a ten dot network somewhere here in as 500. So I want to ensure that this as 500 dot network should be able to reach 20 dot network. Now as they are in different as this 20 dot network will be a reduced in the BGP and it’s getting A reduced from this side. Here you can see. And this 20 dot network will have only one autonomous system as hop with his origin code and it is receiving from this side with only one as hop. And the same time the route is also getting a reduced from the other side from this side.
And when as 500 routers or this router receives the tendriver network, it is going to receive the same network from multiple parts, one is having only one as hop whereas the other routes are having multiple as hops because of the long distance, because of multiple as parts coming in between. Now, when a BGP route is going to carry the autonomous system path information and that will be the default decider which is going to see which is going to simply consider this as a best route. And the reason is it is having least number of as hops. But let’s say my requirement is to ensure that this path should be preferred over this path. I want to ensure that this path should be preferred over this path. What I can do is I can simply go to this router and I can go and apply to this neighbor.
I can apply some weight, something higher weight, because higher value is preferred. I can simply say some 4000 because for this network it’s not directly connected. The default weight is zero on this side and the weight is 1000. Now, when this router decides to go outside the as, it always now it’s not going to listen to the as path information because weight is more preferred than as path. It says this route is having more weight, it’s always going to use this path. So that is the importance of the weight. So using weight, we can manipulate the path, we can decide which path should be more preferred than the other path. So that’s a good thing about the weight. But apart from this, there is one small disadvantage with the weight is the first one, it is a Cisco proprietary attribute.
If you’re running Cisco devices, probably you can try weight. And the second thing, it is local to the router, which means it is not going to impact any other router in the A S. It’s going to only affect the local router. Like an example here, I got one more diagram, similar kind of diagram here. Now, the same example I have used, this $20 network is coming from this side and it is having only one as hop. And also this network is Rodriguez from the other side. And this side I’m having multiple as hops. Out of these two as hops, this will be considered as the best route because of less as hops if you don’t use any weight or any local preference. Now, I want to prefer this route should be more preferred than the alternate route. So that’s my requirement.
Now if you want to do that, what I am going to do is I’m going to apply the weight on this router. I’m going to do this router and then I’ll say weight of something 4000 on this side. Now this side the weight is default zero. Now when this router, when anything comes to this router, it says over this path, this fruit is more preferred because of weight. So now we will decide that, okay, the best part should be going via this side, via 800. But now when this router inside the as decides to go, now if this router comes to this router, then only it will apply the weight. But when you apply the weight on router B, it is not going to impact any other router in the as. Which means it is going to apply only to the local router and only the local router will be the deciding factor or it will decide how to exit the as.
But it’s not going to affect any other router in that is. So that is one of the major difference with the local preference. So let’s try to understand local preference. So when I discuss local preference, probably you will get a more understanding, better understanding on this point. Let me jump to the local preference. Here. The local preference is also the same thing. You can see it defines how to ex how the data traffic should exit. There is and here also the common point, highest value is preferred and the default logo preference value will be 100. But we can increase it as per our requirement. But the major difference between the weight and the logo preference apart from these values is it is advertised to all your internal BGP neighbors within the S. So let me explain you much in detail about this.
So the same diagram, I am coming here. Now this network is getting advertised from this side with only one a stop and coming from this side with multiple airsops. And the default based route is this. Now my requirement is to change the best route and I want to ensure that this route must be preferred route to reach 20 dot network rather than this route. That is my requirement. So what I can do is I can go to this router and I can apply the local preference value and I’m going to say the local preference value of 200. And by default everyone will have the local preference of 100. Now when you do that automatically, this router will start advertising this information to all these rivals within the as. Which means this $20 network will be advertised coming from a 600, reaches 700 and then reaches 800 and then finally reaches router B.
And this router B is going to advertise, router B is going to advertise the same network, whatever it is receiving. Let’s say in our scenario, 20 route network is going to advertise from 600 and then reaches 700, and then reaches 800 and then reaches our router B. Now B is going to advise the same network, not only 20 dot network, whatever the networks it is learning, it’s going to advertise this network with local preference value of 200. So which means now router A. Or we can give some names here. Router C, router D. Now your router A, router C, router D is going to receive the $20 network from both the ends it’s going to receive from this side with this A is hop. And the local preference value will be the default, which is 100. And also it is receiving the route from this side, the other end with the same local preference value of 200.
Now the router A will decide that router S is okay, I’m receiving the route from both the ends and when it decides now router A will decide that, okay, this side the local preference value is 200. So router A will always use this route and router B or router C also will use this route and router D also will use the alternate route. Which means I can say now if you apply weight, it is going to affect only the local router. That is one of the major difference. And it is not going to advertise to any other routers inside the S. It is local to the router. But when you say local preference, local preference also same, it tells how to exit the as, but it is going to advertise to all the routers inside your IGP nothing but IBGP neighbors. It’s going to advise that information along with the network information.
So now every router, it’s going to affect all the routers inside theirs. Which means every router inside the Aus will automatically use the highest local preference value because the network is advised. Whereas it’s going to affect the local router, it’s going to affect all the routers. Now it’s very simple and very important thing to understand is whenever the question says, let’s say you have a requirement that all the routers inside the A’s should exit via so and so router XYZ router if you want, then we generally use local preference. If the question says only router B should exit via this router, we use weight. So that is one major decider when to use local preference and when to use weight. Now weight is local to the router, it’s not getting advertised. So it’s more applicable.
When you have two exit paths from the same router. Weight is more applicable, I can say because if you want to go outside, there’s definitely how to come to this router A to go outside. But when you have multiple exit paths through multiple different routers and you want to manipulate or you want every router inside there should get affected or should do the path manipulation as per your requirement, then it’s more common to use local preference. But these are the two major attributes which are used when we decide to exit the as. When you want any specific route to prefer it depends upon which one you want to use and what is your requirement.
Popular posts
Recent Posts