Modification of OSPF overhead value, protocol priority and timer

Principle overview

Calculation formula of interface cost value:
   interface cost value = bandwidth reference value / interface bandwidth
   take the integer part of the calculation result as the interface cost value, and take 1 when the result is less than 1.
   the overhead value of the interface can be changed by changing the bandwidth reference value. The bandwidth reference value can be configured, and the default value is 100M.
   the default values of various interface costs can be calculated according to the formula, as follows:
           56kbit/s serial port -- the default value for overhead is 1785.
       64kbit/s serial port -- the default value of overhead is 1562.
                       .
                      .
If the cost value of OSPF interface is not configured directly, OSPF will automatically calculate the cost value according to the bandwidth of the interface.
The Cost value is the cumulative Cost value of all outgoing interfaces from the source address to the destination address.
OSPF's common timers include Hello timer and Dead timer, which determine the interval between OSPF sending Hello messages and the timer to maintain neighborhood relationship. By default, the time interval for P2P and Broadcast type interfaces to send Hello messages is 10s, and the neighbor failure time is 40s; the time interval for P2MP and NBMA type interfaces to send Hello messages is 30s, and the neighbor failure time is 120s.

Experimental content

Experimental topology


Experimental steps

1. Configure the interface address, host address and gateway of each router
2. Configure protocol priority
Deploy OSPF network to realize communication between branch A and branch B through R2. Deploy OSPF network on routers R1, R2 and R4, and notify that the relevant network segment belongs to zone 0.

[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net 10.0.1.0   0.0.0.255	
[R1-ospf-1-area-0.0.0.0]net 10.0.12.0   0.0.0.255

[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net 10.0.12.0   0.0.0.255
[R2-ospf-1-area-0.0.0.0]net 10.0.24.0   0.0.0.255

[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net 10.0.24.0   0.0.0.255
[R4-ospf-1-area-0.0.0.0]net 10.0.45.0   0.0.0.255

[R5]ospf 1
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]net 10.0.45.0   0.0.0.255
[R5-ospf-1-area-0.0.0.0]net 10.0.2.0   0.0.0.255

After deployment, test connectivity between PC1 and PC2.

PC>ping 10.0.1.1

Ping 10.0.1.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.0.1.1: bytes=32 seq=2 ttl=124 time=125 ms
From 10.0.1.1: bytes=32 seq=3 ttl=124 time=157 ms
From 10.0.1.1: bytes=32 seq=4 ttl=124 time=125 ms
From 10.0.1.1: bytes=32 seq=5 ttl=124 time=141 ms

--- 10.0.1.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/137/157 ms
  //Communication is normal, i.e. the current line through R2 is normal.

First, the network administrator starts to implement the network upgrade scheme, deploy and use the R3 line, and run RIP protocol.

[R1]rip 1
[R1-rip-1]ver   2
[R1-rip-1]undo   summary 
[R1-rip-1]net   10.0.0.0

[R3]rip 1
[R3-rip-1]ver 2
[R3-rip-1]undo   summary 
[R3-rip-1]network   10.0.0.0

[R4]rip 1
[R4-rip-1]ver 2	
[R4-rip-1]undo   summary 
[R4-rip-1]net   10.0.0.0

[R5]rip 1
[R5-rip-1]ver 2
[R5-rip-1]undo   summary 	
[R5-rip-1]net   10.0.0.0

After configuration, check the entry of branch B network segment 10.0.2.0 in routing table on network device R1 of branch A.

[R1]dis ip routing-table 10.0.2.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
       10.0.2.0/24  OSPF    10   3126        D   10.0.12.2       Serial0/0/0

It is found that the route entry of branch B network is still obtained through OSPF protocol, that is, the data between two branches is still forwarded through R2. For the newly accessed R3, the path with larger bandwidth did not participate in data forwarding, and the upgrade was unsuccessful.
The reason for the failure is that the route entry can be obtained from OSPF protocol and RIP protocol at the same time. When the same route entry can be obtained through different routing protocols, first compare the priority of the two protocols, and the router will select the routing protocol with high priority. The default protocol priority of OSPF is 10, while RIP is 100. The lower the value is, the higher the priority is. Therefore, the route entry obtained by OSPF is selected.
In order to meet the actual needs, OSPF protocol priority needs to be modified. In the process of R1, R4 and R5, use the preference command to modify the OSPF protocol priority value to 110, which is greater than RIP's 100.

[R1]ospf 1
[R1-ospf-1]preference 110

[R4]ospf 1
[R4-ospf-1]preference 110

[R5]ospf 1
[R5-ospf-1]preference 110

After configuration, check the entry of 10.0.2.0 of branch B network segment in routing table on gateway device R1 of branch A.

[R1-ospf-1]dis ip routing-table 10.0.2.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
 10.0.2.0/24  RIP     100  3           D   10.0.13.3       GigabitEthernet0/0/1
 //It can be observed that the line through R3 has now been used.

On the gateway device R4 of branch B, check the entry in the routing table for 10.0.1.0 of branch A gateway.

[R4]
Mar  9 2020 10:46:21-08:00 R4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 13, the c
hange loop count is 0, and the maximum number of records is 4095.dis	
[R4-ospf-1]display ip rou	
[R4-ospf-1]display ip routing-table 10.0.1.1
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
       10.0.1.0/24  RIP     100  2           D   10.0.34.3       GigabitEthernet0/0/0
 R4 It also uses the R3 The routes are the same.

3. Configure OSPF cost value
In the process of network adjustment, the most important thing is to try to make sure that it can minimize the impact on the user communication, and generally choose to carry out in the late night when the user network utilization is less. After analyzing the network, it is found that the direct deployment of OSPF protocol on R3 belongs to network 0, that is, OSPF protocol is run as R2. Under the same OSPF protocol, the route selection first compares the cost value of the link, while the line passing R2 is the wide area network line, and the cost value is significantly higher than the Ethernet link passing R3, that is, the traffic of the two branches of the company is still transmitted through R3 , less risk. Therefore, the network administrator will directly deploy OSPF protocol on the line passing R3.
Configure OSPF protocol on R1, R3 and R4 to notify related network segments.

[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net 10.0.13.0   0.0.0.255

[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net 10.0.13.0   0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 10.0.34.0   0.0.0.255

[R4]ospf 1
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]net 10.0.34.0   0.0.0.255

After configuration, check the entry of 10.0.2.0 in the router for branch B network segment on gateway device R1 of branch A.

[R1]dis ip routing-table 10.0.2.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
       10.0.2.0/24  OSPF    110  4           D   10.0.13.3       GigabitEthernet0/0/1
  It can be observed that after the network configuration is adjusted, the line forwarding using R3 is still maintained. Note that the relevant configuration of RIP protocol should be deleted to avoid unnecessary hidden dangers.

Branch A is required to regularly check whether the standby path is available every month, so it is required that the traffic can be forwarded through R2. However, the current overhead value of the line passing R2 is far greater than that of the line passing R3, which makes it impossible to test. The path selection can be realized by manually modifying the OSPF overhead value. Use the ospf cost command on the G0/0/1 interface of R1 to configure the cost value required to run OSPF protocol.

[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ospf cost 20000

After configuration, check the entry of branch B network segment 10.0.2.0 in the routing table on the gateway device R1 of branch A.

[R1]dis ip routing-table 10.0.2.0
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
       10.0.2.0/24  OSPF    110  3126        D   10.0.12.2       Serial0/0/0
 It can be observed that the traffic sent to branch B has been forwarded through R2. The routing cost of the path passing R2 is 3126, far less than the routing cost of 20000 configured on R3. Note: the OSPF link cost value is based on the interface modification, and it must be valid only after the incoming interface modification of route update.

4. Configure OSPF timer
The network administrator found in the daily network inspection that the line passing R3 is Ethernet, and the network type in OSPF protocol is broadcast network type, that is, the default Hello timer and Dead timer are 10s and 40s. In this way, the Hello message of OSPF data is sent too frequently.
First, change the Hello timer and Dead timer on R1 to 20s and 80s.

[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ospf timer hello 20
[R1-GigabitEthernet0/0/1]ospf timer dead 80
//Wait a moment, you will find that the neighbor relationship between R1 and R3 is interrupted. This is because the Hello timer and the Dead timer need to be verified when establishing the neighbor relationship in the OSPF broadcast network. Only when the verification is consistent can the neighbor be established. Also modify the two timers of R3 to be consistent with R1.

[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello  20
[R3-GigabitEthernet0/0/0]ospf timer dead  80

After the configuration is completed, check the neighbor status of R1.

[R1]dis ospf pe br
	 OSPF Process 1 with Router ID 10.0.1.254
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/1             10.0.13.3        Full        
 0.0.0.0          Serial0/0/0                      10.0.12.2        Full        
 ----------------------------------------------------------------------------
 //It can be observed that the neighborhood is back to normal.
Published 0 original articles, won praise 1, visitors 292
Private letter follow

Tags: network less

Posted on Mon, 09 Mar 2020 03:26:26 -0400 by Aeolus