In this article we will discuss Router Packet Forwarding Decision – How routing works, will make brief discussion on Router Packet Forwarding Decision. In last article we discuss about Host Routing Tables – IPv4 Routing Table.
Router Packet Forwarding Decision
A primary function of a router is to forward packets toward their destination. When a host sends a packet to another host, it will use its routing table to determine where to send the packet. If the destination host is on a remote network, the packet is forwarded to the default gateway.
What happens when a packet arrives at the default gateway, which is usually a router? The router looks at its routing table to determine where to forward packets. This is accomplished by using a switching function, which is the process used by a routerto accept a packet on one interface and forward it out of another interface.
The routing table of a router can store information about:
- Directly-connected routes – are always the best path to a subnet. Since they are configured directly on a router’s interface, they get an administrative distance of 0. These routes come from the active router interfaces. Routers add a directly connected route when an interface is configured with an IP address and is activated. Each of the router’s interfaces is connected to a different network segment.
- Remote routes – When a router forwards a packet to a host, such as a web server, that host is on the same network as a router’s directly connected network. These routes come from remote networks connected to other routers. Routes to these networks can be manually configured on the local router by the network administrator or dynamically configured by enabling the local router to exchange routing information with other routers using a dynamic routing protocol.
- Default route – Like a host, routers also use a default route as a last resort if there is no other route to the desired network in the routing table.