Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

HOT STANDBY ROUTER PROTOCOL USING CISCO PACKET TRACER

Report submitted to the SASTRA Deemed to be University


as the requirement for the course

CSE302: COMPUTER NETWORKS

Submitted by

KHALIDHA KHANAM
(Reg. No.: 122003297, B. Tech Computer Science Engineering)

February 2021

SCHOOL OF COMPUTING

THANJAVUR, TAMIL NADU-613 401

i
SCHOOL OF COMPUTING
THANJAVUR- 613 401

Bonafide Certificate

This is to certify that the report titled “Hot standby router protocol using cisco packet

tracer” submitted as a requirement for the course, CSE302: COMPUTER NETWORKS for

B.Tech. is a bonafide record of the work done by Shri/Ms. Khalidha Khanam(Reg.

No.122003297 B. Tech Computer science engineering Programme) during the academic year

2020-21, in the School of Computing

Project Based Work Viva voce held on

Examiner 1 Examiner 2

ii
List of Figures

Figure No. Figure Name Page No.

1 Default gateway(i) 1

2 Connection establishment 1

3 Default gateway(ii) 2

4 Data transfer without HSRP 8

5 Data loss without HSRP 9

6 Data transfer with HSRP 10

7 Successful tranfer 11

iii
List of Tables

Table No. Table name Page No.

1 Device Requirements 5

2 IP Table of our network 6

iv
ACKNOWLEDGEMENTS

First of all, I would like to thank God Almighty for his endless blessings.

I thank my parents and all others who helped me acquire this interest in the project and motivated me
in completing it within the deadline without much struggle.

I would like to express my sincere gratitude to Dr S. Vaidyasubramaniam, Vice-Chancellor for


his encouragement during the span of my academic life at SASTRA Deemed University.

I would forever remain grateful and I would like to thank Dr A.UmaMakeswri, Dean, School of
Computing and R. Chandramouli, Registrar for their overwhelming support provided during my
course span in SASTRA Deemed University.

I am extremely grateful to Dr. Shankar Sriram, Associate Dean, School of Computing for his
constant support, motivation and academic help extended for the past three years of my life in
School of Computing.

I would specially thank and express my gratitude to Prof.Vijay Sai.R, School of Computing for
providing me an opportunity to do this project and for her guidance and support to successfully
complete the project.

I also thank all the Teaching and Non-teaching faculty, and all other people who have directly or
indirectly help me through their support, encouragement and all other assistance extended for
completion of my project and for successful completion of all courses during my academic life at
SASTRA Deemed University.

Finally, I thank my parents and all others who help me acquire this interest in project and aided me
in completing it within the deadline without much struggle.

v
Abstract

Sometimes while establishing connections the first hop router fails leading to complete data loss
and failure. To avoid this we are using the hot standby router protocol, where the host is allowed to
use multiple routers as single virtual routers, so even if one fails the rest are present at stand-by.

This project specifies the Hot Standby Router Protocol (HSRP).The goal of the protocol is to allow
hosts to appear to use a single router and to maintain connectivity even if the actual first router they
are using fails. Multiple routers participate in this protocol and in concert create the illusion of a
single virtual router. The protocol insures that one and only one of the routers is forwarding packets
on behalf of the virtual router. End hosts forwards their packets to the virtual router.

The router forwarding packets is known as the active router. A standby router is selected to replace
the active router should it fail. The protocol provides a mechanism for determining active and
standby routers, using the IP addresses on the participating routers. If an active router fails a standby
router can take over without a major interruption in the host’s connectivity.

vi
Table of Contents
Title Page No.
BONAFIDE CERTIFICATE ii
LIST OF FIGURES iii
LIST OF TABLES iv
ACKNOWLEDGEMENT v
ABSTRACT vi

1. INTRODUCTION……………………………………………………………………..01

2. SOURCE CODE……………………………………………………………………....17

3. SNAPSHOTS……………………………………………………………………….....18

4. CONCLUSION AND FUTURE PLANS……………………………………..………20

5. REFERENCES………………………………………………………….……………..21
1. INTRODUCTION

HSRP (Hot Standby Router Protocol) is a cisco proprietary and network layer protocol.
HSRP is a redundancy protocol for setting up a fault-tolerant default gateway in a LAN
environment. . The default gateway is the path used to pass information when the device doesn't
know where the destination is. More directly, a default gateway is a router that connects your host to
remote network segments. It is the exit point for all the packets in your network that have
destinations outside your network.

Figure 1-Default gateway (i)


'Default' gateway simply refers to the fact that this particular node will be used by default unless a
different route is specified in a request.  The default gateway is the IP address through which all
computers in the local network connect to the internet.

1
Figure 2- Connection establishment
The above flow chart describes the steps by which the default gateway establishes connection.

Figure 3- Default Gateway(ii)

With advancements in technology and new inventions, there is a huge rise in the usage of
internet. Internet has become part and parcel of today’s world. We access the internet from a local
network through the default gateway. At times, we might face a situation where in we see that we
have lost our connection and the internet is no more available all of a sudden. We might see a
prompt-“Default gateway is not available”.

There are many possible reasons for this. The IP address the default gateway is looking for might not
be available. Increasing network traffic can also be one of the reasons for the default gateway to not
be available. But this will reduce the efficiency and quality of the work we were doing on our
system.

To avoid such situations we use HSRP in computer network. HSRP is a routing protocol. Routing is
the act of moving information across a network from source to destination. It is divided into two
parts i.e. static routing and dynamic routing. In static routing, the transmission of data takes place
manually whereas; in dynamic routing it is done using various routing protocols.

At the time being the computer networks give us the possibility to communicate and interact in real
time. Now we use the networks at maximum capacity in order to use a great variety of applications
as the ones following: web applications, video conferences, e-commerce applications, IP protocol
telephones, conference calls, education process development, media access applications, online
newspapers applications and so on. Routing protocols should be very well planned and dimensioned
2
for each type of network. In order to optimize the routing protocols, the solution should be very
carefully chosen. The dynamic routing protocols are divided in two distinct categories: interior
routing protocols and exterior routing protocol.

The Hot Standby Router Protocol, HSRP, provides a mechanism which is designed to support non-
disruptive fail over of IP traffic in certain circumstances. In particular, the protocol protects against
the failure of the first hop router when the source host cannot learn the IP address of the first hop
router dynamically. The protocol is designed for use over multi-access, multicast or broadcast
capable LANs (e.g., Ethernet). HSRP is not intended as a replacement for existing dynamic router
discovery mechanisms and those protocols should be used instead whenever possible .HSRP
provides fail over services to those hosts.

All of the routers participating in HSRP are assumed to be running appropriate IP routing protocols
and have a consistent set of routes. The discussion of which protocols are appropriate and whether
routing is consistent in any given situation is beyond the scope of this specification.

Using HSRP, a set of routers work in concert to present the illusion of a single virtual router to the
hosts on the LAN. This set is known as an HSRP group or a standby group. A single router elected
from the group is responsible for forwarding the packets that hosts send to the virtual router. This
router is known as the active router. Another router is elected as the standby router. In the event
that the active router fails, the standby assumes the packet forwarding duties of the active router.
Although an arbitrary number of routers may run HSRP, only the active router forwards the packets
sent to the virtual router.

To minimize network traffic, only the active and the standby routers send periodic HSRP messages
once the protocol has completed the election process. If the active router fails, the standby router
takes over as the active router. If the standby router fails or becomes the active router, another router
is elected as the standby router.

Here we are implementing HSRP over an OSPF Network.


OSPF- OPEN SHORTEST PATH FIRST- Open Shortest Path First (OSPF) is a very widely used
link-state interior gateway protocols (IGP). This protocol routes Internet Protocol (IP) packets by
gathering link-state information from neighboring routers and constructing a map of the network.
OSPF routers send many message types including hello messages, link state requests and updates

3
and database descriptions. Djisktra’s algorithm is then used to find the shortest path to the
destination. Shortest Path First (SPF) calculations are computed either periodically or upon a
received Link State Advertisement (LSA), depending on the protocol implementation. Topology
changes are Dynamic Routing Protocols EGP BGP IGP Distance Vector RIP EIGRP Link-State
OSPF detected very quickly using this protocol. Another advantage of OSPF is that its many
configurable parameters make it a very flexible and robust protocol. Contrary to RIP, however,
OSPF has the disadvantage of being too complicated.

1.1 IMPORTANT DEFINITIONS

1. Active Router - the router that is currently forwarding packets for the virtual router

2. Standby Router - the primary backup router

3. Standby Group - the set of routers participating in HSRP that jointly emulate a virtual router

4. Virtual IP: IP address from local subnet is assigned as default gateway to all local hosts in the
network.

5. Hello messages: Periodic messages exchanged by active and standby routers. These messages
are exchanged after every 3 seconds telling the state of router.

6. Hold down timer: Its default value is 10 seconds i.e roughly 3 times the value of hello
message. This timer tells us about the router that how much time will the standby router waits
for hello message if it is not received on time.If the active router fails then the standby router
will become the active router.

7. Priority: By default, the priority value is 100. It is helpful when the active router comes back
after falling down, we can change the priority of standby router (which has become the active
router after the original active router is down) to less than 100 therefore it again becomes
standby router.The router having higher priority will become the active router.

8. Preempt: It is a state in which the standby router automatically becomes the active router.

4
1.2 HSRP Features

Preemption
The HSRP preemption feature enables the router with highest priority to immediately become the
Active router. Priority is determined first by the priority value that you configure, and then by the IP
address. In each case a higher value is of greater priority.
When a higher priority router preempts a lower priority router, it sends a coup message. When a
lower priority active router receives a coup message or hello message from a higher priority active
router, it changes to the speak state and sends a resign message.
Preempt Delay
The preempt delay feature allows preemption to be delayed for a configurable time period, allowing
the router to populate its routing table before becoming the active router.

1.2 STATES
1. Initial

This is the starting state and indicates that HSRP is not running. This state is entered via a
configuration change or when an interface first comes up.

2. Learn

The router has not determined the virtual IP address, and not yet seen an authenticated Hello
message from the active router. In this state the router is still waiting to hear from the active router.

3. Listen

The router knows the virtual IP address, but is neither the active router nor the standby router. It
listens for Hello messages from those routers.

4. Speak

The router sends periodic Hello messages and is actively participating in the election of the active
and/or standby router. A router cannot enter Speak state unless it has the virtual IP address.

5. Standby

The router is a candidate to become the next active router and sends periodic Hello messages.
Excluding transient conditions, there MUST be at most one router in the group in Standby state.

6. Active
The router is currently forwarding packets that are sent to the group's virtual MAC address. The
router sends periodic Hello messages. Excluding transient conditions, there MUST be at most one
router in Active state in the group.

5
1.4 EVENTS

These are the events in the HSRP finite state machine.

a - HSRP is configured on an enabled interface.

b - HSRP is disabled on an interface or the interface is disabled.

c - Active timer expiry. The Active timer was set to the holdtime when the last Hello message was
seen from the active router.

d - Standby timer expiry. The Standby timer was set to the holdtime when the last Hello message
was seen from the standby router.

e - Hello timer expiry. The periodic timer for sending Hello messages has expired.

f - Receipt of a Hello message of higher priority from a router in Speak state.

g - Receipt of a Hello message of higher priority from the active router.

h - Receipt of a Hello message of lower priority from the active router.

i - Receipt of a Resign message from the active router.

j - Receipt of a Coup message from a higher priority router.

k - Receipt of a Hello message of higher priority from the standby router.

l - Receipt of a Hello message of lower priority from the standby router.

1.5 ACTIONS
This section specifies the actions to be taken as part of the state machine.

1. Start Active Timer


If this action occurred as the result of the receipt of an authenticated Hello message from the active
router, the Active timer is set to the holdtime field in the Hello message. Otherwise the Active timer
is set to the current Holdtime value in use by this router. The Active timer is then started.

2. Start Standby Timer


If this action occurred as the result of the receipt of an authenticated Hello message from the
standby router, the Standby timer is set to the Holdtime field in the Hello message. Otherwise the

6
Standby timer is set to the current hold time value in use by this router. The Standby timer is then
started.

3. Stop Active Timer- The Active timer is stopped.

4. Stop Standby Timer-The Standby timer is stopped.

5. Send Hello Message-The router sends a Hello message with its current State, Hellotime and
Holdtime.

6. Send Coup Message - The router sends a Coup message to inform the active router that there is a
higher priority router available.

7. Send Resign Message- The router sends a Resign message to allow another router to become the
active router.

Hot Standby Router Protocol (HSRP) has 2-versions:


Version 1 : The messages are multicast at 224.0.0.2 and uses the UDP port 1985. This version
allows group number range from 0 to 255.
Version 2 : The messages are multicast at 224.0.0.102 and uses the UDP port 1985. This version
allows group number range from 0 to 4095.

1.6 DEVICE REQUIREMENTS

DEVICE QUANTITY
PC
1

ROUTERS 3

SWITCHES 2

SERVER 1

COPPER CROSSOVER CABLE 2

COPPER STRAIGHT THROUGH CABLE 4

SERIAL DTE 1

7
1.7 IP CONFIGURATION

DEFAULT
DEVICE INTERFACE IP ADDRESS
GATEWAY
Gi0/0 192.168.1.2
R1 NIL
Gi0/1 192.168.2.1
192.168.1.3
R2 Gi0/0 NIL
Gi0/1 192.168.3.1
Gi0/0 192.168.2.2
NIL
Edge Router Gi0/1 192.168.3.2
Serial 0/0/0 209.165.200.13
PC NIC 192.168.1.100 192.168.1.2

Figure 4- Data transfer without HSRP

8
Figure 5- Data loss without HSRP

9
Figure 6- Data transfer with HSRP

Figure 7- Successful transfer

10
2. SOURCE CODE

Router R1(active) is configured with the following hot standby attributes:


R1>standby 1 ip 192.168.1.1
R1>standby 1 priority 105
R1>standby 1 preempt
R1>standby 1 track g0/1

Router R2(standby) is configured with the same commands as above with minor changes as follows:
R2>standby 1 ip192.168.1.1
R2>standby 1 priority 100
R2>standby 1 preempt
R2>standby 1 track g0/1

Change the default gateway address at the PC's to the virtual IP address here 192.168.1.1

11
3. SNAPSHOTS

12
13
4. CONCLUSION AND FUTURE WORK

Routing is used to trace the path for the network and in this paper we implemented the virtual
network model using Cisco packet tracer. There are different types of routing techniques but due to
the usage and area of necessity we use the required one.

HSRP is the efficient protocol for providing the redundancy and the load balancing as well as for
scalable network. Hot standby router protocol (HSRP) is implemented to provide the reliable
network hosts and optimize the network traffic. The network stability and efficiently fault tolerant
networking is also provided by the HSRP.

14
5. REFERENCES

[1]. Choi J. S., 2016, “Design and Implementation of a Stateful PCE-Based Unified Control and
Management Framework for Carrier-Grade MPLS-TP Networks”, Journal of lightwave technology,
VOL. 34, NO. 3, pp 836-843. International Journal of Engineering Science and Computing,
December 2018 19605 http://ijesc.org/
[2]. Chua E. M. et al., 2018, “Comparative Study on Networking Simulation Tools using
Correlation Analysis”, IEEE, International Symposium on Educational Technology, pp 123- 127.
[3]. Robbins D. S., 2018, “Using Protocol Redundancy to Enhance OSPF Network System
Survivability”, IEEE.
[4]. Ayoub O. et al., 2018, “Energy-Efficient Video-on-Demand Content Caching and Distribution in
Metro Area Networks”, IEEE transactions on Green Communications and Networking.
[5]. Savas S. S. et al., 2018, “RASCAR: Recovery-Aware Switch-Controller Assignment and
Routing in SDN”, IEEE transactions on Network and Service Management.
[6]. Liu Y. et al., 2018, “Design and Analysis of Probing Route to Defense Sink-hole Attacks for
Internet of Things Security”, IEEE transactions on Network Science and Engineering. [7]. Mohamed
A. et al., 2018,” Joint Energy and SINR Coverage in Spatially Clustered RF-powered IoT Network”,
IEEE transactions on Green Communications and Networking.
[8]. Rambach et al., 2013, “A Multilayer Cost Model for Metro/Core Networks”, J. OPT.
COMMUN. NETW./VOL. 5, NO. 3, pp 210-225.
[9]. Murakami M. et al., 2014, “Highly Reliable and LargeCapacityPacket TransportNetworks:
Technologies, Perspectives, and Standardization”, Journal of Lightwave Technology, VOL. 32, NO.
4, FEBRUARY 15, pp 805-816.

15

You might also like