IP Routing is the process of moving packets from one network to another network using routers.
Basically a routing protocol determines the path of a packet through an internetwork. Examples of routing protocols are RIP, IGRP, EIGRP, OSPF and BGP.
A routing protocol is used by routers to dynamically find all the networks in the internetwork, and ensure that all routers have the same routing table.
Routed protocols are assigned to an interface and determine the method of packet delivery. Examples of routed protocols are IP and IPx.
Once all routers know about all networks, a routed protocol can be used to send user data (packets) through the established enterprise. We create an internetwork by connecting WAN’s and LAN’s to a router. We will need to configure logical network addresses, such as IP addresses, to all hosts on the internetwork so that they can communicate across that internetwork.
The term routing is used for taking a packet from one device and sending it through the network to another device on a different network.
The logical network address of the destination host is used to get packets to a network through a routed network, and then the hardware address of the host is used to deliver the packet from a router to the correct destination host. The router learns about remote networks from neighbor routers or from an administrator. The router then builds a routing table that describes how to find the remote networks. If a network is directly connected then the router already knows how to get to it, if a network isn’t connected the router must learn how to get the remote network in two ways by using static routing, meaning that someone must hand type all network location in to the routing table , or through something called dynamic routing.
In dynamic routing, a protocol on one router communicates with the same protocol running on neighbor routers. The routers then update each other about all the networks they know about and place this information in to the routing table.
If a change occurs in the network the dynamic routing protocols automatically inform all routers about the event. If static routing is used, the administrator is responsible for updating all changes by hand in to all routers.
Typically, in a large network, a combination of both dynamic and static routing is used. When the packet is lost on the way back to the originating host, you will typically see a request timed out message because it is unknown error. If the error occurs because of a known issue, such as if a route is not in the routing table on the way to the destination device you will see a destination unreachable message.
A very important point to remember is that when host A sends a packet to host B the destination hardware address used is the default gateway Ethernet interface. This is because frames can’t be placed on remote networks, only local networks, and packet destined for remote networks must go to the default gateway.
The different type of routing:
- Static Routing
- Default Routing
- Dynamic Routing
Static Routing occurs when we manually add routes in each routers routing table. Static Routing is cheaper than dynamic routing but it’s not feasible in large networks because maintaining it would be a Full – time job in itself.
Static Routing Command
Ip route (Destination network) (Mask) (Next hop address or exit interface) (administrative distance)
IP Route: This command is used to create the static route.
Destination Network: The network we are placing in the routing table.
Mask: The subnet mask being used on the network.
Next Hop Address: The address of the next-hop router that will receive the packet and forward it to the remote network. This is a router interface that’s on a directly connected network.
After the router is configured we can type show running config and show ip route to see the static routes.
Router# show ip route
Router# show run
R1 (config)# ip route 126.96.36.199 255.0.0.0 188.8.131.52
R1 (config)# ip route 184.108.40.206 255.0.0.0 220.127.116.11
R1 (config)# ip route 18.104.22.168 255.0.0.0 22.214.171.124
R2 (config)# ip route 10.0.0.0 255.0.0.0 126.96.36.199
R2 (config)# ip route 188.8.131.52 255.0.0.0 184.108.40.206
R3 (config)# ip route 10.0.0.0 255.0.0.0 220.127.116.11
R3 (config)# ip route 18.104.22.168 255.0.0.0 22.214.171.124
R3 (config)# ip route 126.96.36.199 255.0.0.0 188.8.131.52
If we don’t have LAN connection then we use Nokeepalive command.
We use default routing to send packets with a remote destination network not in the routing table to the next-hop router. We can only use default routing on stub networks those with only one exit path out of the network.
We use Ip classless command when we use default routing. (For older IOS)
R1 (config)# ip classless
R1 (config)# ip route 0.0.0.0 0.0.0.0 184.108.40.206
R2 (config)# ip route 0.0.0.0 0.0.0.0 220.127.116.11
R2 (config)# ip route 0.0.0.0 0.0.0.0 18.104.22.168
R3 (config)# ip route 0.0.0.0 0.0.0.0 22.214.171.124
- Distance Vector (RIP, IGRP)
- Hybrid (EIGRP, BGP)
- Link State (OSPF, IS-IS)
Dynamic routing means when protocols are used to find networks and update routing tables on routers. A Routing protocol defines the set of rules used by a router when it communicates routing information between neighbor routers.
There are two types of routing protocols used in internetworks: Interior Gateway Protocols (IGPs) and Exterior Gateway Protocols (EGPs).
IGP are used to exchange routing information with routers in the same autonomous system. (Ex of IGP – RIP, EIGRP, OSPF) EGPs are used to communicate between ASes. (Ex of EGP – BGP)
Autonomous Systems (AS)
An AS is a collection of networks under a common administrative domain, which basically means that all routers sharing the same routing table information are in the same AS. AS is a collection of routers under a single administration.
AS Range- 1 to 65535
Public Range- 1 to 64511
Private Range- 64512 to 65535
Administrative Distance (AD)
The AD is used to rate the trustworthiness of routing information received on a router from a neighbor router. An administrative distance is an integer from 0 to 255, where 0 is the most trusted and 255 means no traffic will be passed via this route. If a router receives two updates listing the same remote network, the first thing the router checks is the AD. If one of the advertised routes has a lower AD than the other, then the route with the lowest AD will be placed in the routing table.
If both advertised routes to the same network have the same AD, then routing protocol metrics (such as hop count or bandwidth of the lines) will be used to find the best path to the remote network. The advertised route with the lowest metric will be placed in the routing table. But if both advertised routes have the same AD as well as the same metrics, then the routing protocol will load balance to the remote network. (This means that it send packets down each link).
Default Administrative Distance
|Route Source||Default AD|
There are three class of routing Protocols:
- Distance Vector: The distance Vector Protocols find the best path to a remote network by judging distance. Both RIP and IGRP is distance vector routing protocols. They sent the entire routing table to directly connected neighbors.
- Link State: In link state protocols, also called shortest-path first protocols, the routers each create three separate tables. One of these tables keeps track of directly attached neighbors. One determines the topology of the entire internetwork, and one is used as the routing table. Link state routers know more about the internetwork than any distance vector routing protocol.
OSPF is an IP routing protocol that is completely link state. Link state protocols send updates containing the state of their own links to all other routers on the network.
- Hybrid: Hybrid protocols use aspects of both distance vector and link state. For Ex- EIGRP.