Route Prefixes: How Does a Juniper Choose a Route?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so the junos running device compiles prefixes or learned routes from multiple sources these could be directly connected routes static routes or even dynamically learned routes now we're going to talk about static and dynamically learned routes in a little bit more detail as we progress through the skill but just for now understand the concept that we can get routes from many different sources how then does the juniper device know which route is actually the best perhaps it learns a prefix from both a statically configured route as well as ospf how then does juniper choose which one it should actually use and forward traffic to that's what this nugget is all about as we set up what's called the route preference as well as keep in mind some other core routing concepts like the longest match let's get going talking about how juniper devices choose their best destination for the next hop let's go now an astute observer may have seen this in the previous nugget but we didn't really cover it and that's how does a juniper device choose which path is the best path to go towards when it has multiple paths to get there think about it again like the road map where we were sitting at the intersection of a street but where our destination was pretty far away we could have actually taken a couple different paths in order to actually get to our destination but one of those paths would have probably been the fastest way to get there and how does our router know the fastest way to get there well there's a bunch of different ways that it chooses and the first thing it comes down to is the most specific prefix always wins let me set up this scenario right here where host 7 is once again trying to ping host 8 and let's say host 8 is at 10.8.8.8 so when host 7 sends its destination icmp packet into the packet forwarding engine of vmx1 here how does vmx1 know how to treat this traffic or which route to send it through the first thing we could specify is we need to have routes in place that say okay well your next hop is going to be this way so if we had a route installed on the device for 10.0.0.0.8. send it to 2222 that's vmx2 right here as well as a route for 10.8.8.0 24. send it to two two two two even though the next hops are the same we have two separate routes here this is for ten dot anything and this is specifically for 10.8.8 and that's a pretty big deal to think about so we know oh wait this is the exact prefix that i'm trying to reach that's better than this kind of catch-all prefix it's kind of like this all-encompassing casting a wide net prefix so juniper devices as well as many other vendors prefer to use the most specific prefix meaning that the most specific network bits or the longest match is what is chosen over the shortest match or the least specific prefix match this is a very common network engineering design technique where we actually specify specific prefixes and destinations that we wanted to go to but then kind of have this wide arching catch all just punted in this area route just in case another packet comes in destined for the tin prefix but it's not destined for 1088 in this case so this is the first major talking point about how a juniper device chooses what is the next hop or the most preferred destination to send traffic to and that is with the most specific prefix it comes down to the longest bit match or the longest prefix match the next item is what happens when we learn about prefixes from different sources for instance let's say vmx1 here learned about 10.8.8.0.24 from a static route that we statically or manually configured on this device but then it also learned about the exact same prefix 10.8.8 24 from a dynamic routing protocol like ospf again these are things that we're going to talk about in the upcoming nuggets but right now we're just kind of setting up the fact that our routing table could be populated with routes that are learned from various sources there's things like static routes ospf isis bgp and so on what really this comes down to is juniper assigns a value to each one of these route sources and you can kind of think of it as a trustworthiness if we manually assign this route ourselves we know we're being pretty explicit we did that if we went through the effort to create that route that static route is going to be our most trustworthy source then there's ospf learned routes if we learn routes from an ospf neighbor we'll trust that more than we would an isis learned route and we would trust that more than a bgp learned route and juniper calls this route preference other vendors call this administrative distance but juniper calls it route preference so in an exam environment if you see route preference that's where your head should go if you're coming from a cisco world you should be thinking oh wait that's like administrative distance and this is where we can actually go to see route preference in action back on my vmx1 device here if i give it a show route this is what we're talking about you may have actually seen this in the previous nugget we have our learned source right here but then the number that comes after this slash is the route preference and the route preference has default values by default anything that we are directly connected to has a route preference of zero any statically created route has a route preference of five any ospf learned route has a route preference of 10 and i'm going to stop right here because this is really the point that we're trying to set up the lowest number always wins the lowest preference is what always wins and it's easy to get this confused with metrics and we haven't really talked about metrics and honestly we don't really need to get into metrics because that's something that comes up in the jnc is exams as we start to dig in to the actual routing protocols themselves for now you should just know that what we're really looking at here is the source of our protocol and then the actual route preference so below this i see static and then a route preference of five and then the upcoming nuggets we'll actually get into ospf and you'll see the ospf preference of 10. but just for your other information isis has a route preference of 15 ospf external has a route preference of 150 bgp has a route preference of 170. in fact i'd like to actually defer you to juniper's documentation because there's a lot of other route preference values that you should know about you've of course got the ones that we've just talked about like directly connected and static routes but then if we scroll down some more you'll actually see the different isis level routes so the level one internal route for isis was 15. the level two internal route for isis is 18. again don't worry about that until you start to get into jncis you can scroll down some more and you see things like rip pim aggregate routes bgp and msdp the point is is that a static route would always be considered preferable over the exact same ospf route but remember the more specific prefix would always win so you could be in a scenario where you have two prefixes installed in your routing table 10.8.8.0 24 was installed by ospf which has a preference of 10 and then 10.0.0.0.8 was a static route which has a preference of 5. however if we were trying to ping host 8 at 10.8.8.8 which one would actually win the most specific prefix 10.8.8.0.24 even with the less preferred preference would always win the most specific prefix always wins so that's understanding how juniper devices select the next hop route i hope this has been informative for you and i'd like to thank you for viewing
Info
Channel: CBT Nuggets
Views: 1,678
Rating: 5 out of 5
Keywords: cbt nuggets, it training, it jobs, it certification, it learning, it training program, tech learning, tech training, certification training, training courses, it career, career progression, it tutorial, e-learning
Id: 8rIIIOKLpqE
Channel Id: undefined
Length: 7min 49sec (469 seconds)
Published: Thu Feb 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.