OSPF Overview

OSPF (Open Shortest Path First Open Shortest Path First) is an interior gateway protocol (Interior Gateway Protocol, referred IGP), is used for routing within a single autonomous system (Autonomous System, AS). Is a link state routing protocol implemented under the Interior Gateway Protocol (the IGP), so that the operation of the internal autonomous systems. Dick Alaska known algorithm (the Dijkstra) algorithm is used to calculate the shortest path tree. OSPF and OSPFv2 OSPFv3 into two versions, which use the IPv4 network OSPFv2, OSPFv3 used in the IPv6 network. OSPFv2 is defined by RFC 2328, OSPFv3 is defined by RFC 5340. Compared with RIP, OSPF is a link state protocol, the RIP is a distance vector protocol.

From different manufacturers in different management, Cisco OSPF protocol management distance (AD) is 110, OSPF protocol management Huawei distance 10.

OSPF origin
IETF built in order to meet the growing need for IP-based network, the formation of a working group dedicated to the development of open link-state routing protocol for use in a large-scale, heterogeneous IP network. The new routing protocol has been some success in a series of private, and manufacturers related Shortest Path First (SPF) routing protocol-based, widely used on the market. Including OSPF, including all of the SPF routing algorithm based on a mathematical algorithm -Dijkstra. This algorithm enables the link-state routing, rather than distance vector. OSPF by the IETF developed in the late 1980s, OSPF routing protocols like SPF is an open version. The body initially OSPF specification is now RFC1131. The first edition (OSPF version 1) was soon replaced materially improved version, this new version is now RFC1247 document body. RFC 1247OSPF called OSPF version 2 for its clear that substantial improvements in stability and functionality aspects. This version has a number of OSPF update the document, each update is a refinement of open standards. Today, some of the following specification RFC 1583,2178 and 2328. OSPF version 2 is the latest version of RFC 2328 in the now. The latest version only and interoperability by the RFC 2138,1583 and 1247 versions of the specification.

Link is another way of saying router interface, also known as interface state so OSPF routing protocol. OSPF is established by the state of the network interface between the router advertisement link state database, to generate the shortest path tree, OSPF each router uses the shortest path routing table.

OSPF routing protocol is a typical link-state (Link-state) routing protocol, generally used in the same routing domain. Here, the routing domain refers to an autonomous system (Autonomous System), i.e. the AS, which refers to a set of network exchange routing information through a unified policy routing protocol or routing each other. In the AS, all OSPF router maintains a database describing the AS same structure, which is stored in the database information of the corresponding link state routing domain, OSPF router which is calculated by the OSPF routing table database of.

As a link-state routing protocols, OSPF link state multicast data LSA (Link State Advertisement) transmitted to all routers in an area, which is different from the distance vector routing protocol. Routers running distance vector routing protocol is to pass some or all of the routing table to its neighboring routers.

Folding Edit this paragraph the term protocol
folding OSPF term
Router-ID

Assuming that person's name in this world is not repeated, each person's name are not the same, when one day, met a stranger tells you that there is any trouble can find him, he will be able to help you solve; wait until you are in trouble when you are looking for that person to help, but even if you do not know the name of the person, then it is impossible to find someone to help. OSPF is similar to the above case, the network routers are each equivalent to a person OSPF, link-state advertisement to each other between OSPF routers, can help inform each other is equal. If you can not tell who is who between the router, there is no way to determine their identity, then the link state advertisement is meaningless, it is necessary to define each OSPF router an identity, is equivalent to the person's name, which is router-ID, and router-ID in the network must not have the same name or the link status of the router received, you can not determine the identity of the initiator, it can not determine the network location by the link state information, OSPF router issue link state will write his router-ID, you can understand the signature for the link status, link status different routers produced signature will never be the same.

Each OSPF router only a Router-ID, Router-ID to use the IP address represented in the form, the method determines Router-ID is:

★ 1. Manually specify Router-ID.

★ 2. Loopback activity on the router interface IP address of the maximum, i.e. the maximum number, such as Class B Class C addresses over an address, an IP address of the interface is inactive can not be selected as the Router-ID.

★ 3. If there is no activity Loopback interface, then select the active physical interface IP address of the largest.

Note: If a router receives a link state, can not reach the position of the Router-ID, you can not reach the target network link state.

Router-ID only when the calculation starts OSPF or OSPF processes after resetting the calculation.

COST

OSPF uses to calculate the Metric bandwidth interfaces, for example, a 10 Mbit / s interface, a method for calculating Cost:

The 10 Mbit terms of 'bit, to 10 000 000 bit, and then divided by the bandwidth of 100 million, the result is 10000 0000/10 000 000 bit = 10, so that a 10 Mbit / s interface, OSPF Metric values ​​that the interface 10, it is noted that the calculation unit of bandwidth taken bit / s, rather than Kbit / s, for example, a 100 Mbit / s interface, Cost is 100,000,000 / 100,000,000 = 1, because the value must be Cost it is an integer, so even a 1000 Mbit / s (1GBbit / s) interfaces, the value Cost and 100Mbit / s as 1. If the router to go through two interfaces in order to reach the target network, then it is clear that two Cost value of the interface to add up, be considered to reach the Metric value of the target network, the OSPF router calculates the arrival Metric value of the target network, along the way must be in Cost all added up value of the interface, when accumulated, the same as EIGRP, only the interface is calculated, is not calculated into the interface.

Cost OSPF will automatically calculate the values ​​on the interface, but can also specify the interface Cost value manually, automatically calculated value takes precedence manually assigned.

Cost calculation OSPF, and the same is inversely proportional to the bandwidth of the interface, the higher the bandwidth, the smaller the value Cost. Cost the same path to the target value, you may perform load balancing, up to six links simultaneously perform load balancing.

Link (Link)

Is the interface on the router, where should refer to the interface at run OSPF process.

Link state (Link-State)

Link Status (LSA) is described information on the OSPF interface, such as IP address, subnet mask, network type, etc. Cost value on the interface, the router is not exchanged between the OSPF routing table, but the link state (LSA), OSPF link state by obtaining all the information network, to calculate the accurate network to each destination path. OSPF routers will link all of their own state without reservation all sent to a neighbor, the neighbor will link all the state received into the link state database (Link-State Database), and then a neighbor to all their neighbors, and in the transfer process, there will be no change. By this process, eventually, all of the network routers have all OSPF link state of the network, and link status of all routers should be able to depict the same network topology. For example, now you want to calculate a subway map, such as the Shanghai Metro Line drawing of a certain, if not the direct map for others to see, like a map routing table, but now the information reported to the people of each station, the information is like link status, left by what others tell each station stop, what the right leg, the others by the information (link state), the complete circuit shown in FIG. (routing table), such as to give the following information for each station (link state):

★ Nanjing Road - Station (left stop was the People's Square, Lujiazui is the right leg)

★ Nanjing West Road - Station (on the left leg is the Jing'an Temple, the right leg is People's Square)

★ Jing'an Temple - Station (on the right stop is Nanjing West Road)

★ People's Square - Station (left stop is Nanjing West Road, the right leg of Nanjing East Road)

★ Lujiazui - Station (on the left leg of Nanjing East Road)

FIG reduction circuit (routing table) is as follows:

The following two analysis station information (two link state):

★ Nanjing West Road - Station (on the left leg is the Jing'an Temple, the right leg is People's Square)

★ Jing'an Temple - Station (on the right stop is Nanjing West Road)

Because the right is calculated Nanjing West Road, Jing'an Temple, and Nanjing West Road on the left is the Jing'an Temple, Jing'an Temple and Nanjing West Road, it is adjacent to Jing'an Temple - Nanjing West Road and Nanjing West Road because the right is the People's Square, so by these two pieces of information, draw the line for the Jing'an Temple - Nanjing Road - the people's Square, continue down

Then two stations according to the following information (link state):

★ People's Square - Station (left stop is Nanjing West Road, the right leg of Nanjing East Road)

★ Nanjing Road - Station (left stop was the People's Square, Lujiazui is the right leg)

Before the calculation because the right is the People's Square, Nanjing Road, People's Square, Nanjing West Road on the left, so the Nanjing Road and People's Square is adjacent to the two stations, and the People's Square, Nanjing Road on the right, draw the line Nanjing West Road - people's Square - Nanjing East Road and Nanjing East Road because the right is the Lujiazui, so this part of the line that is Nanjing West Road - people's Square - Nanjing Road - Lujiazui, continue down

The next station then such information (link state):

★ Lujiazui - Station (on the left leg of Nanjing East Road)

Because the right is calculated Nanjing Road, Lujiazui, Lujiazui and left Nanjing East Road, the two adjacent stations, come to Nanjing East Road - Lujiazui,

By the above line portions:

Jing'an Temple - Nanjing Road - People's Square

Nanjing West Road - People's Square - Nanjing Road - Lujiazui

Nanjing Road - Lujiazui

So very easy to draw the line segment subway Pictured:

Jing'an Temple - Nanjing Road - People's Square - Nanjing Road - Lujiazui

From the above calculation can know information as to give each station, the entire line can be drawn view, and also in accordance with OSPF information (link state) of each router interface, network topography is calculated, exchanged between OSPF link state, as the above information exchange stations, rather than directly switching RIP and EIGRP routing table, the routing table switching is equivalent circuit diagram posters directly visible OSPF intelligent algorithms, than a distance vector protocol networks have more accurate perception.

OSPF area
because all will link state (LSA) between OSPF routers exchange, without reservation, when the network size reaches a certain level, LSA will form a huge database, OSPF compute bound to give tremendous pressure ; OSPF order to reduce the complexity of calculation, calculate the pressure buffer, a subregional OSPF calculation, dividing the network into different OSPF routers all regions, each responsible for routing and accurate delivery LSA computing respective regions, and then a and forwarding LSA area after a simplified summary of one region to another, so that, in the inner region, has a precise network LSA, in different regions, the transfer LSA simplified. In order to try to divided areas designed acyclic network, so using Hub-Spoke topology architecture, i.e. the core and branch topology employed, as shown below:

Named area integer number may be employed, such as four, in the form of an IP address can also be employed, 0.0.0.1,0.0.0.2, because the use of Hub-Spoke architecture, it is necessary to define a core, and then other parts are connected with the core, the area 0 OSPF is the core of all regions, called backBone area (backbone area), and the other area is called Normal area (general area), in theory, all the conventional areas should be directly and backbone connected region, and only regular area LSA backbone area of ​​the exchange, even if the direct connection between the LSA can not interchangeable with conventional regular area region, such as the figure above area 1, area 2, area 3, area 4 area 0 can only swap LSA, and then forwarded by the area 0, area 0 is like a transit point, two general areas need to exchange LSA, it can only be handed over to area 0, then forwarded by the area 0, while the general area can not be forwarded between each other.

OSPF area is divided based on the interface of the router, the router rather than on the entire division, a router may belong to a single zone, can belong to a plurality of regions, as shown below:

If an OSPF router belonging to a single region, i.e., the router all interfaces belonging to the same area, then this router is called Internal Router (IR), such as the figure above, R2, R3 and R4; if an OSPF router belonging to a plurality of region, i.e. the interface of the router does not belong to a region, then this router is called area Border router (ABR), forwarded to another area after the above figure R1, ABR region may be a summary LSA; if a the external routing protocol OSPF router redistribution into OSPF, then this router is called Autonomous System Boundary router (ASBR), such as the figure above, R5 EIGRP redistribution into the OSPF, then R5 is ASBR, but only if the redistribution into OSPF other routing protocols can not be called ASBR.

You can configure any OSPF routers become ABR or ASBR.

Since OSPF has a plurality of regions, the OSPF routing also exist in various forms in the routing table, divided into the following:

If the same routing area, called Intra-Area Route, the O is represented in the routing table;

If different regions of the route, called the Inter-Area Route or Summary Route, using O IA is represented in the routing table;

If this is not the OSPF routing, or different OSPF routing process, only to be re-distributed to OSPF, called External Route, using O E2 or OE 1 is represented in the routing table.

When there are multiple routes to reach the same destination, OSPF will be used to select the route according to the order, the order of all the routes are:

Intra-Area - Inter-Area - External E1 - External E2,即 O - O IA - O E1 - O E2。

Guess you like

Origin blog.51cto.com/14220532/2408175