IP Routing
IP routing is basically the process of moving packets from one network to another network using
routers. Before we proceed with the discussion of this topic, we need to understand the
difference between a routing protocol and a routed protocol.
A routed protocol is a protocol by which data can be routed. Examples of a routed protocol are
IPv4, IPv6, IPX, and AppleTalk. Required in such a protocol is an addressing scheme. Based on
the addressing scheme, you will be able to identify the network to which a host belongs, in
addition to identifying that host on that network. All hosts on an internetwork (routers, servers,
and workstations) can utilize the services of a routed protocol.
Routed protocols are assigned to an interface and determine the method of packet delivery.
A routing protocol, on the other hand, is only used between routers. Its purpose is to help routers
building and maintain routing tables. RIP, RIPv2, EIGRP, and OSPF are great examples of the
most common routing protocols.
Routing Decisions
A primary function of a router is to determine the best path to use to send packets. To determine
the best path, the router searches its routing table for a network address that matches the
destination IP address of the packet.
The routing table search results in one of three path determinations:
Directly connected network—If the destination IP address of the packet belongs to a
device on a network that is directly connected to one of the interfaces of the router, that
packet is forwarded directly to the destination device. This means that the destination IP
address of the packet is a host address on the same network as the interface of the router.
Remote network—If the destination IP address of the packet belongs to a remote
network, then the packet is forwarded to another router. Remote networks can only be
reached by forwarding packets to another router.
No route determined—If the destination IP address of the packet does not belong to
either a connected or a remote network, the router determines if there is a Gateway of
Last Resort available. A Gateway of Last Resort is set when a default route is configured
or learned on a router. If there is a default route, the packet is forwarded to the Gateway
of Last Resort. If the router does not have a default route, then the packet is discarded.
Switching Function
Switching function of a Router is the process used by a router to switch a packet from an
incoming interface to an outgoing interface on the same router.
- A packet received by a router will do the following:
Strips off layer 2 headers.
Examines destination IP address located in Layer 3 header to find best route to
destination.
Re-encapsulates layer 3 packets into layer 2 frame.
Forwards frame out exit interface.
A router can learn about remote networks in one of two ways:
- Manually - Remote networks are manually entered into the route table using static routes.
- Dynamically - Remote routes are automatically learned using a dynamic routing protocol.
1
ROUTING METRICS
Routing metrics are parameters or measurements used by routing algorithms and protocols to
determine the best path or route for data packets to reach their destination in a computer network.
These metrics help routers and routing protocols to evaluate and select the most optimal paths based
on certain criteria. Some common routing metrics used by routing protocols include:
1. Hop Count: This metric simply counts the number of routers or hops a packet must
traverse to reach the destination network. Protocols like RIP (Routing Information
Protocol) use hop count as their primary metric. The route with the fewest hops is
considered the best route.
2. Bandwidth: Bandwidth-based metrics consider the available or configured bandwidth
along a path. Routing protocols like OSPF (Open Shortest Path First) use link bandwidth as
a metric to select paths with higher bandwidth, aiming for faster transmission rates.
3. Delay: Delay metrics measure the time it takes for a packet to traverse a link or a
network. Lower delay values indicate faster routes. Protocols like EIGRP (Enhanced
Interior Gateway Routing Protocol) use delay as a component in their composite metric
calculation.
4. Load: Load-based metrics consider the current traffic load on a network link. Routing
protocols may prefer routes with lighter traffic to avoid congestion. Load balancing can
also be achieved by distributing traffic across multiple paths based on load metrics.
5. Reliability: Reliability metrics assess the stability or reliability of a link or route. Highly
reliable routes are preferred over less reliable ones. Factors like link uptime, error rates,
or link stability contribute to reliability metrics.
6. Cost: Cost metrics are often composite metrics calculated by combining multiple factors
such as bandwidth, delay, reliability, and other configurable parameters. OSPF, for
instance, uses a cost metric that is inversely proportional to the bandwidth, providing a
more flexible and customizable metric than a simple hop count.