CC CHP 12
CC CHP 12
Chapter 12
Routing in Switched Networks
03/13/20
24
12.1 Routing in Packet Switched Network 3
Characteristics
The primary function of a packet-switching network is to accept packets from a source
station and deliver them to a destination station. To accomplish this, a path or route through
the network must be determined; generally, more than one route is possible. Thus, a routing
function must be performed. The requirements for this function include
• Correctness
• Simplicity
• Robustness
• Stability
• Fairness
• Optimality
• Efficiency
03/13/20
24
4
Performance Criteria
03/13/20
24
5
03/13/20
24
6
Decision Time and Place
Decision time is determined by whether the routing decision is made on a packet or virtual
circuit basis.
The term decision place refers to which node or nodes in the network are responsible for the
routing decision.
The decision time and decision place are independent design variables. For example, in Figure
12.1, suppose that the decision place is each node and that the values depicted are the costs at a given
instant in time: the costs may change.
In a datagram network, the next packet may follow a different route, again determined by each
node along the way.
In a virtual circuit network, each node will remember the routing decision that was made when
the virtual circuit was established, and simply pass on the packets without making a new decision.
03/13/20
24
7
Network Information Source and Update Timing
With distributed routing, in which the routing decision is made by each node, the
individual node may make use of only local information, such as the cost of each outgoing link.
Each node might also collect information from adjacent (directly connected) nodes, such as the
amount of congestion experienced at that node.
For an adaptive strategy, information is updated from time to time to enable the routing
decision to adapt to changing conditions
03/13/20
24
8
Routing Strategies
Fixed Routing
use a single permanent route for each source to destination pair
route is fixed
-at least only change when there is a change in the topology of the network
With fixed routing, there is no difference between routing for datagrams and virtual circuits. All
packets from a given source to a given destination follow the same route. The advantage of fixed
routing is its simplicity. Its disadvantage is its lack of flexibility. It does not react to network
congestion or failures
03/13/20
24
9
03/13/20
24
Routing Strategies 10
Flooding
A packet is sent by a source node to every one of its neighbors. At each node, an
incoming packet is retransmitted on all outgoing links except for the link on which it arrived. For
example, if node 1 in Figure 12.1 has a packet to send to node 6, it send a copy of that packet (with
a destination address of 6), to nodes 2, 3, and 4. Node 2 will send a copy to nodes 3 and 4.Node 3
will send a copy to nodes 2, 4, 5 and 6.Node 4 will send a copy to nodes 2, 3, and 5.Eventually, a
number of copies of the packet will arrive at node 6. The packet must have some unique identifier
(e.g., source node and sequence number, or virtual circuit number and sequence number) so that
node 6 knows to discard all but the first copy.
Unless something is done to stop the incessant retransmission of packets, the number of
packets in circulation just from a single source packet grows without bound.
03/13/20
24
10
An example of the latter tactic is shown in Figure 12.3. The label on each packet in the figure
indicates the current value of the hop count field in that packet. A packet is to be sent from node 1 to node
6 and is assigned a hop count of 3. On the first hop, three copies of the packet are created, and the hop
count is decrement to 2. For the second hop of all these copies, a total of nine copies are created. One of
these copies reaches node 6, which recognizes that it is the intended destination and does not retransmit.
However, the other nodes generate a total of 22 new copies for their third and final hop. All packets
received from the third hop are discarded, because the hop count is exhausted.
03/13/20
24
11
Flooding Example
03/13/20
24
13
Routing Strategies
Random Routing
Random routing has the simplicity and robustness of flooding with far less traffic load. With random
routing, a node selects only one outgoing path for retransmission of an incoming packet. The outgoing link is
chosen at random, excluding the link on which the packet arrived. If all links are equally likely to be chosen, then
a node may simply utilize outgoing links in a round-robin fashion. A refinement of this technique is to assign a
probability to each outgoing link and to select the link based on that probability. The probability could be based
on data rate,
Like flooding, random routing requires the use of no network information. Because the route taken is
random, the actual route will typically not be the least cost route nor the minimum-hop route. Thus, the network
must carry a higher than optimum traffic load, although not nearly as high as for flooding.
03/13/20
24
Routing Strategies
Adaptive Routing
14
Adaptive Routing In virtually all packet-switching networks, some sort of adaptive routing technique is used.
That is, the routing decisions that are made change as conditions on the network change. The principal conditions that
influence routing decisions are
• Failure: When a node or link fails, it can no longer be used as part of a route.
• Congestion: When a particular portion of the network is heavily congested, it is desirable to route packets around rather
than through the area of congestion.
There are several drawbacks associated with the use of adaptive routing, compared to fixed routing:
• The routing decision is more complex; therefore, the processing burden on network nodes increases.
• In most cases, adaptive strategies depend on status information that is collected at one place but used at another.
• An adaptive strategy may react too quickly, causing congestion-producing oscillation.
Despite these real dangers, adaptive routing strategies are by far the most prevalent, for two reasons:
• An adaptive routing strategy can improve performance, as seen by the network user.
• An adaptive routing strategy can aid in congestion control. Because an adaptive routing strategy tends to balance loads, it
can delay the onset of severe congestion
03/13/20
24
2
A convenient way to classify adaptive routing strategies is on the basis of information source: local,
adjacent nodes, all nodes. An example of an adaptive routing strategy that relies only on local information is one in
which a node routes each packet to the outgoing link with the shortest queue length, Q. This would have the effect of
balancing the load on outgoing links. However, some outgoing links may not be headed in the correct general
direction.. In this case, each link emanating from the node would have a bias for each destination i, such that lower
values of indicate more preferred directions. For each incoming packet headed for node i, the node would choose the
outgoing link that minimizes Q + . Thus a node would tend to send packets in the right direction, with a concession
made to current traffic delays. As an example, Figure 12.4 show the status of node 4 of Figure 12.1 at a certain point
in time. Node 4 has links to four other node. A packet arrives from node 1 destined for node 6.To which outgoing
link should the packet be routed? Based on current queue lengths and the values of bias for each outgoing link, the
minimum value of Q + is 4, on the link to node 3. Thus, node 4 routes the packet through node 3.
03/13/20
24
17
Going to
node 6
9+2 = 11
6+3 = 9
3+1 = 4
0+5 = 5
1969
distributed adaptive using estimated delay
• queue length used as estimate of delay
using Bellman-Ford algorithm
node exchanges delay vector with neighbors
update routing table based on incoming information
problems:
• doesn't consider line speed, just queue length
• queue length is not a good measurement of delay
• responds slowly to congestion
03/13/20
24
2
03/13/20
24
20
ARPANET Routing Strategies
3rd Generation
1987
link cost calculations changed
measure average delay over last 10 secs and transform into link
utilization estimate
normalize this based on current value and previous results
set link cost as function of average utilization
03/13/20
24
21
12.3 Least Cost Algorithms
basis for routing decisions
Given a network of nodes connected by bidirectional links, where of a path each link has a cost
associated with it in each direction, define the cost of a path between two nodes as the sum of the
costs of the links traversed. For each pair of nodes, find a path with the least cost.
Most least-cost routing algorithms in use in packet-switching networks and internets are variations of
one of two common algorithms, known as Dijkstra’s algorithm and the Bellman-Ford algorithm
03/13/20
24
22
Dijkstra’s Algorithm
finds shortest paths from given source node s to all other nodes
03/13/20
24
Dijkstra’s Algorithm Method 23
Step 1 [Initialization]
• T = {s} Set of nodes so far incorporated
• L(n) = w(s, n) for n ≠ s
• initial path costs to neighboring nodes are simply link costs
Step 2 [Get Next Node]
• find neighboring node not in T with least-cost path from s
• incorporate node into T
Step 3 [Update Least-Cost Paths]
• L(n) = min[L(n), L(x) + w(x, n)] for all n ∉ T
• If latter term is minimum, path from s to n is path from s to x concatenated with edge
from x to n
03/13/20
24
2
Dijkstra’s Algorithm Example
03/13/20
24
Dijkstra’s
Algorithm Example
Iter T L(2) Path L(3) Path L(4) Path L(5) Path L(6) Path
03/13/20
24
Bellman-Ford Algorithm 26
find shortest paths from given node subject to constraint that paths contain at most one link
find the shortest paths with a constraint of paths of at most two links and so on
step 1 [Initialization]
(n) = ∞, for all n ≠ s
(s) = 0, for all h
step 2 [Update]
• for each successive h ≥ 0
for each n ≠ s, compute: (n)=min[
• connect n with predecessor node j that gives min
• path from s to n terminates with link from j to n
03/13/20
24
Results of Bellman-Ford Example
h Lh(2) Path Lh(3) Path Lh(4) Path Lh(5) Path Lh(6) Path
0 - - - - -
28
27
Example of Bellman-Ford Algorithm
03/13/20
24
2
Results of Bellman-Ford Example
03/13/20
24
2
Comparison
results from two algorithms agree
Bellman-Ford
• calculation for node n needs link cost to neighboring nodes plus total cost to each neighbors from s
• each node can maintain set of costs and paths for every other node
• can exchange information with direct neighbors
• can update costs and paths based on information from neighbors and knowledge of link costs
Dijkstra
• each node needs complete topology
• must know link costs of all links in network
• must exchange information with all other nodes
03/13/20
24