Sei sulla pagina 1di 55

Packet Switching

Packet-Switching Principles
? Store & forward scheme
? Message is split into size-limited packets for
transmission
? Pipelining of packet transmission
? Advantages over circuit-switching
? Greater line efficiency due to sharing of line
capacity
? Sender and receiver do not need to be
simultaneously ready
? Easy message prioritization
? Easy data-rate conversion

Two schemes for packet switching
? Datagrams: each packet is individually
routed through network
? Virtual circuits: a virtual circuit is first
established; all packets then follow this path,
one following the other
? Datagram
? Better flow balancing
? No call-setup phase
? More flexible
? More reliable
? Virtual circuit
? Easier error & flow control
? Small packet headers ? more efficient use of
bandwidth for interactive, small packet traffic
Packet Size
Design Issue
Packet size vs.
Overhead
Packet size vs.
Number of
packets sent for a
given message
size.
Effect of packet size
on transmission
time
Effect of packet size
on processing and
queuing delay -
these effects are
more pronounced
for smaller packet
size smaller
packet will require
high overhead but
lower queuing delay
Comparison of
Communication
Switching
Techniques

Comparison of Switching Techniques
External and Internal Operation of
Packet Switching
? Externally, to the user a Packet Switching
Network (PSN) may appear as a datagram
(connectionless) or VC (connection-oriented)
service; its internal structure can be different
from the external structure.
? External view: interface between host
and PSN
? Internal view: operations inside PSN

External Operation of Packet Switching
? Virtual circuit service (external view)
? Packets are delivered error-free and in sequence
? Provide flow and error control
? (Most network applications demand sequential,
error-free, flow controlled service)
? Datagram service (external view)
? Packets may arrive out of sequence, be
damaged, be duplicated, or be lost.
? No flow and error control
? Higher throughput
? (For some applications, efficiency is more
important than an occasional erroneous or omitted
packet. For some applications (e.g., credit checking,
banking) higher level protocol will implement flow and
error control anyway. Virtual circuit just introduces
unnecessary redundancy.)
External Virtual Circuit

External Datagram
Internal Operation of Packet Switching
? Virtual circuit operation (internal view)
? Connection establishment (make routing decision
only once)
? Minimize per-packet overhead (only need virtual
circuit number in every packet)
? The failure of a node or link could destroy some
virtual circuits
? Datagram operation (internal view)
? No connection establishment (each packet is
delivered independently)
? High bandwidth overhead (full destination address
in every packet)
? More flexible: react more quickly to traffic condition
by making routing decisions on a per-packet basis
? More robust: if nodes or links are failed, packets
can be routed around the affected area
Internal Virtual Circuit

Internal Datagram

Routing
? In a packet switched network, need to
determine a path from a sender to a destination;
usually multiple paths exist, so need to choose one.
? Responsibility of the network layer
? Done on a session basis in virtual circuits and
on a packet basis in datagrams
? Desirable characteristics:
? Correctness
? Simplicity
? Robustness
? Stability
? Fairness
? Optimality
? Efficiency
Routing Issues
scalability: must be able to support large numbers
of hosts, routers, networks
adapt to changes in topology or significant
changes in traffic, quickly and efficiently
self-healing: little or not human intervention
route selection may depend on different criteria
performance: choose route with smallest delay
policy: choose a route that doesnt cross a
government network (equivalently: let no non-
government traffic cross this network)

Routing Table Issues
key question: how are routing tables
determined/updated?
who determines table entries?
what info used in determining table entries?
when do routing table entries change?
where is routing info stored?
how to control table size?
why are routing tables determined a particular
way.
What is the theoretical basis?
Classification of Routing Algorithms
centralized versus decentralized
centralized: central site computes and distributed routes
(equivalently: information for computing routes known
globally, each router makes same computation)
decentralized: each router sees only local information (itself
and physically-connected neighbors) and computes routes
on this basis
Static versus adaptive
static: routing tables change very slowly, often in response
to human intervention
dynamic: routing tables change as network traffic or
topology change
Two basic approaches adopted in practice:
link-state routing: centralized, dynamic (periodically run)
distance vector: distributed, dynamic (in direct response to
changes)
Link State Routing
each node knows network topology and cost of
each link
quasi-centralized: each router periodically broadcasts
costs of attached links
cost may reflect
queueing delay on link
link bandwidth
all links with equal cost: shortest path routes
used in Internet OSPF, ISO IS-IS, DECnet, new
(1980) ARPAnet routing algorithm
goal: find least cost path from one node (source)
to all other nodes:
ex: Dijkstras shortestpath algorithm
Bellmon Ford Algorithm
Least-Cost Algorithms (Determining
least-cost paths)
? Dijkstras algorithm
N = set of nodes in the network
s = source node
M = set of nodes so far incorporated by the algorithm
d
ij
= link cost from node i to j; d
ii
= 0, and d
ij
= ? if nodes are not
directly connected
D
n
= cost of the least-cost path from node s to node n that is currently
known to the algorithm
Algorithm
1. Initialize: M = {s}, D
n
= d
sn
for n ? s
2. Find the neighboring node not in M that has the least-cost path
from node s and incorporate that node into M
Find w ? M s.t D
w
= min
(j ? M)
D
j
Add w to M
3. Update least-cost paths:
Dn = min[D
n
, D
w
+ d
wn
] for all n ? M
Repeat steps 2 & 3 until M = N
Example Network
Bellman-Ford algorithm
s = source node
d
ij
= link cost from node i to j; d
ii
= 0, and d
ij
= ? if
nodes are not directly connected
h = maximum number of links in a path at the
current stage of the algorithm
D
n
(h)
= cost of the least-cost path from node s to
node n under the constraint of no more than h
links
Algorithm
1. Initialize:
D
n
(0)
= ? for all n ? s
D
s
(h)
= 0 for all h
2. For each successive h ? 0
D
n
(h+1)
= min
(j)
[D
j
(h)
+ d
jn
]
Distance vector routing
asynchronous, iterative, distributed computation:
at each step:
receive info from neighbor or notice change in local link cost
compute
possibly send new info to adjacent neighbors
computation/communication between network layer entitites!

Distance table:
per-node table recording cost to all other nodes via each of its neighbors
D
E
(A,B) gives minimum cost from E to A given that first node on path is B
D
E
(A,B) = c(E,B) + min D
B
(A,*)
minD
E
(A,*) gives Es minimum cost to A
routing table derived from distance table
example: D
E
(A,B) = 14 (note: not 15!)
example: D
E
(C,D) = 4, D
E
(C,A) = 6

Distance vector algorithm
1. based on Bellman-Ford algorithm
2. used in many routing protocols: Internet BGP, ISO IDRP,
Novell IPX, original ARPAnet
Algorithm (at node X):
Initialization: for all adjacent nodes v:
D
X
(*,v) = infinity
D
X
(v,v) = c(X,v)
send shortest path cost to each destination to neighbors
loop
execute distributed topology update algorithm
Forever
Topology Update Algorithms
At node X:
1. wait (until I see a link cost change to neighbor Y
or until I receive update from neighbor W)
2. if (c(X,Y) changes by delta) {
/* change my cost to my neighbor Y */
change all column-Y entries in distance table by delta
if this changes my least cost path to Z
send update wrt Z, D
X
(Z,*) , to all neighbors
}
3. if (update received from W wrt Z) {
/* shortest path from W to some Z has changed */
D
X
(Z,W) = c(X,W) + D
W
(Z,*)
if this changes my least cost path to Z
send update wrt Z, D
X
(Z,*) , to all neighbors

Distance vector routing: example:

D
X
(Z,Y)=c(X,Y) +minD
Y
(Z,*) = 2 + 1 = 3
D
X
(Y,Z)=c(X,Z) +minD
Z
(Y,*) = 7 + 1 = 8
Distance vector routing: recovery from
link failure
if link XY fails, set c(X,Y) to infinity and run
topology update algorithm
example (next page)
good news travels fast, bad news travels slow
looping:
inconsistent routing tables: to get to A, D routes through
E, but E routes through D
loops eventually disappear (after enough iterations)
loops result in performance degradation, out-of-order
delivery

How many steps
are required for
the network to
recover after
link A-E is
restored?
Link A-E is broken
Routing Strategies
? Fixed Routing
? Routes fixed for a given topology
? Central routing directory created using
some optimality criterion
? Each node only needs to store the
first-hop destination for each of the paths
? Simple but does not react to network
congestion or failure

Routing Strategies Fixed Routing
Routing Strategies - Flooding
? Flooding
? Source sends packet to all nodes connected
to it
? When a node receives packet, it forwards it to
all nodes except the one that gave the packet
? Most robust, but tremendous waste of
network capacity
? Guarantees minimum-hop delivery
? Used usually for broadcast; need mechanism
to control indefinite retransmissions: use packet id
or hop counter decremented every hop (initialized
to network diameter)
? Also used when ultra-reliable delivery is
required. e.g. military applications
? Also recently used for wireless ad hoc
networks
Routing Strategies Flooding (2)
Reverse path forwarding
goal: avoid flooding duplicates
assumptions:
A wants to broadcast
all nodes know predecessor node on
shortest path back to A
reverse path forwarding: if node receives a
broadcast packet
if packet arrived on predecessor on
shortest path to A, then flood to all
neighbors
otherwise ignore broadcast packet - either
already arrives, or will arrive from
predecessor

Multipath Routing
At router, given packet with particular final
destination, several choices for next router are
enumerated
each choice is assigned routing probability
for given packet, actual routing choice is made by
sampling corresponding probability function (pmf)
Applicable to VC networks as well as datagram
networks
in VC network, path of setup packet is determined
stochastically
Multipath routing
Multipath routing can yield more stable traffic patterns than
shortest path routing
e.g., shortest path routing with link utilization as cost can result in traffic
oscillations
Availability of multiple paths between source and destination pair
can be used to decrease vulnerability to faults
Alternative routes can be determined by other means
e.g., assign traffic to routes based on priorities
Example: an interactive connection between terminal and remote computer
could be routed over fiber to minimize delay, while file transfer between
same host and destination could be routed via satellite
Advantages
> Increases reliability over single path approaches
> Improves performance
reduces congestion
provides the ability to provide class of service distinction
Disadvantages
> More complex
> More memory space
Routing Strategies Random Routing
? Random routing
? When a node receives packet, it selects only
one outgoing
? Can be improved by making probabilistic
decision based on link data rates:





? Like flooding, require no network information
? Simple but not in common use

i
i
i
i
R
R
P
Prob. of picking link i
Data rate on link i
Data rate on all links
Routing Strategies Adaptive Routing
? Adaptive routing
? Routing strategy that continuously changes to
adapt to changing environment
? Can improve performance, but algorithms
become much more complex; increases
processing burden and traffic burden; may react
too quickly, causing congestion-producing
oscillation
? Three types of adaptive strategies
Isolated adaptive: local info., distributed control
Distributed adaptive: info. from neighbors, distributed
control
Centralized adaptive: info. from all nodes, centralized
control

Example of
a simple
isolated
adaptive
routing
Distributed Routing
Methodology
>Routing decisions are made at the node based on traffic conditions
at neighboring nodes using distance vector routing
>Each node exchanges routing information with each of its neighbors
Directly
Backward Learning
-Each incoming packet contains information on the incoming
port number, source location and distance to source
>Information is used to build/update RT to distant nodes.
Example (for figure in the next slide)
>Construct a new route from J to G
via node A = 18 + 8 = 26
via node I = 31 + 10 = 41
via node H = 6 + 12 = 18
via node K = 31 + 6 =37
Distributed routing
Centralized Routing
Methodology
>Routing decisions are made at a central location based on
global traffic conditions.
>Routing Control Center (RCC) receives information from all
network nodes and computes routes
>Routing tables are then downloaded to each node
Advantages
>Near perfect routing decisions
>Relieves switches of computational burden
Disadvantages
>Overhead of update traffic detracts from network Utilization
>Single point of failure
>Complexity
>Routing inconsistencies
Multicast Routing
GOAL: deliver packet from one sender to many (but not
all) other hosts
deliver to M hosts in N-host network (M<N)
option 1: sender establishes M point-to-point connections
option 2: sender sends one packet, which is duplicated and
forwarded, as needed by routers:
router A duplicates packet
router B selectively forwards
multicast abstraction:
multicast address associated
with multicast group
hosts join/leave multicast group
sender sends packet to multicast
address (destination)
routers delivers to hosts that
joined group address
Multicast Routing: Link State
GOAL: route packets to all hosts that joined
multicast address
Each router uses link state flooding to distribute:
cost to neighbors
multicast addresses it wants to receive (has attached
host joined to that group)
Each router computes:
regular unicast routing (e.g., Dijkstras algorithm)
spanning tree for M nodes joined to each active
multicast address
spanning tree: set of links connecting M nodes together in a
tree
Multicast Routing: Link State (cont)
one possible spanning tree algorithm:
find node with smallest host address among M
use Dijkstras algorithm to build tree, rooted at that host
that reaches all M
note: tree below is not minimum cost!

Multicast Routing: Distance Vector
packet arrives with multicast address m
look at sender address
use reverse path forwarding to flood to downstream
routers that want mcast packet with that address
Pruning: how to know if downstream router
want mcast packet?
host informs nearest router of addresses it wants
router Y tells router X:
if X wants mcast address and Y on Xs shortest path to source,
then Y wants that address so that Y can forward the mcast
packet to X after receiving it from source

Multicast Routing: Distance Vector - cont
E will forward As mcast pkts to D
E will not forward As mcast pkts to D
A will not forward Es mcast pkts to B
B will not forward any mcast pkts to C
Question: E, B, A forwarding of Ds mcast pkts?

B
A
Hierarchical Routing
For large networks, not practical to store
routing table in each router that contains an
entry for every other router in network
organize routers in a hierarchy
routing table has entry for its parents, siblings,
and children
not necessarily a tree
generally results in suboptimal routes
Example of hierarchical routing
Hierarchical Routing
Problem
> Large networks - Large Routing Tables
> Increased requirements for memory and processor power
> Increased network management traffic
Methodology
> Divide the network up into regions
> Each node has a table that specifies a path to
each node in the same region
the nearest node in each neighboring region
> Similar to telephone network area codes
> The larger the network, the larger the number of regions
(hierarchical levels)
Example: Fig 5-20 below
> 17 node network with 17 entry RT vs. 5 region network with 6-9
entries per table
What is an optimal number of levels?
> For N nodes ---- ln N levels, e ln N entries per node
> For N = 17, ln(17) = 3 levels, e ln(17) = 7 entries per node

Potrebbero piacerti anche