Okay. So we're now going to look at the weight. I've included weight in the list even though it's not really an attribute. A BGP attribute is passed from BGP speaker and from AS to AS -- a weight isn't passed from any BGP speaker. It's just local to the router and it's stored within the BGP RIB when prefixes arrive on the router so I like to see weight as a local preference that only applies to the router and indeed it overrides the local preference as we'll see later highest weight wins easy to remember I think a little bit like local preference highest local preference wins it can be applied in a number of ways we can apply weight to all rights from a neighbor so you can apply weight directly on the neighbor peering it can be applied to write based on a filter as well and it can be applied within the policy language that's Cisco IOS and other vendors implement also so when would we actually use weight well we've got a couple of examples here which have been used and are used on networks on the internet today the first example is to help deploy RPF RPF is reverse path forwarding it's a common check used to catch spoofed source addresses coming from adjacent networks and the internet today so we refer to the diagram if we want to deploy RPF in this case and this is an example of an autonomous system that has got two links to a neighboring a s if we want to deploy RPF on this then we need to use the weight otherwise we end up with severe problems with connectivity so let's look at the diagram the link from s1 to s4 from router B to router C is the primary link we also have a backup link from router e2 right see what we want to do is up all the traffic go from s1 to s4 over the b2c link so what we do as we've learned when we looked at the local pref attribute is set high local preference on it so I think that should be quite clear high local pref make it 200 outbound traffic from s1 to s4 go some router be to write a seat we have the backup link from router a to router C so if the primary path fails then traffic will use the AC link what now if we want to implement RPF well reverse path forwarding check will check the source address of the packets coming from router C to make sure that they're reachable back through the link they came in on so if we turn on our PF in router a on the link to router see what would happen and the scenario were set up here well is one was set local prep 200 on the path B to C so all prefixes from a s 4 as seen in s 1 of local craft 200 including those on router a so when router a does the RPF check a legitimate packet comes in from a s 4 the source address is a s4 address space what's the best path well the best path has local preference 200 from router B not back on the direct link to rata C so there are PF check will cause router a to drop that packet even though it is valid this is bad so to work around it what we do is all prefixes we learn on router a from router C we set a high weight from a clear weight even 100 it's the only path we're hearing prefixes directly on everything else we hereby bgp has weight of zero so this half will win right so that means the RPF check will succeed because now the best path only from router a to router c is alone on the direct link for the rest of a s1 the local preference 200 will indicate that the best path is through router B and onwards to router C we have included a description of how you RPF works elsewhere in this series the second example of the use of the wait is for traffic policy many operators use this if they're trying to give specific paths for specific and users or end-user customers of theirs here's an example that I've commonly been involved in and it shows how to give particular set of customers a particular transit to other autonomous systems the diagram has a s1 as the service provider and maybe a couple of up streams a s4 and a s7 giving connection to the rest of the Internet now what es1 wants to do is most of its customers that are connected to a s1 war head through router B to use the big link to a s4 to get to the rest of the internet router e also has another connection to another upstream maybe a smaller link may be a bigger bandwidth link who knows and it may have some customers that are also connected to router a there could be a particular class of customers they could be transit customers again whatever the operator has decided what we want to do is to have the customers connecting to router a to use the direct link through a s7 and then to a s4 to see the internet while the rest of a s1 simply uses the main transit link from B to C to a as for now if we want the whole of a s1 to use the main transit link we set local preference to hundred and everything we hear from router see the problem with this is that router a then sees the best path - router B so any of the customers connected to router a would see best path to B even though they have an external link to a s7 and they're not ears for so where we fix it for router eight customers is to set a weight of 100 and all the prefixes we learn from air seven and then router a customers would use the outbound path to air seven for their internet access so this is how weight can be used to override local preferences for localized traffic policy it's an extremely useful feature for BGP and is used by several operators and fairly specialized situations like this so as a recap the weight is not a BGP attribute but it is actually stored in the BGP RIB it can be set on the local router and is used by the local router in a case where the network operator wants to override the local preference that's used for the autonomous system.
© Produced by Philip Smith and the Network Startup Resource Center, through the University of Oregon.
Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
This is a human-readable summary of (and not a substitute for) the license. Disclaimer. You are free to: Share — copy and redistribute the material in any medium or format Adapt — remix, transform, and build upon the material The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms: Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. NonCommercial — You may not use the material for commercial purposes. No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.