Introduction to OSPF (1)

Source: Internet
Author: User

I. Basic concepts and terms
1. Link Status
The OSPF router collects the connection status information of each vro in the network region, that is, Link-State, and generates a Link-State Database ). The router has the link status information of all the routers in the region, which means that it understands the topology of the entire network. The OSPF router uses the Shortest Path First, SPF algorithm to calculate the route to any destination independently.
2. Region
The OSPF Protocol introduces the concept of "hierarchical routing", which divides the network into a group of independent parts connected by a "trunk, these independent parts are called "areas" and "trunk" are called "trunk areas ". Each region is like an independent network. The OSPF router in this region only saves the link status of this region. The link status database of each vro can maintain a reasonable size, and the route computing time and number of packets are not too large.
3. OSPF network type
Based on the physical network connected by the router, OSPF divides the network into four types: Broadcast Multi-Channel Access Broadcast multiAccess), non-Broadcast Multi-Channel Access None Broadcast MultiAccess, NBMA) point-to-Point, Point-to-Point, and Point-to-MultiPoint ).
Broadcast Multi-Channel Access networks such as Ethernet, Token Ring, and FDDI. NBMA networks such as Frame Relay, X.25, and SMDS. Point-to-Point networks such as PPP and HDLC.
4. assign a vrodr DR) and backup a vrobbdr)
Multiple routers may exist in a multi-channel access network. In order to avoid overhead caused by establishing a completely adjacent relationship between routers, OSPF requires selecting a DR in the region. Each vro is completely adjacent to it. DR is responsible for collecting all link status information and releasing it to other routers. A bdr is also elected during the DR election. When the DR fails, the BDR is responsible for the DR.
Point-to-point networks do not require DR because there are only two nodes that are completely adjacent to each other. The OSPF protocol consists of Hello protocol, exchange protocol, and diffusion protocol. This article only introduces the Hello protocol. For details about the other two Protocols, refer to RFC2328.
When the router enables an OSPF route for a port, a Hello packet will be sent from this port, and then it will periodically send Hello packets at a certain interval. The OSPF router uses the Hello message to initialize new adjacent relationships and confirm the communication status between neighboring router neighbors.
For a broadcast-type network and a non-broadcast-type multi-channel access network, the router uses the Hello protocol to elect a DR. In a broadcast network, Hello messages are periodically broadcast using the multicast address 224.0.0.5, and router neighbors are automatically discovered through this process. In the NBMA network, DR is responsible for sending Hello messages to other routers one by one.
Ii. Protocol Operations

Step 1: Establish vro
Adjacency refers to the relationship established between the selected neighboring routers for the OSPF router to exchange route information.
The router first sends a Hello message with its own ID Loopback port or the largest IP address. If a router adjacent to it receives the Hello packet, it adds the ID information in the packet to its Hello packet.
If a port of a vro receives a Hello message containing its own ID from another vro, it determines whether the connection can be established based on the network type of the port.
In a point-to-point network, the vro directly establishes an adjacent relationship with the peer vro, And the vro directly enters Step 3: Find other vrouters. If it is a MultiAccess network, the router will enter the election step.
Step 2: elect DR/BDR
The DR and BDR election methods for different types of networks are different.
The MultiAccess network supports multiple routers. In this case, OSPF needs to establish a central node as the link status and LSA update. The ID and Priority field values in the Hello message are selected. The priority field value ranges from 0 to 255, and the router with the highest priority value becomes DR. If the priority value is the same, the router with the highest ID is elected as DR, And the router with the highest priority value is elected as BDR. You can set both the priority value and ID value.
Step 3: Discover vrouters
In this step, the router and the router first use the Hello Message ID to confirm the master-slave relationship, and then the master-slave router exchanges some link status information. Each vro analyzes and compares the information. If the received information contains new content, the vro requires the other party to send the complete link status information. After the status is complete, the vro establishes a completely adjacent Full Adjacency) relationship, and the adjacent vro has its own independent and complete link status database.
In a MultiAccess network, DR and BDR exchange information and exchange link status information with other vrouters In the subnetwork.
Information between adjacent routers in a Point-to-Point or Point-to-MultiPoint network.
Step 4: select the appropriate vro
When a router has a complete and independent link status database, it uses the SPF algorithm to calculate and create a route table. Based on the content of the link status database, the OSPF router uses the SPF algorithm to calculate the path to each destination network and saves the path to the routing table.
OSPF uses the Cost measurement to calculate the destination path. The minimum Cost is the shortest path. When configuring an OSPF router, you can set the Cost size based on the actual situation, such as link bandwidth, latency, or economic Cost. The smaller the Cost, the more likely the link is to be selected as a route.
Step 5: maintain route information
When the link status changes, OSPF notifies other routers on the network through the Flooding process. When an OSPF router receives a link status update packet containing new information, it updates its own link status database and then recalculates the route table using the SPF algorithm. During the re-calculation process, the router continues to use the old route table until SPF completes the new route table calculation. The new link status information is sent to other routers. It is worth noting that even if the link status does not change, the OSPF route information is automatically updated. The default time is 30 minutes.


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.