IP Routing Basics
IP Routing Basics
IP routing is performed on the data which describes the path that data follows to reach from
source to destination in the network. Through IP routing only the shortest path for the data is
determined to reach the destination which decreases cost and data is sent in minimum time. IP
routing uses different protocols and technologies for different networks. For IP routing we
IP Routing:
IP routing is the process that defines the shortest path through which data travels to reach from
source to destination. It determines the shortest path to send the data from one computer to
another computer in the same or different network. Routing uses different protocols for the
different networks to find the path that data follows. It defines the path through which data
travel across multiple networks from one computer to other. Forwarding the packets from
source to destination via different routers is called routing. The routing decision is taken by the
routers.
Terminologies:
Autonomous System (AS): The collection of networks managed and supervised by a single
Router: A router is a device that forwards the data using routing through multiple networks.
Routing Table: A routing table is a table present in the router which stores the routing
information.
1. Static Routing
2. Dynamic Routing
3. Default Routing
Static Routing: In this type of routing the routing table is updated by the network administrator.
Dynamic Routing: In this type of routing the routing table is automatically updated using
routing protocols.
Default Routing: In this type of routing the router is configured to send all the data towards a
specific router. This routing is generally used with the stub routers.
How does IP routing work?
When the data is sent from the source to the destination the TCP and other protocols of the
source work and form an IP packet that is sent to the network. When an IP packet is sent to the
network from the source it has to pass through multiple routers to reach the destination. The
router in the network gets the destination address from the packet and through its routing table
identifies the next router information to which the data packet has to be passed. The routing
table of the router includes various information about the next router, its cost, and other
necessary information. The router takes the routing decision with the help of routing protocols
and a routing table to which next router the packet has to be sent to find the best route to reach
the destination. Different packets can be sent through different paths but all the packets reach
their intended destination. When the packets reach the destination through different routers it
Routing Protocols:
For taking routing decisions router needs various routing protocols and a routing table. The
This routing is used among the autonomous networks and it includes Path Vector
Routing(PVR).
This routing is used within the autonomous networks and it includes two types of
DVR suffers from count to infinity problem which can be solved using split-horizon or
route poisoning.
Link State routing uses the state of the link for routing.
Open Shortest Path First (OSPF) is used in LSR for making routing decisions.
LSR suffers from heavy traffic due to flooding which can be solved by the TTL field.
Routers:
A Router is a networking device that forwards data packets between computer network. This
device is usually connected to two or more different networks. When a data packet comes to a
router port, the router reads address information in packet to determine out which port the packet
will be sent. For example, a router provides you with the internet access by connecting your
make routing decisions accordingly. Routers use Routing Tables to determine out which
interface the packet will be sent. A routing table lists all networks for which routes are known.
Each router’s routing table is unique and stored in the RAM of the device.
Routing Table:
A routing table is a set of rules, often viewed in table format, that is used to determine where
data packets traveling over an Internet Protocol (IP) network will be directed. All IP-enabled
devices, including routers and switches, use routing tables. See below a Routing Table:
default Eth2
The entry corresponding to the default gateway configuration is a network destination of 0.0.0.0
with a network mask (netmask) of 0.0.0.0. The Subnet Mask of default route is always 0.0.0.0 .
Entries of an IP Routing Table:
A routing table contains the information necessary to forward a packet along the best path
toward its destination. Each packet contains information about its origin and destination. Routing
Table provides the device with instructions for sending the packet to the next hop on its route
1. Network-ID:
2. Subnet-Mask:
The mask that is used to match a destination IP address to the network ID.
3. Next-Hop:
4. Outgoing-Interface:
Outgoing interface the packet should go out to reach the destination network.
5. Metric:
A common use of the metric is to indicate the minimum number of hops (routers crossed) to
Routing table entries can be used to store the following types of routes:
Host Routes
Default Route
Destination
When a router receives a packet, it examines the destination IP address, and looks up into its
Routing Table to figure out which interface packet will be sent out.
These Routing tables can be maintained manually or dynamically. In dynamic routing, devices
build and maintain their routing tables automatically by using routing protocols to exchange
information about the surrounding network topology. Dynamic routing tables allow devices to
“listen” to the network and respond to occurrences like device failures and network congestion.
Tables for static network devices do not change unless a network administrator manually
changes them.
Consider a network is subnetted into 4 subnets as shown in the above picture. The IP Address
200.1.2.0 (Subnet a)
200.1.2.64 (Subnet b)
200.1.2.128 (Subnet c)
200.1.2.192 (Subnet d)
Then, Routing table maintained by the internal router looks like:
200.1.2.0 255.255.255.192 a
200.1.2.64 255.255.255.192 b
200.1.2.128 255.255.255.192 c
200.1.2.192 255.255.255.192 d
Default 0.0.0.0 e
To find its right subnet (subnet ID), router performs the bitwise ANDing of destination IP
Address mentioned on the data packet and all the subnet masks one by one.
If there occurs only one match, router forwards the data packet on the corresponding
interface.
If there occurs more than one match, router forwards the data packet on the interface
If there occurs no match, router forwards the data packet on the interface corresponding to
Example : Find the summarized route for the networks 10.1.1.0/24, 10.1.3.0/24, and 10.1.9.0/24,
- The first two octets (10.1) are consistent across all three addresses.
- The first four bits of the third octet are common: 0000.
- The first two octets (10.1) and the first four bits of the third octet give us:
- We have four bits of the third octet plus the full two octets, resulting in a prefix of /20.