What is OSPF and How Does It Work?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what you want the routers to be able to forward traffic all the way through the network are you kidding me in this video i'd like to chat with you about how ospf from a high-level perspective how ospf does its magic of figuring out how to forward packets and to start i'd like to introduce you to this topology so in this topology for open shortest path first i would like to acquaint you with the numbering system that we're going to go ahead and use up here we have area zero over here on the left we have area one and over here on the right we have area two and for the network addressing we're using ten as the first octet and following that the second number is going to be the area number so over here in area one we would expect the networks to have in their second octet of their ip address one and over here in area two a two and an area zero a zero and then for the links between routers like between r1 and r2 and r3 and r4 and r2 and r4 and r1 and r3 i'm just using the two router numbers there from lower to higher so this would be 12 in that third octet and this would be 13 in the third octet and this would be 24 between r2 and r4 in that third octet and between r3 and r4 would be 34. and that logic continues down between all the other routers as well so in this overview let's talk about how ospf does its work let's imagine that we've got r1 right here and r1 has information about its directly connected networks or another way of thinking about that is the state of its links and with its links i'm referring to gig one zero gig two zero and gig zero zero and so at the heart of ospf is something called an l lsa that's a link state advertisement and one of those types of link state advertisements is created by each router and regarding itself that's always a great place to start let's start with ourselves r1 would have a link state advertisement that talks all about it so let's imagine that this is router one's link state advertisement now inside of this information this link state advertisement r1 has three interfaces three links and so it would talk about if we open up the details in that advertisement it would have okay i've got information about network a and network b and network c and that would all be part of router one's lsa now if we have 20 routers we're going to have 20 different router lsas these information from each of the routers with all the details in them so perhaps this represents a collection of lsas from the different routers so if we took all these lsas together we could consider them like i don't know some kind of a bigger database of lsas in fact that's what we do call it it's a link state database so all the routers learn and discover information about all the lsas and they put them into a link state database and why is so they can take all the information regarding the network and then calculate the best path of how to forward a packet to any given network because they have all the data but one of the problems is is how how does the information like get all collected i mean if router1 knows about his lsas but how does he get the lsas from the other routers and other devices on the network and the answer is they share and so with ospf what happens is ospf uses little hello messages and if you send out a hello you're basically advertising your id and that you're speaking ospf and you're super happy about it and if you see somebody else who is saying hello is on the same network segment what can happen is these two devices can become friends and those friends are called neighbors meaning their neighbors on the same segment and not only can they become neighbors but they can also be considered fully adjacent and here's what fully adjacent means it means that these two routers are willing to share everything it's like complete disclosure i'm willing to share all my information with you let me give you an example so let's imagine that you and i are router one so we've got our collection of link state advertisements in this link state database and each of those links data advertisements has details about the networks regarding a specific router so we have all this information and then we start seeing these little hello messages between us router one and router two and they go something like this hey this little multicast message on the local segment hey i'm a router running ospf so the short version is that after we see some hello messages we can negotiate and when we do that we'll go ahead and compare our link state databases so maybe this is what ours looks like we got like one two three four five six six major elements with details in each one of those and let's imagine that our neighbor says uh here's what i got so what's this neighbor gonna do this neighbor is going to ask and request updates so it can get the current database of all the lsas for that area of the network and router 1 is going to comply it'll go ahead and send copies of all the lsa information that router 2 for example doesn't have so it would look something like this boom and then on router 1 and router 2 the link state databases would be identical they have the same information and then router 2 can use all that data with all the link information to calculate its best paths from its perspective to forward traffic to anywhere on the network so link state databases is a collection of the link state advertised information and that's how information gets shared in ospf and i should also point out that if something changes uh let's say there's an lsa change that r1 becomes aware of either on his own router or learning an update from somebody else what he'll do is he can communicate that update to his neighbors so that basically everybody is going to be up to date in just a few seconds because there's a change those changes get propagated through the network and ideally every single link state database in the area for each router is going to match now one of the challenges is this if we have to collect link state advertisements and put them in a link state database and there's hundreds or thousands of routers that is a whole bunch of data to have to grind through and calculate if we're trying to figure out our routing table so instead of having to have every router get a copy of all the links date advertisements and put them in a huge link state database we can carve the network up into smaller chunks think of it like instead of having a huge room where we have to memorize everybody else's name and get information from everybody else instead if we have a smaller room we can just memorize and learn the information for everybody in that smaller room and that's less overhead so there'll be less link state advertisements our link state database will be smaller and as a result there'll be less overhead on the router so in this topology uh we've identified that we have area zero here area one here and area two here and let's go back just for a moment to the lsa on router one so router1's lsa which has information about his three networks that he's connected to that lsa itself no longer has to go to every single other route in our entire topology instead this lsa regarding r1 only has to be shared with other routers who are also in area 0. and this specific lsa for this router does not have to be sent down to area 2 and it doesn't have to be sent down to area 1. so from a visual perspective it looks like this so here's router 1's lsa it has the information about the link states for gig zero zero gig two zero and gig one zero and that information is going to be shared with r2 it's going to be shared with r4 it's going to be shared with r3 but those are the only four routers in that area so router 5 doesn't ever have to get a copy of it router 7 doesn't router 6 does not router 8 does not because the lsa for this router stays in the area sort of like the vegas thing what happens in vegas stays in vegas now there's one other question that when i was first learning ospf maybe two and a half decades ago but one of the questions i had was well how does how does the information like the router ones lsa with its link information how does that find its way all the way down to a non-directly connected router so in our topology how does how's r4 learn about r1's lsa they're not directly connected neighbors and the answer goes back to being willing to share so if we have a neighbor that we are adjacent with and we're going to become fully adjacent we're going to share everything so if this is the neighbor that's adjacent it says well i don't have this lsa something's wrong we can share that over with that neighbor so every router in an area is going to have identical lsa information in their link state databases so the point i wanted to make is it's not directly r1 in our topology it's not directly r1 who's communicating over to r4 saying here's my lsas it is r2 or r3 or both of them that are willing to share our one's lsa with our four because they are neighbors with him so the end result is that every router in an area is going to have exact copies of all the link state advertisements associated with that area and that's what makes up the link state database for that area and there's just a couple more things i want to share with you before we close out this overview and that is when i was first learning about ospf they said okay it's multicast traffic and then i thought well multicast class d addresses where you send out a packet to a multicast address and a group of devices that are listening can receive that but there's also the concept of multicast routing which is way above and beyond the scope of what we're talking about with just multicasting to neighbors so although ospf uses multicast addresses which we'll talk about more in a different video that multicast is for the local segment only so a multicast that's being sent from router 1 is not being routed around the network or anything else multicast with 224.00 anything are local and so they're just meant for other devices on that immediate segment and it's a mechanism that ospf uses but it's not using multicast routing we're actually routing an individual packet over a multicast network so it's just for the local segment for two neighbors to use that multicast to communicate with each other and because i already brought up the concept of areas i'd also like to introduce just a little teeny bit more on areas in this ospf overview and that is this that networks belong to one area so for example this network right here between r6 and r8 that is associated with area 2. the network between r4 and r6 is associated also with area 2. networks up here between r1 and r2 are going to be associated with area 0. so it's it's more appropriate or more accurate to say that networks are assigned to be in specific areas as opposed to a router because a router could have an interface in area 0 and it could have an interface in area 1. so each of the networks are going to be in one and only one area but a router could actually be connected to two or more areas and when that happens we have some special terms for those routers so this is router four which has three interfaces in area zero it has one interface in area two and this router has the ability to forward routing information between these two areas this backbone area area 0 and area 2. and that router with that capability is called an a b r an area border router think of it like a gateway between the backbone area and the area 2. and the same thing is true over here for r3 it's also an abr and area border router because it has some interfaces in the backbone area and it has another interface in area 1. so it is an abr between the backbone area area 0 and area 1. so that's a high level overview to the concepts of ospf and as we continue on we're going to dig in in quite some detail regarding lsas and how to view them and where they show up to make sure we're comfortable it'll also support this with labs now if you are brand new to ospf meaning uh i can barely spell it that's a joke um if you're fairly new though to ospf i would invite you at cbt nuggets as part of your subscription to go check out the ospf sections in ccna that's the ccna for 200-301 there's two sections one is on the concepts one's on implementation they also have labs and that'll help give you a really good foundation that you can build on as we continue to focus on ospf at the professional level here so i'll see you in the next video meanwhile i hope this has been informative for you and i'd like to thank you for viewing
Info
Channel: CBT Nuggets
Views: 10,346
Rating: 4.963964 out of 5
Keywords: cbt nuggets, it training, it jobs, it certification, it learning, it training program, tech learning, tech training, tech education, certification training, training courses, it career, career progression, it tutorial, e-learning, ospf explained, what is ospf, open shortest path first, routing protocols explained, ospf routing protocol, ospf explained step by step, ospf explained simply, routing protocols, routing protocol, link state advertisement, how ospf works
Id: Xb3CbIDMDRk
Channel Id: undefined
Length: 12min 7sec (727 seconds)
Published: Wed May 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.