When an IP address is configured on a routers interface what happens in the route table?

Routers forward packets based on routing tables and forwarding information base (FIB) tables. Each router maintains at least one routing table and one FIB table. Routers select routes based on routing tables and forward packets based on FIB tables.

Routing Table

Each router maintains a local core routing table (namely, an IP routing table), and each routing protocol maintains its own routing table.

  • Local core routing table

    A router uses the local core routing table to store preferred routes. The router then sends the preferred routes to the FIB table to guide packet forwarding. The router selects routes according to the priorities of protocols and costs stored in the routing table.

    A router that supports Layer 3 Virtual Private Network (L3VPN) maintains a local core routing table for each VPN instance.

  • Protocol routing table

    A protocol routing table stores routing information discovered by the protocol.

    A routing protocol can import and advertise routes that are discovered by other routing protocols. For example, if a router running the Open Shortest Path First (OSPF) protocol needs to use OSPF to advertise direct routes, static routes, or Intermediate System-Intermediate System (IS-IS) routes, the router must import the routes into the OSPF routing table.

Routing Table Contents

You can run the display ip routing-table command on a router to view basic information about the routing table of the router. The command output is as follows:

<HUAWEI> display ip routing-table
Proto: Protocol        Pre: Preference
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table: _public_
         Destinations : 14       Routes : 14                                    
                                                                                
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface      
                                                                                
        0.0.0.0/0   Static  60   0          RD   10.137.216.1    Vlanif20
     10.10.10.0/24  Direct  0    0           D   10.10.10.10     Vlanif20
    10.10.10.10/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
   10.10.10.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
     10.10.11.0/24  Direct  0    0           D   10.10.11.1      LoopBack0      
     10.10.11.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
   10.10.11.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
   10.137.216.0/23  Direct  0    0           D   10.137.217.208  Vlanif20      
 10.137.217.208/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
 10.137.217.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
      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    
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0    
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0 

A routing table contains the following key data for each IP packet:

  • Destination: identifies the destination IP address or destination network address of an IP packet.

  • Mask: supplements the destination address to specially identify the address of the network segment where the destination host or router resides.

    The network segment address of a destination host or router is obtained through the "AND" operation on the destination address and network mask. For example, if the destination address is 10.1.1.1 and the mask is 255.255.255.0, the address of the network segment where the host or router resides is 10.1.1.0.

    The network mask is composed of several consecutive 1s. These 1s can be expressed in either the dotted decimal notation or the number of consecutive 1s in the mask. For example, the network mask can be expressed either as 255.255.255.0 or 24.

  • Proto: indicates the protocol through which routes are learned.

  • Pre: indicates the routing protocol preference of a route. There may multiple routes to the same destination, which have different next hops and outbound interfaces. These routes may be discovered by different routing protocols or manually configured. A router selects the route with the highest preference (the smallest value) as the optimal route. For the routing protocol preference, see Routing Protocol Preference.

  • Cost: indicates the route cost. When multiple routes to the same destination have the same preference, the route with the lowest cost is selected as the optimal route.

    The Preference value is used to compare the preferences of different routing protocols, while the Cost value is used to compare the preferences of different routes of the same routing protocol.

  • NextHop: indicates the IP address of the next device that an IP packet passes through.

  • Interface: indicates the outbound interface through which an IP packet is forwarded.

In Figure 1-1, the routing table of RouterA shows that it connects to three networks, so it has three IP addresses and three outbound interfaces.

Automatic Restoration After the Number of Routes Exceeds the Upper Limit

A local core routing table stores routes of different routing protocols. If the number of routes in the local core routing table reaches the upper limit, no more route can be added to the table. The local core routing table has the following route limitations:

  • System route limit: specifies the maximum number of routes supported by the system.
  • System route prefix limit: specifies the range of prefixes for all the routes supported by the system.
  • Multicast IGP route limit: specifies the maximum number of multicast IGP routes.
  • Multi-topology route limit: specifies the maximum number of multi-topology routes.
  • Private network route limit: specifies the maximum number of private network routes supported by the system.
  • VPN route limit: specifies the maximum number of VPN routes supported by the system.
  • VPN route prefix limit: specifies the range of prefixes for all the VPN routes supported by the system.

If a protocol fails to add routes to the local core routing table due to a specific route limitation, the system records the failure with the protocol name and routing table ID.

After routes of protocols are deleted from the local core routing table, and the number of routes falls below the upper limit, the system prompts all the protocols that failed to add routes to the local core routing table to re-add the routes to the local core routing table. This process restores most of the routes in the local core routing table. The size of released table space determines whether all routes in the local core routing table can be restored.

Matching with FIB Table

After selecting an optimal route from the routing table, a router sends it to the FIB table. When receives a packet, the router compares it against the FIB table to find the optimal route to forward the packet.

Each entry in the FIB table contains the physical or logical interface through which a packet is sent to a network segment or host to reach the next router. An entry can also indicate whether the packet can be sent to a destination host in a directly connected network.

The router performs the "AND" operation on the destination address in the packet and the network mask of each entry in the FIB table. The router then compares the result of the "AND" operation with the entries in the FIB table to find a match and chooses the optimal route to forward packets according to the longest match rule.

For example, assume that a router has the following routing table:

Routing Tables:
Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
 0.0.0.0/0      Static   60   0       D   192.168.0.2      GigabitEthernet1/0/0
 10.8.0.0/16    Static   60   3       D   192.168.0.2      GigabitEthernet1/0/0
 10.9.0.0/16    Static   60   50      D   172.16.0.2       GigabitEthernet3/0/0
 10.9.1.0/24    Static   60   4       D   192.168.0.2      GigabitEthernet2/0/0
 10.20.0.0/16   Direct   0    0       D   172.16.0.1       GigabitEthernet4/0/0

After receiving a packet carrying the destination address 10.9.1.2, the router searches the following FIB table:

 FIB Table:
 Total number of Routes : 5
Destination/Mask   Nexthop         Flag TimeStamp     Interface              TunnelID
0.0.0.0/0            192.168.0.2       SU   t[37]         GigabitEthernet1/0/0  0x0
10.8.0.0/16          192.168.0.2       DU   t[37]         GigabitEthernet1/0/0  0x0
10.9.0.0/16          172.16.0.2        DU   t[9992]       GigabitEthernet3/0/0  0x0
10.9.1.0/24          192.168.0.2       DU   t[9992]       GigabitEthernet2/0/0  0x0
10.20.0.0/16         172.16.0.1        U    t[9992]       GigabitEthernet4/0/0  0x0

The router performs the "AND" operation on the destination address 10.9.1.2 and the masks 0, 16, and 24 to obtain the network segment addresses: 0.0.0.0/0, 10.9.0.0/16, and 10.9.1.0/24. The three addresses match three entries in the FIB table. The router chooses the entry 10.9.1.0/24 according to the longest match rule, and forwards the packet through GigabitEthernet2/0/0.

When a router's interface is configured with an IP address and subnet mask that interface becomes?

When a router interface is configured with an IP address and subnet mask, the interface becomes a host on that attached network. A directly connected network is a network that is directly attached to one of the router interfaces.

What happens at the routing table?

A routing table contains the information necessary to forward a packet along the best path toward its destination. Each packet contains information about its origin and destination. Routing Table provides the device with instructions for sending the packet to the next hop on its route across the network.

What does the command show ip route do when executed on a router?

Indicates the address of the remote network. The first number in the brackets is the administrative distance of the information source; the second number is the metric for the route. Specifies the address of the next router to the remote network. Specifies the last time the route was updated in hours:minutes:seconds.

How do routers and IP address work together?

The router has a “pool” of IP addresses that it keeps track of. When a computer connects to it and asks for an IP address, the router picks an IP address from the pool and assigns it to the computer. The router makes sure that two computers are not assigned the same IP address.