OSPF basics (2): OSPF area, router-ID, metric value, method of modifying metric value, OSPF protocol packet type, OSPF adjacency establishment process

Table of contents

OSPF Terminology: Area

OSPF term: router-ID

Basic Terminology of OSPF: Metrics

To modify the overhead value:

Why do you want to modify the overhead value, and what is the effect of modifying the overhead value:

OSPF protocol packet type:

OSPF Three Table Items - Neighbor Table

OSPF commonly used viewing commands:

View router neighbor relationship:

View router link state database LSDB:

Check the OSPF routing table:

OSPF adjacency establishment process:


OSPF Terminology: Area

  1. OSPF Area is used to represent an OSPF area.
  2. Areas logically divide devices into different groups, each leased area number (Area ID) to identify.

OSPF term: router-ID

Route id Function: (router identifier, router identifier) ​​is used to identify an OSPF router, and is used to uniquely identify a router in an ospf area.  

Route id format: dotted decimal, length 32bit, example: 1.1.1.1, 2.2.2.2

Router-ID configuration method: The setting of router-ID can be configured manually or automatically by the system.

Route id manual configuration/automatic configuration, manual configuration is better than automatic configuration.

Note: By default, the router will use the first configured IP address as its global route id , and the administrator can also manually configure the router id.

OSPF router id If the administrator does not configure it manually , the global router id will be used as the router id of ospf by default.

If the administrator configures the router id, it will be used first.

The router id is not related to the physical interface, but the format is the same. Even if all the physical interfaces are down, the router id still exists. Used to identify the identity of the host.

Project suggestion: It is recommended to usethe loopbackinterface of the router as the router id of ospf.

What is a loopback interface?  It is a logical routing interface (virtual interface, which can be assigned an IP address) created by the administrator according to actual needs. As long as the router is turned on, this interface will be in the UP state. And there will be no physical failure and good stability, so it is usually used as the interface of choice for ospf router id . -- The loopback interface can also be used as a network test interface. Or the inband network management address of the device.

Basic Terminology of OSPF: Metrics

  1. OSPF uses Cost as the metric value of routes. Each OSPF-activated interface will maintain an interface Cost value. By default, the interface Cost value = 100Mbit/s/interface bandwidth (the value is a positive integer, rounded up to integer digits, for example: 100/1000=0.1, and the cost is 1. 3.9999, the overhead is 3). Among them, 100Mbit/s is the default reference value specified by OSPF. This value is configurable.
  2. Generally speaking, the cost value of an OSPF route can be understood as the accumulation of the cost values ​​of all interfaces along the route from the destination network segment to the router.

 

 Cost value algorithm is: 100Mbit/s divided by interface bandwidth

When the interface bandwidth is greater than 100Mbit/s, the cost value is always 1. Therefore, we can modify 100Mbit to be larger than the interface bandwidth, and then we can realize the operation of modifying the cost value of OSPF.

Example: 100Mbit/s / 1000M broadband = 0.1 --- cost value is 1, take a positive integer

Modify 100Mbit/s to 5000Mbit/s:

5000Mbit/1000M broadband=5 ----cost value is 5

 The routing protocol chooses the path with the least cost first, so the adjustment of the routing line needs to modify the cost value.

To modify the overhead value:

The first:

Ways to modify the bandwidth value calculated by default reference:

1、进入OSPF视图

2、bandwidth-reference +想要修改的带宽值(1~2147483648)

例:修改带宽值为5000Mbit/s

Bandwidth-reference 5000   ---单位是M(兆)bit每秒

 Our router is a Gigabit interface, so 5000/1000=5, so the cost value will be changed to 5

The second type:

Directly modify the overhead value of data passing through the interface

1、进入需要修改开销的物理接口(数据会同过的路由接口)

2、修改接口的ospf开销:

ospf cost 1000  ----这里是直接修改开销,cost值为1000,而不是参考带宽值。直接粗暴。

dis ospf interface +接口名  ----查看接口的ospf开销值

The OSPF cost value configured on the interface is better than the cost value calculated by the formula. After using the second ospf overhead modification method, the overhead value modified by the second method will be used first.

The first method is to modify the cost value of the overall situation , and the second method is to fine-tune the cost value of a certain link .

Notice:

If you need to change the reference cost, you only need to change it on one router, and then you need to change it on other routers. To achieve the consistency of the cost calculation method and unify the weights and measures. In order to avoid the inconsistency between the outgoing routing cost and the returning routing cost.

Modifying the overhead value of the receiving and sending interfaces can change the way data is sent and returned.

OSPF network cost : = outbound interface cost of the link passed + outbound interface cost of the destination network link

Why do you want to modify the overhead value, and what is the effect of modifying the overhead value:

1. The router will select the route with the smallest cost value according to the cost value of each interface, so modifying the cost value of each interface can make the data packet take a different route when it comes back and when it is sent out.

2. The routing table only allows data to pass through, allowing data to come and go, but it does not mean that it must go back and forth on the same link, and come back from another road.

3. For example, if the ACL access control list is made on the way back, and the data cannot come back after it goes out, the interface overhead can be changed to allow the data to come back from another way.

As shown below:

Select the optimal route according to the cost value of the outgoing interface. (The cost value of an OSPF route can be understood as the accumulation of the cost values ​​of all outgoing interfaces along the way from the source router to the destination router)

 

OSPF protocol packet type:

OSPF has five types of protocol packets. These packets play different roles in the interaction between OSPF routers.

 

OSPF Three Table Items - Neighbor Table

OSPF has three important entries, OSPF neighbor table, LSDB table and OSPF routing table. For the OSPF neighbor table, you need to know:

1. Before OSPF transmits link state information, it needs to establish an OSPF neighbor relationship.

2. The OSPF neighbor relationship is established by exchanging Hello packets.

3. The OSPF neighbor table shows the status of the neighbor relationship between OSPF routers, and can be viewed by using the display ospf peer command.

OSPF commonly used viewing commands:

View router neighbor relationship:

display ospf peer

View router link state database LSDB:

display ospf lsdb

Check the OSPF routing table:

display ospf routing

OSPF adjacency establishment process:

Guess you like

Origin blog.csdn.net/weixin_53466908/article/details/126870185