1 routing lesson 10 nets2150/2850 nets2150/ school of information technologies
Post on 19-Dec-2015
214 views
TRANSCRIPT
1
Routing
Lesson 10NETS2150/2850http://www.ug.cs.usyd.edu.au/~nets2150/
School of Information Technologies
2
Lesson Outline• Know the characteristics of unicast routing
protocol• Understand various ways of routing
—Routing Strategies
• Experiment with common routing algorithms—Dijsktra’s Algorithm of OSPF—Bellman-Ford Algorithm of RIP
3
Routing
Graph abstraction for routing algorithms:
• graph nodes are routers
• graph edges are physical links—link cost/weight:
delay, $ cost or congestion level
Goal: find “good” path thru network from source to
destination.
Routing protocol
A
ED
CB
F
• “good” path:—typically means
minimum cost path
4
Routing in Packet Switched Network• Routing protocol establish mutually consistent
routing tables in every router• Characteristics of routing protocol:
—Correctness—Simplicity—Robustness
—Stability—Fairness—Optimality—Efficiency
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
1. Send data 2. Receive data
networkdata linkphysical
Packet switching network
5
Performance Criteria• How to select “best” path?• Used for selection of path
—Minimum hop—Least cost
IP routing table
Destination Gateway Netmask Iface
129.78.8.0 0.0.0.0 255.255.252.0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 lo
0.0.0.0 129.78.11.254 0.0.0.0 eth0
6
Example Packet Switched Network
Link cost
•Shortest path VS•Least-cost path
7
Routing Strategies• Fixed• Flooding• Random• Adaptive
8
Fixed Routing• Single permanent path for each source to
destination pair• Path fixed, at least until a change in
network topology
9
Fixed RoutingTables
Network Topology
10
Flooding• Packet sent by node to every neighbour
and the neighbour sends to its neighbours• Incoming packets retransmitted on every
link except incoming link• Eventually a number of copies will arrive
at destination• Each packet is uniquely numbered so
duplicates can be discarded• To bound the flood, max hop count is
included in the packets
If (Packet’s hop count = = max_hop_count) discard!
11
Flooding Example
12
Properties of Flooding• All possible routes are tried
—Very robust
• At least one packet will have taken minimum hop count or “best” route
• All nodes are visited• The common approach used to distribute
routing information, like a node’s link costs to neighbours
13
Random Routing• Node selects one outgoing path for
retransmission of incoming packet• Selection can be random or round robin• Can select outgoing path based on
probability calculation• Path is typically not “best” one• Used in ‘hot potato routing’
— nodes have no buffer to store packets— packets routed to any path of the lowest
delay
14
Adaptive Routing• Used by almost all packet switching
networks• Routing decisions change as conditions
on the network change—Failure—Congestion
• Requires info about network• Decisions more complex
15
Adaptive Routing - Advantages• Improved performance• Aids congestion control by
exercising load balancing across different alternative paths
• But, it is complex—Reacting too quickly can cause
oscillation—Too slowly, may not be relevant
16
Routing Algorithm classificationGlobal or decentralised information?Global:• all routers have complete topology, link cost info• Known as “link state” algorithms• E.g. Dijkstra’s AlgorithmDecentralised: • router knows physically-connected neighbours,
i.e link costs to neighbours• iterative process of computation, exchange of
info with neighbours• Known as “distance vector” algorithms• E.g. Bellman-Ford Algorithm
17
Routing Algorithms• Given network of nodes connected by bi-
directional links• Each link has a cost in each direction and
may be different• Cost of path between two nodes is sum of
costs of links traversed• For each pair of nodes, find a path with
the least cost
18
Dijkstra’s Algorithm Definitions• Find shortest paths from given source node to all
other nodes, by developing paths in order of increasing path length
• N = set of nodes in the network• s = source node• T = set of nodes so far incorporated by the
algorithm• w(i, j) = link cost from node i to node j
—w(i, i) = 0—w(i, j) = if the two nodes are not directly connected—w(i, j) 0 if the two nodes are directly connected
• L(n) = cost of least-cost path from node s to node n
19
Dijkstra’s Algorithm• Step 1 [Initialization]
—T = {s} Set of nodes so far incorporated consists of only source node
—L(n) = w(s, n) for n ≠ s
• Step 2 [Get Next Node]—Find neighbouring node, x, not in T with least-cost path
from s — Incorporate node x into T
• Step 3 [Update Least-Cost Paths]—L(n) = min[L(n), L(x) + w(x, n)] for all n T
• Algorithm terminates when all nodes have been added to T
20
Dijkstra’s Algorithm Notes• At termination, value L(x) associated with
each node x is cost of least-cost path from s to x.
• One iteration of steps 2 and 3 adds one new node to T—Defines least cost path from s to that node
21
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A}
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A,D}
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A,D,B}
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A,D,B,E}
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A,D,B,E,C}
A
ED
CB
F
2
2
13
2
2
2
53
5
T = {A,D,B,E,C,F}
22
Results of Example Dijkstra’s Algorithm
No
T L(B) Path L(C) Path L(D) Path L(E) Path L(F) Path
1 {A} 2 A–B 5 A-C 1 A–D - -
2 {A,D} 2 A–B 4 A-D-C 1 A–D 3 A-D-E -
3 {A,D,B} 2 A–B 4 A-D-C 1 A–D 3 A-D-E -
4 {A,D,B,E}
2 A–B 4 A-D-C 1 A–D 3 A-D-E 5 A-D-E-F
5 {A,D,B,E,C}
2 A–B 4 A-D-C 1 A–D 3 A-D-E 5 A-D-E-F
6 {A,D,B,E,C,F}
2 A–B 4 A-D-C 1 A–D 3 A-D-E 5 A-D-E-F
23
Bellman-Ford Algorithm Definitions• Find shortest paths from given node considering
at most one hop away• Then, find the shortest paths with a constraint of
paths of at most two hops. Then 3 hops, and so on…
• s = source node• w(i, j) = link cost from node i to node j
—w(i, i) = 0—w(i, j) = if the two nodes are not directly connected—w(i, j) 0 if the two nodes are directly connected
• h = maximum number of hops (links) in path• Lh(n) = cost of least-cost path from s to n, at
most h hops away
24
Bellman-Ford Algorithm• Step 1 [Initialization]
—Lh(s) = 0, for all h
—L0(n) = , for n s
• Step 2 [Update] —For each successive h > 0 and each node n:
• If Lh(n) > minj[Lh(j) + w(j,n)] Then
– Lh+1(n)=minj[Lh(j)+w(j,n)]
• Connect n with predecessor node j that achieves minimum cost
25
A
ED
CB
F
2
2
13
2
2
2
53
5
h = 1
A
ED
CB
F
2
2
13
2
2
2
53
5
h = 2
A
ED
CB
F
2
2
13
2
2
2
53
5
h = 3
A
ED
CB
F
2
2
13
2
2
2
53
5
h = 4
26
Results of Example Bellman-Ford Algorithm
hop
Lh(B) Path
Lh(C) Path Lh(D) Path Lh(E) Path Lh(F) Path
1 2 A–B 5 A-C 1 A–D - -
2 2 A–B 4 A-D-C 1 A–D 3 A-D-E 10 A-C-F
3 2 A–B 4 A-D-C 1 A–D 3 A-D-E 5 A-D-E-F
4 2 A–B 4 A-D-C 1 A–D 3 A-D-E 5 A-D-E-F
27
Algorithms Comparison• Results from two algorithms agree• Information gathered
—Bellman-Ford• Each node can maintain set of costs and paths for every
other node• Only exchange information with direct neighbours• Can update costs and paths based on information from
neighbours and knowledge of link costs• Used as part of the Routing Information Protocol (RIP)
—Dijkstra• Each node needs complete topology• Must know link costs of all links in network• Must exchange information with all other nodes• Used as part of Open Shortest Path First Protocol (OSPF)
28
OSPF Protocol
29
Example: ImageStream’s TransPort™ router
Physical Spec:• 533 MHz VIA C3 processor• 128 MB SDRAM• Runs on Linux• Three onboard 10/100
Ethernet ports• 1 or 2 T1/E1 ports
Software spec:• PPP, Cisco HDLC &
frame relay• ATM• PPPoE & PPPoA• Routing procotols:
—RIP, RIP II, OSPF, IS-IS & BGP4
30
Summary• Routing is the process of finding a path
from a source to every destination in the network
• Different routing strategies available• Common adaptive routing:
—Dijsktra’s algorithm—Bellman-Ford algorithm
• Read Stallings Section 12.2 and 12.3• Next: Functions of internetwork layer
protocol