IP routing
Lecture 2: Dynamic routing protocols
Objectives
• Discuss the basic principles of distance vector routing
protocols.
• Discuss the basic principles of Link state routing protocols.
Introduction
• A routing protocol is like a language that is used to exchange
information between routers about network status and network
reachability information.
• Routing protocols define a set of rules for communication between
the neighboring routers.
• Routing involves calculating routes dynamically, finding routes
from local routers to reach other networks and adapting to network
changes.
Classification of dynamic routing protocols
• Routing protocols are classified based on:
1. Working area – Does the protocol work within the same
autonomous system or between different autonomous systems?
2. Protocol algorithm – Does the protocol use the distance vector
(Bellman Ford) or the link state (Dijkstra) algorithm?
3. Service application – Is the protocol for unicast or multicast
applications?
Autonomous system (AS)
• A traditional definition for autonomous system (AS) is a collection of IP
networks and routers under the control of one entity that presents a common
routing policy to the Internet.
• AS numbers are assigned by the IANA and each AS is allocated with a unique
number to differentiate it from others.
• AS numbers range from 1 to 65535 and are divided into two ranges;
• Public AS numbers
• Can be used on the Internet
• Range from 1 to 64511
• Private AS numbers
• Used internally within an organization
• Range - 64512 to 65534
Classification by working area
• Routing protocols can be divided into IGP and EGP according to their
working area.
• IGPs ( Interior gateway Or intra-AS protocols)
• A set of routing protocols that are used to search and calculate routes within
an autonomous
• Examples of IGPs – RIP, OSPF and IS-IS
• EGPs (Exterior gateway protocols )
• Used to search and calculate routes between different autonomous systems.
• Also control communication of route information using filtering policies, e.g.
border gateway protocol (BGP).
Classification by algorithm
• Based on the working algorithm, routing protocols can be
divided into:
1. Distance-vector Routing Protocols
2. Link state routing protocols
Distance vector routing protocols
• They use the Bellman-Ford algorithm to calculate routes.
• In distance-vector routing protocols, each router sends
complete routing tables to their neighboring routers at
fixed intervals.
• Routes are advertised as vectors (distance, direction)
• Distance - Distance between router & destination
network
• Direction - indicates the next hop/interface from which
data is forwarded.
Distance vector routing protocols
• The adjacent routers compare the received routing table with their
own routing tables.
• If the received route is new, it will be added to the routing tables
directly.
• If the received route has the same destination as the existing route,
the router will compare the metric of these routes, and will add the
one whose metric (distance to destination) is smaller to the routing
table.
• The adjacent routers then broadcast their routing tables (with the
new routes) to their adjacent routers.
Route Flooding At time t 0
Initialization
RTA RTB RTC
10.1.1.0/30 10.1.2.0/30 10.1.3.0/30 10.1.4.0/30
.1 .1 .2 .1 .2 .1
next hop next hop next hop
destination destination destination
hop count hop count hop count
10.1.1.0 -- 0 10.1.2.0 -- 0 10.1.3.0 -- 0
10.1.2.0 -- 0 10.1.3.0 -- 0 10.1.4.0 -- 0
• When the router starts, it initializes the routing table, creates a table item
for each direct y connected network.
• The hop count of every initialization table item is 0.
Route Flooding At time t1
Updating periodically
RTA RTB RTC
10.1.1.0/30 10.1.2.0/30 10.1.3.0/30 10.1.4.0/30
.1 .1 .2 .1 .2 .1
hop hop hop
destination next hop destination next hop destination next hop
count count count
10.1.1.0 -- 0 10.1.2.0 -- 0 10.1.3.0 -- 0
10.1.2.0 -- 0 10.1.3.0 -- 0 10.1.4.0 -- 0
10.1.3.0 10.1.2.2 1 10.1.1.0 10.1.2.1 1 10.1.2.0 10.1.3.1 1
10.1.4.0 10.1.3.2 1
• Each router sends its own routing table to its directly connected
neighbors periodically.
Network convergence - At time, t 2
Updating periodically
RTA RTB RTC
10.1.1.0/30 10.1.2.0/30 10.1.3.0/30 10.1.4.0/30
.1 .1 .2 .1 .2 .1
hop hop hop
destination next hop destination next hop destination next hop
count count count
10.1.1.0 -- 0 10.1.2.0 -- 0 10.1.3.0 -- 0
10.1.2.0 -- 0 10.1.3.0 -- 0 10.1.4.0 -- 0
10.1.3.0 10.1.2.2 1 10.1.1.0 10.1.2.1 1 10.1.2.0 10.1.3.1 1
10.1.4.0 10.1.2.2 2 10.1.4.0 10.1.3.2 1 10.1.1.0 10.1.3.1 2
• Each router sends its own routing table to its directly connected neighbors
periodically (30 seconds if protocol is RIP).
Distance vector protocols
• Advantages of Distance-vector protocols:
• They are easy to configure
• Use comparatively fewer resources of memory and CPU.
• Disadvantages of Distance-vector protocol:
• Poor network extensibility, for example, the maximum number of hops in RIP
is limited to 16.
• Examples of distance vector protocols
• RIP (Routing information protocol)
•
Research problem – Due Monday (16th, 2022)
• One of the most common problems experienced on networks running
distance vector routing protocols is routing loops.
1. Explain what a routing loop is.
2. With the aid of a diagram, explain how routing loops come about.
3. Explain how routing loops are mitigated using the following methods:
a) Split horizon method
b) Route poisoning
c) Hold down timers
d) Triggered updates
Link state routing protocols
• Link state protocols use the Dijkstra algorithm which is sometimes
called the Shortest Path First (SPF) algorithm to calculate routes.
• This algorithm pays attention to the state of links or interfaces in
the network, including whether they are up or down, their IP
addresses and masks.
• Link state routing protocols divide the routing domain into areas
for easy management and for reducing the size of the routing
tables.
Link state algorithm working principle
• Each router establishes adjacency with neighboring routers
• Each router generates a link state advertisement and floods this
information to neighboring routers (state of their interfaces and
connected networks).
• Using received link state advertisements, each router in the area
builds up a complete link state database for the area.
• Then each router runs the Dijkstra algorithm on the linkstate
database giving a graph known as the shortest path tree showing
which nodes are connected to which other nodes.
• The routing table is then computed from the SPF tree based on
Example 1 – The figure below is a network topology of routers with associated
cost for each link. Determine the shortest path tree for the node A to every
other node in the network
Example 2 – The figure below is a network topology of routers with associated cost for
each link. Determine the shortest path tree for RTA to every other node in the network
Link state routing protocols - Advantages
• The primary advantage of link-state routing is that it reacts more
quickly to connectivity changes.
• Routers send update information only when the link state changes
which saves the bandwidth of the links between routers.
• Some of the update information only covers the information about
the changes of link state instead of the whole routing table.
• Examples of link state protocols
• Open shortest path first (OSPF), IS-IS
Characteristics of a good routing protocol
1. Correctness
• The optimal route can be found, and there is no routing loop.
2. Fast convergence
• When the topological network structure changes, the route should be changed
accordingly in the AS.
3. Low cost
• The cost of the protocol itself (memory, CPU, network bandwidth) must be minimal.
4. Security
• With the relevant security mechanism, the protocol itself should not be easy to
attack.
5. Universal application
• Must be universally applicable to various topological structures and scales.
Exterior gateway protocols (EGPs)
• These are dynamic routing protocols for exchanging routing and
network reachability information between autonomous systems.
• The internet would not work without EGPs
• They make routing decisions based on paths, network policies or
rules, access control lists, etc.
• Common types of EGPs
1. Exterior gateway protocol (popular until the 80s)
2. Border gateway protocol
Border gateway protocol
• This is currently the most popular protocol used for exchange of
routing information between autonomous systems.
• Current version is called BGP4 (bgp version 4)
• This version has included features such as CIDR and route
aggregation to reduce size of the routing tables.
• All internet service providers must use BGP on their gateway
routers to establish to establish routing with other routers.
• For large ISPs, even internally, they use internal BGP (IBGP)
Border gateway protocol - working
• Every router running BGP is called a BGP speaker
• Neighboring routers are called BGP peers and must be peered by way of
manual configuration.
• Important Commands
1. To enable BGP on a router;
• Type bgp, then as number, e.g. bgp as 100 enables BGP on a router in AS 100
2. To peer two BGP routers
• Type “peer IP address then As #” (peer 1.1.1.1 AS-NUMBER 100) – HUAWEI
• Type “router bgp as number neighbor ip address remote as #” - CISCO
• To maintain the TCP connection, a bgp peer will send a keep alive massage
every 60 seconds.
Research problem – due Monday (31st October,
‘22)
• To make decisions in its operations with peers, a BGP speaker uses a simple
finite state machine involving six states.
• Idle
• Connect
• Active
• Open sent
• Open sent
• Open confirm
• Established
• Question: Use a diagram to explain each of the six states