0% found this document useful (0 votes)
172 views40 pages

Net Routing 1

This document summarizes routing algorithms and protocols used on the internet. It discusses two main types of routing algorithms - link state and distance vector. For link state algorithms, it provides an overview of Dijkstra's algorithm, which is used to calculate the shortest path between nodes in a graph. It also discusses how link state routing protocols work by reliably flooding link state packets to all routers to share topology and cost information. For distance vector algorithms, it describes how each router iteratively shares its routing table with neighbors and calculates the best paths based on the information received. It discusses how distance vector protocols can experience slow convergence or even routing loops when link costs change. Techniques like poison reverse are used to address this.

Uploaded by

Fariya Meraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views40 pages

Net Routing 1

This document summarizes routing algorithms and protocols used on the internet. It discusses two main types of routing algorithms - link state and distance vector. For link state algorithms, it provides an overview of Dijkstra's algorithm, which is used to calculate the shortest path between nodes in a graph. It also discusses how link state routing protocols work by reliably flooding link state packets to all routers to share topology and cost information. For distance vector algorithms, it describes how each router iteratively shares its routing table with neighbors and calculates the best paths based on the information received. It discusses how distance vector protocols can experience slow convergence or even routing loops when link costs change. Techniques like poison reverse are used to address this.

Uploaded by

Fariya Meraj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Internet Protocol: Routing Algorithms

Srinidhi Varadarajan
Routing
Routing protocol
Goal: determine “good” path 5
(sequence of routers) thru 3
network from source to dest. B C 5
2
A 2 1 F
3
Graph abstraction for 1 2
D E
routing algorithms: 1
z graph nodes are
routers z “good” path:
z graph edges are – typically means
physical links minimum cost path
– link cost: delay, $ cost,
or congestion level
– other def’s possible
Routing Algorithm classification
Global or decentralized Static or dynamic?
information?
Global:
Static:
z all routers have complete z routes change slowly
topology, link cost info over time
z “link state” algorithms
Dynamic:
Decentralized:
z router knows physically- z routes change more
connected neighbors, link quickly
costs to neighbors
– periodic update
z iterative process of
computation, exchange of – in response to link
info with neighbors cost changes
z “distance vector”
algorithms
A Link-State Routing Algorithm
Dijkstra’s algorithm Notation:
z net topology, link costs z c(i,j): link cost from node i
known to all nodes to j. cost infinite if not
– accomplished via “link direct neighbors
state broadcast”
z D(v): current value of cost
– all nodes have same of path from source to
info dest. V
z computes least cost paths
from one node (‘source”) z p(v): predecessor node
to all other nodes along path from source to
v, that is next v
– gives routing table for
that node z N: set of nodes whose
z iterative: after k iterations, least cost path definitively
know least cost path to k known
dest.’s
Dijsktra’s Algorithm
1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 then D(v) = c(A,v)
6 else D(v) = infty
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N
Dijkstra’s algorithm: example
Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

5
3
B C 5
2
A 2 1 F
3
1 2
D E
1
Dijkstra’s algorithm, discussion
Algorithm computational complexity: n nodes
z each iteration: need to check all nodes, w, not in N
z n*(n+1)/2 comparisons: O(n2)
z more efficient implementations possible:
– O(nlogn): Use a heap (sorted) to maintain interim table
Oscillations possible:
z e.g., link cost = amount of carried traffic

1 A A A A
1+e 2+e 0 0 2+e 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing
Link State: Reliable Flooding
z Link State routers exchange information using
Link State Packets (LSP).
z LSP contains
– id of the node that created the LSP
– cost of the link to each directly connected neighbor
– sequence number (SEQNO)
– time-to-live (TTL) for this packet
z Reliable flooding
– store most recent LSP from each node
– forward LSP to all nodes but one that sent it
– generate new LSP periodically
• increment SEQNO
– start SEQNO at 0 when reboot
– decrement TTL of each stored LSP
• discard when TTL=0
Distance Vector Routing Algorithm
iterative:
z continues until no Distance Table data structure
nodes exchange info. z each node has its own
z self-terminating: no z row for each possible
“signal” to stop destination
asynchronous: z column for each directly-
z nodes need not attached neighbor to node
exchange info/iterate
in lock step!
distributed:
z each node
communicates only
with directly-attached
neighbors
Distance Table: example

B 1 C E
cost to destination via
7 D () A B D
A 8 2
1 A 1 14 5
E D
2
B 7 8 5

destination
E D
D (C,D) = c(E,D) + minw {D (C,w)}
= 2+2 = 4 C 6 9 4
E D
D (A,D) = c(E,D) + min {D (A,w)}
w D 4 11 2
= 2+3 = 5 loop!
E B
D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14
loop!
Distance table gives routing table
cost to destination via
E Outgoing link
D () A B D to use, cost

A 1 14 5 A A,1

B 7 8 5
destination

B D,5

destination
C 6 9 4 C D,4

D 4 11 2 D D,4

Distance table Routing table


Distance Vector Routing: overview
Iterative, asynchronous: Each node:
each local iteration caused
by:
z local link cost change wait for (change in local link
z message from neighbor: cost of msg from neighbor)
its least cost path change
from neighbor
Distributed:
recompute distance table
z each node notifies
neighbors only when its
least cost path to any
destination changes if least cost path to any dest
– neighbors then notify has changed, notify
their neighbors if neighbors
necessary
Distance Vector: link cost changes
Link cost changes:
1
z node detects local link cost change Y
4 1
z updates distance table (line 15)
X Z
z if cost change in least cost path, 50
notify neighbors (lines 23,24)

“good algorithm
news terminates

travels
fast”
Distance Vector: link cost changes
Link cost changes:
60
z good news travels fast Y
z bad news travels slow - 4 1
“count to infinity” X Z
50
problem!

algorithm
continues
on!
Distance Vector: poisoned reverse
If Z routes through Y to get to X : 60
Y
z Z tells Y its (Z’s) distance to X is 4 1
infinite (so Y won’t route to X via Z) X Z
50
z Does not work on larger loops

algorithm
terminates
Comparison of LS and DV algorithms
Message complexity Robustness: what happens if
z LS: with n nodes, with an router malfunctions?
average of l links/node, each LS:
node sends O(nl). Total – node can advertise
messages O(n2l) incorrect link cost
z DV: exchange between – each node computes only
its own table
neighbors only
DV:
– convergence time varies
– DV node can advertise
– may be routing loops incorrect path cost
– count-to-infinity problem – each node’s table used by
others
• error propagate thru
network
Hierarchical Routing
Our routing study thus far -idealization
z all routers identical
z network “flat”
… not true in practice

scale: with 50 million administrative autonomy


destinations: z internet = network of
networks
z can’t store all dest’s in
routing tables! z each network admin may
z routing table exchange want to control routing in its
would swamp links! own network
Hierarchical Routing
z aggregate routers into gateway routers
regions, “autonomous z special routers in AS
systems” (AS) z run intra-AS routing
z routers in same AS protocol with all other
routers in AS
run same routing
z also responsible for
protocol routing to destinations
– “intra-AS” routing outside AS
protocol
– run inter-AS routing
– routers in different AS protocol with other
can run different intra- gateway routers
AS routing protocol
Why different Intra- and Inter-AS routing ?

Policy:
z Inter-AS: admin wants control over how its traffic is
routed and who routes through its net.
z Intra-AS: single admin, so no policy decisions
needed
Scale:
z hierarchical routing saves table size, reduced update
traffic
Performance:
z Intra-AS: can focus on performance
z Inter-AS: policy may dominate over performance
Intra-AS and Inter-AS routing
C.b Gateways:
B.a
•perform inter-AS
A.a routing amongst
b A.c c themselves
a C a
b •perform intra-AS
a B
routers with other
d c routers in their
A b
AS

network layer
inter-AS, intra-AS link layer
routing in
gateway A.c physical layer
Intra-AS and Inter-AS routing

Inter-AS
C.b routing
between B.a
A.a A and B Host
b A.c c h2
a C a
b
a B
Host d c Intra-AS routing
h1 b
A within AS B
Intra-AS routing
within AS A
Routing in the Internet
z The Global Internet consists of Autonomous
Systems (AS) interconnected with each
other:
– Stub AS: small corporation
– Multihomed AS: large corporation (no transit)
– Transit AS: provider

z Two-level routing:
– Intra-AS: administrator is responsible for choice
– Inter-AS: unique standard
Internet AS Hierarchy
Intra-AS border (exterior gateway) routers

Inter-AS interior (gateway) routers


Intra-AS Routing

z Also known as Interior Gateway Protocols


(IGP)
z Most common IGPs:

– RIP: Routing Information Protocol


– OSPF: Open Shortest Path First

– IGRP: Interior Gateway Routing


Protocol (Cisco proprietary.)
RIP ( Routing Information Protocol)

z Distance vector algorithm


z Included in BSD-UNIX Distribution in 1982
z Distance metric: # of hops (max = 15 hops)
– Can you guess why?

z Distance vectors: exchanged every 30 sec


via Response Message (also called
advertisement)
z Each advertisement: routes for up to 25
destination nets
RIP (Routing Information Protocol)
z
w x y
A D B

C
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B 7
x -- 1
…. …. ....
Routing table in D
RIP: Link Failure and 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
– poison reverse used to prevent ping-pong
loops (infinite distance = 16 hops)
RIP Table processing

z RIP routing tables managed by application-


level process called routed (daemon)
z advertisements sent in UDP packets,
periodically repeated
RIP Table example (continued)
Router: giroflee.eurocom.fr

Destination Gateway Flags Ref Use Interface


-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1 127.0.0.1 UH 0 26492 lo0
192.168.2. 192.168.2.5 U 2 13 fa0
193.55.114. 193.55.114.6 U 3 58503 le0
192.168.3. 192.168.3.5 U 2 25 qaa0
224.0.0.0 193.55.114.6 U 3 0 le0
default 193.55.114.129 UG 0 143454

z Three attached class C networks (LANs)


z Router only knows routes to attached LANs
z Default router used to “go up”
z Route multicast address: 224.0.0.0
z Loopback interface (for debugging)
OSPF (Open Shortest Path First)
z “open”: publicly available
z Uses Link State algorithm
– LS packet dissemination
– Topology map at each node
– Route computation using Dijkstra’s algorithm
z OSPF advertisement carries one entry per
neighbor router
z Advertisements disseminated to entire AS
(via flooding)
OSPF “advanced” features (not in RIP)

z Security: all OSPF messages authenticated


(to prevent malicious intrusion); TCP
connections used
z Multiple same-cost paths allowed (only one
path in RIP)
z For each link, multiple cost metrics for
different TOS (eg, satellite link cost set “low”
for best effort; high for real time)
z Integrated uni- and multicast support:
– Multicast OSPF (MOSPF) uses same topology
data base as OSPF
z Hierarchical OSPF in large domains.
Hierarchical OSPF
Hierarchical OSPF
z 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.
z Area border routers: “summarize” distances
to nets in own area, advertise to other Area
Border routers.
z Backbone routers: run OSPF routing limited to
backbone.
z Boundary routers: connect to other ASs.
IGRP (Interior Gateway Routing Protocol)

z CISCO proprietary; successor of RIP (mid 80s)


z Distance Vector, like RIP
– Hold time
– Split Horizon
– Poison Reverse
z several cost metrics (delay, bandwidth, reliability,
load etc)
z uses TCP to exchange routing updates
z EIGRP (Garcia-Luna): Loop-free routing via
Distributed Updating Algorithm. (DUAL) based on
diffused computation
– Uses a mix of link-state and distance vector
Inter-AS routing
Internet inter-AS routing: BGP

z BGP (Border Gateway Protocol): the de facto


standard
z Path Vector protocol:
– similar to Distance Vector protocol
– each Border Gateway broadcast to neighbors
(peers) entire path (I.e, sequence of ASs) to
destination
– E.g., Gateway X may send its path to dest. Z:

Path (X,Z) = X,Y1,Y2,Y3,…,Z


Internet inter-AS routing: BGP
Suppose: gateway X send its path to peer
gateway W
z W may or may not select path offered by X
– cost, policy (don’t route via competitors
AS), loop prevention reasons.
z If W selects path advertised by X, then:
Path (W,Z) = w, Path (X,Z)
z Note: X can control incoming traffic by
controlling it route advertisements to peers:
– e.g., don’t want to route traffic to Z -> don’t
advertise any routes to Z
Internet inter-AS routing: BGP
z BGP messages exchanged using TCP.
z BGP messages:
– OPEN: opens TCP connection to peer and
authenticates sender
– UPDATE: advertises new path (or
withdraws old)
– KEEPALIVE keeps connection alive in
absence of UPDATES; also ACKs OPEN
request
– NOTIFICATION: reports errors in previous
msg; also used to close connection
Other Routing Techniques

z Hot-Potato Routing a.k.a Deflection


Routing
– Use the first available link irrespective of
whether it leads to the destination or not.
z Cut Through routing
– Non-store and forward: Routes before entire
packet is received at the router.
– Outgoing link is reserved. What happens if a
fast links succeeds a slow link?
Reading

z Recommended
– End-To-End Routing Behavior in the Internet,
V. Paxson, SIGCOMM 1996.
ftp://ftp.ee.lbl.gov/papers/routing.SIGCOMM.ps
.Z

– Persistent Route Oscillations in Inter-Domain


Routing, K. Varadhan, R. Govindan, D. Estrin,
ftp://ftp.isi.edu/ra/Publications/bgp_osc.ps.gz

You might also like