WEBVTT 0:00:03.180000 --> 0:00:06.800000 Welcome to this video, which for the CCNA Bootcamp is a review of the 0:00:06.800000 --> 0:00:11.920000 OSPF Designated Router and Backup Designated Router election process. 0:00:11.920000 --> 0:00:17.520000 Now before we talk about what DRs and BDRs are and how they're elected, 0:00:17.520000 --> 0:00:21.620000 we first have to do a review of another concept that's actually very important 0:00:21.620000 --> 0:00:25.660000 and related to this, which is loopback interfaces. 0:00:25.660000 --> 0:00:32.180000 So, as a review, interfaces on Cisco devices come in two different flavors, 0:00:32.180000 --> 0:00:35.680000 physical interfaces that you can actually plug a cable into, stick your 0:00:35.680000 --> 0:00:39.380000 finger in the hole right there, and logical interfaces, which have no 0:00:39.380000 --> 0:00:43.840000 cable, it's just a placeholder in the mind of the CPU for adding an IP 0:00:43.840000 --> 0:00:46.160000 address or doing something. 0:00:46.160000 --> 0:00:50.340000 And some logical interfaces come as part of the router, for example, a 0:00:50.340000 --> 0:00:56.220000 VTY line, a VTY line, which is used to terminate telnet and SSH sessions. 0:00:56.220000 --> 0:00:57.480000 You don't have to create that. 0:00:57.480000 --> 0:01:00.480000 The moment you boot up the router, it automatically creates these virtual 0:01:00.480000 --> 0:01:02.500000 things called VTY lines. 0:01:02.500000 --> 0:01:06.260000 Other virtual interfaces, you do have to create, like on your switch, 0:01:06.260000 --> 0:01:12.600000 your interface VLAN 2 or interface VLAN 3 or sub interfaces, or what we're 0:01:12.600000 --> 0:01:15.620000 going to talk about, loopback interfaces, you have to manually create 0:01:15.620000 --> 0:01:19.700000 them. So most logical interfaces have to be created via configuration 0:01:19.700000 --> 0:01:24.440000 commands. Now, the good thing about a logical interface is it's not dependent 0:01:24.440000 --> 0:01:29.620000 upon any keep-alives or any electrical heartbeats or any kind of line 0:01:29.620000 --> 0:01:32.980000 protocol in order to maintain its status. 0:01:32.980000 --> 0:01:37.780000 So, as long as the device is up, the CPU is up in the router or the switch 0:01:37.780000 --> 0:01:43.600000 that the logical interface will also be up. 0:01:43.600000 --> 0:01:47.300000 Now, when switches switched virtual interfaces, your interface VLANs, 0:01:47.300000 --> 0:01:52.280000 those are a little bit in on your physical interfaces, but a loopback 0:01:52.280000 --> 0:01:55.020000 interface that we're going to talk about here is not. 0:01:55.020000 --> 0:01:59.400000 You could have a router or a switch where every single interface is disabled 0:01:59.400000 --> 0:02:03.300000 and down. Nothing's physically plugged into that switch, but your loopback 0:02:03.300000 --> 0:02:06.200000 interface could still be up and operational. 0:02:06.200000 --> 0:02:09.000000 Now, why do we use a loopback interface? 0:02:09.000000 --> 0:02:10.360000 Well, there's a lot of reasons. 0:02:10.360000 --> 0:02:13.800000 So like it says here, we typically used to host the management IP address 0:02:13.800000 --> 0:02:18.320000 for a device. So a lot of times people will say, oh, okay, I want this 0:02:18.320000 --> 0:02:20.060000 router to be 111. 0:02:20.060000 --> 0:02:22.280000 I want this router to be 112. 0:02:22.280000 --> 0:02:26.120000 This one, 1113. So I want to apply an IP addressing scheme that's independent 0:02:26.120000 --> 0:02:30.480000 of my actual networks are carrying data, and I want that to be used to 0:02:30.480000 --> 0:02:33.560000 manage to like telnet or SSH to the device. 0:02:33.560000 --> 0:02:36.900000 So a place in that IP address on a loopback interface is a great idea 0:02:36.900000 --> 0:02:40.060000 for that. It's also great for lab environments to create extra networks 0:02:40.060000 --> 0:02:42.380000 for learning routing protocols. 0:02:42.380000 --> 0:02:45.760000 Let's say that we have a lab environment where I'm a router, you're a 0:02:45.760000 --> 0:02:47.240000 router, and that's it. 0:02:47.240000 --> 0:02:49.380000 It's just the two of us with a cable. 0:02:49.380000 --> 0:02:55.660000 And I want to go on my router and I want my RIP or OSPF or BGP to advertise 0:02:55.660000 --> 0:02:58.220000 like 15 different networks to you. 0:02:58.220000 --> 0:03:01.340000 Well, how are we going to do that if there's just one cable between us? 0:03:01.340000 --> 0:03:05.700000 We can use loopback interfaces because when you create a loopback interface 0:03:05.700000 --> 0:03:14.460000 and you put an IP address on a physical interface, they had a cable. 0:03:14.460000 --> 0:03:18.560000 So I can just create 15 or 20 loopbacks with different networks on them. 0:03:18.560000 --> 0:03:22.380000 And now I've got some stuff I can advertise to you to play around with. 0:03:22.380000 --> 0:03:27.140000 And some protocols such as OSPF use the IP address on your loopback interface 0:03:27.140000 --> 0:03:30.580000 as part of their processing rules. 0:03:30.580000 --> 0:03:33.780000 So how do we create a loopback interface? 0:03:33.780000 --> 0:03:36.500000 Real simple. So here it is before. 0:03:36.500000 --> 0:03:44.920000 All right. All we do is a global configuration level, just type interface, 0:03:44.920000 --> 0:03:46.980000 loopback, and then a number. 0:03:46.980000 --> 0:03:50.280000 Most people typically start at loopback zero, but you don't have to. 0:03:50.280000 --> 0:03:55.400000 You could do loopback 200, but the number is completely irrelevant. 0:03:55.400000 --> 0:03:58.740000 The line, notice the line protocol, even before I put an IP address on 0:03:58.740000 --> 0:04:02.520000 there, instantly goes up because that loopback interface is not dependent 0:04:02.520000 --> 0:04:05.200000 on anything to bring up as line protocol status. 0:04:05.200000 --> 0:04:11.040000 Then I add an IP address of 1111 1111 and now under show IP interface 0:04:11.040000 --> 0:04:14.480000 brief at the bottom, we actually see that loopback interface showing up 0:04:14.480000 --> 0:04:18.880000 there. And if I looked at the routing table, if I did a show IP route, 0:04:18.880000 --> 0:04:24.780000 we would now see a connected route for the 1111 1111.0 network. 0:04:24.780000 --> 0:04:28.980000 All right. So what does this have to do with OSPF? 0:04:28.980000 --> 0:04:33.080000 Well, OSPF, when you first started up, one of the very first things it 0:04:33.080000 --> 0:04:35.920000 does, it elects a router ID for itself. 0:04:35.920000 --> 0:04:38.300000 Think of this as being like a descriptive name. 0:04:38.300000 --> 0:04:44.120000 So whenever this router creates an LSA describing itself, it's going to 0:04:44.120000 --> 0:04:47.660000 plug that router ID in there as the advertising router. 0:04:47.660000 --> 0:04:53.180000 So all the routers out there will know about you as your router ID. 0:04:53.180000 --> 0:04:56.980000 So the router ID is also important in another way. 0:04:56.980000 --> 0:05:01.100000 Not only does it describe you to the rest of the area so they know who 0:05:01.100000 --> 0:05:05.360000 you are, but there's some election processes that take place between routers. 0:05:05.360000 --> 0:05:08.240000 So when I'm forming a neighbor relationship with somebody, that router 0:05:08.240000 --> 0:05:13.920000 ID is critical into determining who's going to play certain types of OSPF 0:05:13.920000 --> 0:05:18.080000 roles. So how does OSPF come up with a router ID? 0:05:18.080000 --> 0:05:21.500000 Well, this is the process that it goes through. 0:05:21.500000 --> 0:05:24.300000 Number one, you can configure it. 0:05:24.300000 --> 0:05:28.340000 Under the OSPF process, there's a router ID command where you can type 0:05:28.340000 --> 0:05:29.420000 in the router ID. 0:05:29.420000 --> 0:05:31.140000 So that's the first preference. 0:05:31.140000 --> 0:05:35.120000 OSPF will look to see if you've manually added a router ID. 0:05:35.120000 --> 0:05:40.560000 If you have not, then OSPF will look to see if you have any loopback interfaces 0:05:40.560000 --> 0:05:42.280000 like we were just talking about. 0:05:42.280000 --> 0:05:46.780000 And it'll pick the highest, the numerically highest IP address from among 0:05:46.780000 --> 0:05:51.580000 your loopbacks. Now, let's say you don't have any loopback interfaces, 0:05:51.580000 --> 0:05:54.440000 then OSPF will look at your physical interfaces. 0:05:54.440000 --> 0:06:00.980000 Any physical interface that is not administratively down will be a candidate. 0:06:00.980000 --> 0:06:04.900000 And so if you have no loopbacks, you'll pick the highest IP address from 0:06:04.900000 --> 0:06:09.540000 any of your physical interfaces or your sub interfaces as long as they're 0:06:09.540000 --> 0:06:14.820000 not shut down. As I mentioned, you can configure the router ID using the 0:06:14.820000 --> 0:06:19.020000 router-id command under the OSPF instance. 0:06:19.020000 --> 0:06:28.820000 Okay, so in broadcast and non-broadcast multi-access networks. 0:06:28.820000 --> 0:06:31.880000 Now, you're probably not going to see non-broadcast multi-access networks 0:06:31.880000 --> 0:06:36.800000 very much. If you're still dealing with frame relay networks, which are 0:06:36.800000 --> 0:06:42.500000 a type of a WAN network, those are considered non-broadcast by OSPF. 0:06:42.500000 --> 0:06:47.420000 But more and more if time goes on, Ethernet and all the flavors of Ethernet 0:06:47.420000 --> 0:06:50.200000 are becoming more and more ubiquitous among networks. 0:06:50.200000 --> 0:06:54.200000 And that's becoming like the only network type that people use these days. 0:06:54.200000 --> 0:06:56.520000 And Ethernet is considered a broadcast network type. 0:06:56.520000 --> 0:07:00.880000 But either way, OSPF elects a DR and a BDR. 0:07:00.880000 --> 0:07:02.800000 So what is the purpose of this? 0:07:02.800000 --> 0:07:03.700000 How does this work? 0:07:03.700000 --> 0:07:05.240000 Well, here's how it works. 0:07:05.240000 --> 0:07:09.140000 So imagine your typical environment where you have an Ethernet switch 0:07:09.140000 --> 0:07:15.820000 and you have several routers connected to Ethernet switch. 0:07:15.820000 --> 0:07:22.480000 Let's say router one, router two, router three, and router four. 0:07:22.480000 --> 0:07:25.100000 Now, let's assume that the links to those routers are all in the same 0:07:25.100000 --> 0:07:37.860000 VLAN. So we'll say this guy is 1.1 .1.1, 1.1.1.2, 1.1.1.3, and 1.1.1.4. 0:07:37.860000 --> 0:07:42.720000 That's the actual IP address on their actual interfaces themselves. 0:07:42.720000 --> 0:07:48.400000 OK, now when you enable OSPF on an interface, one thing the OSPF does 0:07:48.400000 --> 0:07:52.000000 is OSPF has a priority, an interface priority. 0:07:52.000000 --> 0:07:54.820000 Now, by default, the priority is one. 0:07:54.820000 --> 0:07:56.420000 So I'll just put that right here. 0:07:56.420000 --> 0:07:59.680000 OSPF interface priority is the same on all these guys. 0:07:59.680000 --> 0:08:10.520000 OK, so what's going to happen here is that as these routers boot up, one 0:08:10.520000 --> 0:08:13.320000 of them is going to be elected as the designated router. 0:08:13.320000 --> 0:08:15.680000 Now, why do we need a designated router? 0:08:15.680000 --> 0:08:22.440000 Well, let's contrast this with EIGRP as a routing protocol. 0:08:22.440000 --> 0:08:26.560000 Now, in the world of routing with EIGRP, if all these routers here were 0:08:26.560000 --> 0:08:30.540000 running EIGRP, they would all form neighbors with each other. 0:08:30.540000 --> 0:08:33.660000 So if I was on router one, for example, I would see that I had three neighbors, 0:08:33.660000 --> 0:08:36.020000 router two, three, and four. 0:08:36.020000 --> 0:08:41.860000 And in the world of EIGRP, if router one learned of some new network via 0:08:41.860000 --> 0:08:47.120000 that way, he would send that update into the switch, which would get to 0:08:47.120000 --> 0:08:51.540000 router two, router three, and router four. 0:08:51.540000 --> 0:08:54.500000 And then each one of those routers would be responsible for sending an 0:08:54.500000 --> 0:08:58.600000 acknowledgement back to router one, saying, yep, I got it. 0:08:58.600000 --> 0:09:01.760000 If one of the routers did not send an acknowledgement, router one would 0:09:01.760000 --> 0:09:05.660000 resend that update specifically to that EIGRP neighbor, saying, hey, never 0:09:05.660000 --> 0:09:07.180000 got an acknowledgement from you. 0:09:07.180000 --> 0:09:09.060000 Here's some new information. 0:09:09.060000 --> 0:09:13.680000 The desires of OSPF took a different approach. 0:09:13.680000 --> 0:09:17.340000 So the desires of OSPF said, hey, here's what we're going to do. 0:09:17.340000 --> 0:09:21.220000 One router is going to be elected as the designated router. 0:09:21.220000 --> 0:09:24.600000 Another router is going to be elected as the backup of the designated 0:09:24.600000 --> 0:09:29.720000 router. Then all the routers in this environment are going to form a fully 0:09:29.720000 --> 0:09:34.120000 synchronized neighbor relationship with the DR and the BDR. 0:09:34.120000 --> 0:09:35.600000 Not amongst each other. 0:09:35.600000 --> 0:09:38.760000 They'll see each other's hello packets, but they're not going to exchange 0:09:38.760000 --> 0:09:40.360000 database descriptors. 0:09:40.360000 --> 0:09:42.920000 They're not going to change link state requests and link state updates 0:09:42.920000 --> 0:09:43.900000 with each other. 0:09:43.900000 --> 0:09:47.720000 They're only going to do that with the DR and the BDR. 0:09:47.720000 --> 0:09:52.620000 Now, in this environment, how do we determine who that's going to be? 0:09:52.620000 --> 0:09:57.100000 Well, the default is whoever's got the highest OSPF priority, that's number 0:09:57.100000 --> 0:10:01.020000 one. So if one of these guys had a priority other than one, if somebody 0:10:01.020000 --> 0:10:03.020000 was higher than that, they would win. 0:10:03.020000 --> 0:10:05.540000 They would take on the role of the designated router. 0:10:05.540000 --> 0:10:10.100000 If their priorities are the same, then it falls back to that router ID 0:10:10.100000 --> 0:10:11.140000 we were just talking about. 0:10:11.140000 --> 0:10:13.380000 So it's not the IP address. 0:10:13.380000 --> 0:10:17.340000 So if I put in some different numbers in here for router IDs, let's say 0:10:17.340000 --> 0:10:24.600000 we've got seven, seven, three, three, let's say we've got one dot two 0:10:24.600000 --> 0:10:27.240000 dot one dot seventy seven. 0:10:27.240000 --> 0:10:33.380000 Let's say we have nine dot nine dot one dot one and two dot two dot two 0:10:33.380000 --> 0:10:37.840000 dot two. So in this environment, because they all have the same interface 0:10:37.840000 --> 0:10:42.400000 priority, our designated router would end up being router one. 0:10:42.400000 --> 0:10:44.520000 He's got the highest router ID. 0:10:44.520000 --> 0:10:51.700000 So he would be my designated router and router three would end up being 0:10:51.700000 --> 0:10:57.340000 my backup designated router because he has the second highest router ID. 0:10:57.340000 --> 0:11:05.820000 Now that we know that, what we're going to see is, let's start with router 0:11:05.820000 --> 0:11:10.420000 two. Router two will form a fully synchronized neighbor relationship with 0:11:10.420000 --> 0:11:13.260000 router one and with router three. 0:11:13.260000 --> 0:11:17.960000 Same thing same thing is going to happen with router four. 0:11:17.960000 --> 0:11:21.100000 He's going to form a fully synchronized neighbor relationship with router 0:11:21.100000 --> 0:11:22.960000 one and router three. 0:11:22.960000 --> 0:11:27.040000 Matter of fact, router one and router three will form fully synchronized 0:11:27.040000 --> 0:11:30.400000 neighbor relationships with each other. 0:11:30.400000 --> 0:11:38.040000 Now, as far as what's going on between router two and router four, they 0:11:38.040000 --> 0:11:42.700000 will see each other's hellos, but that's as far as they're going to go. 0:11:42.700000 --> 0:11:45.460000 They will not exchange data based descriptors with each other. 0:11:45.460000 --> 0:11:48.120000 They will not exchange link state requests. 0:11:48.120000 --> 0:11:59.480000 So, if I was in, for example, router four, and in router four, I did the 0:11:59.480000 --> 0:12:02.120000 command show IP OSPF neighbor. 0:12:02.120000 --> 0:12:03.600000 Let's just get rid of some of this here. 0:12:03.600000 --> 0:12:06.100000 So, I've got a little bit of space. 0:12:06.100000 --> 0:12:13.440000 So, router four, I would see this. 0:12:13.440000 --> 0:12:19.080000 I would see router one which would display as the designated router and 0:12:19.080000 --> 0:12:22.760000 I am in the full state fully synchronized with him. 0:12:22.760000 --> 0:12:26.500000 All of his LSAs match all of my LSAs. 0:12:26.500000 --> 0:12:30.620000 Router three would display as the backup designated router. 0:12:30.620000 --> 0:12:38.660000 Also in the full state, router two would display as a DR other, which 0:12:38.660000 --> 0:12:42.840000 means he is neither the BDR. 0:12:42.840000 --> 0:12:47.060000 He could become that in the future if the DR, the BDR drops out of the 0:12:47.060000 --> 0:12:51.420000 picture, router two could take their spot, but he is right now neither. 0:12:51.420000 --> 0:12:55.220000 And I am in the two-way state with him, which means I'm just exchanging 0:12:55.220000 --> 0:12:55.980000 hellos with him. 0:12:55.980000 --> 0:12:58.900000 I have not become fully synchronized with that guy. 0:12:58.900000 --> 0:13:06.920000 And so now if, let's just take router two here for a second. 0:13:06.920000 --> 0:13:13.160000 Let's say that router two is on the back end a neighbor with router X. 0:13:13.160000 --> 0:13:16.740000 Okay? And router X sends him some sort of a link state update about some 0:13:16.740000 --> 0:13:18.120000 new information. 0:13:18.120000 --> 0:13:24.520000 Router two is going to forward that link state update to the DR and the 0:13:24.520000 --> 0:13:29.660000 BDR. And to make sure that only they get it, he's going to send that to 0:13:29.660000 --> 0:13:37.120000 224.006. That's a special multicast address that only the DR and the BDR 0:13:37.120000 --> 0:13:39.360000 are actually listening to. 0:13:39.360000 --> 0:13:43.540000 So router four is not going to pay attention to that because he's not 0:13:43.540000 --> 0:13:44.660000 one of those roles. 0:13:44.660000 --> 0:13:48.480000 So router one and router three will get that link state update to 224 0:13:48.480000 --> 0:13:55.700000 .006. Now that they've gotten it as it is the DR's responsibility, you 0:13:55.700000 --> 0:13:58.320000 know, the router three will basically say, thank you. 0:13:58.320000 --> 0:13:59.680000 And then just go silent. 0:13:59.680000 --> 0:14:03.480000 Router one who's the DR will say, okay, I have to make sure that everybody 0:14:03.480000 --> 0:14:08.240000 else in this particular broadcast domain in this VLAN also knows about 0:14:08.240000 --> 0:14:13.960000 this. So he'll turn around and reflect that update right back out to 224 0:14:13.960000 --> 0:14:18.820000 .005. Well, it'll get to router two. 0:14:18.820000 --> 0:14:20.740000 Router two will say, I've already got this. 0:14:20.740000 --> 0:14:23.260000 Ignore it. It'll get to router three. 0:14:23.260000 --> 0:14:24.960000 Route three will say, I've already got this. 0:14:24.960000 --> 0:14:30.000000 Ignore it. But now router four can hear it for the first time. 0:14:30.000000 --> 0:14:36.480000 So that's the idea behind a DR and a BDR in a broadcast environment, i 0:14:36.480000 --> 0:14:42.280000 .e. Everybody synchronizes with the DR and the BDR. 0:14:42.280000 --> 0:14:45.260000 And when they learn of new information, they send it to the DR and the 0:14:45.260000 --> 0:14:49.360000 BDR. And that's the responsibility of the designated router to reflect 0:14:49.360000 --> 0:14:58.480000 that back and make sure that everybody is synchronized with that information. 0:14:58.480000 --> 0:15:01.960000 So that's what we discussed right there. 0:15:01.960000 --> 0:15:04.580000 And I've already mentioned this. 0:15:04.580000 --> 0:15:10.620000 That the router with the highest priority becomes the designated router. 0:15:10.620000 --> 0:15:15.740000 And the way you can influence that is if I was under router, I said, hey, 0:15:15.740000 --> 0:15:18.740000 I really do want this router to become the designated router. 0:15:18.740000 --> 0:15:22.880000 Then you would go on to an interface like interface, get the data, and 0:15:22.880000 --> 0:15:24.220000 then you would go on to an interface. 0:15:24.220000 --> 0:15:30.800000 And the command would be ipospf priority. 0:15:30.800000 --> 0:15:35.460000 As long as he gave it something higher than one, he'll beat all the other 0:15:35.460000 --> 0:15:37.500000 routers that have the default. 0:15:37.500000 --> 0:15:43.020000 Now one thing to be aware of. 0:15:43.020000 --> 0:15:45.720000 Now let me just see if this is coming up in the next slide before I talk 0:15:45.720000 --> 0:15:54.900000 about it. Okay, so we're not it's not in the slides there so one thing 0:15:54.900000 --> 0:15:57.060000 to be aware of is that. 0:15:57.060000 --> 0:16:01.960000 Once the designated router and the backup doesn't eat router is elected 0:16:01.960000 --> 0:16:04.340000 but this is focused on the DR right now. 0:16:04.340000 --> 0:16:09.600000 It's kind of sticky in other words what I mean by that is, let's say that. 0:16:09.600000 --> 0:16:13.320000 Let's say that you and I were connected to a switch and it's just you 0:16:13.320000 --> 0:16:17.180000 and I and so we decide that you'll be the designated router I'll be the 0:16:17.180000 --> 0:16:19.540000 backup because you have a higher router ID than me. 0:16:19.540000 --> 0:16:23.740000 Great now let's say that your router ID is one dot one dot one dot four 0:16:23.740000 --> 0:16:27.860000 and I'm one one one one one that's why you won because you're one one 0:16:27.860000 --> 0:16:29.600000 one four okay great. 0:16:29.600000 --> 0:16:32.360000 Let's say that in a few minutes or a few hours all of a sudden another 0:16:32.360000 --> 0:16:37.760000 router joins the same switch and his router ID is higher than yours. 0:16:37.760000 --> 0:16:39.880000 He's like one one one five. 0:16:39.880000 --> 0:16:44.580000 It's too late. Once you're elected as the DR anybody else that comes in 0:16:44.580000 --> 0:16:48.060000 after that point in time whether they've got a higher priority or they 0:16:48.060000 --> 0:16:52.540000 have a higher router ID they cannot take over that role from you. 0:16:52.540000 --> 0:16:55.760000 That's why I said it's sticky that roles are like sticks to you. 0:16:55.760000 --> 0:17:00.240000 Now clearly if your interface goes down or if you crash and die well then 0:17:00.240000 --> 0:17:05.060000 that guy now has the opportunity to take over the role but the DR sticks 0:17:05.060000 --> 0:17:11.640000 to whoever gets elected to that position. 0:17:11.640000 --> 0:17:16.240000 All right so here are some show commands you can use to view who your 0:17:16.240000 --> 0:17:22.180000 various neighbors are and what their what their state is show IP OSPF 0:17:22.180000 --> 0:17:26.660000 database will show you your LSA's show IP route OSPF will display the 0:17:26.660000 --> 0:17:29.780000 routing table but only the OSPF learned routes. 0:17:29.780000 --> 0:17:36.920000 And these are a couple of useful debug you can use to troubleshoot OSPF. 0:17:36.920000 --> 0:17:41.720000 So that concludes this particular video on OSPF designated routers backup 0:17:41.720000 --> 0:17:44.920000 designated routers and how they are elected. 0:17:44.920000 --> 0:17:45.780000 I hope you found it useful.