Introducing Route Table Search Order

The kernel routing algorithm searches route table entries in the following order:

1. The kernel routing algorithm checks the LAN for destination hosts.

The kernel extracts the destination IP address from the IP datagram and computes the destination network number. The destination network number is then compared with the network numbers of all of the local interfaces (interfaces that are physically attached to the system) for a match. If the destination network number matches that of a local interface network number, the kernel encapsulates the IP datagram inside an Ethernet frame and sends it through the matching local interface for delivery.

2. The kernel routing algorithm checks the route table for a matching host IP address.

The kernel searches the route table entries for a matching host IP address. If an entry that matches the host IP address is found, the kernel encapsulates the IP datagram inside an Ethernet frame and sends the frame to the router that is associated with that destination.

3. The kernel routing algorithm checks the route table for a matching network number.

The kernel searches the route table entries for a matching network number. If a matching number is found, the kernel sets the destination Ethernet address to that of the corresponding router and delivers the frame to that router. The router that receives the frame repeats the execution of the route algorithm, but leaves the destination IP address unchanged.

4. The kernel routing algorithm checks for a default entry in the route table.

The kernel searches the route table entries for a default entry. If a default entry is found, the kernel encapsulates the datagram, sets the destination Ethernet address to that of the default router, leaves the destination IP address unchanged, and delivers the datagram through the interface that is local to the default router.

5. If there is no route to the destination, the kernel routing algorithm check generates an ICMP error message.

The kernel cannot forward the datagram, and an error message from ICMP is generated. The error message states No route to host or network is unreachable.

Figure 7-7 shows the kernel routing process.

Extract the destination IP address, and compute the network number.

Encapsulate the datagram by setting the destination Ethernet address to that of the router associated with the host route table entry. Deliver the frame through the interface connected to the router.

Encapsulate the datagram by setting the destination Ethernet address to that of the router associated with the route table entry. Deliver the frame through the interface connected to the router.

Encapsulate the datagram by setting the destination Ethernet address to that of the default router found in the route table. Deliver the packet through the interface frame connected to the router.

Generate a routing error message through I CMP

Figure 7-7 Kernel Routing Algorithm

0 0

Post a comment

  • Receive news updates via email from this site