Skip to main content

Know about Route Recursion

We are going back to networking basics with this post. In few lines below you will find most important theory that makes network gear do its job.
The main router job is to making routing decisions to be able to route packets toward their destination. Sometimes that includes recursive lookup of routing table if the next-hop value is not available via connected interface.

ROUTING DECISION ON END DEVICES

Lets have a look at routing decision that happens if we presume that we have a PC connected on our Ethernet network.
If one device wants to send a packet to another device, it first needs to find an answer to these questions:
  • Is maybe the destination IP address chunk of local subnet IP range?
    • If that is true, packet will be forwarded to the neighbour device using Layer 2 in the ARP example below.
    • If that is not the case, does the device network card configuration include a router address through which that destination can be reached? (default gateway)
  • Device then looks at his local ARP table. Does it include a MAC address associated with the destination IP address?
    • If the destination is not part of the local subnet, does the local ARP table contain the MAC address of the nearest router? (MAC address to IP address mapping of default gateway router)

ROUTING DECISION ON A ROUTER

Contrary to user end device like iPhone or Notebook which usually have only one way out of local network using broadband home router as Internet access default gateway, routers across the network usually have multiple network subnets each connected to one of their interfaces. That makes them able to route traffic out on different interfaces forwarding that traffic across different paths. If router receives the packet that is destined to some destination IP address it goes through similar list of questions like the end host in the example above, but it can became more complicated. Router receives the packet, opens the IP header and reads the destination IP address. After that the questions for him to solve are these:
  1. Is maybe the destination IP address chunk of one of the local subnets that this router has on one of his interfaces?
    • If that is true, packet will be forwarded using the Layer 2 described in the question No2 below.
    • If that is not the case, Router needs to make a route lookup on his routing table in order to find the longest match for this IP address subnet. Each routing table entry has the destination subnet defined together with next-hop IP address which needs to be used in order to forward the packet to that destination network. Router makes that routing table lookup in order to decide out on which interface (towards which next-hop address) he will need to forward the packet so that IP destination can be reached.
  2. Device then looks at his local ARP table.
    • Does it include a MAC address associated with the destination IP address?
    • If there is no ARP table entry for that IP address it will need to broadcast an ARP request to get this destination IP host response with his MAC address.

ROUTE RECURSION

Routing recursion is a recursive search process of routers routing table where the next-hop IP address is wanted to route packed towards its destination but when found it is not part of any directly connected network.
Usually, Router checks the destination address inside packets IP header and makes the decision based of few steps described in the routing example above.
When router finds longest match route for wanted destination, the next-hop value for this prefix is read and checked. If that longest match next-hop IP address value is a connected route then outgoing interface is known and layer 2 address is found which enables the frame to be built and transition of the packet can be done towards the destination.
If the next-hop that IP does not exist on any of the ends of connected interfaces, additional routing lookups must be done for an outgoing interface to be found. This additional routing table lookups are known as recursive lookups.

EXAMPLE

Here is an example that will show the recursive lookup within a simple topology and routing table from R1:
Route recursion
R1(config)#do sh ip route

      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.10.1.0/24 is directly connected, FastEthernet0/0
L        10.10.1.1/32 is directly connected, FastEthernet0/0
S     192.168.1.0/24 [1/0] via 10.10.1.2
S     192.168.2.0/24 [1/0] via 10.10.1.2

When packet arrives with destination IP 192.168.2.111, router R1 will make a routing table lookup and it will find that a route for that packet is static route 192.168.2.0/24 with the next hop 10.10.1.2
That next hop IP 10.10.1.2 is then found as a part of directly connected subnet 10.10.1.0/24 through exit interface FastEthernet0/0.
Process used by router R1 in the example above is called recursive lookup because router needed to go across the routing table twice in order to find the out interface.
When a route table entry shows next-hop IP address and not a directly connected exit interface, recursive lookup is needed. Therefore another lookup has to be made. There can be more lookups, until the route with exit interface specified is found

Popular posts from this blog

UPGRADING EOS in the ARISTA Switches

UPGRADING EOS in the ARISTA Switches: EOS is the Firmware for Arista Switches whereas IOS for Cisco. This blog post shows the detailed procedures to follow and to upgrade the EOS in the Arista Switches. This Post was supports for any platform or the Version you are going to upgrade in the Arista Switches. This Post was divided into three parts : Pre-Upgrade Process Upgrade Process Post-Upgrade Process PRE-UPGRADING-PROCESS: 1       1)        Check the Upgrade Path tool by clicking the below link. https://www.arista.com/en/support/mlag-portal/mlaglist and confirm it is in mlag issu compatible 2)       Check if the  STP agent is restartable by giving the command switch-1# show spanning-tree bridge detail | grep agent Stp agent restartable                      :            True NOTE :    A switch can continue supporting MLAG when its peer is offline if the STP agent is restartable. When one peer is offline, data traffic flows from the devices through the

DIFFERENCE BETWEEN THE LAN AND WAN (local area network ,wide area network

Improve The other difference between LAN and WAN, is the speed of the network . The maximum speed of a LAN can be 1000 megabits per second, while the speed of a WAN can go up to 150 megabits per second. This means the speed of a WAN, is one-tenth of the speed of a LAN. A WAN is usually slower because it has lower bandwidth. Computers in a LAN can share a printer, if they are all in the same LAN. On the other hand, a WAN cannot share a printer, so a computer in one country cannot use a printer in another country. A LAN does not need a dedicated computer to direct traffic to and from the Internet, unlike a WAN that needs a special-purpose computer, whose only purpose is to send and receive data from the Internet. Another LAN vs. WAN comparison is the cost of the network. A WAN is more expensive than a LAN. It is easier to expand a LAN than a WAN. The equipment needed for a LAN is a network interface card (NIC), a switch and a hub. On the other hand, the equipment needed to connec

FORTIGATE ACTIVE PASSIVE UPGRADE

FORTIGATE ACTIVE PASSIVE UPGRADE : This blog post shows the detailed procedures to follow and to upgrade the firmware in the Fortigate Firewall. This Post was supports for any platform or the Version you are going to upgrade in the Fortigate Firewall This Post was divided into three parts : Pre-Upgrade Process Upgrade Process Post-Upgrade Process PRE UPGRADE STEPS: 1   1)     Go to the below website and check the Upgrade Path https://docs.fortinet.com/upgrade-tool 2)        Next Login to the Fortigate Console and check the HA Status ( it is to be In sync and higher Priority enabled for the required primary device) 3)        Login to the Console and give the command Config global – get sys ha status Also check session pickup is in enable to avoid session interruptions in failover. 4)        Download all the Firmware’s and the md5 files in the list and check with the software MD5sum.exe to avoid the download errors. NOTE : Must and should configuration backup have t