23
1 CMPE 150- Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 21 Introduction to Computer Networks

CMPE 150 Fall 2005 Lecture 21

  • Upload
    elpida

  • View
    42

  • Download
    0

Embed Size (px)

DESCRIPTION

CMPE 150 Fall 2005 Lecture 21. Introduction to Computer Networks. Announcements. Homework 4 up. Due on 11.23.05. Lab this week: “The Internet Behind the Web” video. Today. Finish DLL!. Last Class…. Network Layer. Focus on packet switching networks. Main functions. - PowerPoint PPT Presentation

Citation preview

Page 1: CMPE 150 Fall 2005 Lecture 21

1CMPE 150- Introduction to Computer Networks

CMPE 150

Fall 2005Lecture 21

Introduction to Computer Networks

Page 2: CMPE 150 Fall 2005 Lecture 21

2CMPE 150- Introduction to Computer Networks

Announcements

• Homework 4 up.• Due on 11.23.05.• Lab this week:– “The Internet Behind the Web” video.

Page 3: CMPE 150 Fall 2005 Lecture 21

3CMPE 150- Introduction to Computer Networks

Today

• Finish DLL!

Page 4: CMPE 150 Fall 2005 Lecture 21

4CMPE 150- Introduction to Computer Networks

Last Class…

• Network Layer.– Focus on packet switching networks.

– Main functions.

– Different network layer implementations.• Datagrams versus virtual circuits.

Page 5: CMPE 150 Fall 2005 Lecture 21

5CMPE 150- Introduction to Computer Networks

Virtual-Circuit versus Datagram Subnets

5-4

Page 6: CMPE 150 Fall 2005 Lecture 21

6CMPE 150- Introduction to Computer Networks

Routing

Page 7: CMPE 150 Fall 2005 Lecture 21

7CMPE 150- Introduction to Computer Networks

Routing

• One of the main functions of network layer.• Routing versus forwarding?• Datagram versus VC networks?

Page 8: CMPE 150 Fall 2005 Lecture 21

8CMPE 150- Introduction to Computer Networks

Routing Algorithm

• Computes routing tables.• Properties:– Correctness.

– Robustness.

– Stability.

– Optimality.• Try to optimize a certain metric.

Page 9: CMPE 150 Fall 2005 Lecture 21

9CMPE 150- Introduction to Computer Networks

Optimality Principle

• General statement about optimal routes (topology, routing algorithm independent).

• If router J is on optimal path between I and K, then the optimal path from J to K also falls along the same route.– Proof by contradiction.

• Corollary:– Set of optimal routes from all sources to destination form a

tree rooted at destination.

– Sink tree.

Page 10: CMPE 150 Fall 2005 Lecture 21

10CMPE 150- Introduction to Computer Networks

Types of Routing Algorithms

• Non-adaptive versus adaptive.

Page 11: CMPE 150 Fall 2005 Lecture 21

11CMPE 150- Introduction to Computer Networks

Adaptive and Non-adaptive Routing• Non-adaptive routing:– Fixed routing, static routing.– Do not take current state of the network (e.g., load,

topology).– Routes are computed in advance, off-line, and

downloaded to routers when booted.

• Adaptive routing:– Routes change dynamically as function of current

state of network.– Algorithms vary on how they get routing information,

metrics used, and when they change routes.

Page 12: CMPE 150 Fall 2005 Lecture 21

12CMPE 150- Introduction to Computer Networks

Static Algorithms

(Non-Adaptive)

1.Shortest-path routing.

2.Flooding.

Page 13: CMPE 150 Fall 2005 Lecture 21

13CMPE 150- Introduction to Computer Networks

Shortest-Path Routing

• Problem: Given a graph, where nodes represent routers and edges, links, find shortest path between a given pair of nodes.

• What is shortest in shortest path?– Depends on the routing metric in use.

– Example: number of hops (static), geographic distance (static), delay, bandwidth (raw versus available), combination of a subset of these.

• Dijkstra’s shortest-path algorithm (19590.

Page 14: CMPE 150 Fall 2005 Lecture 21

14CMPE 150- Introduction to Computer Networks

Dijkstra’s Shortest-Path Algorithm• Initially, links are assigned costs.• As the algorithm executes, nodes are labeled

with its distance to source along best known path.

• Initially, no routes known, so all nodes are labeled with infinity.

• Labels change as the algorithm proceeds.• Labels can be temporary or permanent.– Initially all labels are tentative.– A label becomes permanent if it represents the

shortest path from the source to the node.

Page 15: CMPE 150 Fall 2005 Lecture 21

15CMPE 150- Introduction to Computer Networks

Shortest Path RoutingFind shortest-path from A to D:

Start

Label each adjacent node with distance to A.

B is madepermanent.

Page 16: CMPE 150 Fall 2005 Lecture 21

16CMPE 150- Introduction to Computer Networks

Flooding

• Every incoming packet forwarded on every outgoing link except the one it arrived on.

• Problem: duplicates.• Constraining the flood:– Hop count.

– Keep track of packets that have been flooded.

• Robust, shortest delay (picks shortest path as one of the paths).

Page 17: CMPE 150 Fall 2005 Lecture 21

17CMPE 150- Introduction to Computer Networks

Flooding: Example

•Stallings Figure 12.4

(hop-count=3)

Page 18: CMPE 150 Fall 2005 Lecture 21

18CMPE 150- Introduction to Computer Networks

Dynamic Routing Algorithms

• (Adaptive Routing)–Distance vector routing.– Link state routing.

Page 19: CMPE 150 Fall 2005 Lecture 21

19CMPE 150- Introduction to Computer Networks

Distance Vector Routing

• Aka, Bellman-Ford (1957), Ford-Fulkerson (1962).• Original ARPANET routing; also used by Internet’s

RIP.• Each router keeps routing table (or routing vector)

with best known distance to each destination and corresponding outgoing interface.

• Routing tables are updated by exchanging routing information with neighbors.

Page 20: CMPE 150 Fall 2005 Lecture 21

20CMPE 150- Introduction to Computer Networks

Distance Vector (Cont’d)

• Routing table at each router:– One entry per participating router.

– Each entry contains outgoing interface and distance to corresponding destination.

– Metric: number of hops, delay, queue length.

– Each router knows distance to its neighbors.

• Old ARPANET algorithm: DV where cost metric is outgoing link queue length.

Page 21: CMPE 150 Fall 2005 Lecture 21

21CMPE 150- Introduction to Computer Networks

Distance Vector Routing

• (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

Page 22: CMPE 150 Fall 2005 Lecture 21

22CMPE 150- Introduction to Computer Networks

Routing Updates

• Every T interval, routers exchange routing updates.

• Routing update from router X consists of a vector with all destinations and the corresponding distance from X to them.

• When router Y receives an update from X, it can estimate its distance to router Z through X as Dyz = Dyx + Dxz.

• Router Y receives update from all its neighbors and builds a new RT.

Page 23: CMPE 150 Fall 2005 Lecture 21

23CMPE 150- Introduction to Computer Networks

Distance Vector: Example

1

4

6

2 3

5

1Node Distance Next

2

33

2

1

9

9

5

1

2 1 0 -

2 2 2

3 5 3

4 1 45 6 3

6 8 3

T=T0T=T1

3 7 5

2 3 4

0 4 2

3 0 2

2 2 03 1 15 3 3

Node Distance Next

1 0 -

2 2 2

3 3 4

4 1 45 2 4

6 4 4

T=T2

7