Lecture 17 (Dijkstra)
Lecture 17 (Dijkstra)
Lecture-17
What is routing
Network layer must know the topology of the subnet, it must take care to
choose routes to avoid overloading
Network layer – Connectionless Services
VC subnet avoids choosing new routes for every packet but use the
same route stored in router tables
Call Setup, Teardown for each call before data can flow
Each Packet carries VC identifier (not destination host address)
Every router on source-destination path maintains “state” for each passing
connection
Link, Router Resources (bandwidth, buffers) may be allocated to VC
Virtual Circuits (Signaling Protocols)
The algorithms that manages the routing tables and makes routing decisions is
called routing algorithm
Routing algorithm is the main topic of interest in network layer design (more
about routing will follow on coming slides)
Routing….. 5
3
“good” path: B C 5
2
typically means minimum cost path A 2
3
1 F
link “cost” : 1 2
D E
Weight on a graph edge reflect “cost” of traversing the “link” 1
delay,
NOTE:
£, cost,
Resulting shortest path
Hop count (weight = 1)
may not have fewest hops.
Throughput (utilization)
or congestion level
Types of Routing Algorithms
Next-Hop Routing
The routing table holds only the address of the next hop instead of holding info
about the complete route.
A technique to reduce the routing table
Network-Specific Routing
Insteadof having an entry for every host connected to the same physical
network, only one entry is used to give the network address.
Another way to reducing the routing table.
Routing Methods…..
Host-Specific Routing
The destination host address is given in the routing table.
Useful when the administrator wants to have more control over the routing to a
particular host.
Default Routing
A routing method in which a router is assigned to receive all packets with no
match in the routing table.
Next-Hop Routing
Routing Metric
Used to decide the cost value associated with each link,
can be based on a number of functions – bandwidth, distance etc.,
Capacity, Delay, Expense and Error Rate are examples of routing metrics.
Hops
Every time a packet is received by a router (on the route to the destination), this is known as a
hop
Hop Count
the total number of hops a packet needs to make before arriving at its destination.
Pre-requisite - Terms and definitions …..
Optimality Principle
R1 R2 R3
If router R2 is on the optimal path from router R1 to router R3, the optimal path
from R2 to R3 also falls along the same route.
Next Hop Routing
Given the Optimality principle, a router need only know the next router to
transmit to, and need not necessarily have a global view of the network
Shortest Path Routing
Disadvantages:
Static routes require considerable amount of coordination and maintenance in
non-trivial network environments
Static routes can not dynamically adapt to the current operational state of
network
Dijkstra Algorithm
3
B C
2 5
A 2 1 F
3
1
2
D E
1
Dijkstra’s Algorithm: an 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
Distance Vector Routing
Itallows each device in the network to automatically build and maintain a local
IP routing table
Eachrouter in the internetwork maintains a distance or cost from itself to every
known destination, this value represents the overall desirability of the path
The path represented by the smallest cost becomes the preferred path to reach
destination.
The information is maintained in a distance vector table, which is periodically
advertised to each neighbouring router
Distance Vector Routing…..
When a node is first turned on, it constructs its initial distance table (see below
for how to construct) and then transmits the table to its neighbours.
On receipt of a packet containing the distance table from a neighbour, a node
compares the entries in this table with their own. If an entry contains a lower
cost, it adds the new entry to its table.
In this way, the entries are updated and created across the network.
Thisrouting algorithm is known with these names: Bellman-Ford, Ford-
Fulkerson
Distance Vector Routing…..
Distance Table data structure:
Each node has its own distance table
Each row for each possible destination
Each column for each directly-attached neighbor to node
example: in node X, for destination Y via neighbor Z
distance from X to
X = Y, via Z as next hop
D (Y,Z)
Z
= c(X,Z) + minw{D (Y,w)}
Link State Routing
Each router identifies all other routing devices on the directly connected
networks
Each router advertises a list of all directly connected network links and
associated cost of each link through exchange of link state advertisements
(LSAs)
Using LSAs, each router creates a database detailing the current topology
Link State Routing….
Link State Routing….
Link State Routing….
The name path vector routing –because a route is defined as a pairing between a
destination and the attributes of the path to that destination (routers receive a
vector that contains paths to a set of destinations)
Recommended Reading
1. Chapters 6 and 13 of Forouzan’s Book (Behrouz A. Forouzan, TCP/IP Protocol Suite, 2/e,
McGraw Hall).
2. Sections 5.2 (5.2.1-5.2.7) and 5.6 (5.6.4-5.6.5) of Tanenbaum’s Book (Andrew S.
Tanenbaum, Computer Networks, 4/e, Prentice Hall, 2003, ISBN 0-13-038488-7)
3. Sections 4.2, 4.3 and 4.5 of Kurose’s Book (James F. Kurose, Keith W. Ross, Computer
Networking, 2/e, Addison-Wesley, ISBN 0-201-97699-4).
4. Sections 9.4, 10.2, 16.1 and Apendix 10A of Stallings’ book (William Stallings, Data &
Computer Communications, 6/e, Prentice Hall, 2000. ISBN: 0-13-084370-9).
5. Chapters 13 and 25 of Comer’s book (Douglas E. Comer, Computer Networks and
Internets with Internet Applications, 3/e, Prentice Hall, 2001, ISBN 0-13-091449-5).