Routing Table
IP destination address in
arriving packet’s header
1
3 2
Routing Algorithm Classification
All routers have complete
topology, link cost info
Global
Link state
algorithms
Global or
Router knows physically-
Decentralized connected neighbors, link
information costs to neighbors
Iterative process of
Decentralized computation, exchange of
info with neighbors
Classification Distance vector
algorithms
Routes change
Static slowly over time
Static or Periodic
Dynamic update
Routes change
Dynamic more quickly
In response to
link cost
changes
Routing in the Global Internet
A route propagation protocol allows one router to
exchange routing information with another
All routers
within a
group
exchange
routing
information
Routing in the Global Internet
The designers of the Internet routing system did not
dictate an exact size nor did they specify an exact data
representation or protocol
Instead, the designers purposefully kept the architecture
flexible enough to handle a wide variety of organizations
Autonomous System
Collection of networks/routers
Metrics
Reliability Load:
: probability traffic
of a link utilization
failure Delay: on a link
time for a
packet to
traverse a
path
Path Determination
The process of how the router determines which path to
use when forwarding a packet
Directly connected
• Forwarded directly
to the destination
Graph: G = (N,E)
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Cost of path (x1, x2, x3,…, xp) = c(x1, x2) + c(x2, x3) + … + c(xp-1, xp)
Advantages Disadvantages
• Minimal CPU • Configuration and
processing maintenance is time
• Easy to configure consuming
• Easier for administrator • Does not scale well with
to understand growing networks
• Requires complete
knowledge of the whole
network for proper
implementation
Outline
Router Fundamentals
Static Routing
Dynamic Routing Protocol
Internet Routing Protocols
Border Gateway Protocol (BGP)
RIP and RIPv2
OSPF (Open Shortest Path First) Routing Protocol
Hybrid Protocols –EIGRP (Enhanced Interior Gateway
Routing Protocol)
Dynamic Routing
Added to routing table by using a dynamic routing
protocol
It continually
checks for
network
failures that
cause routes
to change
Dynamic Routing
Advantages Disadvantages
• Less administrative • Router resources are
overhead when adding used (CPU cycles,
or deleting a network memory and link
• Protocols automatically bandwidth)
react to the topology • More administrator
changes knowledge is required
• More scalable for configuration,
verification and
troubleshooting
Outline
Router Fundamentals
Static Routing
Dynamic Routing Protocol
Internet Routing Protocols
Border Gateway Protocol (BGP)
RIP and RIPv2
OSPF (Open Shortest Path First) Routing Protocol
Hybrid Protocols –EIGRP (Enhanced Interior Gateway
Routing Protocol)
Internet Routing Protocols
Routing protocols can be classified into different groups
according to their characteristics
Interior Gateway Protocols (IGP)
Used by the routers within AS to exchange routing information
It is easy to install and operate
May limit the size/routing complexity of AS
Distance vector
• Determines the direction
and distance to any link
in the internetwork
Classes
of IGP Link-state
• Recreates the exact
topology of the entire
internetwork
Link State Routing Protocol
Complex
database of
topology
More information
Knowledge
memory
of the
and
entire
processor
network
overhead
Features
Uses SPF
Fast to
Convergence calculate
Updates the best
when path
changes in
the
topology
occurs
A Link-State Routing Algorithm
Dijkstra’s algorithm
Network topology, link costs Notations
known to all nodes
c(x,y): link cost from node x to
Accomplished via “link state y; = ∞ if not direct neighbors
broadcast”
All nodes have same info D(v): current value of cost of
Computes least cost paths path from source to destination v
from one node (source) to all
other nodes p(v): predecessor node along
Gives forwarding table for that
path from source to v
node
Iterative: After k iterations,
N': set of nodes whose least cost
path definitively known
know least cost path to k’s
destination
Dijsktra’s Algorithm
Dijsktra’s Algorithm Example
Notes:
❖ construct shortest path tree by
tracing predecessor nodes
❖ ties can exist (can be broken
arbitrarily)
Dijsktra’s Algorithm Example
Dijsktra’s Algorithm Example
Steps N’
0
1
2
3
4
5
Steps N’
0
1
2
3
4
5
6
7
Distance Vector Routing Protocol
Periodic
updates
Distance is
defined in
Slow
terms of a
convergence
metric, such
as hop count
Features
Add Routing
distances table from
before directly
passing it connected
to other neighbor
neighbors routers
Distance Vector Algorithm
let
𝑑𝑥(𝑦) = 𝑐𝑜𝑠𝑡 𝑜𝑓 𝑙𝑒𝑎𝑠𝑡 − 𝑐𝑜𝑠𝑡 𝑝𝑎𝑡ℎ 𝑓𝑟𝑜𝑚 𝑥 𝑡𝑜 𝑦
then
𝑑𝑥 (𝑦) = min𝑣 {𝑐(𝑥, 𝑣) + 𝑑𝑣 (𝑦)
Node achieving minimum is next hop in shortest path, used in forwarding table
Distance Vector Algorithm
𝐷𝑥 (𝑦) = estimate of least cost from x to y
x maintains distance vector 𝑫𝑥 = [𝐷𝑥 𝑦 : y ∈ 𝑁]
Node x:
Knows cost to each neighbor v: c(x,v)
Maintains its neighbors’ distance vectors. For each neighbor v, x
maintains 𝑫𝑦 = [𝐷𝑦 𝑦 : y ∈ 𝑁]
Distance Vector Algorithm
Distributed
Each node notifies neighbors Recompute
estimates
only when its DV changes
Neighbors then notify their
neighbors if necessary
𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑧 ,
𝐷𝑥 𝑧 = min
𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑧
= min 2 + 1, 7 + 0 = 3
𝑐 𝑥, 𝑦 + 𝐷𝑦 𝑦 ,
𝐷𝑥 𝑦 = min
𝑐 𝑥, 𝑧 + 𝐷𝑧 𝑦
= min 2 + 0, 7 + 1 = 2
Distance Vector: Link Cost Changes
Link cost changes:
✓ Node detects local link cost
change
✓ Updates routing info, recalculates
distance vector
✓ If DV changes, notify neighbors
Example
t0 : y detects link-cost change, updates its DV, informs its
neighbors.
t1 : z receives update from y, updates its table, computes new
least cost to x , sends its neighbors its DV.
t2 : y receives z’s update, updates its distance table. y’s least costs do not
change, so y does not send a message to z.
Distance Vector: Link Cost Changes
Link cost changes:
‼ Node detects local link cost change
‼ Bad news travels slow
‼ 44 iterations before algorithm
stabilizes
Poisoned Reverse:
t0 : y detects link-cost change, updates its DV, informs its neighbors
and continue to directly to x, with Dz(x) is set to infinity
t1 : z receives update from y, updates its table, computes new least cost
to x , shift to direct route to x , updates its neighbors its DV
t2 : y receives z’s update, updates its distance table. y’s least costs
changes and redirect through z
t3 : y sends update to neighbors saying Dy(x) is infinity
Comparison of LS and DV Algorithms
LS: with n nodes, E DV: exchange between
links, O(nE) neighbors only
messages needed to
be sent • convergence time varies
Message
DV: Complexity
• DV node can advertise
incorrect path cost
• each node’s table used by LS: O(n2) algorithm
others requires O(nE)
• error propagate thru messages
network
LS vs • may have oscillations
DV
Robustness:
what happens if
router Speed Of
malfunctions? Convergence
Reliable transport
When router learns of new prefix, it creates entry for prefix in its
forwarding table.
Path Attributes and BGP routes
Gateway router
Advertised prefix receiving route
Two important
includes BGP advertisement
attributes:
attributes uses import policy
to accept/decline
OPEN: opens
UPDATE:
TCP connection
advertises new
to peer and
path (or
authenticates
withdraws old)
sender
BGP messages:
KEEPALIVE:
NOTIFICATION:
keeps
reports errors in
connection alive
previous
in absence of
message; also
UPDATES; also
used to close
ACKs OPEN
connection
request
How Does an Entry Get Into a Router’s
Forwarding Table?
Router becomes
Enter prefix-port aware of prefix
entry in • via BGP route
forwarding table advertisements
from other
routers
❖ A advertises path AW to B
❖ B advertises path BAW to X
When a
message
arrived, if the
receiver does
Each Each entry in not have a
outgoing a RIP route to an
RIP software
message advertisemen advertised
uses the list of
contains an t consists of a destination
destinations
advertisemen
to update the pair OR if an
t that lists the
local (destination advertised
networks the
forwarding network, destination is
sender can
table when an distance) shorter than
reach along • distance is the the distance
advertisemen
with a number of of current
t is received
distance to hops to the route, the
each destination receiver
replaces its
route with a
route to the
sender
RIP (Routing Information Protocol)
Included in BSD-UNIX distribution in 1982
Distance vector algorithm
Distance metric: # hops (max = 15 hops), each link has cost 1
DVs exchanged with neighbors every 30 sec in response message (aka
advertisement)
Each advertisement: list of up to 25 destination subnets (in IP addressing
sense)
A 5
RIP: Link Failure, Recovery
If no advertisement heard after 180 sec →
Neighbor/link declared dead
▪ Routes via neighbor invalidated
▪ New advertisements sent to neighbors
▪ Neighbors in turn send out new advertisements (if tables
changed)
▪ Link failure info quickly propagates to entire net
RIP Table Processing
RIP routing tables managed by application-level process called
route-d (daemon)
Advertisements sent in UDP packets, periodically repeated
Advantages
The chief advantage is simplicity
Requires little configuration
A manager merely starts RIP running on each router in the
organization and allows the routers to broadcast message to
one another
Multiple same-cost
Hierarchical paths allowed
OSPF in large
• Only one path in RIP
domains.
Boundary Router
Backbone Router
Backbone
Area
Border
Routers
Area 3
Internal
Routers
Area 1
Area 2
Hierarchical OSPF
Two-level hierarchy: local area, backbone.
Link-state advertisements only in area
Each nodes has detailed area topology; only know direction
(shortest path) to nets in other areas.
EIGRP must
provide:
Router Fundamentals
You should be able to •
Static Routing
Explain on the fundamentals in routing within a •