IP Routing

gascitytankNetworking and Communications

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

93 views

IP Routing
When we want to connect two or more networks using different n/w addresses then we

have to use IP Routing technique. The router will be used to perform routing between the

networks. A router will perform following functions for routing.
(1)
Path determination
(2)
Packet forwarding
(1) Path determination
The process of obtaining path in routing table is called path determination. There are

three different methods to which router can learn path.
i) Automatic detection of directly connected n/w.
ii) Static & Default routing
iii) Dynamic routing
(2) Packet forwarding
It is a process that is by default enable in router. The router will perform packet

forwarding only if route is available in the routing table.
Routing Process
(i)
The pc has a packet in which destination address is not same as the local n/w address.
(ii)
The pc will send an ARP request for default gateway. The router will reply to the

ARP address and inform its Mac address to pc.
(iii)
The pc will encapsulate data, in which source IP is pc itself, destination IP is server,

source Mac is pc’s LAN interface and destination Mac is router’s LAN interface.
S. MAC
D. MAC
PC1
R1
D. IP
172.16.0.5
S. IP
10.0.0.6
1
The router will receive the frame, store it into the buffer. When obtain packet from the

frame then forward data according to the destination IP of packet. The router will obtain a

route from routing table according to which next hop IP and interface is selected
(iv)
According to the next hop, the packet will encapsulated with new frame and data is

send to the output queue of the interface.
Static Routing
In this routing, we have to use IP route commands through which we can specify routes

for different networks. The administrator will analyze whole internetwork topology and

then specify the route for each n/w that is not directly connected to the router.
Steps to perform static routing
(1) Create a list of all n/w present in internetwork.
(2) Remove the n/w address from list, which is directly connected to n/w.
(3) Specify each route for each routing n/w by using IP route command.
Router(config)#ip route <destination n/w> <mask> <next hop ip>
Next hop IP
it is the IP address of neighbor router that is directly connected our router.
Static Routing Example: -
Router#conf ter
Router(config)#ip route 10.0.0.0 255.0.0.0 192.168.10.2
Advantages of static routing
(1) Fast and efficient.
(2) More control over selected path.
(3) Less overhead for router.
(4) Bandwidth of interfaces is not consumed in routing updates.
Disadvantages of static routing
(1) More overheads on administrator.
(2) Load balancing is not easily possible.
(3) In case of topology change routing table has to be change manually.
Alternate command to specify static route
Static route can also specify in following syntax: -
Old
Router(config)#ip route 172.16.0.0 255.255.0.0 172.25.0.2
Or
Router(config)#ip route 172.16.0.0 255.255.0.0 serial 0
2
Backup route or loading static route
If more than one path are available from our router to destination then we can specify one

route as primary and other route as backup route.
Administrator Distance is used to specify one route as primary and other route as

backup. Router will select lower AD route to forward the traffic. By default static route

has AD value of 1. With backup path, we will specify higher AD so that this route will be

used if primary route is unavailable.
Protocols
AD
Directly Connected
0
Static
1
BGP
20
EIGRP
90
IGRP
100
OSPF
110
RIP
120
Syntax: -
To set backup path
Router(config)#ip route <dest. n/w> <mask> <next hop> <AD>
Or
<exit interface>
Example: -
Router#conf ter
Router(config)#ip route 150.10.0.0 255.255.0.0 150.20.0.5
Router(config)#ip route 150.10.0.0 25.255.0.0 160.20.1.1 8 (below 20)
Router(config)#exit
Default Routing
Default routing means a route for any n/w. these routes are specify with the help of

following syntax: -
Router(config)#ip route 0.0.0.0 0.0.0.0 <next hop>
Or
<exit interface>
This type of routing is used in following scenario.
Scenario 1: -
Stub network
A n/w which has only one exit interface is called stub network.
3

If there is one next hop then we can use default routing.
Scenario 2
Internet connectivity
On Internet, million of n/ws are present. So we have to specify default routing on our

router.
Default route is also called gateway of last resort. This route will be used when no other

routing protocol is available.
Router9(config)#ip route 10.0.0.0 255.0.0.0 172.16.0.5
Router9(config)#ip route 0.0.0.0 0.0.0.0 200.100.100.11
4
To display routing table
Router#sh ip route
To display static routes only
Router#sh ip route static
S 192.168.10.0/28 [1/0] via 172.16.0.5
To display connected n/ws only
Router#sh ip route connected
To check all the interface of a router
Router#sh interface brief
Dynamic Routing
In dynamic routing, we will enable a routing protocol on router. This protocol will send

its routing information to the neighbor router. The neighbors will analyze the information

and write new routes to the routing table.
The routers will pass routing information receive from one router to other router

also. If there are more than one path available then routes are compared and best path is

selected. Some examples of dynamic protocol are: -
RIP, IGRP, EIGRP, OSPF
Types of Dynamic Routing Protocols
According to the working there are two types of Dynamic Routing Protocols.
(1) Distance Vector
(2) Link State
According to the type of area in which protocol is used there are again two types of

protocol: -
(1) Interior Routing Protocol
(2) Exterior Routing Protocol
Autonomous system
Autonomous system is the group of contiguous routers and n/w, which will share their

routing information directly with each other. If all routers are in single domain and they

share their information directly with each other then the size of routing updates will

depend on the no. of n/w present in the Internetwork. Update for each n/w may take 150

– 200 bytes information.
For example: - if there are 1000 n/ws then size of update will be
200*1000 = 200000 bytes
The routing information is send periodically so it may consume a large amount of

bandwidth in our n/w.
5

Domain

Protocols
Interior Routing
Exterior Routing
RIP
BGP
IGRP
EXEIGRP
EIGRP
OSPF
Distance Vector Routing
The Routing, which is based on two parameters, that is distance and direction is called

Distance Vector Routing. The example of Distance Vector Routing is RIP & IGRP.
Operation: -
(1) Each Router will send its directly connected information to the neighbor router. This

information is send periodically to the neighbors.
(2) The neighbor will receive routing updates and process the route according to

following conditions: -
(i) If update of a new n/w is received then this information is stored in routing table.
(ii) If update of a route is received which is already present in routing table then route

will be refresh that is route times is reset to zero.
(iii) If update is received for a route with lower metric then the route, which is already

present in our routing table. The router will discard old route and write the new route in

the routing table.
6
(iv) If update is received with higher metric then the route that is already present in

routing table, in this case the new update will be discard.
(3) A timer is associated with each route. The router will forward routing information on

all interfaces and entire routing table is send to the neighbor. There are three types of

timers associated with a route.

(i) Route update timer

It is the time after which the router will send periodic update to the neighbor.
(ii) Route invalid timer

It is the time after which the route is declared invalid, if there are no updates for the

route. Invalid route are not forwarded to neighbor routers but it is still used to forward the

traffic.
(iii) Route flush timer
It is the time after which route is removed from the routing table, if there are no

updates about the router.
Metric of Dynamic Routing
Metric are the measuring unit to calculate the distance of destination n/w. A protocol may

use a one or more than one at a time to calculate the distance. Different types of metric

are: -
(1) Hop Count
(2) Band Width
(3) Load
(4) Reliability
(5) Delay
(6) MTU
Hop Count
It is the no. of Hops (Routers) a packet has to travel for a destination n/w.
Bandwidth
Bandwidth is the speed of link. The path with higher bandwidth is preferred to send the

data.
Load
Load is the amount of traffic present in the interface. Paths with lower load and high

throughput are used to send data.
Reliability
Reliability is up time of interface over a period of time.
Delay
Delay is the time period b/w a packet is sent and received by the destination.
MTU
Maximum Transmission Unit
It is the maximum size of packet that can be sent in a frame mostly MTU is set to 1500.
7
Problems of Distance Vector
There are two main problems of distance vector routing
(1)
Bandwidth Consumption
(2)
Routing Loops
Bandwidth Consumption
The problem of accessive bandwidth consumption is solved out with the help of

autonomous system. It exchanges b/w different routers. We can also perform route

summarization to reduce the traffic.
Routing Loops
It may occur b/w adjacent routers due to wrong routing information. Distance Vector

routing is also called routing by Rumor. Due to this the packet may enter in the loop

condition until their TTL is expired.
Method to solve routing loops
There are five different methods to solve or reduce the problem of routing loop.
(1)
Maximum Hop Count
(2)
Flash Updates/Triggered Updates
(3)
Split Horizon
(4)
Poison Reverse
(5)
Hold Down
Maximum Hop Count
This method limits the maximum no. of hops a packet can travel. This method does not

solve loop problem. But it reduce the loop size in the n/w. Due to this method the end to

end size of a n/w is also limited.
Flash Updates/Triggered Updates
In this method a partial update is send to the all neighbors as soon as there is topology

change. The router, which receives flash updates, will also send the flash updates to the

neighbor routers.
Split Horizon
Split Horizon states a route that update receive from an interface can not be send back to

same interface.
8
Poison Reverse
This method is the combination of split Horizon and Flash updates. It implements the rule

that information received from the interface can not be sent back to the interface and in

case of topology change flash updates will be send to the neighbor.
Hold Down
If a route changes frequently then the route is declared in Hold Down state and no

updates are received until the Hold Down timer expires.
Routing Information Protocol
Features of RIP: -
* Distance Vector
* Open standard
* Broadcast Updates
(255.255.255.255)
* Metric
Hop Count
*Timers
Update 30 sec
Invalid 180 sec
Hold 180 sec
Flush 240 sec
* Loop Control
Split Horizon
Triggered Updates
9
Maximum Hop Count
Hold Down
* Maximum Hop Count 15
* Administrative Distance 120
* Equal Path Cost Load Balancing
* Maximum Load path 6
Default 4
* Does not support VLSM
* Does not support Autonomous system
Configuring RIP
Router#conf ter
Router(config)#router rip
Router(config-router)#network <own net address>
Router(config-router)#network <own net address>
--------------
--------------
Router(config-router)#exit
172.16.0.6
10.0.0.1 172.16.0.5
175.2.1.1

200.100.100.12
Router(config-router)#network 10.0.0.0
Router(config-router)#network 172.16.0.0
Router(config-router)#network 200.100.100.0
175.2.0.0 via 172.16.0.6
Display RIP Routes
Router#sh ip route rip
10
R 192.168.75.0/24 [120/5] via 172.30.0.2 00:00:25 serial 1/0
RIP Dest. n/w mask AD Metric Next Hop Timer own Interface
RIP advanced configuration
Passive Interfaces
An interface, which is not able to send routing updates but able to receive routing update

only is called Passive Interface. We can declare an interface as passive with following

commands: -
Router#conf ter
Router(config)#router rip
Router(config-router)#Passive-interface <type> <no>
Router(config-router)#exit
Configuring Timers
Router(config)#router rip
Router(config-router)#timers basic <update> <invalid> <hold down> <flush>
Router(config-router)#exit
Example: -
Router(conf-router)#timer basic 50 200 210 300
Update 50 sec
Invalid 200 sec
Hold 210 sec
Flush 300 sec
To change Administrative Distance
Router(config)#router rip
Router(config-router)#distance <value>
Router(config-router)#exit
95 or 100
To configure Load Balance
RIP is able to perform equal path cost Load Balancing. If multiple paths are available

with equal Hop Count for the destination then RIP will balance load equally on all paths.
Load Balancing is enabled by default 4 paths. We can change the no. of paths. It

can use simultaneously by following command: -
Router(config)#router rip
Router(config-router)#maximum-path <1-6>
To display RIP parameters
Router#sh ip protocol
Or
Router#sh ip protocol RIP
This command display following parameters: -
11
(i) RIP Timers
(ii) RIP Version
(iii) Route filtering
(iv) Route redistribution
(v) Interfaces on which update send
(vi) And receive
(vii) Advertise n/w
(viii) Passive interface
(ix) Neighbor RIP
(x) Routing information sources
(xi) Administrative Distance
RIP version 2
RIP version 2 supports following new features: -
(1) Support VLSM (send mask in updates)
(2) Multicast updates using address 224.0.0.9
(3) Support authentication
Commands to enable RIP version 2
We have to change RIP version 1 to RIP version 2. Rest all communication will remain

same in RIP version 2.
Router(config)#Router RIP
Router(config-router)#version 2
Router(config-router)#exit
To debug RIP routing
Router#debug ip rip
To disable debug routing
Router#no debug ip rip
Or
Router#no debug all
Or
Router#undebug all
12
Interior Gateway Routing Protocol
Features: -
* Cisco proprietary
* Distance vector
* Timers
Update 90 sec
Invalid 270 sec
Hold time 280 sec
Flush 630 sec
* Loop control
All methods
* Max hop count
100 upto 255
* Metric (24 bit composite)
Bandwidth (default)
Delay (default)
Load
Reliability
MTU
* Broadcast updates to address 255.255.255.255
* Unequal path cost load balancing
* Automatic route summarization
* Support AS
* Does not support VLSM
Configuring IGRP
Router(config)#router igrp <as no>(1 – 65535)
Router(config-router)#network <net address>
Router(config-router)#network <net address>
Router(config-router)#exit
Configuring Bandwidth on Interface for IGRP
By default the router will detect maximum speed of interface and use this value as the

bandwidth metric for IGRP. But it may be possible that the interfaces and working at its

maximum speed then we have to configure bandwidth on interface, so that IGRP is able

to calculate correct method.
Router(config)#interface <type> <no>
Router(config-if)#bandwidth <value in kbps>
Router(config-if)#exit
Router(config)#interface serial 0
Router(config-if)#bandwidth 256
Router(config-if)#exit
13
Serial E1
modem
Serial E1
2048 k
2048 k
256 k
sync
Configuring Unequal path cost load balancing
To configure load balancing, we have to set two parameters
(1) Maximum path (by default 4)
(2) Variance (default 1)
Maximum Path: - it is maximum no. of paths that can be used for load balancing

simultaneously.
Variance: - it is the multiplier value to the least metric for a destination n/w up to which

the load can be balanced.

Router(config)#Router igrp <as no>
Router(config-router)#variance <value>
Router(config-router)#exit
Configuring following options in IGRP as same as in case of RIP: -
(1) Neighbor
(2) Passive interface
(3) Timer
(4) Distance (AD)
(5) Maximum path
14
Link State Routing
This type of routing is based on link state. Its working is explain as under
(1) Each router will send Hello packets to all neighbors using all interfaces.
(2) The router from which Hello reply receive are stored in the neighborship table. Hello

packets are send periodically to maintain the neighbor table.
(3) The router will send link state information to the all neighbors. Link state information

from one neighbor is also forwarded to other neighbor.
(4) Each router will maintain its link state database created from link state advertisement

received from different routers.
(5) The router will use best path algorithm to store the path in routing table.
Neighbor
Topology
Routing
11.0.0.1 R1 11.0.0.0 dc
13.0.0.2
12.0.0.0 dc
13.0.0.0 dc
R2
11.0.0.0
10.0.0.0
R3
13.0.0.0
14.0.0.0
15.0.0.0
16.0.0.0
R4
16.0.0.0
17.0.0.0
R5
18.0.0.0
19.0.0.0
20.0.0.0
14.0.0.0
R6
20.0.0.0
21.0.0.0
15
R6
20.0.0.0
19.0.0.0
21.0.0.0
20.0.0.0
18.0.0.0
21.0.0.0
14.0.0.0
15.0.0.0
13.0.0.0
11.0.0.0
10.0.0.0
16.0.0.0
12.0.0.0
17.0.0.0
Problems of Link State Routing
The main problems of link state routing are: -
(1) High bandwidth consumption.
(2) More hardware resources required that is processor and memory (RAM)
The routing protocols, which use link state routing are: -
(1) OSPF
(2) EIGRP
Enhanced Interior Gateway Routing Protocol
Features: -
* Cisco proprietary
* Hybrid protocol
Link State
Distance Vector
* Multicast Updates using
Address 224.0.0.10
* Support AS
* Support VLSM
* Automatic Route Summarization
* Unequal path cost load balancing
* Metric (32 bit composite)
16
R
4
R
6
R
5
R
3
R
1
R
2
Bandwidth
Delay
Load
Reliability
MTU
* Neighbor Recovery
* Partial updates
* Triggered updates
* Backup Route
* Multi Protocol Routing
EIGRP Protocols & Modules
(1) Protocol depended module
This module is used to perform multi protocol routing that is the router will maintain 3

routing table for TCP/IP, IPX/SPX and Appletalk.
TCP/IP
IPX/SPX
Appletalk
Reliable Transport Protocol (Quiet Protocol)
RTP is used to exchange routing updates with neighbor routers. It will also maintain

neighbor relationship with the help of Hello packet. RTP has following features: -
(1) Multicast updates (224.0.0.10)
(2) Neighbor recovery
If neighbor stops responding to the Hello packets then RTP will send unicast Hello

packet for that neighbor.
17
Pack
et
type?
IP Routing
IPX Routing
Appletalk

Routing
(3) Partial updates
(4) No updates are send if there is no topology change.
Diffusing Update Algorithm (DUAL)
DUAL is responsible for calculating best path from the topology table. Dual has

following features: -
* Backup Path
* VLSM
* Route queries to neighbor for unknown n/w.
Configuring EIGRP
Router(config)#router eigrp <as no>
Router(config-router)#network <net addr.>
Router(config-router)#network <net addr.>
Router(config-router)#exit
Advanced Configuration EIGRP
Configuring following options are same as configuring IGRP
(1) Bandwidth on Interfaces
(2) Neighbor
(3) Load balancing
Max path
Variance
Configuring EIGRP Metric
If we want our router to use additional metric then we can use following command: -
Router(config)#Router eigrp <as no>
Router(config-router)#metric weights 0 <k1> <k2> <k3> <k4> <k5>
Type of service (default) 1 0 1 0 0
Router(config-router)#exit
Metric
K
Default value
Bandwidth
K1
1
Load
K2
0
Delay
K3
1
Reliability
K4
0
MTU
K5
0
All routers exchanging update with each other must have same AS no. and same K value.
To up the Ethernet without connect wire
Router(config)#int eth0
Router(config-if)#no keepalive
18
Router(config-if)#bandwidth 64
Router#clear ip route *
Hush routing table and again make it.
Router#sh ip eigrp topology
It shows topology database.
P-> passive->stable A->active->under updation
Router#sh ip eigrp neighbor
It shows neighbor table
Router#redistribute <protocol> ?
Metric also need to be modified
Debug IGRP
Router#debug ip igrp events
Its display info. On special event
Router#debug ip igrp transactions
It shows every update
Debug EIGRP
Router#debug ip eigrp
For full debug
Router#debug ip eigrp summary
For few debug
19
Open Shortest Path First
Features: -
* Link State
* Open standard
* Multicast updates
224.0.0.5
224.0.0.6
* Support VLSM
* Support Area similar to AS
* Manual Route Summarization
* Hierarchical model
* Metric
Bandwidth
* Equal path cost load balancing
* Support authentication
* Unlimited hop count
OSPF Terminology
Already known topics in this: -
(1) Hello packets
(2) LSA (Link State Advertisement)
(3) Neighbor
(4) Neighbor table
(5) Topology table (LSA database)
20
Router ID
Router ID is the highest IP address of router interfaces. This id is used as the identity of

the router. It maintaining link state databases. The first preference for selecting router ID

is given to the Logical interfaces. If logical interface is not present then highest IP of

physical interface is selected as router id.
Area
Area is the group of routers & n/ws, which can share their routing information directly

with each other.
Adjacency
A router is called adjacency when neighbor relationship is established. We can also say

adjacency relationship is formed between the routers.
OSPF Hierarchical Model
21
ROUTER ID
ROUTER ID
Area Router (Autonomous System Border Router – ASBR)
A router, which has all interfaces member of single area, is called area router.
Backbone Area
Area 0 is called backbone area. All other areas must connect to the backbone area for

communication.
Backbone Router
A router, which has all interfaces members of area 0, is called backbone router.
Area Border Router
A router, which connects an area with area 0, is called area border router.
LSA Flooding in OSPF
If there are multiple OSPF routers on multi access n/w then there will be excessive no. of

LSA generated by the router and they can choke bandwidth of the network.
A
B
C
B
A
A
Neighbor
C
C
B
D
E
F
22
This problem is solved with the help of electing a router as designated router and backup

designated router.
Designated Router
A router with highest RID (router id) will be designated router for a particular interface.

This router is responsible for receiving LSA from non-DR router and forward LSA to the

all DR router.
Backup Designated Router
This router will work as backup for the designated router. In BDR mode, it will receive

all information but do not forward this information to other non-DR router.
Commands to configure OSPF
Router#conf ter
Router(config)#router ospf <process no>
Router(config-router)#network <net address> <wild mask> area <area id>
Router(config-router)#network <net address> <wild mask> area <area id>
Router(config-router)#exit
Wild Mask –
Complement of subnet mask
Example
255.255.0.0
0.0.255.255
255.255.255.255
- Subnet mask
Wild mask
255.255.255.255
- 255.255.192.0 subnet mask
0.0.63.255
wild mask


23

R1
Router(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router(config-router)#network 10.0.0.0 0.255.255.255 area 0
R2
Router(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router(config-router)#network 30.0.0.0 0.255.255.255 area 1
Router(config-router)#network 40.0.0.0 0.255.255.255 area 1
R3
Router(config-router)#network 40.0.0.0 0.255.255.255 area 1
Router(config-router)#network 50.0.0.0 0.255.255.255 area 1
Configuring bandwidth on interface
If the actual bandwidth of interface is not equal to the maximum speed of interface then

we have to use bandwidth command to specify the actual bandwidth.
Router(config)#interface <type> <no>
Router(config-if)#bandwidth <speed>
Configuring logical interface for OSPF
By default the highest IP address of interface will be elected as Router id. If there is a

change in status of interface then router will reelect some IP as Router id. So if we create

logical interface, it will never go down and first preference give to the logical interface

for RID.
Command: -
Router(config)#interface loopback <no>
24
Router(config-if)#ip address 200.100.100.1 255.255.255.0
Router(config-if)#no sh
Router(config-if)#exit
Command to display OSPF parameter
Router#show ip protocol
Router#show ip ospf
Router#show ip ospf neighbor
Router#show ip ospf database (it shows RID of router)
Router#show ip ospf interfaces
25