Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Today we will begin our study of OSPF routing. This topic, as well as the discussion of the EIGRP protocol, is central to the entire CCNA course. As you can see, Section 2.4 is titled "Configuring, Verifying, and Troubleshooting OSPFv2 Single Zone and Multizone for IPv4 (Excludes Authentication, Filtering, Manual Route Summarization, Redistribution, Stub Area, VNet, and LSA)".

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

The topic of OSPF is quite extensive, so it will take 2, maybe 3 video tutorials. Today's lesson will be devoted to the theoretical side of the issue, I will tell you what this protocol is in general terms and how it works. In the next video, we'll move on to OSPF configuration mode using Packet Tracer.

So, in this lesson, we will cover three things: what is OSPF, how it works, and what are OSPF zones. In the previous lesson, we said that OSPF is a Link State routing protocol that examines links between routers and makes decisions based on the speed of those links. A long link with a higher speed, that is, with more bandwidth, will be given priority over a short link with less bandwidth.

RIP, being a distance vector protocol, will choose a single hop path even if this link has a low speed, and OSPF will choose a long route of several hops if the total speed on this route is higher than the traffic speed on a short route.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

We'll look at the decision algorithm later, but for now, you should remember that OSPF is a Link State protocol. This open standard was created in 1988 so that every network equipment manufacturer and any network provider could use it. Therefore, OSPF is much more popular than EIGRP.

OSPF version 2 only supports IPv4, and a year later, in 1989, the developers announced the release of version 3, which supports IPv6. However, a fully functional third version of OSPF for IPv6 did not appear until 2008. Why choose OSPF? In the last lesson, we learned that this internal gateway protocol performs route convergence much faster than RIP. This is a classless protocol.

If you remember, RIP is a classful protocol, that is, it does not send subnet mask information, and if it encounters an A/24 class IP address, it will not accept it. For example, if you give it an IP address like 10.1.1.0/24, it will interpret it as a network of 10.0.0.0 because it doesn't understand when a network is subnetted using more than one subnet mask.
OSPF is a secure protocol. For example, if two routers are exchanging OSPF information, you can configure authentication in such a way that it will be possible to share information with a neighboring router only after entering a password. As we said, this is an open standard, so OSPF is used by many network equipment manufacturers.

In a global sense, OSPF is a mechanism for exchanging Link State Advertisemen, or LSAs. LSA messages are generated by the router and contain a lot of information: the router's unique router-id, information about networks known to the router, information about their cost, and so on. All this information is needed by the router to make a routing decision.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Router R3 sends its LSA information to R5, and R5 shares its LSA information with R3. These LSAs are the data structure that forms the Link State Data Base, or LSDB. The router collects all received LSAs and places them in its LSDB. After both routers have created their databases, they exchange Hello messages, which are used to discover neighbors, and proceed to compare their LSDBs.

Router R3 sends a DBD, or "database description" message to R5, and R5 sends its DBD to R3. These messages contain LSA indexes, which are available in the databases of each router. After receiving the DBD, R3 sends an LSR to R5 saying "I already have messages 3,4 and 9, so just send me 5 and 7".

Similarly, R5 does the same, telling the third router: "I have information 3,4 and 9, so send me 1 and 2." Having received LSR requests, routers send back LSU network state update packets, that is, in response to its LSR, the third router receives LSU from R5 router. After the routers update their databases, all of them, even if you have 100 routers, will have the same LSDBs. As soon as the LSDB databases are created in the routers, each of them will know about the entire network as a whole. The OSPF protocol uses the Shortest Path First algorithm to create a routing table, so the most important condition for its correct operation is that the LSDB of all devices on the network be synchronized.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

In the above diagram, there are 9 routers, each of which exchanges LSR, LSU messages, and so on with neighbors. All of them are connected to each other by p2p, or "point-to-point" interfaces that support the OSPF protocol, and interact with each other to create the same LSDB.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

As soon as the bases are synchronized, each router, using the shortest path algorithm, forms its own routing table. Different routers will have different tables. That is, all routers use the same LSDB, but create routing tables based on their own considerations about the shortest routes. To use this algorithm, OSPF needs to update the LSDB regularly.

So, in order for OSPF to function properly, it must first provide 3 conditions: find neighbors, create and update an LSDB, and build a routing table. To fulfill the first condition, the network administrator may need to manually configure the router-id, timings, or wildcard mask. In the next video, we will look at configuring the device to work with OSPF, for now you should know that this protocol uses a reverse mask, and if it does not match, if your subnets do not match, or authentication does not match, the neighborhood of routers cannot be formed. Therefore, when troubleshooting OSPF, you should find out why this very neighborhood is not formed, that is, check the coincidence of the above parameters.

As a network administrator, you are not involved in the creation of the LSDB. Database updates occur automatically after the creation of a neighborhood of routers, as well as the construction of routing tables. All this is done by the device itself, configured to work with the OSPF protocol.
Let's look at an example. We have 2 routers, to which I assigned RIDs 1.1.1.1 and 2.2.2.2 for simplicity. As soon as we connect them, the link channel will immediately go to the up state, because I first configured these routers to work with OSPF. As soon as the communication channel is established, router A will immediately send a Hello packet to the second one. This packet will contain information that this router has not yet "seen" anyone on this channel, because it is sending Hello for the first time, as well as its own identifier, data about the network connected to it, and other information that it can share with a neighbor.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Upon receiving this packet, Router B will say "I see that there is a potential OSPF neighbor candidate on this link" and enter the Init state. The Hello packet is not a unicast or broadcast message, it is a multicast packet sent to the OSPF multicast IP address 224.0.0.5. Some people ask what is the subnet mask for multicast. The fact is that multicast does not have a subnet mask, it is distributed as a radio signal that is heard by all devices tuned to its frequency. For example, if you want to hear FM radio broadcasting at 91,0, then tune your radio to that frequency.

Similarly, Router B is configured to accept messages for the multicast address 224.0.0.5. Listening to this channel, it receives the Hello packet sent by router A and replies to it with its own message.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

In this case, the neighborhood can be established only if the answer B satisfies the set of criteria. The first criterion is the frequency of sending Hello messages and the waiting interval for a response to this Dead Interval message must be the same for both routers. Typically, Dead Interval is several values ​​of the Hello timer. Thus, if Router A's Hello Timer is 10s, and Router B sends it a message in 30s, with a Dead Interval of 20s, the neighborhood will fail.

The second criterion is that both routers must use the same type of authentication. Accordingly, the authentication passwords must also match.

The third criterion is the match of the Arial ID zone identifiers, the fourth one is the match of the length of the network prefix. If router A reports a /24 prefix, then router B must also have a /24 network prefix. In the next video we will look at this in more detail, for now I will note that this is not a subnet mask, here routers use the inverse Wildcard mask. And of course, the Stub area flags must also match if the routers are in this area.

After checking these criteria, if they match, Router B sends its Hello packet to Router A. Unlike message A, router B reports that it has seen router A and introduces itself.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

In response to this message, router A again sends Hello to router B, in which it confirms that it also saw router B, the communication channel between them consists of devices 1.1.1.1 and 2.2.2.2, and it itself is device 1.1.1.1. This is a very important stage in establishing a neighborhood. In this case, a two-way 2-WAY connection is used, but what happens if we have a switch with a distributed network of 4 routers? In such a "shared" environment, one of the routers should play the role of a dedicated Designated router DR, and the second one should play the role of a backup dedicated router Backup designated router, BDR

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Each of these devices will form a Full connection, or a state of full adjacency, later we will consider what it is, however, a connection of this type will only be established with DR and BDR, the two lower routers D and B will still communicate with each other according to the two-way connection scheme point-to-point.

That is, with DR and BDR, all routers establish a full neighborhood relationship, and with each other, a point-to-point connection. This is very important because for two-way communication of adjacent devices, all parameters of the Hello packet must match. In our case, everything matches, so the devices form a neighborhood without any problems.

As soon as two-way communication is established, router A sends router B a Database Description packet, or β€œdatabase description”, and enters the ExStart state - the beginning of the exchange, or waiting for download. The Database Descriptor is information similar to the table of contents of a book - it is a listing of everything that is in the routing database. In response, Router B sends its database description to Router A and enters the Exchange Links state. If in the Exchange state the router detects that some information is missing in its database, then it will go into the LOADING state and begin to exchange LSR, LSU and LSA messages with the neighbor.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

So, router A will send an LSR to its neighbor, he will answer him with an LSU packet, to which router A will respond to router B with an LSA message. This exchange will occur as many times as the number of times the devices want to exchange LSA messages. The LOADING state indicates that the full update of the LSA database has not yet taken place. After downloading all the data, both devices will enter the FULL adjacency state.

Note that with a two-way connection, the device is simply in the neighbor state, and the full adjacency state is only possible between the routers, DR and BDR This means that each router informs the DR about changes in the network, and all routers learn about these changes from the DR

The choice of DR and BDR is an important issue. Let's consider how the choice of DR occurs in the general environment. Suppose in our scheme there are three routers and a switch. OSPF devices first compare the priority in the Hello messages, then they compare the Router ID.

The device with the highest priority becomes the DR If the priorities of the two devices are the same, then the device with the highest Router ID is selected from the two devices, which becomes the DR

The device with the second highest priority or the second highest Router ID becomes the backup dedicated router of the BDR. If the DR goes down, it will be immediately replaced by the BDR It will take over the role of the DR and the system will choose another BDR

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

I hope that you have figured out the choice of DR and BDR, if not, then I will return to this issue in one of the following videos and explain this process.

So we've looked at Hello, the Database Descriptor, and the LSR, LSU, and LSA messages. Before moving on to the next topic, let's talk a little about the cost of OSPF.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

In Cisco, the cost of the route is calculated by the ratio of the Reference bandwidth, which is set to 100 Mbps by default, to the cost of the link. For example, if you connect devices through a serial port, the speed is 1.544 Mbps, and the cost will be 64. If you use a 10 Mbps Ethernet connection, the cost is 10, and the cost of a 100 Mbps FastEthernet connection will be 1.

When using Gigabit Ethernet, we have a speed of 1000 Mbps, but in this case, the speed is always assumed to be 1. Thus, if you have Gigabit Ethernet on your network, you must change the default Ref. BW by 1000. In this case, the cost will be 1, and the entire table will be recalculated with an increase in cost values ​​by 10 times. After we have formed the neighborhood and built the LSDB database, we move on to building the routing table.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

After receiving the LSDB, each of the routers independently proceeds to form a list of routes using the SPF algorithm. In our scheme, router A will create such a table for itself. For example, it calculates the cost of route A-R1 and determines it to be 10. To simplify understanding of the diagram, suppose that router A determines the best route to router B. The cost of the connection A-R1 is 10, the connection A-R2 is 100, and the cost of the route A-R3 is equal to 11, that is, the sum of the route A-R1(10) and R1-R3(1).

If router A wants to get to router R4, it can do this either along the route A-R1-R4 or along the route A-R2-R4, and in both cases the cost of the routes will be the same: 10+100 =100+10=110. Route A-R6 will cost 100+1= 101, which is already better. Next, we consider the path to the router R5 along the route A-R1-R3-R5, the cost of which will be 10+1+100 = 111.

The path to the R7 router can be laid along two routes: A-R1-R4-R7 or A-R2-R6-R7. The cost of the first will be 210, the second - 201, so you should choose 201. So, to reach router B, router A can use 4 routes.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Route A-R1-R3-R5-B will cost 121. Route A-R1-R4-R7-B will cost 220. Route A-R2-R4-R7-B will cost 210 and A-R2-R6-R7- B has a cost of 211. Based on this, router A will choose the route with the lowest cost, equal to 121, and place it in the routing table. This is a very simplified diagram of how the SPF algorithm works. In fact, the table contains not only the designations of routers through which the optimal route runs, but also the designations of the ports connecting them and all other necessary information.

Let's look at another topic that concerns routing zones. Typically, when OSPF is configured for a company's devices, they are all in the same common area.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

What happens if the device connected to the R3 router suddenly fails? Router R3 will immediately start sending a message to routers R5 and R1 that the channel with this device is no longer working, and all routers will begin to exchange updates about this event.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

If you have 100 routers, they will all update their link status because they are in the same common area. The same will happen if one of the neighboring routers fails - all devices in the zone will exchange LSA updates. After the exchange of such messages, the network topology itself will change. As soon as this happens, SPF will recalculate the routing tables according to the changed conditions. This is a very large process, and if you have a thousand devices in one zone, you need to control the memory size of the routers so that it is sufficient to store all the LSAs and the huge LSDB link state database. As soon as changes occur in some part of the zone, the SPF algorithm immediately recalculates routes. By default, the LSA is updated every 30 minutes. This process does not occur simultaneously on all devices, however, in any case, updates are performed by each router with a frequency of 30 minutes. The more network devices. The more memory and time it takes to update the LSDB.

This problem can be solved by dividing one common zone into several separate zones, that is, using multizoning. To do this, you must have a plan or diagram of the entire network that you manage. Zero area AREA 0 is your main area Main area. This is where you connect to an external network, such as accessing the Internet. When creating new zones, you must be guided by the rule that each zone must have one ABR, Area Border Router. The edge router has one interface in one zone and a second interface in another zone. For example, router R5 has interfaces in zone 1 and zone 0. As I said, each of the zones must be connected to the zero zone, that is, have a border router, one of whose interfaces is connected to AREA 0.

Cisco Training 200-125 CCNA v3.0. Day 44 Introduction to OSPF

Let's assume that the connection R6-R7 has failed. In this case, the LSA update will be distributed only in the AREA 1 zone and will affect only this zone. Devices in zone 2 and zone 0 won't even know about it. The border router R5 summarizes information about what is happening in its area, and sends summary information about the state of the network to the main AREA 0. Devices in one zone do not need to know about all LSA changes within other zones, because the ABR router will forward summary information about routes from one zone to another.

If you're not completely familiar with the concept of zones, you can learn more in the following lessons when we get into configuring OSPF routing and look at a few examples.


Thank you for staying with us. Do you like our articles? Want to see more interesting content? Support us by placing an order or recommending to friends, 30% discount for Habr users on a unique analogue of entry-level servers, which was invented by us for you: The whole truth about VPS (KVM) E5-2650 v4 (6 Cores) 10GB DDR4 240GB SSD 1Gbps from $20 or how to share a server? (available with RAID1 and RAID10, up to 24 cores and up to 40GB DDR4).

Dell R730xd 2 times cheaper? Only here 2 x Intel TetraDeca-Core Xeon 2x E5-2697v3 2.6GHz 14C 64GB DDR4 4x960GB SSD 1Gbps 100 TV from $199 in the Netherlands! Dell R420 - 2x E5-2430 2.2Ghz 6C 128GB DDR3 2x960GB SSD 1Gbps 100TB - from $99! Read about How to build infrastructure corp. class with the use of Dell R730xd E5-2650 v4 servers worth 9000 euros for a penny?

Source: habr.com

Add a comment