cmm based software quality management - nju.edu.cn
TRANSCRIPT
1
第12章 交换网络中的路由选择
南京大学计算机系 黄皓教授
2007年9月30日星期五
南京大学计算机系讲义 2
12.1 Routing in Circuit Switched Network
Many connections will need paths through more than one switchNeed to find a route
EfficiencyResilience
Static routingPublic telephone switches are a tree structureStatic routing uses the same approach all the time
Dynamic routing allows for changes in routing depending on traffic
Uses a peer structure for nodes
南京大学计算机系讲义 3
Alternate Routing
Possible routes between end offices predefined
Originating switch selects appropriate route
Routes listed in preference order
Different sets of routes may be used at different times
南京大学计算机系讲义 4
AlternateRoutingDiagram
南京大学计算机系讲义 5
12.2 Routing in Packet Switched Network
Complex, crucial aspect of packet switched networksCharacteristics required
CorrectnessSimplicityRobustnessStabilityFairnessOptimalityEfficiency
南京大学计算机系讲义 6
Example Packet Switched Network
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 7 7
12.2.1 Elements of RoutingPerformance criteriaDecision timeDecision placeNetwork info sourceNetwork info update timing
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 8 8
Performance CriteriaMinimum hop
e.g. 1–3–6
Least coste.g. 1–4–5–6
OthersMinimum delayLargest throughput
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 9
Decision Time and Place
TimePacket virtual circuit
PlaceDistributed
Made by each nodeCentralizedSource
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 10
Network Information Source and Update Timing
Routing decisions usually based on knowledge of network (not always)
Distributed routingNodes use local knowledgeMay collect info from adjacent nodesMay collect info from all nodes on a potential route
Central routingCollect info from all nodes
Update timingWhen is network info held by nodes updatedFixed - never updatedAdaptive - regular updates
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 11 11
Conclusion of Routing Elements
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 12
12.2.2 Routing Strategies
FixedFloodingRandomAdaptive
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 13
(1) Fixed Routing
Single permanent route for each source to destination pairDetermine routes using a least cost algorithm Route fixed, at least until a change in network topology
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 14
(1) Fixed Routing tables
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 15
(2) Flooding
No network info requiredPacket sent by node to every neighbor
Incoming packets retransmitted on every link except incoming linkEventually a number of copies will arrive at destinationEach packet is uniquely numbered so duplicates can be discardedNodes can remember packets already forwarded to keep network load in boundsCan include a hop count in packets
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 16 16
(2) Flooding Example
Hop count = 3Initial
3 packets1st hop
9 packets2nd hop
23 packets
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 17 17
(2) Properties of FloodingAll possible routes are tried
Very robust
At least one packet will have taken minimum hop count route
Can be used to set up virtual circuit
All nodes are visitedUseful to distribute information (e.g. routing)
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 18
(3) Random Routing
Node selects one outgoing path for retransmission of incoming packetSelection can be random or round robinCan select outgoing path based on probability calculationNo network info neededRoute is typically not least cost nor minimum hop
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 19 19
(3) Random Routing
Assign Probabilities
Pi = Ri / ΣjRjPi – Probability of selecting out-link iRi – Cost factor of link i
Possible cost factorTransmission rate – for throughputQueue size – for delay
Partly used in adaptive routing
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 20
Adaptive Routing
Used by almost all packet switching networksRouting decisions change as conditions on the network change
FailureCongestion
Requires info about networkDecisions more complexTradeoff between quality of network info and overheadReacting too quickly can cause oscillationToo slowly to be relevant
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 21
Adaptive Routing - Advantages
Improved performanceAid congestion control Complex system
May not realize theoretical benefits
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 22
Classification
Based on information sourcesLocal (isolated)
Route to outgoing link with shortest queueCan include bias for each destinationRarely used - do not make use of easily available info
Adjacent nodesAll nodes
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 23
Isolated Adaptive Routing
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 24
12.3 Least Cost AlgorithmsGiven network of nodes connected by bi-directional links
Each link has a cost in each directionEach link cost 1 – minimum hop countLink cost inversely proportional to capacity – maximum throughput
Link costs in different directions may be differente.g. length of packet queue
Define cost of path between two nodes as sum of costs of links traversed
For each pair of nodes, find a path with the least cost
Chapter 12 Routing
南京大学计算机系讲义 25
2 Algorithms in Adaptive RoutingDijkstra's AlgorithmBellman-Ford Algorithm
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 26
Dijkstra's AlgorithmFind shortest paths from given source to all other nodes
Developing paths in order of increasing path cost (length)N = set of nodes in the networks = source nodeT = set of nodes so far incorporated by the algorithmw(i, j) = link cost from node i to node j
w(i, i) = 0w(i, j) = ∞ if the two nodes are not directly connectedw(i, j) ≥ 0 if the two nodes are directly connected
L(n) = cost of least-cost path from node s to node n currently knownAt termination, L(n) is cost of least-cost path from s to n
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 27
Dijkstra's Algorithm MethodStep 1 [Initialization]
T = {s} Set of nodes so far incorporated consists of only source nodeL(n) = w(s, n) for n ≠ sInitial path costs to neighboring nodes are simply link costs
Step 2 [Get Next Node]Find node x not in T with least-cost path from s (i.e. min L(x))Incorporate node x into TAlso incorporate the edge that links x with the node in T that contributes to the path
Step 3 [Update Least-Cost Paths]L(n) = min[L(n), L(x) + w(x, n)] for all n ∉ TIf latter term is minimum, path from s to n is path from s to x concatenated with link from x to n
Algorithm terminates when all nodes have been added to T
s x. .
...
...T
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 28
Dijkstra's Algorithm NotesOne iteration of steps 2 and 3 adds one new node to T
Defines least cost path from s to that node
At termination, value L(n) associated with each node n is the cost (length) of least-cost path from s to nIn addition, T defines the least-cost path from s to each other node
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 29
Example of Dijkstra's Algorithm
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 30
Results of Example Dijkstra’s AlgorithmNo T L(2) Path L(3) Path L(4) Path L(5) Path L(6) Path
1 {1} 2 1-2 5 1-3 1 1-4 ∞ – ∞ –
2 {1,4} 2 1-2 4 1-4-3 1 1-4 2 1-4-5 ∞ –
3 {1, 2, 4} 2 1-2 4 1-4-3 1 1-4 2 1-4-5 ∞ –
4 {1, 2, 4, 5} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
5 {1, 2, 3, 4, 5} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
6 {1, 2, 3, 4, 5, 6} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
Destination Next-Hop Distance
2 2 2
3 4 3
4 4 1
5 4 2
6 4 4
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 31
Bellman-Ford Algorithm DefinitionsFind shortest paths from given node containing at most 1 linkFind the shortest paths that containing at most 2 links, based on the result of 1 linkFind the shortest paths of 3 links based on result of 2 links, and so ons = source nodew(i, j) = link cost from node i to node j
w(i, i) = 0w(i, j) = ∞ if the two nodes are not directly connectedw(i, j) ≥ 0 if the two nodes are directly connected
h = maximum number of links in path at current stage of the algorithmLh(n) = cost of least-cost path from s to n under constraint of no more than h links
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 32
Bellman-Ford Algorithm MethodStep 1 [Initialization]
L0(n) = ∞, for all n ≠ sL1(n) = w(s, n)Lh(s) = 0, for all h
Step 2 [Update]For each successive h ≥ 0
For each n ≠ s, compute Lh+1(n) = minj[Lh(j)+w(j,n)]Connect n with predecessor node j that achieves minimum
Eliminate any connection of n with different predecessor formed during earlier iterations
Path from s to n terminates with link from j to n
Repeat until no change made to route (convergence)
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 33
Bellman-Ford Algorithm NotesFor each iteration with h=K and for each destination node n
Compares newly computed paths from s to n of length K with path from previous iteration
If previous path shorter it is retainedOtherwise new path is defined
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 34
Example of Bellman-Ford Algorithm
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 35
Results of Bellman-Ford Exampleh Lh(2) Path Lh(3) Path Lh(4) Path Lh(5) Path Lh(6) Path
0 ∞ – ∞ – ∞ – ∞ – ∞ –
1 2 1-2 5 1-3 1 1-4 ∞ – ∞ –
2 2 1-2 4 1-4-3 1 1-4 2 1-4-5 10 1-3-6
3 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
4 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 36
Comparison of Info GatheringBellman-Ford
Calculation for node n involves knowledge of link cost to all neighbours plus total cost to each neighbour from s
Each node can maintain set of costs and paths to every other nodeCan exchange info with direct neighboursUpdate costs and paths based on info from neighbours and knowledge of direct link costs
DijkstraEach node needs complete topologyMust know link costs of all links in networkMust exchange information with all other nodes
s j n s i n
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 37
Comparison of EfficiencyEvaluation
Dependent on processing time of algorithmsDependent on amount of info required from other nodes
Implementation specificBoth converge to same solution under static topology and costsIf link costs change, algorithms will attempt to catch upIf link costs depend on traffic, which depends on routes chosen, then feedbackBoth will result in instability
12.2 Routing in Packet Switched Network
南京大学计算机系讲义 38
12.4 ARPANET Routing StrategiesFirst Generation, 1969Second Generation, 1979Third Generation, 1987
南京大学计算机系讲义 39
First GenerationMethod
Distributed adaptive, uses Bellman-Ford algorithmEstimated delay using performance criterion per 128msNode exchanges delay vector with neighborsUpdate routing table based on incoming info
ProblemDoesn't consider line speed, just queue length (lines speed is not similar now)Queue length not a good measurement of delayResponds slowly to congestion
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 40
The 1st Routing Algorithm
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 41
Second GenerationMethod
Uses measured delay as performance criterionPer 10s, the node computes the average delay on each outgoing link
Time of retransmit – Time of arrive + Transmission time + Transport time
Uses Dijkstra’s algorithmThe delay info of each link is sent to all other nodes using flooding
ProblemGood under light and medium loadsUnder heavy loads, little correlation between reported delays and those experienced
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 42
The Vibration ProblemTrunks of data vibratebetween links A and B
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 43
Third GenerationGoal
Let some stay on loaded link to balance and avoid oscillationsUnder heavy load, should give the majority route a good path instead of every route the best path
MethodLink cost calculations changedLeveling based on current value and previous resultsUse hop normalized metric to calculate cost
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 44
Cost CalculationUses the single-server queuing model, computes link utilization instead of delayStep 1. link utilization
ρ =
ρ – link utilizationT – current measured delayTs – mean packet length (600 bit) / transmission rate of the link
Step 2. LevelingUn+1 = α×ρn+1+(1–α)×UnUn – average link utilization at time nα – constant, now set 0.5
Step 3. Set link cost based on leveled utilization
2( )( 2 )
S
S
T TT T
−−
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 45
Link Utilization to Cost (1)D
elay
(nor
mal
ized
)
Estimated utilization
Theoreticalqueueing delay
0.90.7
Metric forsatellite link
Metric forterrestrial link
0.80.60.4 0.50.30.1 0.2 1.00.0
1
2
3
4
5
0
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 46
Link Utilization to Cost (2)
0
30
60
140
75
50% 100%25% 75%
225
New metric(routing units)
Utilization
9.6 satellite
9.6 terrestrial
56 terrestrial
56 satellite
90
12.4 ARPANET Routing Strategies
南京大学计算机系讲义 47
12.5 Routing Information Protocol
南京大学计算机系讲义 48
Convergence
D NC
A
B
Router D to the target network: Directly connected network. Metric 1.Router B to the target network: Next hop is router D. Metric is 2.Router C to the target network: Next hop is router B. Metric is 3.Router A to the target network: Next hop is router B. Metric is 3.
12.5 Routing Information Protocol
南京大学计算机系讲义 49
counting to infinity
the link connecting router B and router D fails.
D NC
A
B
10
1
11
11
12.5 Routing Information Protocol
南京大学计算机系讲义 50
split horizonThe "simple " scheme omits routes learned from one neighbor in updates sent to that neighbor.
DC
A
BAbout B, C, A
About D,B
About C,A, B
About A, BAbout C, D, B
Abo
ut A
,C
Abo
ut B
,C,
D
About D, CAbout B, A
About C, A, D
12.5 Routing Information Protocol
南京大学计算机系讲义 51
split horizon
D NC
A
B
10
1
11
11
Wait for timeout
12.5 Routing Information Protocol
南京大学计算机系讲义 52
Split horizon with poisoned reverse
"Split horizon with poisoned reverse” includes such routes in updates, but sets their metrics to infinity.
If A thinks it can get to D via C, its messages to C should indicate that D is unreachable.
If the route through C is real, then C either has a direct connection to D, or a connection through some other gateway.
D NC
A
B
12.5 Routing Information Protocol
南京大学计算机系讲义 53
counting to infinityunder the Split horizon with poisoned reverse
D
CA B
E
距离 下一跳
B→D 2 EC→D 2 EE→D 无穷
距离 下一跳
B→D 无穷
C→D 2 EE→D 无穷
距离 下一跳
B→D 3 EC→D 2 EE→D 4 B
Unreachable message reached B but not reached C.
12.5 Routing Information Protocol
南京大学计算机系讲义 54
Triggered updates
To get triggered updates, we simply add a rule that whenever a gateway changes the metric for a route, it is required to send update messages almost immediately, even if it is not yet time for one of the regular update message.
12.5 Routing Information Protocol
南京大学计算机系讲义 55
RIP is a UDP-based protocol. Each host that uses RIP has a routing process that sends and receives datagrams on UDP port number 520.
12.5 Routing Information Protocol
南京大学计算机系讲义 56
作业
7,8,9,10,12,16