Welcome to this CertificationKits CCNA training video on OSPF. We are going to be doing in overview of OSPF, the different tables OSPF uses, how it's gets a router ID and what that router ID is for, how it goes about establishing neighbor relationships and troubleshooting the establishment of the neighbor relationships. If OSPF is not able to establish a neighbor relationship with the router it will not exchange routing information and then the Dijkstra Shortest Path First algorithm how that functions and what that’s used for.
Just take a look at this CCNA diagram. For OSPF to function we want OSPF to run here, and what OSPF is going to do for us, it's going to all these routers talk to each other and share the information of their directly connected subnets, so router B here will share the information of subnet 99.16 and subnet 99.40 with the router A. Router A will share its information with router B, router C eventually each router will know about each of the individual five subnets in this diagram. So as a CCNA, to get this to function appropriately, we are going to need to do some certain things to make sure that OSPF will share this information so we are going and enable OSPF on each router. What we do is we type in router OSPF and then what's called a process ID number. This number does not have to match on each router. All it is — it's a number that allows the router to keep track of this particular instance of OSPF on its router. There may be situations where you might have more than one instance of OSPF running on your router. The individual number allows the router to keep track of each instance so I could router OSPF 1 here, router OSPF 10 here, router OSPF 30095 on router C if I wanted to. I probably won’t do that, it doesn't hurt if I use the same number so I usually use the same number just to keep it simple so you got router OSPF 1. Now the next thing I have to do is I have to tell it what interface is I wanted to route for and we'll get into that in more detail in another CCNA video.
Real quick, I'll do what's called publishing the interface and I type in network 99 and I am going to have all interfaces being in 188.8.131.52 and I'll use what's called a wild card mask now the wild card mask tells the router what parts of this line right here, what parts of this address has to match up against the IP address on the interface. So if I have an IP address of 184.108.40.206 on this interface and an IP address of 220.127.116.11 on this interface, the wild card mask will compare the IPs on the interfaces of the router with this statement. So by having a wild card mask of 0 255.255.255 what that means is when it goes in and compares it says okay zero means the IP address on the interface, I am comparing with this interface right here must match what's in the first octet of the statement which is 99, is that a 99, yes it is. The 255 means doesn’t matter what's in the second octet, 255 means doesn’t matter what's in the third octet, 255 means doesn’t matter what's in the fourth octet. So the only spot that has to match is where this zero is which is in the first octet, so it says any interface with an IP address that starts with a 99 is going to apply to the statement.
So I have cleaned this up a little bit so we can actually read it so to reiterate one more time, the 0 means, it's going to compare the first octet of this address I put here which is 99 to the IP addresses on the interfaces of the router. Each of the IP addresses on the interface the router have a 99 so that matches what the 255 tell is it doesn’t matter what's in the last three octets, so as long as IP address on the interface starts with the 99 it’s going to match the statement and what the statement says is I want the IP addresses or interfaces with an IP addresses start with 99 to be in area 0. OSPF is sectioned off into areas. And what an area does it allows the OSPF protocol to minimize the amount of routing information that needs to go to every router in the network. Area 0 is always your backbone area. In the CCNA video areas with OSPF we will go in and take a further look at configuring OSPF with multiple areas in the importance of area. But the key thing here is we're just trying to get a look at how OSPF is going to establish neighbor relationships and what it does to exchange the topology information.
The first thing is it only establishes a neighbor relationship with the router that has an IP address on the next top in the same area. So this interface is an area0 this interface is an area 0. And if I want router A to exchange routing information with router B, this interface has to be in area 0. So I would do a similar command on router B. Now once I specify the area information OSPF and I turn it on, OSPF is going to send it out these hello packets. These hello packets are ways that the OSPF protocol uses to meet — have the routers be friendly with one another. This is how they make their friends and they only exchange routing information with their friends as hello packets are going to out every ten seconds by default and there's a dead interval of 40 seconds. So after 40 seconds of not hearing from their friend they get really worried and that they think that particular route is down. The information in these hello packets is very important and it’s got to match up. There's a subnet mask the subnet mask doesn’t match but are not going to share with each other. The subnet ID has to match and that goes with pretty much any protocol though if the subnet ID or the IPs are not right, they are not going to share information you want to be able to ping, so you got to be able to ping each other. The hello interval must match again 10 seconds by default and that can be changed at the interface. The dead interval is always 40 seconds so it’s 4 times the hello interval (CCNA exam question). So if I change the hello interval to 20 seconds then the dead interval would be 80 seconds. So whatever the hello interval is it’s 4 times that for the dead interval.
And then the OSPF area ID must match so if I want all these routers to share information with each other, the interfaces that match up with each other have to have matching area ID so this interface has to be in the same area as this interface. After comparing their hellos, then the routers determine that they would like each other as long as all that hello information matches. Then they will start exchanging topology information. And what they do is they exchange what's call a topology database. And what it is, it’s all the information that's — that they collected to figure out how the network looks so they kind of get an idea of how everything is connected based on the information, from this, they get from their neighbor routers. They do a full topology database exchange. Now they use what are call database description packets to describe what the database looks like. Can you get in there just to trying a picture of the network? That’s not the way that a distance vector protocol works, link state protocols carry this topology database and get a picture of what the network looks like. RIP, IGRP, distance vectors, they don’t care, they just discard information that they don’t use and they just take the best packets available to them at that time. Once they have built this topology database, OSPF then uses what's called the shortest path first algorithm math stuff. And they run this algorithm against the information in the topology database. That’s how they determine what the best cost path is. Once they have determined the best cost path by running the shortest path first algorithm in the topology database, they put the best cost path in their routing table. And, they store the other information, so that’s why OSPF is CPU intensive because it has to store this information and run this complicated algorithm against this database to determine what the best cost path is. But it's gets a really good idea of what the actual best path to take from one destination to another would be.
So, they’ve got the topology database, they’ve got a routing table, and they’ve got a list of friends that are directly connected that they share this information with. Now, the router ID is what they use to identify their friends, everybody has to have a name that they go by and OSPF uses a router ID as its name, so the friend can identify the neighboring routers based on this router ID. So, it has something to refer to the other routers with. Let's take a look at how these get their router ID as we need to know this in our CCNA lab.
I’ve cleaned this slide a little bit and let's go take a look at how the routers get their router ID for our CCNA exam. Now, the router ID is determine by an IP address on the router, the router determines its own router ID, what it'll do is it'll look for the presence of a loop back interface, a loop back interface is an interface you can use basically kind for management purposes. What it does it allows you to have an interface that’s not applied to a physical interface, so this is more kind of like a logical interface and it's something that you can actually even ping and always test connectivity, so if you can hit the loop back interface you know, at least one of the interfaces is up on in the router and something is functioning there. You can also use it for monitoring purposes things like that. So a loopback interface if it's there is a management interface and the highest IP address on a loopback interface would become the router ID. If there is not a loopback interface present the highest IP address on an up and up interface would become the router ID.
So, when all neighbor tables, it’ll have the same router ID representing that router and again the key thing is here is up and up, if the interface is not up for layer one and layer two it's not functioning and it will not use that IP address as a router ID. So, the router ID for router A since this is the highest IP address it's got, would be 18.104.22.168, for router B the router ID would become 22.214.171.124 here become 126.96.36.199 and router Cs would be 188.8.131.52 because that’s the highest IP address on router C. So, in router Cs neighbor information, it’ll have a neighbor of 99.40 01 and in router as neighbor information it'll have a neighbor of 184.108.40.206 because it only uses one router ID. You could also use what's called a router ID command and specify the router ID if you wanted to, but it's nothing that needs to be done, if you just let the router do its thing, it will take the highest IP address on an up and up interface and use that as it's router ID to identify itself to the neighboring routers.
Let's take a look in the CCNA lab simulator. I’ve got three routers configured just like this is in the CCNA simulator and we’ll go in and look around for a minute. So, on Palaestra1, if I do a show IP OSPF neighbor, it shows me the neighbor ID 220.127.116.11 it's doesn’t show me the next top address as the neighbor ID, this is the next top address, this is the neighbor ID, that ID will represent router B in all of its neighboring routers, neighbor tables. So, if I look at Palaestra3, show IP OSPF neighbor, it would show me neighbor ID of router B again 18.104.22.168 and it just happens to be the next top address on this one. So, what I would do is if I did a show IP OS or show IP route and I wasn’t seeing the Os in here, O means OSPF. If I did not see the OS in here, what I would want to do first is figure out whether or not the OSPF process is establishing neighbor relationships. So, I would use this command show IP OSPF neighbors. And, it shows me that there’s a neighbor, if there’s not a neighbor then I want to go through and check everything. I want to take a look at the interface that I am running OSPF on, and I see serial zero it's — I check to make sure it's up, the line protocols is up and I would look at the IP address, 22.214.171.124 with the /13 subnet mask.
What I would do is I would do show CDP neighbors detail command and take a look at the neighbor router IP 126.96.36.199 and I’d make sure that they were compatible. If I had to I could even tell that into Palaestra2– it's not – oh, I haven’t set password yet to turn this, so I’ll do it the cheater way. I’ll do show interface and check out the IP address so she’llrun and I would look at this interface right here serial one is the interface on Palaestra2 that connects to Palaestra3 and look at the IP address 188.8.131.52 notice /13, remember if the subnet masks don’t match in the hello packets and the IPs aren’t sharing the same subnet address. Then you’re going to have problems. Also I can’t have the same IP. If they’re both 99.40.01, I’d have an IP conflict. So, I got to make sure that the IP stuff is fine.
Once I've verified that the IP information is fine, I would check one other thing. I would use the show IP OSPF interface command because remember if the hello information isn’t right, then they’re not going to share information and they’re not going to become neighbors all that stuff. So they have to agree on everything, they have to agree on the subnet, the IP scheme, hello interval, dead interval. If they disagree on any of that they’re not going to be friends with each other and they’re not going to share the information. So it's very important that they get along. So, again I can check the IP herein, you can actually use this command to check the IP subnet mask, Hello interval, 10 Dead interval, 40 and then I want to check that on both routers to make sure all matched up. So, what I do is I’d go back over to Palaestra3, and I do show IP OSPF interface. And, I’d check it out over here serial zero is the one that connects to serial one on router B. The IPs are not the same, but they’re compatible, subnet mask is the same, hello ID is 10, dead interval is 40. Priority, will talk about that a little bit later in the next CCNA video with designated routers. But, the key information matches so they’re able to become neighbors. So, once I verify that again show IP OSPF neighbor and if everything matches up you should see the neighbor router in this list of neighbors. And, what the state means full is that means they’ve fully exchanged all of their topology information and then the router was able to run its shortest path first, algorithm on its own topology database and figure out what the best path to put in the routing table is to get to the particular destination subnets.
So, let's do a quick recap on the trouble shooting of these neighbor relationships. Now, the first thing you’re going to do and why we want to troubleshoot these again is if we’re looking in our routing table, we do a show IP route and we’re not seeing any Os. We want to see some Os in there, O stand for OSPF. If we don’t see them, they didn’t want to go and we want to check some things. First thing I might do is show IP OSPF neighbor and see if I have established a neighbor relationship. If I have not established a neighbor relationship with the router I am assuming I should be able to establish neighbor relationship with; I’ll make sure that my interfaces are open up; I’ll start with just layer one. If this is up, that’s layer one, if this is up that’s layer two, that’s good. I’d verify the layer three information making sure the IP addresses are correct. Remember if the subnet mask does not match or there’s a problem with the IPs, they will not establish neighbor relationships.
So, all layer one, layer two, layer three has to be good. On top of that I need to go in and verify the hello and the dead interval by default the hello interval is 10 seconds and the dead interval is four times the hello-interval so that’s a 40 second default. I can use the command show IP OSPF interface. That will allow me to view the IP addresses as well as the hello and dead interval. Again, this very important because if these guys don’t agree on all of this information and it doesn’t match then they’re going to establish that neighbor relationship, they’re going to share their topology information with each other and the routing tables will not get populated. I would also verify the areas set for OSPF if the interfaces on the neighbor routers so this interface right here and this interface here if they are in different areas they don’t like that so they won’t share information then so, they have to agree on all of that to establish this neighbor relationship and share that topology information. And again, what’s in that topology database is used to calculate the routes with that shortest path first algorithm. So, again it goes in calculates the best cost path based on the information in this topology data base. So, it all hinders on this show show IP OSPF neighbor command making sure that the neighbor relationships are there and all this information matches. If it doesn’t match then it’s not going to function.
So, we’ve done a CCNA overview of OSPF. We've talked about the tables, the topology table, the routing table, the router ID and what’s that for, the process of establishing neighbors and again if the routers unable to establish a neighbor relationship it’s going to exchange routing table, not going to able to route. Troubleshooting those neighboring relationships as well as Dijkstra SPF algorithm. I hope you have enjoyed this overview of OSPF, another CertificationKits CCNA training video.