Lecture 10 - Routing Part III
Lecture 10 - Routing Part III
repared by ur.S.Muralldharan 1
LINK STATE ROUTING LINK STATE ROUTING LINK STATE ROUTING LINK STATE ROUTING
Link state broadcast node learns about the path costs from its
neighbors
Inform the neighbors whenever the link cost changes
hence the name link state
Each router does the following (repeatedly):
discover neighbors, particularly, learn their network
addresses
A router learns about its neighbours by sending a special
HELLO packet to each point-to-point line. Routers on the other
end send a reply.
measure the cost to each neighbor
e.g. by exchanging a series of packets
sending ECHO packets and measuring the average round-trip-
time
construct a link state packets
send this packet to all other routers by flooding
compute locally the shortest path to every other router
when this information is received
Information will be shared when there is a change.
40
Concept of Link State Routing
Cost in Link State Routing
41
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 2
Link State Packet
Flooding of As LSP
42
Link State Database
43
The Dijkstra Algorithm The Dijkstra Algorithm The Dijkstra Algorithm The Dijkstra Algorithm
All the routers applies this algorithm to its link state database for
finding the shortest path between two points on a network using a
graph made up of nodes and arcs.
Nodes are of two types : networks and routers.
Arcs are connections between a router and a network(router to
network and network to router)
Cost is applied only to the arc from router to network.
The cost of the arc from network to router is always zero.
44
Shortest Path Tree
Dijkstra algorithm follows the following four steps what is
called the shortest path tree(routing table) for each router:
The algorithm begins to build the tree by identifying its root. The
root of each routers tree is the router itself. The algorithm then
attaches all nodes that can be reached from that root(neighbor
nodes).
The algorithm compares the trees temporary arcs and identifies
the arc with the lowest cumulative cost. This arc and node to
which it connects are now a permanent part of the shortest path
tree.
The algorithm examines the database and identifies every node
that can be reached from its chosen node.
The last two steps are repeated until every node in the network
has become a permanent part of the tree
45
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 3
46
Example of formation of shortest path tree
47
48
Step 1 Step 3 Step 2
Step 5
Contd.
Step 4
49
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 4
Step 6
Step 7
Step 8
Step 9
Contd
Step 10
Step 11
Step 12
Step 13 51
Link State Routing table for Router A
52
Distance Vector Vs Link State
Distance Vector Protocol :
Entire routing table is sent as an update
Distance vector protocol send periodic update at every 30 or 90 second
Update are broadcasted
Updates are sent to directly connected neighbor only
Routers don't have end to end visibility of entire network.
It is proned to routing loops
Routing loop avoidance Mechanism used are as below :
1) Max Hop Count 2) Split horizon 3) Route poisoning 4) Hold down Timer
Distance vector routing protocol has slow convergence due to periodic update.
Eg. RIP ,IGRP , BGP .
Link state protocol :
Updates are incremental & enitire routing table is not sent as update
Updates are triggered not periodic
Updates are multicasted
Update are sent to entire network & to just directly connected neighbor
Updates are carry SPF tree information & SPF cost Calculation information of entire
topology
Routers have visibility of entire network of that area only.
No routing loops
Convergence is fast because of triggered updates.
Eg. : OSPF , IS-IS
53
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 3
ROUTING Vs ROUTED Protocols
A routing protocol is the communication used
between routers. A routing protocol allows one router
to share information with other routers regarding the
networks it knows about as well as its proximity to
other routers. The information a router gets from
another router, using a routing protocol, is used to
build and maintain a routing table.
Examples of routing protocols are:
Routing Information Protocol (RIP)
Interior Gateway Routing Protocol (IGRP)
Enhanced Interior Gateway Routing Protocol (EIGRP)
Open Shortest Path First (OSPF)
54
A routed protocol is used to direct user traffic. A routed
protocol provides enough information in its network
layer address to allow a packet to be forwarded from
one host to another based on the addressing scheme.
Examples of routed protocols are:
Internet Protocol (IP)
Internetwork Packet Exchange (IPX)
55
56
Routing in the Internet
What would happen if hundreds of millions of routers
execute the same routing algorithm to compute routing
paths through the network?
Scale
large overhead
enormous memory space in the routers
no bandwidth left for data transmission
would DV algorithm converge?
Administrative autonomy
an organization should run and administer its networks as it
wishes but must be able to connect it to the outside networks
57
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 6
Most routers use dynamic routing
Automatically build the routing tables
AS = Autonomous System
An autonomous system (AS) is a collection of networks
under a common administration sharing a common
routing strategy
To the outside world, an AS is viewed as a single entity.
58
The Internet uses hierarchical routing
it is split into Autonomous Systems (AS)
routers at the border: gateways
gateways must run both intra & inter AS routing protocols
routers within AS run the same routing algorithm
the administrator can chose any Interior Gateway Protocol
Routing Information Protocol (RIP)
Open Shortest Path First (OSPF)
between AS gateways use Exterior Gateway Protocol
Border Gateway Protocol (BGP)
59
Routing in an AS
IRP = Interior Routing Protocol
Also IGP ; Interior Gateway Protocol
Passes routing information between routers within AS
Can use routing metric, e.g. hop count or administrative
cost
ERP = Exterior Routing Protocol
Also EGP; Exterior Gateway Protocol
Passes routing information between routers across AS
May be more than one AS in internet
Routing algorithms and tables may differ between
different AS
Finds a path, but cant find an optimal path since it cant
compare routing metrics via multiple AS
60
Application of IRP and ERP
61
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 7
RIP
Routing Information Protocol is an interior routing
protocol used inside an autonomous system. It is a very
simple protocol based on distance vector routing.
OSPF
Open Shortest Path First (OSPF) protocol is another
interior routing protocol that is gaining popularity. OSPF
uses Link State routing to update the routing tables in
an area.
BGP
Border Gateway Protocol(BGP) is an inter-autonomous
system routing protocol. It is based on a routing method
called Path vector routing.
62
Autonomous system
gateways (R1, R2, R3, R4) use both interior & exterior routing
other routers use only interior routing
Note: AS routing protocols in A, B, C & D not need to be the same!
63
network
router
gateway
BGP
BGP
BGP RIP &
OSPF
A B
C
D
H2
H1
The gateways are exit points
routers use default routing
each router knows all netids within AS
packets destined to another AS are sent to the default
router
default router is the border gateway to the next AS
64
Why are Distance Vector Routing & Link State Routing
not good candidates?
route with the smallest hop count not the preferred one
AS not secure
Distance Vector Routing : only a number of hops known
to a destination, not the path to get there
Link State Routing : Internet too big for this routing
method
huge databases
long time to run Dijsktras algorithm
65
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 8
Path Vector Routing
The principle of path vector routing is similar to distance
vector routing
In path vector routing, we assume that there is one node
(in practice there can be more) in each autonomous
system that acts on behalf of the entire autonomous
system. Let us call it the speaker node
The speaker node in an AS creates a routing table and
advertises it to speaker nodes in the neighboring Ass
A speaker node advertises the path, not the metric of the
nodes, in its AS or other ASs
66
Example I:
Initial routing tables in path vector routing
67
Stabilized tables for three autonomous systems
68
Example II
At the beginning, each speaker node can know only the
reachability of nodes inside its autonomous system
69
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 9
A speaker in an AS shares its table with immediate
neighbors.
When a speaker node receives information from a
neighbor, it updates its own table by adding the
nodes that are not in its routing table and adding
its own AS and the AS that sent the table
After a while each speaker has a table and knows
how to reach each node in other ASs
70
Aggregation
The path vector routing protocols normally support
CIDR notation and the aggregation of addresses
Note that a range may also include a block that
may not be in the corresponding AS
However, if this network exists in some other Ass,
it eventually becomes part of the routing table due
to the longest prefix principle
71
Internet inter-AS routing: BGP
BGP (Border Gateway Protocol): the de facto
standard
BGP provides each AS a means to:
1. Obtain subnet reachability information from neighboring
ASs.
2. Propagate reachability information to all AS-internal
routers.
3. Determine good routes to subnets based on
reachability information and policy.
allows subnet to advertise its existence to rest of
Internet: I am here
72
BGP Sessions
The exchange of routing information between 2 routers
using BGP takes place in a session
A session is a connection that is established between 2
BGP routers only for the sake of exchange routing
information
The create a reliable environment, BGP uses the service of
TCP. In other words, a session at the BGP level, as an
application program, is a connection at the TCP level.
When a TCP connection is created for BGP, it can last for a
long time, until something unusual happens.
For this reason, BGP sessions are sometimes referred to
as semi-permanent connections
73
uepL of LLL CS63-CompuLer neLworks
repared by ur.S.Muralldharan 10
Internal and external BGP sessions
BGP can have 2 types of session: external BGP
(E-BGP) and internal BGP (I-BGP) sessions
The E-BGP session is used to exchange
information between 2 speaker nodes belonging to
2 different Ass
The I-BGP session is used to exchange routing
information between 2 routers inside an AS.
74
BGP does not use traditional Interior Gateway Protocol (IGP) metrics,
but makes routing decisions based on path, network policies and/or
rulesets. For this reason, it is more appropriately termed a reachability
protocol rather than routing protocol.
Path Vector Routing
A path: an ordered list of AS that a packet should travel through to
reach the destination
Path information rather than cost information!
AS #s assigned by Internet Corporation for Assigned Names and
Numbers (ICANN) regional registries
75
Network Next Router Path
N01 R01 AS14, AS23, AS67
N02 R05 AS22, AS67, AS05, AS89
N03 R06 AS67, AS89, AS09, AS34
N04 R12 AS62, AS02, AS09
CIDRized
destination
network address
(128.119.40/24)
offers control to the
administrator!