You are on page 1of 57

Advanced Network Routing

Algorithms and Protocols

1
Overview
 Routing is a basic concept in data communication networks.
Routing is an activity that transmits information from a source
address to a destination address through an interconnected
network.
 Routing occurs at the network layer, Layer 3, in the Open Systems
Interconnection (OSI) reference model. The devices that provide
routing and forwarding functions are called routers.
 When a router receives an IP packet, the router searches its
routing table for the best matching route based on the
destination IP address of the packet and forwards the packet
through the outbound interface or next-hop IP address for the
route.
 The routing protocol is a routing algorithm that provides the best
path from the source to the destination. The best path is the path
that has the "least-cost path" from source to the destination.
2
Routers and Routing
 On the Internet, network connecting devices such as hubs,
bridges, switches, and routers control traffic and ensure data
transmission quality.
 A router selects routes and forwards packets. Upon receiving a
packet, a router selects a proper path, which may have one or
multiple hops, to send the packet to the next router according
to the destination address in the packet.
 The last router is responsible for sending the packet to the
destination host.
 A route is a path along which packets are sent from the source
to the destination.
 When multiple routes are available to send packets from a
router to the destination, the router can select the optimal
route from an IP routing table.

3
Static Routes and Dynamic Routes
 Static routes are easy to configure, have low system
requirements, and apply to simple, stable, and small
networks.
 The disadvantage of static routes is that they require
subsequent maintenance as they cannot automatically adapt
to network topology changes.
 Dynamic routing protocols have routing algorithms.
Therefore dynamic routes can automatically adapt to network
topology changes and apply to networks on which Layer 3
devices are deployed.
 The disadvantages of dynamic routes are that they are
complex to configure, have higher system requirements than
static ones, and consume network and system resources.
4
Routing Table and FIB Table

 Routers forward packets based on routing tables and


forwarding information base (FIB) tables. Each router maintains
at least one routing table and one FIB table.
 Routers select routes based on routing tables and forward
packets based on FIB tables.
 Routing Table – Two Types
 1) Local core routing table : A router uses the local core routing
table to store preferred routes. The router then sends the
preferred routes to the FIB table to guide packet forwarding.
 2) Protocol routing table : A protocol routing table stores
routing information discovered by the protocol.
 A routing protocol can import and advertise routes that are
discovered by other routing protocols. 
5
Routing table

6
Types of Routing Protocols
 Routing protocols can be classified into the following types.
 Classified based on the used routing algorithms:
1) Distance vector routing protocols, for example: Routing
Information Protocol (RIP)
2) Link state routing protocols, for example: Open Shortest
Path First (OSPF)
 Classified into the following based on where they are used:
1. Interior Gateway Protocol (IGP): exchanges routing
information within a single autonomous system (AS), for
example: OSPF.
2. Exterior Gateway Protocol (EGP): exchanges routing
information in different ASs, for example, Border Gateway
Protocol (BGP).
7
Commonly Used Routing Protocols

• Currently, the following routing protocols are commonly used:


Open Shortest Path First Routing Protocol (OSPF)
Routing Information Protocol(RIP)
Intermediate System-to-Intermediate System (IS-IS)
Border Gateway Protocol(BGP)
• The most commonly used routing protocols are OSPF and
BGP.

8
Link State routing protocol
 Link State routing protocol is an intra-domain routing protocol
which is used for networks in several areas under one domain.
In link state routing, the routers create Link State Packet (LSP)
periodically.
 The LSP contains info of node identity, list of links, sequence
number, and age. After creating LSP, the routers send it to all
other routers.

 The router creates


shortest path tree using
Dijkstra algorithm.
 The router calculate
routing table from
shortest path tree.
9
Dijkstra’s algorithm: example

10
Resulting shortest-path tree from A:

Resulting forwarding table in A:

11
Dijsktra’s Algorithm

12
Bellman Ford algorithm
 Bellman Ford is an algorithm used to compute single source
shortest path. This means that starting from a single vertex,
we compute best distance to all other vertices in a weighted
graph.
 Bellman Ford algorithm helps us find the shortest path from a
vertex to all other vertices of a weighted graph.
 It is similar to Dijkstra's algorithm but it can work with graphs
in which edges can have negative weights.
 This is done by relaxing all the edges in the graph for n-1
times, where n is the number of vertices in the graph.
Dijkstra's algorithm also achieves the same goal, but Bellman
ford works in dynamic approach.

13
Bellman-Ford Equation (dynamic programming)
 Define
dx(y) := cost of least-cost path from x to y
then
dx(y) = min {c(x,v) + dv(y) }

where min is taken over all neighbors v of x

14
Bellman-Ford example
5 Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
3
v w 5 B-F equation says:
2
u 2 1 z du(z) = min { c(u,v) + dv(z),
3
1 2 c(u,x) + dx(z),
x 1
y
c(u,w) + dw(z)
}
= min {2 + 5,
1 + 3,
5 + 3} = 4
Node that achieves minimum is next
hop in shortest path ➜ forwarding table

15
Distance vector routing protocols
 Distance Vector Routing protocol is a dynamic routing
protocol. With this protocol, every router in the
network creates a routing table which helps them in
determining the shortest path through the network.
 A distance-vector routing protocol in data networks
determines the best route for data packets based on
distance. Distance-vector routing protocols measure
the distance by the number of routers a packet has
to pass, one router counts as one hop.
 Distance vector routing protocol is an intra-
domain routing protocol. Intra-domain routing means
routing inside the autonomous system (i.e. cluster of
routers and networks authorized by a single
administrator).
16
Distance vector routing protocols Example

17
Routing Information Protocol
 RIP stands for Routing Information Protocol. RIP is an intra-
domain routing protocol used within an autonomous system.
 RIP is a commonly used routing protocol in TCP/IP networks.
Routing Information Protocol (RIP) is a stable protocol that
uses a distance-vector algorithm to calculate routes.
 RIP is to configure the hosts as part of a RIP network. This
type of routing requires little maintenance and also
automatically reconfigures routing tables when network
changes or network communication stops. 
 RIP uses hop count as the cost or metric during creating and
updating routing table. The maximum number of hop for RIP
is 15. It means if there is 16 hop requirements for packet
transfer, the cost is infinity. Every 30s each router sends it
updated routing table to its immediate neighbors.
18
Routing Information Protocol example

19
Open Shortest Path First Routing Protocol (OSPF):
 The OSPF stands for Open Shortest Path First. It is a widely
used and supported routing protocol. It is an intra-domain
protocol, which means that it is used within an area or a
network. It is an interior gateway protocol that has been
designed within a single autonomous system.
 It is based on a link-state routing algorithm in which each
router contains the information of every domain, and based
on this information, it determines the shortest path. 
 Routing is the building of maps and each routing protocol
usually has its own routing forwarding table or database.
 Forwarding table contains the best path to the next hop for
each prefix.

20
OSPF Areas

Group of contiguous hosts and


networks and per area
topological database
 Invisible outside the area
 Reduction in routing traffic
 Backbone area contiguous
 All other areas must be
connected to the backbone

21
OSPF Background
 Developed by IETF – RFC1247
 Designed for Internet TCP/IP environment
 OSPF v2 described in RFC2328/STD54
 OSPF v3 described in RFC2740 - IPv6
 Link state/Shortest Path First Technology
 Dynamic Routing : Dynamic routing is a technique in which a
router learns about routing information without an
administrator's help and adds the best route to its routing
table.
 Fast Convergence : Convergence time is a measure of how fast
a group of routers reach the state of convergence. It
implement a mechanism that allows all routers running the
protocol to quickly and reliably converge.

22
OSPF ROUTING PROTOCOL
 OSPF supports a number of messages that allow routing
information to be exchanged within and between areas.
OSPFs area architecture limits the required number and size
of routing messages through IP route aggregation at area
boundaries.
 The OSPF IP routing database is maintained through the
exchange of Link State Update (LSU) messages. LSU
messages encapsulate a variety of OSPF messages called Link
State Advertisements (LSAs).
 Five types of Routers(Classification of Routers)
1) Internal Router (IR)
2) Area Border Router (ABR)
3) Backbone Router (BR)
4) Autonomous System Border Router (ASBR)
5) Hierarchical OSPF
23
Classification of Routers

1) Internal Router (IR)


2) Area Border Router (ABR)
3) Backbone Router (BR)
4) Autonomous System Border
Router (ASBR)
5) Hierarchical OSPF

24
Hierarchical OSPF
In OSPF, there must always be one backbone area—area 0—
to which all other internal routers must be directly attached.
Routers that reside on boundaries between the backbone and
a internal routers are called Area boundary Routers (ABR) and
have at least one interface in each area.

25
Intermediate-System to Intermediate-System(IS-IS)
 Intermediate System to Intermediate System (IS-IS, also
written ISIS) is a routing protocol designed to use distribute
IP routing information throughout a single Autonomous
System (AS) in an IP network.
 It accomplishes this by determining the best route for data
through a packet switching network.
 it is an Interior Gateway Protocol (IGP) standardized by the
Internet Engineering Task Force (IETF) and commonly used in
large Service Provider networks. 
 IS-IS is a link-state routing protocol, providing fast
convergence and excellent scalability. Like all link-state
protocols, IS-IS is very efficient in its use of network
bandwidth.
26
IS-IS Protocol Concepts Areas

27
 IS-IS is a link-state routing protocol, which means that the
routers exchange topology information with their nearest
neighbors. The topology information is flooded throughout the
AS, so that every router within the AS has a complete picture of
the topology of the AS.

28
 The main advantage of a link state routing protocol is that the
complete knowledge of topology allows routers to calculate
routes that satisfy particular criteria.
 This can be useful for traffic engineering purposes, where
routes can be constrained to meet particular quality of service
requirements.
 The main disadvantage of a link state routing protocol is that it
does not scale well as more routers are added to the routing
domain.
 Increasing the number of routers increases the size and
frequency of the topology updates, and also the length of time
it takes to calculate end-to-end routes.
 This lack of scalability means that a link state routing protocol
is unsuitable for routing across the Internet at large, which is
the reason why IGPs only route traffic within a single AS. 

29
Border Gateway Protocol(BGP)
 Border Gateway Protocol (BGP) refers to a gateway protocol
that enables the internet to exchange routing information
between autonomous systems (AS).
 As networks interact with each other, they need a way to
communicate. This is accomplished through peering. BGP
makes peering possible.
 How Does BGP Work?
 When network router that connects to other networks, it does
not know which network is the best one to send its data to.
BGP takes into consideration all the different peering options a
router has and chooses the one closest to where the router is.
Each potential peer communicates the routing information it
has and that gets stored within a routing information base
(RIB).
 BGP can access this information and use it to choose the best
peering option. 30
BGP Peers

A C

AS 100 AS 101
220.220.8.0/24 220.220.16.0/24
B D

BGP speakers E
are called peers
Peers in different AS’s
AS 102
220.220.32.0/24
are called External Peers
eBGP TCP/IP
Peer Connection
Note: eBGP Peers normally should be directly connected.
BGP Peers

A C

AS 100 AS 101
220.220.8.0/24 220.220.16.0/24
B D

BGP speakers are E


called peers
Peers in the same AS
AS 102
220.220.32.0/24
are called Internal Peers
iBGP TCP/IP
Peer Connection
Note: iBGP Peers don’t have to be directly connected.
BGP Peers

A C

AS 100 AS 101
220.220.8.0/24 220.220.16.0/24
B D

BGP Peers exchange E


Update messages
containing Network Layer AS 102
Reachability Information 220.220.32.0/24

(NLRI)
BGP Update
Messages
Configuring BGP Peers
AS 100 eBGP TCP Connection AS 101
222.222.10.0/30

A .2 220.220.8.0/24 .1 B .2 .1 C .2 220.220.16.0/24 .1 D

interface Serial 0 interface Serial 0


ip address 222.222.10.2 255.255.255.252 ip address 222.222.10.1 255.255.255.252

router bgp 100 router bgp 101


network 220.220.8.0 mask 255.255.255.0 network 220.220.16.0 mask 255.255.255.0
neighbor 222.222.10.1 remote-as 101 neighbor 222.222.10.2 remote-as 100

• BGP Peering sessions are established using the BGP


“neighbor” configuration command
– External (eBGP) is configured when AS numbers are different
Configuring BGP Peers
AS 100 AS 101
iBGP TCP Connection
222.222.10.0/30

A .2 220.220.8.0/24 .1 B .2 .1 C .2 220.220.16.0/24 .1 D

interface Serial 1 interface Serial 1


ip address 220.220.16.2 255.255.255.252 ip address 222.220.16.1 255.255.255.252

router bgp 101 router bgp 101


network 220.220.16.0 mask 255.255.255.0 network 220.220.16.0 mask 255.255.255.0
neighbor 220.220.16.1 remote-as 101 neighbor 220.220.16.2 remote-as 101

• BGP Peering sessions are established using the BGP


“neighbor” configuration command
– External (eBGP) is configured when AS numbers are different
– Internal (iBGP) is configured when AS numbers are same
Configuring BGP Peers
AS 100

B
A

iBGP TCP/IP
Peer Connection
C

• Each iBGP speaker must peer with every other


iBGP speaker in the AS
Configuring BGP Peers
AS 100 215.10.7.2
215.10.7.1

B
A

215.10.7.3

iBGP TCP/IP
Peer Connection
C

• Loopback interface are normally used as


peer connection end-points
Configuring BGP Peers
AS 100 215.10.7.2
215.10.7.1

B
A

215.10.7.3

iBGP TCP/IP
interface loopback 0
ip address
Peer 215.10.7.1 255.255.255.255
Connection
router bgp 100
C
network 220.220.1.0
neighbor 215.10.7.2 remote-as 100
neighbor 215.10.7.2 update-source loopback0
neighbor 215.10.7.3 remote-as 100
neighbor 215.10.7.3 update-source loopback0
Configuring BGP Peers
AS 100 215.10.7.2
215.10.7.1

B
A

215.10.7.3

iBGP TCP/IP interface loopback 0


Peer Connection ip address 215.10.7.2 255.255.255.255
C
router bgp 100
network 220.220.5.0
neighbor 215.10.7.1 remote-as 100
neighbor 215.10.7.1 update-source loopback0
neighbor 215.10.7.3 remote-as 100
neighbor 215.10.7.3 update-source loopback0
Configuring BGP Peers
AS 100 215.10.7.2
215.10.7.1

B
A

215.10.7.3

iBGP TCP/IP
Peer Connection
C
interface loopback 0
ip address 215.10.7.3 255.255.255.255

router bgp 100


network 220.220.1.0
neighbor 215.10.7.1 remote-as 100
neighbor 215.10.7.1 update-source loopback0
neighbor 215.10.7.2 remote-as 100
neighbor 215.10.7.2 update-source loopback0
 Interior Gateway Protocol
Interior Gateway Protocol is a protocol for exchanging routing
information between gateways (hosts with routers) within an
autonomous network (for example, a system of corporate
local area networks).
The routing information can then be used by the Internet
Protocol (IP) or other network protocols to specify how to
route transmissions.
 Collection of networks
with same policy
 Single routing protocol
 Usually under single
administrative control

41
Interior and Exterior Gateway Protocols
 Interior gateway protocols are used inside an organization's
network and are limited to the border router. Exterior
gateway protocols are used to connect the different
Autonomous Systems (ASs).
 A simple definition that fits most of the time defines the
border router as a router that has a foot in two worlds, one
going to the Internet and another that is placed inside the
organization (hence the name, border router).

42
Interior Gateway Protocols can be divided into two categories
shown below
 1) Distance-vector routing protocols use the Bellman-Ford
algorithm. In these protocols, It advertises its distance value
(DV) calculated to other routers and receives similar
advertisements from other routers.
 2) Link-state Routing Protocol In link-state routing protocols,
each router possesses information about the complete
network topology. Each router then independently calculates
the best next hop from it for every possible destination in the
network using local information of the topology. 
 Examples of link-state routing protocols:
 1) Open Shortest Path First (OSPF)
 2) Intermediate System To Intermediate System (IS-IS)

43
Routing Algorithms for Mobile Ad-Hoc Network
 A mobile ad-hoc network is an autonomous collection of
mobile nodes that communicate over bandwidth constrained
wireless links.
 Due to nodal mobility, the network topology may change
rapidly and unpredictably over time.
 The routing protocols meant for wired network cannot be used
for mobile ad-hoc network because of mobility of network.
 MANET is a gathering of wireless mobile nodes that actively
form a network lacking any support of principal management.
 Routing in Mobile ad hoc network is very daunting because of
its restricted bandwidth, battery constraints, routing
expenses, asymmetric link, speed, scalability, packet loss and
quality of services.

44
Types of The Mobile ad-hoc routing protocols
 1) Table-Driven protocol and 2) On-Demand protocol
 Table-Driven Protocol:
Destination Sequenced Distance Vector (DSDV).
 On-Demand protocol
Ad-Hoc OnDemand Distance Vector routing (AODV)
 Proactive routing protocols maintain information on all routes
throughout the network, even if they are not required, so each
node registers routes to all other nodes in the network.
 These protocols exchange control information between nodes
on a regular basis, which keeps updated routes for each node in
the network. 
 Reactive Routing Protocol (RRP) is a bandwidth-efficient on-
demand routing protocol for MANETs. In this protocol the
originator node initiates the route search process, whenever it
needs to send data packets to a target node.
45
Destination Sequenced Distance Vector (DSDV)
 The Destination-Sequenced Distance-Vector (DSDV) Routing
Algorithm is based on the idea of the classical Bellman-Ford
Routing Algorithm with certain improvements.
 Every mobile station maintains a routing table that lists all
available destinations, the number of hops to reach the
destination and the sequence number assigned by the
destination node.
 The sequence number is used to distinguish stale routes from
new ones and thus avoid the formation of loops. The stations
periodically transmit their routing tables to their immediate
neighbors.
 A station also transmits its routing table if a significant change
has occurred in its table from the last update sent. So, the
update is both time-driven and event-driven.
46
For Example :

47
Ad Hoc On-Demand Distance Vector (AODV)
 An adhoc network is the cooperative engagement of a col-
lection of mobile nodes without the required intervention of
any centralized access point or existing infrastructure
 An Ad Hoc On-Demand Distance Vector (AODV) is a routing
protocol designed for wireless and mobile ad hoc networks.
 This protocol establishes routes to destinations on demand and
supports both unicast and multicast routing.
 The AODV protocol was jointly developed by Nokia Research
Center, the University of California, Santa Barbara and the
University of Cincinnati in 1991.
 The AODV protocol builds routes between nodes only if they
are requested by source nodes. AODV is therefore considered
an on-demand algorithm and does not create any extra traffic
for communication along links and routes are maintained as
long as they are required by the sources. 48
AODV….
It forms trees to connect multicast group members. AODV
makes use of sequence numbers to ensure route freshness.
AODV avoids the “counting to infinity” problem by using
destination sequence numbers. This makes AODV loop free.
AODV defines 3 message types:
 Route Requests (RREQs)
 Route Replies (RREPs)
 Route Errors (RERRs)
RREQ messages are used to initiate the route finding process.
• RREP messages are used to finalize the routes. • RERR
messages are used to notify the network of a link breakage in
an active route.

49
AODV properties

50
Step 1 : Sources floods RREQ to create reverse
path for M to A

51
Step 1 : Sources floods RREQ to create reverse path
for M to A

52
Step 1 : Sources floods RREQ to create reverse path
for M to A

53
Step 1 : Sources floods RREQ to create reverse path for
M to A

54
Step 1 : Sources floods RREQ to create reverse path
for M to A

55
Step 2 : Destination on replies back via the trail of
routing table entries created by the RREQ.

56
Thank you!

57

You might also like