sept, 2005csi 41181 part 3.1 wide area networks (wans), routing, and shortest paths robert l....

58
SEPT, 2005 CSI 4118 1 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

Upload: bruno-sullivan

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

SEPT, 2005CSI Building Blocks Point-to-point long-distance connections Packet switches

TRANSCRIPT

Page 1: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 1

Part 3.1Wide Area Networks (WANs),

Routing, and Shortest Paths

Robert L. Probert, SITE, University of Ottawa

Page 2: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 2

Motivation Connect multiple computers Span large geographic distance Cross public right-of-way

Streets Buildings Railroads

Page 3: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 3

Building Blocks Point-to-point long-distance connections Packet switches

Page 4: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 4

Packet Switch Hardware device Connects to

Other packet switches Computers

Forwards packets Uses addresses

Page 5: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 5

Illustration of a Packet Switch

Special-purpose computer system CPU Memory I/O interfaces Firmware

Page 6: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 6

Building a WAN Place one or more packet switches at each

site Interconnect switches

LAN technology for local connections Leased digital circuits for long-distance

connections

Page 7: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 7

Illustration of a WAN

Interconnections depend on Estimated traffic Reliability needed

Page 8: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 8

Store and Forward Basic paradigm used in packet switched network Packet

Sent from source computer Travels switch-to-switch Delivered to destination

Switch “Stores” packet in memory Examines packet’s destination address “Forwards” packet toward destination

Page 9: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 9

Addressing in a WAN Need

Unique address for each computer Efficient forwarding

Two-part address Packet switch number Computer on that switch

Page 10: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 10

Illustration of WAN Addressing

Two part address encoded as integer Higher-order bits for switch number Low-order bits for computer number

Page 11: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 11

Next-Hop Forwarding

Performed by packet switch Uses table of routes Table gives next hop

Page 12: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 12

Forwarding Table Abbreviations

Many entries point to same next hop Can be condensed (default) Improves lookup efficiency

Page 13: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 13

Source of Routing Table Information Manual

Table created by hand Useful in small networks Useful if routes never change

Automatic routing Software creates/updates table Needed in large networks Changes routes when failures occur

Page 14: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 14

Relationship of Routing To Graph Theory

Graph Node models switch Edge models connection

Page 15: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 15

Shortest Path Computation Algorithms from graph theory No central authority (distributed computation) A switch

Must learn route to each destination Only communicates with directly attached

neighbors

Page 16: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 16

Illustration of Minimum Weight Path

Label on edge represents “distance” Possible distance metric

Geographic distance Economic cost Inverse of capacity

Darkened path is minimum 4 to 5

Page 17: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 17

Algorithms for Computing Shortest Paths Distance Vector (DV)

Switches exchange information in their routing tables

Link-state Switches exchange link status information

Both used in practice

Page 18: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 18

Distance Vector Periodic, two-way exchange between

neighbors During exchange, switch sends

List of pairs Each pair gives (destination, distance)

Receiver Compares each item in list to local routes Changes routes if better path exists

Page 19: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 19

Distance Vector Algorithm

Page 20: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 20

Distance Vector Intuition Let

N be neighbor that sent the routing message V be destination in a pair D be distance in a pair C be D plus the cost to reach the sender

If no local route to V or local routed has cost greater than C, install a route with next hop N and cost C

Else ignore pair

Page 21: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 21

Example of Distance Vector Routing

Consider transmission of one DV message Node 2 send to 3, 5, and 6 Node 6 installs cost 8 route to 2 Later 3 sends update to 6 6 changes route to make 3 the next hop for

destination 2

Page 22: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 22

Proposal

4

36

21

9

1

1D

A

FEB

C

Each node discovers its neighbors and tells one specific node (the leader) what they find. The leader runs an algorithm to solve the all-pairs shortest path problem, computing routing tables for each node. The leader communicates the routing table to each node, which stores it in non-volatile memory in each of the nodes.

Question: What are the problems with this method?

Page 23: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 23

Distance Vector Routing

D

G

A

F

E

B

C

Info at node

Distance to nodeA B C D E F G

A 0 1 1 1 1B 1 0 1C 1 1 0 1D 1 0 1E 1 0F 1 0 1G 1 1 0

Dest Cost NextHop

B 1 B

C 1 C

D -

E 1 E

F 1 F

G -

Global view

A’s view: vector

Page 24: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 24

Distance Vector Routing

D

G

A

F

E

B

C Every node starts by building it’s own local view of what nodes are 1 hop away.

Next, every node sends its vector to its directly connected neighbors.

F tells A that it can reach G at cost 1. A knows it can reach F at cost 1, so it updated its own vector to indicate that it can reach G at cost 2. If A were to discover another route to G at a cost higher than 2, it would ignore it and leave its vector as it is.

After a few iterations of these exchanges, the routing table converges to a consistent state.

Question: How would this method deal with link failures?

Page 25: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 25

Distance Vector Routing

D

G

A

F

E

B

C Periodic updates: Every t seconds, send your local info to your neighbors. This allows other nodes to know that you are running.

Triggered updates: Every time you learn new information from a neighbor that leads you to update your local vector, you send the recomputed vector to all your neighbors.

Question: How can you detect that a node has failed?

Page 26: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 26

The Count-to-infinity Problem

D

G

A

F

E

B

C

Link (A,E) goes down. A periodic update kicks in and A advertises that its distance to E is infinity. At about the same time, B and C tell each other that they can reach E in 2 hops. B knows now that it can’t communicate with E via A, but concludes that it can send traffic to C which says it can reach A in 2 hops. Now, B is thinking that its distance to E is 3 hops and it lets A know about that. Argh, now A is going to think it can reach E in 4 hops and it will tell C of this “fact”… Where does this end?

The routing table doesn’t converge or stabilize.

Page 27: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 27

Link-State Routing Overcomes instabilities in DV Pair of switches periodically

Test link between them Broadcast link status message

Switch Receives status message Computes new routes Uses Dijkstra’s algorithm

Page 28: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 28

Link State RoutingAssumptions: Each node can discover the state of

the link to its neighbors and the cost of each link.

Basic principle: If every node knows how to reach its directly connected neighbors, one can spread the local knowledge of each node to all other nodes in the network so that every node can construct a the network weighted graph. With this knowledge, a node can always determine the shortest path to any other node in the network.

Page 29: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 29

Link State Routing MechanismsReliable dissemination of link-state information flooding.Calculation of routes from the sum of all the accumulated link-state knowledge.

(a)

X A

C B D

(b)

X A

C B D

(c)

X A

C B D

(d)

X A

C B D

Page 30: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 30

Reliable FloodingQuestion: If you are a node and you want to tell

your neighbors the state of the links incident to you, what should be contained in the information packets that you pass to them?

Underlying Problems:A packet should reflect the state of your links at a given point in time.You need to ensure that old link-state information eventually stops circulating around the network.

Page 31: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 31

Reliable FloodingQuestion: How can one guarantee that the link-

state packets sent from a node will definitely arrive at its neighbors?

Question: How does one deal with the possibility of having multiple, contradictory copies of a node’s link-state packets circulate the network at the same time?

Page 32: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 32

Link-State Packet (LSP) CreatorID: identity of the packet creator. NeighborsList: a list of tuples like <NeighborId, link cost>. SequenceNumber: a counter value that places this packet in the context of all LSPs sent out by the creator of this packet. TTL: time to live in number of hops.

Question: When should a node send out an LSP?

Page 33: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 33

Dealing with LSPsAn LSP is sent out when:

A periodic time expires. A topology change is detected.

Important: Routing messages, that is LSPs, are overhead in the network and they should be kept to a minimum.

Page 34: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 34

Route Calculation(based on Dijkstra’s shortest-path algorithm)

Assumptions: A node constructs a graph to represent the network to the best of its

knowledge (received LSPs). N: |V|, number of nodes. l(i,j): Non-negative weight of edge (i,j). M: nodes set of nodes incorporated so far for some node s. C(n): cost of the path from node s to node n.

Algorithm for a node s:M = {s}for each n in N-{s} do: C(n)=l(s,n)while (N not equal M)

M=M U{w} such that C(w)=min{for all w in (N-M)}for each n in (N-M) do: C(n)=min{C(n), C(w)+l(w,n)}

Page 35: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 35

Example of Link-State Information

Assume nodes 2 and 3 Test link between them Broadcast information

Each node Receives information Recomputes routes as needed

Page 36: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 36

Dijkstra’s Shortest Path Algorithm Input

Graph with weighted edges Node, n

Output Set of shortest paths from n to each node Cost of each path

Called Shortest Path First (SPF) algorithm

Page 37: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 37

Dijkstra’s Algorithm

Page 38: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 38

Algorithm Intuition

Start with self as source node Move outward At each step

Find node u such that it Has not been considered Is “closest” to source

Compute Distance from u to each neighbor v If distance shorter, make path from u go through v

Page 39: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 39

Result of Dijkstra’s Algorithm

Example routes from node 6 To 3, next hop = 3, cost = 2 To 2, next hop = 3, cost = 5 To 5, next hop = 3, cost = 11 To 4, next hop = 7, cost = 8

Page 40: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 40

Properties of Link-State Routing

Stabilizes quickly. Keeps routing control traffic low. Responds rapidly to topology changes. Doesn’t scale well: the amoung of information stored in each node is large.

Page 41: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 41

Early WAN Technologies ARPANET

Historically important in packet switching Fast when invented, slow by current standards

X.25 Early commercial service Still Used More popular in Europe

Page 42: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 42

Recent WAN Technologies SMDS

Offered by phone companies Not as popular as Frame Relay

Frame Relay Widely used commercial service Offered by phone companies

ATM

Page 43: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 43

Page 44: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 44

Page 45: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 45

Page 46: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 46

Page 47: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 47

Page 48: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 48

Page 49: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 49

Page 50: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 50

Page 51: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 51

Page 52: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 52

Page 53: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 53

Page 54: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 54

Page 55: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 55

Assessment of ATM In practice, failed to deliver on promise Switches initially too expensive for LAN QoS difficult to implement cost-effectively

Page 56: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 56

Summary Wide Area Networks (WANs)

Span long distances Connect many computers Built from packet switches Use store-and-forward

WAN addressing Two-part address Switch/computer

Page 57: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 57

Summary (continued) Routing

Each switch contains routing table Table gives next-hop for destination

Routing tables created Manually Automatically

Two basic routing algorithms Distance vector Link state

Page 58: SEPT, 2005CSI 41181 Part 3.1 Wide Area Networks (WANs), Routing, and Shortest Paths Robert L. Probert, SITE, University of Ottawa

SEPT, 2005 CSI 4118 58

Summary (continued) Example WAN technologies

ARPANET X.25 SMDS Frame Relay ATM