Routing Lecture
Routing Lecture
INSTRUCTOR: NGAKO
Chapter 2: ROUTING
TYPES OF ROUTING
Routing is of three main types:
1)Static routing:
Here, routes are manually added into the routing table . With
this type of routing, a cheaper router can be used. Static
routing adds security and does not require bandwidth usage
between routers. This is a method for small networks.
Examples of static routes we have; standard, default,
summary and floating static routes.
2)Default routing:
Here, the router is configured to send all packets toward a single
router. This type is typically used with a stub router i.e a router that
has only a single route to reach the other network. The only time a
router will use a default route is when a specific route does not exist.
3)Dynamic Routing:
This is the type of routing in which adjustment of the routes are
automatically made according to the current state of the route in the
routing table. Here, protocols are been used to discover network
destination and the route to reach it. It is also easy to configure and
more effective in selecting the best path. This is the most common
method and most complex method of routing.
IMPORTANCE OF ROUTING:
• Routing creates efficiency in network communication. Network
communication failures result in the long await times for website
pages to load for users.
• Routing helps to minimize network failure by managing data
traffic so that a network can use as much of its capacity as
possible without creating congestion.
Hence to conclude, the various types of routing have their
advantages and disadvantages it is up to the network administrator
to study the network in other to know which protocol they need to
apply.
Dynamic routing
Routing is a procedure of selecting the best path to make data transfer from source to destination. A
router exists in the network layer in the OSI as well as TCP/IP model. Some functions of a router are:
Types of Routing
There exist 3 main types of routing namely:
➢ Static routing
➢ Default routing
➢ Dynamic routing
Dynamic Routing
Dynamic routing is a technique of finding the best path for the data to travel over a network. In this
process a router can transmit data through various different routes and reach its destination on the basis
of conditions at that time of communication circuits.
Dynamic routers are smart enough to take the best path for data based on the condition of the present
scenario at that time of the network. In case one section fails in the network to transfer data forward
dynamic router will use its algorithm or protocols and it will re-route the previous network over another
network in real-time. And this amazing capability and functionality to change paths in real-time over the
network by sharing status among them is the key functionality of Dynamic Routing. OSPF (open shortest
path first) and RIP are some protocols used for dynamic routing.
Second, it is started manually to go to the first routing table of the router with router information, and
then after that it goes on automatically with the help of a dynamic routing algorithm and dynamically
forms the routing table for the rest of the routers in the network.
Third, then the routing information is exchanged among the routers so in case if the network goes down
or the router fails to work and share information with its connected routers then the routing table of
each router is modified correctly to that present condition so that it never fails to deliver information to
the destination.
Fourth, hosts are present to check or match the default gateway address to the IP addresses of the local
router.
PURPOSE
Components
There are three main components that were used in dynamic routing:
Advantages
➢ Beneficial in Performance as well as scalable networking with a high frequency of data on nodes.
➢ Makes fewer mistakes as it reroutes itself compared to other routing protocols.
➢ No need to be manually configured by the admin.
➢ Shares information about the network with each other makes them more reliable to work
efficiently.
Disadvantages
Open Shortest Path First (OSPF) is a link-state routing protocol that is used to find the best path between
the source and the destination router using its own Shortest Path First. OSPF is developed by Internet
Engineering Task Force (IETF) as one of the Interior Gateway Protocol (IGP), i.e. the protocol which aims
at moving the packet within a large autonomous system or routing domain. It is a network layer protocol
which works on protocol number 89 and uses AD value 110. OSPF uses multicast address [Link] for
normal communication and [Link] for update to designated router (DR)/Backup Designated Router
(BDR).
OSPF terms
Router Id: It is the highest active IP address present on the router. First, the highest loopback address is
considered. If no loopback is configured then the highest active IP address on the interface of the router
is considered.
Router priority: It is an 8-bit value assigned to a router operating OSPF, used to elect DR and BDR in a
broadcast network.
Designated Router (DR): It is elected to minimize the number of adjacencies formed. DR distributes the
LSAs to all the other routers. DR is elected in a broadcast network to which all the other routers share
their DBD. In a broadcast network, the router requests for an update to DR, and DR will respond to that
request with an update.
Backup Designated Router (BDR): BDR is a backup to DR in a broadcast network. When DR goes down,
BDR becomes DR and performs its functions.
DR and BDR elections take place in the broadcast network or multi-access network. Here are the criteria
for the election:
➢ Down: In this state, no hello packets have been received on the interface.
Note: The Downstate doesn’t mean that the interface is physically down. Here, it means that the OSPF
adjacency process has not started yet.
INIT: In this state, the hello packets have been received from the other router.
2WAY: In the 2WAY state, both the routers have received the hello packets from other routers.
Bidirectional connectivity has been established.
Note In between the 2WAY state and Exstart state, the DR and BDR election takes place.
Exstart: In this state, NULL DBD is exchanged. In this state, the master and slave elections take place. The
router having the higher router Id becomes the master while the other becomes the slave. This election
decides which router will send its DBD first (routers who have formed neighbour ship will take part in
this election).
Loading: In this state, LSR, LSU, and LSA (Link State Acknowledgement) are exchanged.
Note When a router receives DBD from other router, it compares its own DBD with the other router
DBD. If the received DBD is more updated than its own DBD then the router will send LSR to the other
router stating what links are needed. The other router replies with the LSU containing the updates that
are needed. In return to this, the router replies with the Link State Acknowledgement.
Full: In this state, synchronization of all the information takes place. OSPF routing can begin only after
the Full state.
Hop Count
Hop count is the number of routers occurring in between the source and destination network. The path
with the lowest hop count is considered as the best route to reach a network and therefore placed in the
routing table. RIP prevents routing loops by limiting the number of hops allowed in a path from source
and destination. The maximum hop count allowed for RIP is 15 and a hop count of 16 is considered as
network unreachable.
Features of RIP
➢ Updates of the network are exchanged periodically.
➢ Updates (routing information) are always broadcast.
➢ Full routing tables are sent in updates.
➢ Routers always trust routing information received from neighbour routers. This is also known as
routing on rumours
RIP versions
There are three versions of routing information protocol RIP Version1, RIP Version2, and RIPng.
RIP v1 is known as Classful Routing Protocol because it doesn’t send information of subnet mask in its
routing update.
RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in its routing
update.
Classful routing protocol Classless protocol updated Classless updates are sent
supports classful
RIP timers
Update timer: The default timing for routing information being exchanged by the routers operating RIP
is 30 seconds. Using an Update timer, the routers exchange their routing table periodically.
Invalid timer: If no update comes until 180 seconds, then the destination router considers it invalid. In
this scenario, the destination router mark hop counts as 16 for that router.
Hold down timer: This is the time for which the router waits for a neighbour router to respond. If the
router isn’t able to respond within a given time then it is declared dead. It is 180 seconds by default.
Flush time: It is the time after which the entry of the route will be flushed if it doesn’t respond within the
flush time. It is 60 seconds by default. This timer starts after the route has been declared invalid and
after 60 seconds i.e. time will be 180 + 60 = 240 seconds.
1
PROTOCOLS (RIP,OSPF, AND BGP)
Outline
oINTERIOR AND EXTERIOR ROUTING
oRIP
oOSPF
oBGP
Introduction
An internet is a combination of networks connectedby routers.
• How to pass a packet from source to destination ?
• nWhich of the available pathways is the optimum pathway ?
Depends on the metric:
Metric: a cost assigned for passing a packet through a network.
A router should choose the route with the smallest metric to send packets.
The metric assigned to each network depends on the type of protocol
• RIP (Routing Information Protocol)o Treat each network as equals,The cost of passing
through each network is the same: one hop count
• Open Shortest Path First (OSPF) Allow administrator to assign a cost for passing through
a network based on the type of services required for example, maximum throughput or
minimum delay.
• Border Gateway Protocol (BGP)
o The criterion is the policy, which can be set by the administrator.
types of routing
static routing is a process in which we have to manually add routes in a routing table
dynamic routing is a process in which routing protocols add routes in a routing table
default routing
this is a method where the router is configured to send all packets toward a single router(next
hop)
routing techniques
type of messages
Requests and Response
oRIP uses two type of messages
nRequest and response
oRequest is sent by a router that has just come up or has some time-out entries
oResponse: solicited or unsolicited
Response is sent only in answer to a request. It contains information about the destination
specified in the corresponding request.
nAn unsolicited response is sent periodically every 30s and contains information about the entire
routing table also called update packet
Timers in RIP
oRIP uses three timers
nPeriodic timer
nExpiration timer
nGarbage collection timer
Periodic Timer
oPeriodic timer control the advertising of regular update message although protocol specifies 30
s, the working model uses a random number between 25 and 35 s to prevent routers update
simultaneously
Expiration Timer
It govern the validity of a route, it set to 180 s for a route when a router receives update
information for a route
nIf a new update for the route is received, the timer is reset.
nIn normal operation, this occurs every 30 [Link] timer goes off, the route is considered expired
nThe hop count of the route is set to 16, which means destination is unreachable
Problems in RIP
oSlow Convergence
oInstability
Slow Convergence
oA change somewhere in the internet propagates very slowly through the rest of the
internet.
oFor example
nA change is Net1, R1 updates itself immediately
nR1->R2: an average of 15 s
nR2->R3: an average of 15 s
n…
nThus, R1-Rn: an average of 15 x n s
RIP Version 2
oNew fields
nRouting Tag: carries information such as the
autonomous system number
oEnable RIP to receive information from an exterior
routing table
nSubnet mask: carries the subnet mask (or prefix)
oRIP2 support classless addressing and CIDR
nNext-hop address: show the address of the next
Hop
Authentication
oProtect the message against unauthorized
advertisement
oThe first entry of the message is set aside for
authentication information
nFamily field = FFFF16
Multicasting
oVersion 1 of RIP uses broadcasting to send
RIP message to everyneighbor
nAll the router and the hosts receive the packets
oRIP version 2
nUses the multicast address [Link] to multicast
RIP message only to RIP routers in the network
PDF created
Encapsulation
oRIP message are encapsulated in UDP user
datagram
oThe well-known port assigned to RIP in UDP
is port 520
Introduction
oAn internet is a combination of networks connected
by routers
oHow to pass a packet from source to destination ?
nWhich of the available pathways is the optimum pathway ?
oDepends on the metric:
nMetric: a cost assigned for passing through a network
nA router should choose the route with the smallest metric
The construction of routing tables is the primary goal of routing protocols. Static routes are
entries made in a routing table by non-automatic means and which are fixed rather than being the
result of routing protocols and associated network topology discovery procedures.
• The columns Network destination and Netmask together describe the Network
identifier as mentioned earlier. For example, destination [Link] and netmask
[Link] can be written as [Link]/24.
• The Gateway column contains the same information as the Next hop, i.e. it points to the
gateway through which the network can be reached.
• The Interface indicates what locally available interface is responsible for reaching the
gateway. In this example, gateway [Link] (the internet router) can be reached
through the local network card with address [Link].
• Finally, the Metric indicates the associated cost of using the indicated route. This is
useful for determining the efficiency of a certain route from two points in a network. In
this example, it is more efficient to communicate with the computer itself through the use
of address [Link] (called “localhost”) than it would be through [Link] (the IP
address of the local network card).
Routing tables are generally not used directly for packet forwarding in modern router
architectures; instead, they are used to generate the information for a simpler forwarding
table. This forwarding table contains only the routes which are chosen by the routing
algorithm as preferred routes for packet forwarding. It is often in a compressed or pre-
compiled format that is optimized for hardware storage and lookup.
• This router architecture separates the control plane function of the routing table from the
forwarding plane function of the forwarding table.[3] This separation of control and
forwarding provides uninterrupted high-performance forwarding.
The administrative distance of the RIP is 120 and it is a distance vector routing protocol whereas that of
the OSPF, it is a link state routing protocol an its administrative distance is 110.
RIP protocol allows only up to 15 hop count while the OSPF protocol does not have such restrictions or
has no limitations.
The EIGRP has a combination of bandwidth, reliability, load and delay whereas the OSPF uses an
interface bandwidth.
The EIGRP supports load balancing of unequal path metrics, while the OSPF only supports load balancing
equal metrics.
The EIGRP needs lower cpu and memory whereas the OSPF needs and requires high memory and cpu.
OSPF is an intra-domain routing protocol whereas BGP is the inter- domain routing protocol.
OSPF is very fast to occur whereas the BGP is very slow to occur.
OSPF prefers fastest path rather than shortest path while BGP prefers best path.
In RIP, the calculations are in terms of Bandwidth whereas that of the BGP are in terms of HOP count.
RIP is less intelligent protocol when compared to the BGP while the BGP is called a more intelligent
protocol as compared to the RIP.
RIP works for smaller organizations while BGP works for large organizations.
RIP works on Bellman Ford Algorithm(BFA) while the EIGRP works on DUAL (Diffusing Update Algorithm)
algorithm.
RIP is a standard dynamic routing protocol whereas the EIGRP is a Cisco standard routing protocol.
The RIP calculates the metric in terms of hop count while the EIGRP calculates the metric in terms of
bandwidth and delay.
The RIP is not a more intelligent dynamic routing protocol while the EIGRP is a more intelligent routing
protocol.
• A routed protocol is a layer 3 protocol that applies logical addresses to devices and routes data
between networks. Examples would be IP and IPX.
• A routing protocolis a protocol that specifies how routers communicates with each other to
distribute information that enables them to select routes between nodes on a computer
network.
A routing protocol dynamically builds the network, the topology, and next hop information in
routing tables. Examples would be RIP, EIGRP, OSPF, etc.
• Prefix-Length:
It specifies the number of bits in the IP address that are to be used as the subnet
mask(usually between 1-32) Prefix-length is the number of bits used to identify the
network, and is used to determine the most specific route.
It identifies the cost that’s associated with using that route. For example, the matric can
be valued in terms of link speed, hop count or time delay.
A longer prefix-length indicates a more specific route. For example, assume we are trying to reach a host
address of [Link]/24. If we had routes to the following networks in the routing table:
[Link]/24
[Link]/8
The router will do a bit-by-bit comparison to find the most specific route (i.e., longest matching prefix).
Since the [Link]/24 network is more specific, that route will be used, regardless of metric or
Administrative Distance.
Only routes with the best metric are added to the routing tableI.e, the metric with the smallest
magnitude. Thus, even if a particular routing protocol (for example, RIP) has four routes to the same
network, only the route with the best metric (hop-count in this example) would make it to the routing
table.
If multiple equal-metric routes exist to a particular network, most routing protocols will load-balance.
If your router is running multiple routing protocols, Administrative Distance is used to determine which
routing protocol to trust the most. Lowest administrative distance wins.
Again: if a router receives two RIP routes to the same network, it will use the routes’ metric to determine
which path to use. If the metric is identical for both routes, the router will load balance between both
paths.
If a router receives a RIP and an OSPF route to the same network, it will use Administrative Distance to
determine which routing path to choose.
Connected 0
Static 1
EIGRP Summary 5
External BGP 20
Internal EIGRP 90
IGRP 100
OSPF 110
IS-IS 115
RIP 120
Unknown 255
A route with an “unknown” Administrative Distance will never be inserted into the routing table.
Routes are labeled based on what protocol placed them in the table:
• C – Directly connected
• S – Static
• S* - Default route
• D - EIGRP
• R – RIP
• I – IGRP
• i – IS-IS
• O – OSPF
• B--BGP
We have two RIP routes, an OSPF route, and a Static route to that destination. Which route will be
chosen by the router?
• Prefix-Length
• Metric
• Administrative Distance
The static route has the lowest administrative distance (1) of any of the routes; however, its prefix-length
is less specific. [Link]/24 is a more specific route than [Link]/16. Remember, prefix-length
is always considered first.
The second RIP route will not be inserted into the routing table, because it has a higher metric (5) than
the first RIP route (1). Thus, our routing table will actually look as follows:
O [Link]/24 [110/58] via [Link], [Link], Serial3
R [Link]/24 [120/1] via [Link], [Link], Serial0
S [Link]/16 [1/0] via [Link]
Thus, the true choice is between the OSPF route and the first RIP route. OSPF has the lowest
administrative distance, and thus that route will be preferred.
PLEASE NOTE
: Calculating the lowest metric route within a routing protocol occurs before administrative distance
chooses the route it “trusts” the most. This is why the order of the above “criteria” is prefix-length,
metric, and then administrative distance. However, the route with the lowest administrative distance is
always preferred, regardless of metric (assuming the prefix-length is equal). Thus, the metric is calc