IP routing Basics

woonsocketpoliticalNetworking and Communications

Oct 28, 2013 (3 years and 11 months ago)

107 views

Vision Infosystems (VIS)




``



















IP routing Basics
Topics Covered

Basic routing principles
How routing works
Using static routing
Working with RIP
Workin
g
with IGRP
Chapter

9
Copyright ® 2004-2005 VISION INFOSYSTEMS
visioninfosystems@vsnl.net
Vision Infosystems (VIS)


Routing Basics

Path determination is a basic function of network layer devices like routers. Path determination enables a
router to find best path the destination network when a packet arrives a router. Routing is service, which
routers use to find path to destination network. To perform routing or IP forwarding, router used IP
routing table to find path to the destination network. So when a packet arrives at a router, the router
checks the destination address in its routing table and forward the packet to outgoing interface nearest to
the destination.



Terms related with Routing

Routed protocols : Routed protocol is any network layer protocol that allows user data transfer and has a
network layer address. EG. IP, IPX, Appletalk

Routing protocols : Routing protocols support routed protocols to move over the network. Routing
protocol provide path determination for routed protocol. Router uses routing protocol to make packet-
forwarding decision. Eg. RIP, IGRP, OSPF, etc.

Routing table : Routing table is table, which contains information about all network and path to reach
each network. Routing table can be called as a map of network which router uses for packet forwarding. A
typical routing table includes Destination Network, Subnet Mask, Metric and Default Gateway (Outgoing
Interface). Without routing table packet forwarding cannot be done by router. So routing table plays a
vital role in routed network environment.

Administrative Distance : Administrative distance defines cost or weights to you routing protocols. If
multiple routes or multiple routing protocols are configured on a router, you can define which protocol or
route to be used for a specific network.
Default Administrative Distances
Route

Default Distance
Connected interface 0
Static route 1
EIGRP 90
IGRP 100
Vision Infosystems (VIS)
OSPF 110
RIP 120
External EIGRP 170


Example of how Packet forwarding works


Suppose a host with IP 10.0.0.5 on network 10.0.0.0 want to communicate with host 20.0.0.3 on network
20.0.0.0. The host forward the packet to the nearest default gateway i.e router. When the packet arrives at
router, the router checks the destination address of the packet. After checking the destination address the
router checks the available path and outgoing interface for the packet in routing table. If the path exists in
the routing table then the router forward the packet to the outgoing interface. If no packet exists the router
drops the packet and sends an ICMP message to the sender host.

In a large network how does a router knows about each network and path to each network? And how each
router creates its own routing table? . To find out the path and network we using various method for
creating the routing table.

Routing method

1) Static Routing
2) Dynamic Routing


Static Routing

Static routing is a manual method of creating routing table. A router administrator manually makes entry
into routing table for each network. Static route is more stable and reliable for small and stub network. If a
network is large then static route can be an overhead to network administrator. Static route is always
preferred over dynamic route. Static route has administrative distance of 1. While configuration of static
route each router much make entry of all other network expect its directly connected networks in routing
table.

Vision Infosystems (VIS)
Features of Static Route
1) Manually configured on each router
2) Most reliable method
3) Administrative Distance = 1
4) Always preferred for small network or stable network
5) Overhead when the network is large or dynamic

Syntax
ip route (destination Network) (Subnet Mask) (Default Gateway) (Admin Distance)

A Example of using Static route


There is network of 4 routers connected to each other via serial links. The routers named as Mumbai,
Delhi, Chennai and Goa.
Router IP details
Mumbai router

Ethernet = 10.0.0.0
Serial 0 = 20.0.0.0

Delhi Router

Ethernet = 30.0.0.0
Serial 0 = 20.0.0.0
Serial 1 = 40.0.0.0

Chennai Router

Ethernet = 50.0.0.0
Serial 0 = 40.0.0.0
Serial 1 = 60.0.0.0
Goa Router

Ethernet = 70.0.0.0
Serial 0 = 60.0.0.0
Static route configuration of Mumbai Router
ip route 30.0.0.0 255.0.0.0 20.0.0.2
ip route 40.0.0.0 255.0.0.0 20.0.0.2
ip route 50.0.0.0 255.0.0.0 20.0.0.2
ip route 60.0.0.0 255.0.0.0 20.0.0.2
ip route 70.0.0.0 255.0.0.0 20.0.0.2

Vision Infosystems (VIS)
Static route configuration of Delhi Router
ip route 10.0.0.0 255.0.0.0 20.0.0.1
ip route 50.0.0.0 255.0.0.0 40.0.0.1
ip route 60.0.0.0 255.0.0.0 40.0.0.1
ip route 70.0.0.0 255.0.0.0 40.0.0.1

Static route configuration of Chennai Router
ip route 10.0.0.0 255.0.0.0 40.0.0.1
ip route 20.0.0.0 255.0.0.0 40.0.0.1
ip route 30.0.0.0 255.0.0.0 40.0.0.1
ip route 70.0.0.0 255.0.0.0 60.0.0.1

Static route configuration of Goa Router
ip route 10.0.0.0 255.0.0.0 60.0.0.1
ip route 20.0.0.0 255.0.0.0 60.0.0.1
ip route 30.0.0.0 255.0.0.0 60.0.0.1
ip route 40.0.0.0 255.0.0.0 60.0.0.1
ip route 50.0.0.0 255.0.0.0 60.0.0.1

After creating static router you can use the command show ip route to view the routing table. The show
ip route commands display the entire routing table with administrative distance and metrics.

Sample output of show ip route

Mumbai#sh ip route

[Omitted output]
S 30.0.0.0 [1/0] via 20.0.0.2
S 40.0.0.0 [1/0] via 20.0.0.2
S 50.0.0.0 [1/0] via 20.0.0.2
S 60.0.0.0 [1/0] via 20.0.0.2
S 70.0.0.0 [1/0] via 20.0.0.2
C 10.0.0.0 is directly connected, Serial 0
C 20.0.0.0 is directly connected, Ethernet 0

Mumbai#


Default Routing

Default routing is used in case of Stub Network. A stub network is a network, which has only one
outgoing interface to access all network. A router which has only one exit or outgoing interface will
Vision Infosystems (VIS)
always have one default gateway for any or all network. So instead of maintaining information of all
networks in routing table will create a unnecessary overhead on such router. So to in such case a single
default route is used. Default route is a type of static route used by stub routers. Default route is used to
customer end or at last end of a network. Default route state that for all network there is only one gateway.
Syntax
ip route 0.0.0.0 0.0.0.0 default-gateway

The first portion 0.0.0.0 represent any network whereas the second portion 0.0.0.0 represent any subnet
mask. The last part is default gateway for outgoing traffic.

A Example of Default route



In the above example Router-A has two network interfaces. One is connected to E0 i.e. 10.0.0.0 and other
is connected to S0 i.e. 20.0.0.1. Since Router-A has only one outgoing interface to access all the network,
Router-A is called as Stub Router. So rather then configuring entire static router we can use Default route
in such scenario. Default route is based suited for Stub Router.
Configuration of Default Route on Router-A
ip route 0.0.0.0 0.0.0.0 20.0.0.1

Floating Route
Floating route is a type of static route used, but with higher administrative distance. Floating route is used
when you have multiple routes to same destination and you want specific route to be used.

EG :

In the below mentioned scenario Router-A has two links to Remote router. Link with IP 20.0.0.1 is of
128kbps and link with IP 30.0.0.1 is of 512kbps. Your network is using static route for connectivity. You
want to use the second link with IP 30.0.0.1 should be use as primary link to access remote network and
link with IP 20.0.0.1 should be use as secondary link.
Vision Infosystems (VIS)



Floating route configuration on Router-A
ip route 0.0.0.0 0.0.0.0 20.0.0.1 20
ip route 0.0.0.0 0.0.0.0 30.0.0.1

In above configuration we have change the administrative distance of the first static route to 20. It means
that the second route is preferred over the first route as administrative distance is 1 for second route,
which is less then the first route.

Note : Floating route can also be used with combination of static and dynamic route.


Dynamic Routing

Dynamic routing is a alternate method of routing. This method uses layer-3 protocols to automatically
find neighbor routers and create or update routing table on routers. This method offers various advantages
or static routing method. This method of easy to configure and maintain, but however this method is
resource intensive i.e. they requires more CPU process, memory and bandwidth of router. Dynamic
routing protocols are used in large networks. There are various types of routing protocol used today. Each
routing protocol uses different method of creating routing table.

Dynamic routing protocols are classified into 2 categories

Interior Gateway Protocol (IGP)
IGP protocols are used routing with a single routing domain. A routing domain is a domain with same
protocols and policies.

Examples
Routing Information Protocol (RIP)
Interior Gateway Routing Protocols (IGRP)
Enhanced IGRP (EIGRP)
Vision Infosystems (VIS)
Open Shortest Path First (OSPF)
Intermediate System – Intermediate System (IS – IS)

Exterior Gateway Protocol (EGP)

EGP protocols are used for routing between two or more routing domain. It also helps to routing between
multiple routing protocols

Examples
Border Gateway Protocol (BGP)


Dynamic Routing Technologies

Dynamic routing technologies are method which various routing protocols uses for creating and
maintaining routing tables. There are various methods of routing technology like Distance Vector, Link
State, etc. Each routing protocol use different routing technology.


Distance Vector Routing
Distance vector routing protocol uses Bellman-ford algorithm to calculate and exchange routing
information. These routing protocols sends complete routing table at regular interval to their neighbors.
EG RIP, IGRP, etc. These protocols are concern with distance and vector (Direction) of destination
network. These protocols are simple to configure and less memory intensive then link state. These
protocols do not scale well in large network.


Link State Routing
Link state routing protocols offer greater performance improvement and convergence then distance vector
routing protocols. Link state routing protocol uses advance routing algorithm to calculate and exchange
routing information. These protocols are more memory and processor intensive than distance vector. It
uses Dijkstra algorithm or Shortest Path First (SPF) algorithm for routing decision. EG OSPF, IS-IS, etc.

Link state routing protocols are concern with link status of interfaces then distance. Rather then sending
entire routing table they sends link state database and according each router develop its own routing table.
Link state protocol does not sends periodic update like distance vector, they sends update when there is
change in topology i.e. trigger update.


Routing Information Protocol (RIP)

Routing Information Protocol (RIP) is a truly dynamic and distance-vector routing protocol designed by
RFC standard. There are two versions of RIP Version 1 and Version 2. RIP is compatible with all router.
RIP sends complete routing table out to all interfaces every 30 seconds to RIP enables routers. It uses
holdtime of 180 seconds. RIP is used in small networks with limited nos. of hops. RIP uses hop count as
metric to determine the best way to a remote network. It has a maximum supported hop count of 15 by
Vision Infosystems (VIS)
default, meaning that 16 declared as unreachable. RIP version 1 uses classful routing, which means that
all devices in the network must use the same subnet mask. This is because RIP version 1 doesn’t send
updates with subnet mask information in tow. RIP version 2 provides prefix routing or classless routing
means it sends subnet mask information with the route updates.

RIP timers.

• Update timer: It is an interval of 30 seconds between two routing update. Each RIP enables router
sends its complete routing table to all neighbors every 30 seconds. This method is called as
periodic update method.

• Invalid/Hold timer: Invalid time define how much long a router should wait for an update from
neighboring router. It is usually 180 seconds. If a router does not receives any update from a
specific neighbor for 180 seconds then the router is declared as dead and all routes from that router
are declared as invalid. Invalid timer does not removes any entry from routing table be marks as
invalid for specific period for time.



Route flush timer: Flush timer is the time between a route becoming invalid and its removal from
the routing table, which is 240 seconds. Before a route is removed from a routing table the waits
for 240 seconds and then removes the entry from routing table.


Features of RIP
• Dynamic and Distance Vector routing protocol
• Available Version 1 and Version 2
• Uses Hop count as Metric
• Uses Bellmen-ford algorithm
• Usually used in Small Network
• Uses period update method
• Version 1 – classful and Version 2 - classless


Difference Between RIP Version 1 and Version 2

RIP version 1

RIP version 2
Classful routing Classless Routing (Prefix Routing)
Uses broadcast to send routing update Uses multicast to send routing update


How RIP works


When a new router is added to a network or a new network is created with RIP as routing protocols, each
router only has information about its own directly connected networks. Each router creates a RIP based
routing table containing information about its directly connected networks and sends this routing update
Vision Infosystems (VIS)
or routing table to all its neighbors. When a router receives a routing update from its neighbor, it update is
own routing table and sends the same new updated routing table to other neighbors. Every router does the
same process every 30 seconds. When a routing update passes from one router to another each router add
or increments the hop count to the routing update to help other router to find nos. of hops to destination
network. When a hop limit of 15 is reached the router does not sends the route update to next neighbors.
This is how each router knows about every router and every network.

So when a router or network goes down, the neighbor router find that they are unable to receives any
update from that specific router. So each router waits for specific amount of time i.e. 180 seconds to 240
seconds and flushes or removes the entry from the routing table. This is how every RIP enables router
knows about each networks and routers status and according update its routing table dynamically in a
given topology.


Configuration of RIP




Configuration of RIP is simple process, each router must specify or publish only is directly connected
network in RIP configuration.

Syntax

Router(config)# router rip
Router(config-router)# network x.x.x.x
Router(config-router)# network x.x.x.x


Configuration of Mumbai Router

Router rip
Network 10.0.0.0
Network 20.0.0.0


Vision Infosystems (VIS)
Configuration of Delhi Router

Router rip
Network 20.0.0.0
Network 30.0.0.0
Network 40.0.0.0


Configuration of GOA router

Router rip
Network 40.0.0.0
Network 50.0.0.0
Network 60.0.0.0.


Configuration of Chennai Router

Router rip
Network 60.0.0.0
Network 70.0.0.0


After configuration of RIP we must each out routing table of each router to find that all router have
receives routing update of each network and are publish in the routing table. To view the routing table we
use show ip route commands

Output of show ip route

Mumbai#sh ip route

[Omitted output]
R 30.0.0.0 [120/1] via 20.0.0.2
R 40.0.0.0 [120/1] via 20.0.0.2
R 50.0.0.0 [120/2] via 20.0.0.2
R 60.0.0.0 [120/2] via 20.0.0.2
R 70.0.0.0 [120/3] via 20.0.0.2
C 10.0.0.0 is directly connected, Serial 0
C 20.0.0.0 is directly connected, Ethernet 0

Mumbai#


You can see from the above routing table that R is added before the route, which means that the route is
learned via RIP. The [120/1] represents = 1 means metric (hop count) and 120 means administrative
distance.




Vision Infosystems (VIS)
Other configuration parameters or commands for RIP

Commands

Explanation
Version 1
Version 2
Version 1 2
Set the RIP version
Passive-interface <interface> Sets the interface through which routing update
should not be propagated
No auto-summary To disable auto summarization of routes

Timer basic <update> <invalid> <holdtime>
<flush>

To change the rip timers
Show ip rip database

To view rip database
Debug ip rip


To trouble rip packets
Show ip protocols

To view routing protocols details




Interior Gateway Routing Protocol (IGRP)

IGRP is also an dynamic and distance vector routing protocol designed by Cisco Inc. IGRP is Cisco
proprietary routing protocol which is supported only by Cisco based routers. To use IGRP in an network
all router must be Cisco compatible routers. IGRP has various advantages and enhanced feature over RIP.
Infact, IGRP was designed to overcome the problems or limitation of RIP routing protocol. IGRP uses
various metric for calculation of best path. It uses a combination of 6 metric called as composite metric.
The metrics are as under

• Bandwidth
• Delay
• Load
• Reliability
• MTU (Maximum Transmission Unit)
• Hop Count (255 hops support, but default is 100)

But IGRP only uses Bandwidth and delay i.e. (Bandwidth X Delay) as default metric for best path
calculation. IGRP uses a feature called as Autonomous Systems (AS) when configuration. AS is nothing
but a number provided to IGRP based network in order to define a network boundary.



Vision Infosystems (VIS)
IGRP Timers

• Update timers : It specify the interval between routing-update messages. The default is 90
seconds.

• Invalid timers: It specify how long a router should wait before declaring a route invalid if it
doesn’t receive a specific update about it. The default is three times the update period i.e. 270
seconds.

• Holddown timers: The default is three times the update timer period plus 10 seconds i.e. 280
seconds.

• Flush timers: These indicate how much time should pass before a route should be flushed from
the routing table. The default is seven times the routing update period. If the update timer is 90
seconds by default, then 7 x 90 = 630 seconds

Features of IGRP
• Cisco proprietary routing protocol
• Dynamic and distance vector routing protocol
• Classful routing protocol
• Metric = bandwidth and delay
• Used in medium size network
• More stable then RIP


Configuration of IGRP

The configuration of IGRP is similar to RIP, but the only difference is the AS number. IGRP uses a
common AS number to all router in a network.

Syntax :

Router IGRP <autonomous system No.>
Network x.x.x.x
Network x.x.x.x


Sample configuration of IGRP

Router igrp 200
Network 10.0.0.0
Network 20.0.0.0




Vision Infosystems (VIS)
Sample output of show ip route

Mumbai#sh ip route

[Omitted output]
I 30.0.0.0 [100/1250] via 20.0.0.2
I 40.0.0.0 [100/1255] via 20.0.0.2
I 50.0.0.0 [100/2502] via 20.0.0.2
I 60.0.0.0 [100/35282] via 20.0.0.2
I 70.0.0.0 [100/435800] via 20.0.0.2
I 10.0.0.0 is directly connected, Serial 0
I 20.0.0.0 is directly connected, Ethernet 0

Mumbai#


You can see from the above routing table that I is added before the route, which means that the route is
learned via IGRP. The [100/1250] represents = 1250 means metric (bandwidth x delay) and 100 means
administrative distance.