Computer Networks and Internets, 5e By Douglas E. Comer

uptightexampleΔίκτυα και Επικοινωνίες

24 Οκτ 2013 (πριν από 4 χρόνια και 15 μέρες)

69 εμφανίσεις

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

1

Computer Networks and Internets, 5e


By Douglas E. Comer

Lecture PowerPoints


By Lami Kaya, LKaya@ieee.org

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

2

Chapter 18



WAN Technologies

And

Dynamic Routing

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

3

Topics Covered


18.1 Introduction


18.2 Large Spans And Wide Area Networks


18.3 Traditional WAN Architecture


18.4 Forming A WAN


18.5 Store And Forward Paradigm


18.6 Addressing In A WAN


18.7 Next
-
Hop Forwarding


18.8 Source Independence


18.9 Dynamic Routing Updates In A WAN


18.10 Default Routes


18.11 Forwarding Table Computation


18.12 Distributed Route Computation


18.13 Shortest Path Computation In A Graph


18.14 Routing Problems


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

4

18.1 Introduction


This chapter


considers the structure of a network that spans an arbitrarily large
area


describes the basic components used to build a packet switching
system


explains the fundamental concept of routing


presents the two basic routing algorithms


explains the advantages of each algorithm


extends the discussion of routing to the Internet


presents routing protocols that use the algorithms described here


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

5

18.2 Large Spans And Wide Area
Networks


Networking technologies can be classified according to the
distance spanned:



PAN spans a region near an individual



LAN spans a building or campus



MAN spans a large metropolitan area



WAN spans multiple cities or countries


Consider a company that uses a satellite bridge to connect
LANs at two sites


Should the network be classified as a WAN or as an extended LAN?



© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

6

18.2 Large Spans And Wide Area
Networks


The key issue that separates WAN technologies from LAN
technologies is
scalability


A WAN must be able to grow as needed to connect many
sites


spread across large geographic distances


A technology is not classified as a WAN unless it can deliver
reasonable performance for a large scale network


A WAN does not merely connect to many computers at many sites


it must provide sufficient capacity to permit all computers to communicate


Thus, a satellite bridge that connects a pair of PCs and
printers is merely an
extended LAN

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

7

18.3 Traditional WAN Architecture


WAN designers chose to create a special
-
purpose hardware
device that could be placed at each site


A
packet switch

provides


local connections for computers at the site


as well as connections for data circuits that lead to other sites


A packet switch consists of a small computer system


with a processor, memory, and I / O devices used to send and
receive packets


Early packet switches were constructed from conventional
computers


the packet switches used in the highest
-
speed WANs require
special
-
purpose hardware


Figure 18.1 illustrates the internal architecture

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

8

18.3 Traditional WAN Architecture

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

9

18.3 Traditional WAN Architecture


Since the advent of LAN technology, most WANs separate a
packet switch into two parts:


a Layer 2 switch that connects local computers


a
router

that connects to other sites


Part 4 of the text


discusses
Internet routers
in detail


and explains how the concepts covered here apply to the Internet


Communication with local computers can be separated from
transmission across a WAN


Figure 18.2 illustrates the separation



© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

10

18.3 Traditional WAN Architecture

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

11

18.4 Forming A WAN


A WAN can be formed by interconnecting a set of sites


The exact details of the interconnections depend on


the data rate needed


the distance spanned


and the delay


Many WANs use leased data circuits


However, other forms are also available


such as microwave and satellite channels


A network designer must choose a topology


For a given set of sites, many topologies are possible


Figure 18.3 illustrates a possible way to interconnect


a WAN does not need to be
symmetric

the interconnections among
packet switches


the capacity of each connection can be chosen to accommodate the
expected traffic and provide redundancy in case of failure

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

12

18.4 Forming A WAN

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

13

18.5 Store And Forward Paradigm


The goal of a WAN is to allow as many computers as possible to
send packets simultaneously


The fundamental paradigm used to achieve simultaneous
transmission is known as
store

and
forward


To perform store and forward processing


a packet switch buffers packets in memory


The store operation occurs when a packet arrives:


I / O hardware in the switch places a copy of the packet in memory


The forward operation occurs once a packet has arrived and
is waiting in memory. The processor



examines the packet


determines its destination


and sends the packet over the I / O interface that leads to the
destination

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

14

18.6 Addressing In A WAN


From the view of an attached computer


a traditional WAN network operates similar to a LAN


Each WAN technology defines the exact frame format a computer
uses when sending and receiving data


Each computer connected to a WAN is assigned an address


WANs addresses follow a key concept that is used in the
Internet:
hierarchical addressing


Hierarchical addressing divides each address into two parts:



(site, computer at the site)


In practice, instead of a identifying a site, each packet switch is
assigned a unique number


first part of an address identifies a packet switch


second part identifies a specific computer


Figure 18.4 shows two
-
part hierarchical addresses assigned
to computers connected to a pair of packet switches

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

15

18.6 Addressing In A WAN

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

16

18.6 Addressing In A WAN


Figure 18.4 shows each address as a pair of decimal integers


A computer connected to
port 6

on packet
switch 2
is assigned address
[2, 6]


In practice, an address is represented as a single binary value
with some bits of the binary value


used to represent a packet switch


and others used to identify a computer


In Part 4 of the text, we’ll show that each Internet address
consists of a binary number, where


a prefix of the bits identify a specific network in the Internet


the remainder of the bits identify a computer attached to the network


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

17

18.7 Next
-
Hop Forwarding


What is the importance of hierarchical addressing?


When a packet arrives


a switch must choose an
outgoing path
over which to forward it


If a packet is destined


for a local computer


the switch sends the packet directly to the computer


Otherwise


the packet must be forwarded over to another switch


To make the choice, a packet switch


examines the destination address in the packet


and extracts the packet switch number


If the number in the destination address is identical to the packet switch's own
ID the packet is intended for a computer on the local packet switch


Otherwise, the packet is intended for a computer on another switch


Algorithm 18.1 explains the computation

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

18

18.7 Next
-
Hop Forwarding

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

19

18.7 Next
-
Hop Forwarding


A packet switch does not need to keep complete information
about how to reach all possible computers


nor does a switch need to compute the entire route a packet will follow


Instead, a switch bases forwarding on packet switch IDs


which means that a switch only needs to know which outgoing link


A switch only needs to compute the
next hop
for a packet


The process is called
next
-
hop forwarding


and is analogous to the way airlines list flights


To make the computation efficient,


switches use
table lookup


That is, each packet switch contains a
forwarding table


such tables were originally called
routing tables


lists all possible packet switches and gives a next hop for each


Figure 18.5 illustrates next
-
hop forwarding with a trivial example

18.7 Next
-
Hop Forwarding

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

20

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

21

18.7 Next
-
Hop Forwarding


Using only one part of a
two
-
part hierarchical address

to
forward a packet has two practical consequences


First, the
computation time
required to forward a packet is reduced
because the forwarding table can be organized as an array that uses
indexing instead of searching


Second, the forwarding table contains one entry per packet switch
instead of one entry per destination computer


The reduction in table size can be substantial, especially for a large WAN that
has many computers attached to each packet switch


A two
-
part hierarchical addressing scheme allows packet
switches to use only the first part of the destination address
until the packet reaches the
final switch


Once the packet reaches the final switch


the switch uses the second part of the address to choose a specific computer


As Algorithm 18.1 describes


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

22

18.8 Source Independence


Next
-
hop forwarding does not depend on the packet's
original source or on the path the packet has taken before it
arrives at a particular packet switch


Instead, the next hop to which a packet is sent depends only on the
packet's destination


The concept, which is known as
source independence


Source independence allows the forwarding mechanism in a
computer network to be

compact
and

efficient


Because all packets follow the same path, only one table is required


Because forwarding does not use source information, only the
destination address needs to be extracted from a packet


A single mechanism handles forwarding
uniformly

packets that
originate on directly connected computers and packets that arrive
from other packet switches use the same mechanism

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

23

18.9 Dynamic Routing Updates In A WAN


Forwarding table must guarantee the following:



Universal

communication


The forwarding table in each switch must contain a valid next
-
hop
route for each possible destination address



Optimal

routes


In a switch, the next
-
hop value in the forwarding table for a given
destination must point to the shortest path to the destination


Network failures further complicate forwarding


For example, if two paths exist to a given destination and one of the
paths becomes unavailable because hardware fails, forwarding
should be changed to avoid the unavailable path


A network manager cannot merely configure a forwarding table to
contain
static

values that do not change


Instead, software running on the packet switches continually tests for
failures, and
reconfigures

the forwarding tables automatically



© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

24

18.9 Dynamic Routing Updates In A WAN


We use the term
routing software
to describe software that
automatically reconfigures
forwarding tables



Route computation
in a WAN is to think of a graph that
models the network


software uses the graph to compute the shortest path to all possible
destinations


Each
node

in the graph corresponds to a packet switch in
the network (individual computers are not part of the graph)


If the network contains a direct connection between a pair of
packet switches


the graph contains an
edge

or
link

between the corresponding nodes


Figure 18.6 shows an example WAN and the corresponding
graph


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

25

18.9 Dynamic Routing Updates In A WAN

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

26

18.9 Dynamic Routing Updates In A WAN


As the figure 18.6 shows, nodes in the graph are given a
label

that is the same as the number assigned to the
corresponding packet switch


A graph representation is useful in computing next
-
hop
forwarding


because graph theory has been studied and efficient algorithms have
been developed


a graph abstracts away details, allowing routing software to deal with
the essence of the problem


When it computes next
-
hop forwarding for a graph


a routing algorithm must identify a
link


Our examples will used the notation (
k, j
) to denote a link
from node
k

to node
j


When a routing algorithm runs on the graph in Figure 18.6b


The algorithm produces output as shown in Figure 18.7


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

27

18.9 Dynamic Routing Updates In A WAN

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

28

18.10 Default Routes


The forwarding table for node
1

in Figure 18.7 raises an
important point:


a forwarding table may contain many entries that point to the same
next hop


An examination of the WAN in Figure 18.6a reveals why all
remote entries contain the same next hop:


the packet switch has only one connection to the network


Therefore, all outgoing traffic must be sent across the same
connection


Consequently, except for the entry that corresponds to the node
itself, all entries in node
1
's forwarding table have a next hop that
points to the link from node
1

to node
3


In our trivial example, the list of
duplicate entries
in the
forwarding table is short

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

29

18.10 Default Routes


A large WAN may contains hundreds of duplicate entries


Most WAN systems include a mechanism that can be used
to eliminate the common case of duplicate entries



Default route
is a mechanism that allows a single entry in a
forwarding table to replace a long list of entries that have the
same next
-
hop value


Only one default entry is allowed in a forwarding table


and the entry has lower priority than other entries


If the forwarding mechanism does not find an explicit entry
for a given destination


it uses the default


Figure 18.8 shows the forwarding tables from Figure 18.7
revised to use a default route

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

30

18.10 Default Routes

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

31

18.10 Default Routes


Default routing is optional


a default entry is present only if more than one destination has the
same next
-
hop value


For example, the forwarding table for node
3

does not
contain a default route


because each entry has a unique next hop


However, the forwarding table for node
1
benefits from a
default route


because all remote destinations have the same next hop


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

32

18.11 Forwarding Table Computation


Basic approaches to construct forwarding tables?



Static routing


A program computes and installs routes when a packet switch
boots


The routes do not change



Dynamic routing


A program builds an initial forwarding table when a switch boots


Program then alters the table as conditions in the network
change


Each approach has advantages and disadvantages


Advantages of static routing are simplicity and low overhead


Disadvantage is inflexibility


static routes cannot be changed when communication is disrupted


Large networks are designed with redundant connections to
handle occasional hardware failures


most WANs use a form of dynamic routing

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

33

18.12 Distributed Route Computation


Algorithm 18.2 shows how a forwarding table can be
computed


after information about a network is encoded in a graph


In practice, WANs need to perform
distributed route
computation


Instead of a centralized program computing all shortest paths


each packet switch must compute its own forwarding table locally


All packet switches must participate in distributed route computation


There are two general forms:



Link
-
State Routing
(LSR), which uses
Dijkstra's algorithm



Distance
-
Vector Routing
(DVR), which uses another approach



The next sections describe each of the two approaches


Chapter 27 explains how each approach is used to control routes in
the Internet

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

34

18.12 Distributed Route Computation

18.12.1 Link
-
State Routing (LSR)



Link
-
state routing
or
Link
-
status routing


the approach also known as
Shortest Path First

(SPF) routing


Dijkstra algorithm used it to characterize the way it works


actually all routing algorithms find shortest paths


To use LSR, packet switches
periodically

send messages
across the network that carry the
status of a link


For example, packet switches
5
and
9

measure the link between
them and send a status message


such as ``the link between 5 and 9 is
up
''


Each status message is broadcast to all switches


Every switch collects incoming status messages


and uses them to build a graph of the network


Each switch then uses Algorithm 18.2 to produce a
forwarding table by choosing itself as the source

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

35

Algorithm 18.2


A version of Dijkstra’s
algorithm that computes
R,
a nexthop
forwarding table,
and
D, the distance to each
node from
the specified
source node

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

36

18.12 Distributed Route Computation

18.12.1 Link
-
State Routing (LSR)



An LSR algorithm can adapt to hardware failures


If a link between packet switches
fails


the attached packet switches will detect the failure


and broadcast a status message that specifies the link is
down


All packet switches receive the broadcast


change their copy of the graph to reflect the change in the link's
status


and re
-
compute shortest paths


Similarly, when a link becomes available again


the packet switches connected to the link detect that it is working


and start sending status messages that report its
availability


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

37

18.12 Distributed Route Computation

18.12.2 Distance Vector Routing (DVR)


As with LSR, each link in the network is assigned a
weight


The
distance

to a destination between two packet switches
is defined to be the sum of weights along the path between
the two


Like LSR, DVR arranges for packet switches to exchange
messages periodically


In DVR, a switch send a complete list of destinations and
the current cost of reaching each


When it sends a DVR message


a switch is sending a series of individual statements, of the form:


“I can reach destination X, and its current distance from me is Y”


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

38

18.12 Distributed Route Computation

18.12.2 Distance Vector Routing (DVR)


DVR messages are not broadcast


Each switch periodically sends a DVR message to its neighbors


Each message contains pairs of (
destination, distance
)


Each packet switch must keep a list of possible destinations


along with the current distance to the destination and the next hop to
use


The list of destinations and the next hop for each can be found in the
forwarding table


DVR software can be considered as maintaining an
extension to the forwarding table


that stores a distance for each destination


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

39

18.12 Distributed Route Computation

18.12.2 Distance Vector Routing (DVR)


When a message arrives at a switch from neighbor
N


the switch examines each item in the message


and changes its forwarding table if the neighbor has a shorter path to
some destination than the path currently being used


Example:


if neighbor
N

advertises a path to destination
D

as having cost
5

and
the current path through neighbor
K

has cost
100


the current next hop for
D
will be replaced by
N



and the cost to reach
D

will be
5

plus the cost to reach
N


Algorithm 18.3 specifies how routes are updated when using
the distance
-
vector approach


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

40

Algorithm 18.3


Distance
-
vector algorithm
for route computation

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

41

18.13 Shortest Path Computation In A
Graph


Once a graph has been created that corresponds to a
network


software uses a method known as
Dijkstra's Algorithm


To find the shortest path from a source node to each of the
other nodes in the graph:


a next
-
hop forwarding table is constructed during the computation of
shortest paths


The algorithm must be run once for each node in the graph


That is, to compute the forwarding table for packet switch
P


the node that corresponds to
P

is designated as the source node


and the algorithm is run



© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

42

18.13 Shortest Path Computation In A
Graph



Dijkstra's algorithm is popular


because it can be used with various definitions of shortest path


In particular, the algorithm does not require edges in the graph to
represent geographic distance. Instead, the algorithm


allows each edge to be assigned a

nonnegative
value called a weight


defines the distance between two nodes to be the sum of the weights along
a path between the nodes


Figure 18.9 illustrates the concept of weights


by showing an example graph with an integer weight assigned to
each edge


and a least
-
weight path between two nodes in the graph



© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

43

18.13 Shortest Path Computation In A
Graph

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

44

18.13 Shortest Path Computation In A
Graph


Dijkstra's algorithm maintains a
set

of nodes,
S


for which the minimum distance and next hop have not been computed


The set is initialized to all nodes except the source


The algorithm then iterates until set
S

is empty


On each iteration


the algorithm removes a node from
S

that has the least distance from
the source


As it deletes node
u
, the algorithm examines the current distance from
the source to each of the neighbors of
u

that remains in the set


If a path from the source through
u

to the neighbor has less weight than
the current path, the algorithm updates the distance to the neighbor


After all nodes have been removed from
S


the algorithm will have computed the minimum distance to each node
and a correct next
-
hop forwarding table for all possible paths

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

45

18.13 Shortest Path Computation In A Graph


Dijkstra's algorithm needs
3

data structures to store:


the current distance to each node


the next hop for the shortest path


and information about the remaining set of nodes


Nodes can be numbered from
1
to
n

as Figure 18.9


which makes the implementation efficient


because a node number can be used as an index into a data structure


The algorithm can use two arrays,
D

and
R


each indexed by the node number


The
i
th

entry in array
D

stores a current value of the minimum
distance from the source to node

i


The
i
th

entry in array
R
stores the next hop used to reach node
i

along the path being computed


The set
S

can be maintained as a
doubly linked
list of node numbers


which facilitates searching the entire set or deleting an entry

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

46

18.13 Shortest Path Computation In A Graph


Algorithm 18.2 uses weight
(i, j
) as a function


that returns the weight of the edge from node
i
to node
j


Function
weight

is assumed to return a reserved value
infinity

if no edge exists from node
i

to node
j


In practice, any value can be used to represent infinity provided the
value is larger than the sum of weights along any path in the graph


One way to generate a value infinity consists of adding one to the
sum of all weights on all edges


Allowing arbitrary weights to be assigned to edges of a
graph means that


one algorithm can be used with different measures of distance


For example, some WAN technologies measure distance by
counting the number of packet switches along a path


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

47

18.13 Shortest Path Computation In A Graph


To use the algorithm for such technologies


each edge in the graph is assigned a weight of
1


In other WAN technologies, weights are assigned to reflect
the
capacity

of the underlying connections.


A network manager can assign weights to links to control routing


For example, consider a case where two separate paths exist
between a pair of packet switches with


one path designated to be the
primary path


and the other designated to be a
backup path


To enforce such a policy


a network manager can assign the primary link a low weight and the
other link a high weight


Routing software will configure forwarding tables to use the path with
low weight


unless the path is not available


in which case routing software will select the alternative path


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

48

18.14 Routing Problems


In theory, either LSR or DVR routing will compute shortest
paths


Furthermore, each approach will eventually
converge


meaning that the forwarding tables in all packet switches agree


However, problems do occur


For example, if LSR messages are lost, two packet switches can
disagree

about the shortest path


DVR problems can be more severe


because a link failure can cause two or more packet switches to
create a
routing loop


in which each packet switch thinks the next packet switch in the set is the
shortest path to a particular destination


As a result, a packet can circulate among the switches indefinitely


© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

49

18.14 Routing Problems


One of the primary reasons DVR protocols exhibit problems comes from
backwash



(i.e., a packet switch receives information that it sent)


For example, suppose a switch tells its neighbors


“I can reach destination
D
at cost
3
''


If the connection leading to destination
D

fails


the switch will remove the entry for
D

from its forwarding table


(or mark the entry invalid)


But the switch has told neighbors that a route exists


Imagine that just after the link fails


one of the neighbors sends a DVR message that specifies


“I can reach destination

D
at cost
4



Unfortunately


the message will be believed


and a
routing loop

will be created

© 2009 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.

50

18.14 Routing Problems


Most practical routing mechanisms contain constraints and
heuristics

to prevent problems like routing loops


For example, DVR schemes employ
split horizon


which specifies that a switch does not send information back to its
origin


Furthermore, most practical routing systems introduce
hysteresis



that prevents the software from making many changes in a short
time


However, in a large network where many links fail and
recover frequently, routing problems can occur