Network Topology Example 13: Introduction to IPv4 Static Routing and NQA Association

Networking Graphics

        

Introduction of IPv4 Static Routing and NQA Association

  • Network Quality Analysis (NQA) is a real-time network performance detection and statistics technology that can collect statistics on network information such as response time, network jitter, and packet loss rate. NQA can monitor network QoS in real time, and perform effective fault diagnosis and location when network faults occur.
  • When the network is relatively simple, or the switch cannot establish a route to the destination network through the dynamic routing protocol, you can configure a static route. However, unlike dynamic routing protocols, static routes have no detection mechanism. When a network failure occurs, static routes cannot be sensed, and administrators are required to intervene. This cannot guarantee timely link switching, which may result in long-term service interruption.
  • The solution of deploying IPv4 static route and BFD association can adapt to changes in the link. However, IPv4 static route and BFD association requires that devices at both ends of the link support the BFD function. If there are devices on both ends of the link that do not support the BFD function, you can configure IPv4 static routes to associate with NQA. When the NQA test case detects a link failure, the static routes bound to it will be deleted from the IP routing table, so that service traffic can be switched. To the route without link failure, to avoid long-term service interruption.

Networking requirements

  • As shown in Figure 1, a company's network is shown. SwitchD and SwitchE at the access layer are interconnected with switches at the aggregation layer, SwitchB and SwitchC, through static routes. The network is designed as a redundant backup structure. Users want to achieve the following requirements:
  • Deploy a detection mechanism for static routes so that static routes can sense link failures and ensure that link switching can be performed in time when a link fails, avoiding long-term service interruption;
  • Under normal circumstances, service traffic is required to use the active link SwitchB→SwitchD for transmission;
  • When the active link fails, service traffic is switched to the standby link SwitchC→SwitchD.

Configuration ideas

  • 1. Create an NQA test instance of the ICMP type to detect the failure of the active link.
  • Create an ICMP NQA test case between the NQA test case client SwitchB and the device under test SwitchD to check whether the active link SwitchB→SwitchD is normal.
  • 2. Configure static routes and bind NQA test cases.
  • Configure static routes on the aggregation switches SwitchB and SwitchC. Configure the static route on SwitchB to associate with NQA. When the NQA test case detects a link failure, it notifies the routing management module to delete the static route from the IP routing table.
  • 3. Configure the dynamic routing protocol. Configure a dynamic routing protocol on the aggregation switches SwitchA, SwitchB, and SwitchC so that they can learn routes from each other.
  • 4. The OSPF protocol introduces static routes, and sets a lower cost value for the main link to realize the redundant backup of the main and backup links.
  • Configure OSPF to import static routes on the aggregation switches SwitchB and SwitchC, and set a higher cost for the static routes imported by SwitchC. When SwitchA learns a route to the same destination address from SwitchB and SwitchC, it preferentially selects the link SwitchB→SwitchD with the lower cost.

Steps

  • 1. Configure the VLAN to which each interface belongs

# Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to those of SwitchA, and are not repeated here.

<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 30 40
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 30
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 40
[SwitchA-GigabitEthernet0/0/2] quit
  • 2. Configure the IP address of each VLANIF interface

# Configure SwitchA. The configurations of SwitchB, SwitchC, SwitchD, and SwitchE are similar to those of SwitchA, and are not repeated here.

[SwitchA] interface vlanif 30
[SwitchA-Vlanif30] ip address 192.168.3.1 24
[SwitchA-Vlanif30] quit
[SwitchA] interface vlanif 40
[SwitchA-Vlanif40] ip address 192.168.4.1 24
[SwitchA-Vlanif40] quit
  • 3. Configure the NQA test instance between SwitchB and SwitchD on SwitchB
[SwitchB] nqa test-instance user test   //Create an NQA test case with the manager as user and the instance name as test
[SwitchB-nqa-user-test] test-type icmp   //Configure the test type of the NQA test instance as ICMP
[SwitchB-nqa-user-test] destination-address ipv4 192.168.1.2   //Configure the destination address of the NQA test instance as 192.168.1.2
[SwitchB-nqa-user-test] frequency 20   //Configure the time interval for automatic test execution of NQA test cases to be 20 seconds
[SwitchB-nqa-user-test] probe-count 2   //Configure the number of test probes for an NQA test instance to be 2
[SwitchB-nqa-user-test] interval seconds 5   //Configure the interval for sending packets in the NQA test instance to 5 seconds
[SwitchB-nqa-user-test] timeout 4   //Configure the timeout period of one probe of an NQA test instance to 4 seconds
[SwitchB-nqa-user-test] start now
[SwitchB-nqa-user-test] quit
  • 4. Configure static routing

# Configure a static route associated with the NQA test instance on SwitchB.

[SwitchB] ip route-static 192.168.7.0 255.255.255.0 Vlanif 10 192.168.1.2 track nqa user test

# Configure static routes on SwitchC.

[SwitchC] ip route-static 192.168.7.0 255.255.255.0 Vlanif 60 192.168.6.2
  • 5. Configure dynamic routing protocols on SwitchA, SwitchB, and SwitchC. In this example, the OSPF dynamic routing protocol is selected.

# Configure OSPF on SwitchA.

[SwitchA] ospf 1 router-id 10.1.1.1
[SwitchA-ospf-1] area 0.0.0.0
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255
[SwitchA-ospf-1-area-0.0.0.0] quit
[SwitchA-ospf-1] quit

# Configure OSPF on SwitchB.

[SwitchB] ospf 1 router-id 10.2.2.2
[SwitchB-ospf-1] area 0.0.0.0
[SwitchB-ospf-1-area-0.0.0.0] network 192.168.3.0 0.0.0.255
[SwitchB-ospf-1-area-0.0.0.0] quit
[SwitchB-ospf-1] quit

# Configure OSPF on SwitchC.

[SwitchC] ospf 1 router-id 10.3.3.3
[SwitchC-ospf-1] area 0.0.0.0
[SwitchC-ospf-1-area-0.0.0.0] network 192.168.4.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.0] quit
[SwitchC-ospf-1] quit
  • 6. Configure OSPF dynamic routing protocol on SwitchB and SwitchC to import static routes

# Configure the OSPF dynamic routing protocol on SwitchB to import static routes, and set the routing cost to 10.

[SwitchB] ospf 1
[SwitchB-ospf-1] import-route static cost 10
[SwitchB-ospf-1] quit

# Configure the OSPF dynamic routing protocol on SwitchC to import static routes, and set the routing cost to 20.

[SwitchC] ospf 1
[SwitchC-ospf-1] import-route static cost 20
[SwitchC-ospf-1] quit
  • 7. View the configuration results

After the configuration is complete, run the display current-configuration | include nqa command on the aggregation switch SwitchB in the system view, and you can see that the static route has been bound to the NQA test instance. Run the display nqa results command, and you can see that the NQA test case has been created.

# View the configuration of NQA for static routing.

[SwitchB] display current-configuration | include nqa
ip route-static 192.168.7.0 255.255.255.0 Vlanif10 192.168.1.2 track nqa user test
nqa test-instance user test

# View NQA test results.

[SwitchB] display nqa results test-instance user test

 NQA entry(user, test) :testflag is active ,testtype is icmp 
  1 . Test 288 result   The test is finished
   Send operation times: 2              Receive response times: 2          
   Completion:success                 RTD OverThresholds number: 0       
   Attempts number:1                    Drop operation number:0            
   Disconnect operation number:0        Operation timeout number:0         
   System busy operation number:0       Connection fail number:0           
   Operation sequence errors number:0   RTT Status errors number:0         
   Destination ip address:192.168.1.2                                    
   Min/Max/Average Completion Time: 3/4/3                                
   Sum/Square-Sum  Completion Time: 7/25                                 
   Last Good Probe Time: 2019-09-09 09:55:38.2                           
   Lost packet ratio: 0 %

You can see "Lost packet ratio: 0 %", which indicates that the link is in good condition.

# View the routing table of SwitchB, you can see that the static route exists in the routing table.

[SwitchB] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 10       Routes : 10       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     Vlanif10
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       Vlanif10
    192.168.3.0/24  Direct  0    0           D   192.168.3.2     Vlanif30
    192.168.3.2/32  Direct  0    0           D   127.0.0.1       Vlanif30
    192.168.4.0/24  OSPF    10   2           D   192.168.3.1     Vlanif30
    192.168.5.0/24  Direct  0    0           D   192.168.5.1     Vlanif50
    192.168.5.1/32  Direct  0    0           D   127.0.0.1       Vlanif50
    192.168.7.0/24  Static  60   0           D   192.168.1.2     Vlanif10

# View the routing table of the aggregation switch SwitchA.

[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.3.0/24  Direct  0    0           D   192.168.3.1     Vlanif30
    192.168.3.1/32  Direct  0    0           D   127.0.0.1       Vlanif30
    192.168.4.0/24  Direct  0    0           D   192.168.4.1     Vlanif40
    192.168.4.1/32  Direct  0    0           D   127.0.0.1       Vlanif40
    192.168.7.0/24  O_ASE   150  10          D   192.168.3.2     Vlanif30

It can be seen that there is a route to 192.168.7.0/24, the next hop points to 192.168.3.2, and the cost value is 10, so the service traffic will preferentially go through the link SwitchB→SwitchD.

# Shut down the GigabitEthernet0/0/3 interface of SwitchB to simulate a link failure.

[SwitchB] interface GigabitEthernet0/0/3
[SwitchB-GigabitEthernet0/0/3] shutdown
[SwitchB-GigabitEthernet0/0/3] quit

# View NQA test results.

[SwitchB] display nqa results test-instance user test

 NQA entry(user, test) :testflag is active ,testtype is icmp 
  1 . Test 309 result   The test is finished
   Send operation times: 2              Receive response times: 0          
   Completion:failed                 RTD OverThresholds number: 0       
   Attempts number:1                    Drop operation number:2            
   Disconnect operation number:0        Operation timeout number:0         
   System busy operation number:0       Connection fail number:0           
   Operation sequence errors number:0   RTT Status errors number:0         
   Destination ip address:192.168.1.2                                   
   Min/Max/Average Completion Time: 0/0/0                                
   Sum/Square-Sum  Completion Time: 0/0                                  
   Last Good Probe Time: 0000-00-00 00:00:00.0                           
   Lost packet ratio: 100 %

You can see "Completion:failed" and "Lost packet ratio: 100 %", which indicates that the link has failed.

# Check the routing table of SwitchB, and you can see that the static route has disappeared.

[SwitchB] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8        Routes : 8        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.3.0/24  Direct  0    0           D   192.168.3.2     Vlanif30
    192.168.3.2/32  Direct  0    0           D   127.0.0.1       Vlanif30
    192.168.4.0/24  OSPF    10   2           D   192.168.3.1     Vlanif30
    192.168.5.0/24  Direct  0    0           D   192.168.5.1     Vlanif50
    192.168.5.1/32  Direct  0    0           D   127.0.0.1       Vlanif50
    192.168.7.0/24  O_ASE   150  20          D   192.168.3.1     Vlanif30

# View the routing table of SwitchA.

[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 7        Routes : 7        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.3.0/24  Direct  0    0           D   192.168.3.1     Vlanif30
    192.168.3.1/32  Direct  0    0           D   127.0.0.1       Vlanif30
    192.168.4.0/24  Direct  0    0           D   192.168.4.1     Vlanif40
    192.168.4.1/32  Direct  0    0           D   127.0.0.1       Vlanif40
    192.168.7.0/24  O_ASE   150  20          D   192.168.4.2     Vlanif40

   Because the NQA test instance on SwitchB is associated with the static route, when NQA detects a link failure, it immediately informs SwitchB that the static route bound to it is unavailable, and SwitchA cannot learn from SwitchB the route to 192.168.7.0/ 24 routes. However, SwitchA can learn the route to 192.168.7.0/24 from SwitchC, so you can see that the next hop of the route to 192.168.7.0/24 points to 192.168.4.2, and the cost is 20. Service traffic is switched to the link SwitchC→SwitchD.

 

Tags: Router switch

Posted by peter_anderson on Mon, 02 May 2022 06:58:03 +0300