UNIVERSITY OF CHAKWAL
DEPARTMENT OF COMPUTER SCIENCE
(Computer Communication Networks CS-324)(LAB)
LAB 08
Dynamic routing
Using RIP
Page 1 of 13
1. Introduction
1.1. Dynamic routing:
Dynamic routing, also called adaptive routing, is a process where a router can forward data via a
different route or given destination based on the current conditions of the communication circuits
within a system. The term is most commonly associated with data networking to describe the
capability of a network to 'route around' damage, such as loss of a node or a connection between
nodes, so long as other path choices are available. Dynamic routing allows as many routes as possible
to remain valid in response to the change.
Systems that do not implement dynamic routing are described as using static routing, where routes
through a network are described by fixed paths. A change, such as the loss of a node, or loss of a
connection between nodes, is not compensated for. This means that anything that wishes to take an
affected path will either have to wait for the failure to be repaired before restarting its journey, or
will have to fail to reach its destination and give up the journey.
1.2. RIP:
The Routing Information Protocol (RIP) is one of a family of IP Routing protocols, and is an Interior
Gateway Protocol (IGP) designed to distribute routing information within an Autonomous System
(AS).
RIP is a simple vector routing protocol with many existing implementations in the field. In a vector
routing protocol, the routers exchange network reachability information with their nearest
neighbor’s. In other words, the routers communicate to each other the sets of destinations ("address
prefixes") that they can reach, and the next hop address to which data should be sent in order to
reach those destinations. This contrasts with link-state IGPs; vectoring protocols exchange routes
with one another, whereas link state routers exchange topology information, and calculate their own
routes locally.
1.3. How IP protocol works:
In brief the RIP protocol works as follows.
Each router initializes its routing table with a list of locally connected networks.
Periodically, each router advertises the entire contents of its routing table over all of its RIP-
enabled interfaces.
Page 2 of 13
o Whenever a RIP router receives such an advertisement, it puts all of the appropriate
routes into its routing table and begins using it to forward packets. This process
ensures that every network connected to every router eventually becomes known to
all routers.
o If a router does not continue to receive advertisements for a remote route, it
eventually times out that route and stops forwarding packets over it. In other words,
RIP is a "soft state" protocol.
Every route has a property called a metric, which indicates the "distance" to the route's
destination.
o Every time a router receives a route advertisement, it increments the metric.
o Routers prefer shorter routes to longer routes when deciding which of two versions
of a route to program in the routing table.
o The maximum metric permitted by RIP is 16, which means that a route is unreachable.
This means that the protocol cannot scale to networks where there may be more than
15 hops to a given destination.
RIP also includes some optimizations of this basic algorithm to improve stabilization of the routing
database and to eliminate routing loops.
When a router detects a change to its routing table, it sends an immediate "triggered" update.
This speed up stabilization of the routing table and elimination of routing loops.
When a route is determined to be unreachable, RIP routers do not delete it straightaway.
Instead they continue to advertise the route with a metric of 16 (unreachable). This ensures
that neighbors are rapidly notified of unreachable routes, rather than having to wait for a soft
state timeout.
When router A has learnt a route from router B, it advertises the route back to B with a metric
of 16 (unreachable). This ensures that B is never under the impression that A has a different
way of getting to the same destination. This technique is known as "split horizon with poison
reverse."
A "Request" message allows a newly-started router to rapidly query all of its neighbor’s
routing tables.
Page 3 of 13
2. Tools required:
CISCO Packet tracer
3. Objective of the Experiment:
After completing this Lab student should able to:
Configure router in cisco packet tracer.
Do Dynamic IP routing using CLI.
Do Dynamic Ip routing using GUI.
Configure multiple routers having multiple networks.
Configure DCE and DTE devices.
Configure router using serial cable.
Implements RIP protocol in network.
Construct and design RIP network.
4. Commands used:
Enable
Configure terminal
Ip route
Ip address
Interface s0/2/0
Exit
No shut
Hostname
Network
Router rip
5. Walk-through Task:
Construct the topology given below, enable RIP protocol for its IP routing. Moreover, table for all
interfaces IP address is also given.
Page 4 of 13
Figure 1: ip addresses, subnet masks, default gateway to be given
For creating this topology, we have to execute these steps:
1. Open cisco packet tracer.
2. Go in network devices tab and add three 2811 routers.
3. Then add three switches by entering in the switches tabs.
4. After adding these routers, click on the routers and in physical view add WIT serial port from the
given module.
5. Add WIT serial port in every router before creating its connections with switches.
Page 5 of 13
Figure 2: show the addition of WIC IT port.
6. Add three PC’s from the end devices tab in the cisco packet tracer.
7. Connect these routers with serial cable.
8. Connect router with switches using copper straight-through cable from connections tab.
9. Connect PC’s with switches using copper straight-through cable from connection tab.
Page 6 of 13
Figure 3: connections of routers and switches
10. Click on the router and go in the CLI tab.
11. Press N from the question asked by the router CLI and press enter.
12. Connection lights are red because until now router is not configured.
13. Write En or enable command to get privileged for router configuration and press enter.
14. Write config t or configure terminal command for get into configuration mode.
15. Now before of routers, add note on your workspace on both sides of the router indicating IP
address, Subnet mask and default gateway, which will look like:
Page 7 of 13
Figure 4: text on the workspace
16. Open CLI and write command interface serial 0/0/0 for telling interface of router you want to
configure.
17. Then write command ip add “the IP you have given in the table” to provide IP address along with
subnet mask of the interface.
18. Also give clock rate of the DCE port by command clock rate 56000 and then press enter.
19. Write command no shut to up the link state of the router.
20. Your configuration will be some like this:
Page 8 of 13
Figure 5: router configuration.
21. In the same way configure all the interfaces of all three routers, R1,R2 and R3, whether its serial
interfaces or fast Ethernet interfaces configure them both with proper IP addresses as mention in IP
table.
22. Configure every PC, by giving them proper IP address, subnet masks and default gateways.
Figure 6: computer IP addresses.
Page 9 of 13
23. Now after all configuration of routers and PC all the interfaces, should turn to green from red. If
this doesn’t happen then you had done mistake in your configurations.
24. Now as we know that, every router knows their own network that is immediately connected to it
but does not know about the other networks connected with other routers, so for bringing this
network to work, we should tell routers the path, which we will done using RIP protocol.
For configuring it for RIP protocol we will do following steps:
1. To enable a dynamic routing protocol, enter global configuration mode and use the router
command.
2. Enter router at the global configuration prompt to a see a list of available routing protocols on your
router.
3. To enable RIP, enter the command router rip in global configuration mode.
R1(config)#router rip
R1(config-router)#
4. Once you are in routing configuration mode, enter the classful network address for each directly
connected network, using the network command.
R1(config-router)# network 192.168.1.0
R1(config-router)# network 192.168.2.0
R1(config-router)#
5. The network command:
Enables RIP on all interfaces that belong to this network. These interfaces will now both send and
receive RIP updates. • Advertises this network in RIP routing updates sent to other routers every 30
seconds.
When you are finished with the RIP configuration, return to privileged EXEC mode and save the
current configuration to NVRAM:
R1(config-router)#end
%SYS-5-CONFIG_I: Configured from console by console
R1#copy run start.
Page 10 of 13
6. Configure RIP on the R2 router using the router rip and network commands:
R2(config)#router rip
R2(config-router)#network 192.168.2.0
R2(config-router)#network 192.168.3.0
R2(config-router)#network 192.168.4.0
R2(config-router)#end
%SYS-5-CONFIG_I: Configured from console by console
R2#copy run start
7. Configure RIP on the R3 router using the router rip and network commands:
R3(config)#router rip
R3(config-router)#network 192.168.4.0
R3(config-router)#network 192.168.5.0
R3(config-router)#end
%SYS-5-CONFIG_I: Configured from console by console
R3# copy run start
8. Verify RIP Routing.
Verify this by using command: show ip route
You will get results like this:
Figure 7: ip route command.
Page 11 of 13
These R with yellow indicates that these interfaces are configured using RIP protocol.
9. Now send PDU from PC0 to any PC, the status will be successful for this:
Figure 8: status of the PDU
Page 12 of 13
6. Practice tasks:
6.1 Task 1:
Construct the topology given below, configure RIP in it, configure all the interfaces serial or Fast
Ethernet, send the PDU and show the results:
Figure 9: practice task 1
6.2 Task 2:
Attach access points with every network in networks range from 192.168.10.0 to 192.168.17.0 and
connect at least one laptop to each network and send PDU’s in between them and show results to
instructor.
Page 13 of 13