IP routing is the process of sending packets from a host on one network to another on another remote network. This process is usually done by the router. The router checks the destination IP address of the packet, determines the next-hop address, and then forwards the packet. Routers use routing tables to determine the next-hop address to which packets should be forwarded.
Consider the following example of IP routing:
Host A wants to communicate with host B, but host B is on another network. Host A is configured to send all packets sent to the remote network to router R1. Router R1 receives the packet, checks the destination IP address, and forwards the packet to the outgoing interface associated with the destination network.
The default gateway is a router that hosts the host to communicate with other hosts on the remote network. The default gateway will be used when the host does not have a routing entry for a particular remote network and does not know how to access the network. The host may be configured to send all packets destined for the remote network to a default gateway having a route to the network.
The following example explains the concept of a default gateway more thoroughly.
Host A configures the IP address of router R1 as the default gateway address. The host attempts to communicate with host b (a host on another remote network). Host a lookup in its routing table to check if there is an entry for that target network. If the entry is not found, the host sends all data to router R1. Router R1 receives the packet and forwards it to Host B.
Each router maintains a routing table and stores it in RAM. The router uses the routing table to determine the path to the target network. Each routing table contains the following entries:
network destination and subnet mask – specifies a range of IP addresses.
remote router – IP address of the router used to reach that network.
outgoing interface – the outgoing interface the packet should go out to reach the destination network.
There are three different methods for populating a routing table:
1. directly connected subnets
2. using static routing
3. using dynamic routing
Each of these methods will be described in the following chapters.
Consider the following example. Host a wish to communicate with host b, but host b is on another network. Host A is configured to send all packets destined for the remote network to the router. The router receives the packet and checks the routing table to see if it has a destination address entry. If so, the router forwards the packet to the appropriate interface port. If the router cannot find the entry, it discards the packet.
We can use the show IP route command from the enabled mode to display the router’s routing table.
It can be seen from the above output that the router has two direct-connected routes connected to subnets 10.0.0.0/8 and 192.168.0.0/24 respectively. The character C in the routing table indicates that the route is a directly connected route. Therefore, when host A sends a packet to host B, the router queries its routing table and finds the route to the 10.0.0.0/8 network where host B resides. The router then uses the route to route the packets received from host A to host B.
Notice that you can follow SPOTO where we will update the latest news about Cisco certification exams practice tests.
More Recommended Articles