Small and Medium-Sized Enterprise Network Management: OSPF route protocol analysis

Source: Internet
Author: User

OSPF currently uses version 2, which can adapt to large-scale networks. Because OSPF does not have the limit on the number of RIP hops, and the concept of regions is introduced to be larger than the network size supported by VPN. OSPF has been widely used in networks, enterprise networks, power networks, and financial networks. It is an IGP routing protocol that supports large-scale networks and supports a maximum of several hundred vrouters.

Next let's take a look at the advantages of OSPF:

Fast Convergence of route changes: the OSPF route is calculated by the local database where the router is stored. When the network is updated, you do not need to ask the neighbor router passively, therefore, OSPF is faster than OSPF.

No routing loop: The OSPF routing protocol uses the Shortest Path Priority Algorithm (SPF), and the Router uses the Router ID to indicate that there is no loop in a region, thanks to the design of the direct connection backbone area, no loop occurs even when multiple loads occur. Note: The loop-free mechanism mentioned here means that when the network only uses the OSPF routing protocol, there is no loop. If other routing protocols or static routes are involved, no loop is guaranteed.

Support for CIDR and VLSM: The RIP routing protocol we mentioned earlier does not support CIDR and VLSM. This is considered another important reason why RIP routing is not applicable to large networks, CIDR and VLSM can be used to save IP addresses to the maximum extent.

Hierarchical Area Division: In OSPF, a network can be divided into multiple area areas, which are divided into two types: bone Area (area 0) and conventional Area, the general area can support 4.2 billion, and the power of 2 is 32, which is definitely enough. However, it is required that all the common areas must be connected to the backbone areas. One area is connected through the OSPF border router. Routing Summary (Summary) can be used between regions to reduce route information and route tables, increase the operation speed of the router.

Multicast address sending protocol packets: Use a dedicated multicast address to send protocol packets. Because communication is performed within a small range, the impact on non-OSPF devices in the network can be reduced.

Next we will introduce an important but not complex concept in OSPF: Router ID (RID)

A Router that runs the OSPF protocol must have a Router ID. The role of the Router ID is actually very simple. It uniquely identifies an OSPF Router. If no ID is configured, the system automatically selects an ID from the IP address of the current interface as the Router ID. Generally, the order of selection is to first select a router ID from the loopback address. You can also select from the interface address. If multiple interfaces exist at the same time, the maximum IP address in the interface is used as the ID number of the router. That is to say, if a logical interface is the Loopback interface, use the Loopback address as its own RID. If there is no logical interface, there is only a physical interface, the RIP of the physical interface IP address is used. What are physical interfaces, such as Serial, Ethernet, and ATM interfaces? However, if there are two logical interfaces, it is also the one with a large IP address in the logical interface.

Generally, we recommend that you configure the OSPF route protocol first by using the Router ID. Otherwise, if OSPF is started and the Router ID selected by the Router is not what you want, re-configuring the Router ID requires restarting the OSPF routing process. Why do I use the Loopback IP address to configure the Router ID first? In earlier Router operations (IOS), the IP address of the physical interface acts as the Router ID. If the physical interface goes down due to a problem, the Router ID disappears. In this way, the OSPF routing protocol is unstable. Although the vroback operating system has changed this BUG, it is a common practice to give priority to Loopback port IP addresses that are more stable than physical interfaces. In addition, because the Loopback interface is generally not used in routing, you can use the Loopback interface to configure the Router ID first.

Benefits of manually configuring a Router ID:

Because the OSPF protocol uses the Router ID to identify the neighbor Router, the administrator always sees a problem with the Router ID Router when problems occur. When assigning a Router ID, you can allocate it according to the logical or physical address. Another feature in a Cisco Router is to set up a DNS server to parse the Router ID name. In this way, when the network administrator monitors the network conditions, the name of the Peer router is displayed.

After learning about the Router ID, let's take a look at the other two outlines DR and BDR: Because the Router ID directly affects the election of DB and BDR, let's take a closer look, let's start with a graph:

▲Dr BDR election

In an Ethernet environment, if the five routers want to exchange synchronous route information, they use a network-like logical topology. As shown in:

▲Route Information Exchange

At this time, if you want to quickly synchronize between them, you need multiple links, so the maintenance cost is relatively high. We thought about it. We can select a vro on the network to make it the "boss", and then stipulate that if other vrouters want to communicate with another vro, then you only need to pass this "Boss. So if we regard C as the "boss", the topology will become as follows:

▲Election Process

In this way, all the routers communicate with each other through the C router, which reduces the flood of routing information on the network. Saves network bandwidth. Then, this router C is what we call DR, and the specified router (Designated Rouer)

What should I do if the router C breaks down one day? This is a bit similar to the DC in WINDOWS. To achieve redundancy, We need to specify a BDR (Backup DR). If we specify vrod D as the BDR here, the topology will change again:

▲Change again

In fact, this is part of the interconnection in our network topology. In this way, redundancy is realized, and the cost is also reduced. The key is that there are so many routers on the network. Which one is DR and which is BDR?

Let's take a look at the election process:

When selecting DR/BDR, compare the priority in the hello message. The hello message contains some timer values, DR, BDR, and known neighbors. That is to say, each vro sends a hello message when communicating with the other party. Make a photo before you meet! By default, a Hello message is sent every 10 seconds in OSPF! If the message is not received within 40 seconds, the neighbor is declared dead. It contains the Router ID, Hello Message interval and death interval, neighbor information, region information, Router priority, DR and BDR information, verification information, and root area mark. :

▲Ospf Routing Protocol

The parameter * must be identical, otherwise it is impossible to become a neighbor.

When DR/BDR is selected, the highest priority in the Hello packet (priority) is DR, and the second highest priority is BDR, but the default priority is 1, so this is of little significance! In the case of the same priority, we will start to compare the Router ID we just introduced. The highest value of the RID is DR, and the second highest value is BDR, after you set the priority to 0, the vro cannot be a DR or BDR, but it can only be a DROther.

Run the following command to modify the priority: (config-if) # ip ospf cost 0-255 255 highest

After the election is complete, DROther only forms an adjacent relationship with DR/BDR. That is to say, in their eyes, only DR and BDR are their neighbors, all routers route Hello packets to the address 224.0.0.5 so that they can track the information of other neighbors. That is, DR adds the flood LSU to the multicast address 224.0.0.5; DROther can only update LSU (link status update) to all DR data through the multicast address 224.0.0.6. Only DR/BDR listens for this multicast address.

If OSPF is not configured when the two routers are started, the related ports are all DOWN.

▲No routing protocol is enabled

If OSPF is configured, if both parties start to send an initialization state, we will use Router1 as an example. At this time, it will declare that I am 192.168.10.10 and this is actually its RID, it will tell the other party that I am 192.168.10.10 and I have no neighbors now. At this time, Router2 receives the announcement message from Router2 in its own Fa0/0, which is to add this information to its neighbor table and indicate that it is connected through Fa0/0 ., Then I told Router1 that I was 192.168.10.20 and I had a neighbor named 192.168.10.10; in this case, when Router1 receives the message of Router2, it adds the Router2 address to its route table and indicates that it is connected through Fa0/0. This status is called the Two-way status, which is relatively stable but not truly a neighbor. Next, the Exstart status is in progress. There is no real information exchange yet. It is just a process of DR election: Router1 will send a packet saying that I am responsible for updating the route table, because my RID is 192.168.10.10, but Router2 will say, no, I don't agree, because my RID is bigger than yours. Therefore, after negotiation, Roter2 should be a BDR. Next, an Exchange state is used to Exchange the summary information of the link status database in the LSDB of both parties. Note that the summary information is only used to prepare for the database synchronization between the two parties. Note that the hello message is no longer used here. It is a DD message. That is to say, Router1 sends a DD message to the other party, and the other party sends an LSACK after receiving the message. You may be familiar with ACK, we have used ACK in many places, such as TCP connection establishment, communication, connection removal, and DHCP work. The word ACK is used, it also means to send a confirmation to the other party, because if it is not confirmed, the other party will re-send it! Next, we enter the Load status. This is the database that actually adjusts the link status as needed. If I already have it, I should not make any updates when making comparisons, and so on. After the end is complete, it is in FULL state. All link status databases are synchronized! If another network link changes, the LSU information (including the LSA status information in the LSU update package) will only be sent to the DR, then, DR floods the data to other routers in the region through multicast. The other routers re-calculate the new route table based on the link status. The link status tree and shortest path tree are used in the middle. Let's take a look at them:

▲Spf Algorithm

In OSPF, bandwidth is used as the standard of metric called cost. Generally, Each router uses its own root to calculate an overhead required to reach the peer end. The bandwidth is divided by the power of 10 to the power of 8, A smaller value indicates that the larger the bandwidth, the optimal path, is placed in the route table, which is also the Shortest Path Tree.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.