network layer6-1 2011 session 1 tele3118: network technologies week 6: network layer intra-domain...

27
Network Layer 6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: Computer Networking: A Top Down Approach Featuring the Internet , 3 rd edition. Jim Kurose, Keith Ross. Addison-Wesley, July 2004. All material copyright 1996-2004. J.F Kurose and K.W. Ross, All Rights Reserved.

Upload: geoffrey-watson

Post on 14-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-1

2011 session 1TELE3118: Network

Technologies

Week 6: Network LayerIntra-Domain Routing Protocols

Some slides have been taken from:Computer Networking: A Top Down Approach Featuring the Internet, 3rd edition. Jim Kurose, Keith Ross. Addison-Wesley, July 2004. All material copyright 1996-2004. J.F Kurose and K.W. Ross, All Rights Reserved.

Page 2: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-2

IP routing0.0.0.0 0 192.168.1.1

10.0.0.0 8 172.20.4.1

200.23.16.0 20 199.31.18.4

200.23.18.0 23 172.20.4.1

10.20.0.0 24 199.31.18.4

192.168.1.0 24 L 192.168.1.18

172.20.4.0 24 L 172.20.4.253

199.31.18.0 24 L 199.31.18.52

destination mask loca

l

next-hop

LAN

inte

rface

s172.20.4.253/24

192.168.1.18/24199.31.18.52/24

How is the routing table constructed? Static (manual) Dynamic (routing protocol)

Page 3: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-3

The Internet Network layer

Note on terminology: “routing” vs. “forwarding” “routing table” vs. “forwarding table”

forwardingtable

Routing protocols•path selection•RIP, OSPF, BGP

IP protocol•addressing conventions•datagram format•packet handling conventions

ICMP protocol•error reporting•router “signaling”

Transport layer: TCP, UDP

Link layer

physical layer

Networklayer

Page 4: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-4

1

23

0111

value in arrivingpacket’s header

routing algorithm

local forwarding tableheader value output link

0100010101111001

3221

“routing” and “forwarding” tables

Page 5: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-5

Routing: abstract model

Graph abstraction for routing algorithms:

graph nodes are routers

graph edges are physical links link cost: delay, $

cost, or congestion level

Goal: determine “good” path

(sequence of routers) thru network from source to

dest.

Routing protocol

A

ED

CB

F

2

2

13

1

1

2

53

5

“good” path: typically means

minimum cost path other def’s possible

Page 6: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-6

Routing algorithm classification

Distance-vector algorithm

Local information: router knows physically-

connected neighbors, link costs to neighbors

2 components: Neighbor routing-table

exchange Bellman-Ford (also

called Ford-Fulkerson) computation

E.g.: RIP

Link-state algorithm Global information:

router knows complete topology and link cost info of entire network

2 components: Reliable flooding Dijkstra shortest-path

tree (SPT) computation

E.g.: OSPF, IS-IS

Page 7: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-7

Distance vector - RIP

Each node maintains a table of triples.

D

G

A

F

E

B

C

Destination Cost Next-hop

A 1 A

C 1 C

D 2 C

E 2 A

F 2 A

G 3 A

table at B:

Page 8: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-8

RIP: overview

Iterative, asynchronous, distributed Directly connected neighbors exchange

updates periodically (on the order of several seconds) whenever table changes (called triggered update)

Each update is a vector of distances: (Destination, Cost)

Update local table if receive a “better” route smaller cost came from next-hop

Refresh existing routes; delete if they time out

Page 9: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-9

RIP: example

Destination Cost Next-hop

B 1 B

C 1 C

D ∞ -

E 1 E

F 1 F

G ∞ -

D

G

A

F

E

B

C

Destination Cost Next-hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G ∞ -

Destination Cost Next-hop

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 2 F

Initial table at A:

After receiving update from C:

After receiving update from F:

Page 10: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-10

RIP: recovering from link failure

Dest Cost Nh

A 1 A

B 2 A

C 2 A

D ∞ -

E 2 A

G ∞ -

D

G

A

F

E

B

C

Dest Cost Nh

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G ∞ -

Dest Cost Nh

B 1 B

C 1 C

D 2 C

E 1 E

F 1 F

G 3 C

At F:

At A:A receives update from C:

Dest Cost Nh

A 1 A

B 2 A

C 2 A

D 3 A

E 2 A

G 4 A

F receives update from A:

Page 11: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-11

RIP: link cost decreases

X Z14

12

Y1

X 4 X

Z 1 Z

X 5 Y

Y 1 Y

X 1 X

Z 1 Z

X 5 Y

Y 1 Y

X 1 X

Z 1 Z

X 2 Y

Y 1 Y

At Y:

At Z:

Good news travels fast

Page 12: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-12

RIP: link cost increases

X Z14

12

Y14

X 4 X

Z 1 Z

X 5 Y

Y 1 Y

X 6 Z

Z 1 Z

X 5 Y

Y 1 Y

X 6 Z

Z 1 Z

X 7 Y

Y 1 Y

At Y:

At Z:

X 8 Z

Z 1 Z

X 7 Y

Y 1 Yand so on

Bad news travels slow “count to infinity” problem loops!

Page 13: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-13

Breaking the loop …

X Z

14

12

Y14

X 4 X

Z 1 Z

X 5 Y

Y 1 Y

X 14 X

Z 1 Z

X 5 Y

Y 1 Y

X 14 X

Z 1 Z

X 12 X

Y 1 Y

At Y:

At Z:

X 13 Z

Z 1 Z

X 12 X

Y 1 Y

Does this solve the “count to infinity” problem?

If next-hop to D is R: Split Horizon: do not include D

in update to R Split Horizon with Poison

Reverse: include D, but with metric = ∞

Page 14: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-14

… is not always easy

Dest Cost Nh

B 1 B

C 1 C

D 2 C

E ∞ -

F 1 F

G 2 F

D

G

A

F

E

B

C

Dest Cost Nh

A 1 A

C 1 C

D 2 C

E 3 C

F 2 A

G 3 A

Dest Cost Nh

B 1 B

C 1 C

D 2 C

E 4 B

F 1 F

G 2 F

At A:

B receives update from C:A receives update from B:

Dest Cost Nh

A 1 A

B 1 C

D 1 D

E 5 A

F 2 A

G 2 D

C receives update from A:

Page 15: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-15

RIPv2 (RFC 2453) details

Included in BSD-UNIX Distribution in 1982 Distance metric: # of hops (∞ = 16): why? Distance vectors only exchanged among

neighbors Up to 25 destinations per RIP update message Update-interval is 30 sec:

If too large, convergence is slow If too small, too much traffic

Triggered update whenever change in routing table

Split horizon mandatory, poison reverse optional

Page 16: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-16

RIPv2 details (contd.)

Updates sent every 30 (+/- 5) seconds

Route not refreshed for 180 sec is timed-out Still included in update

messages Timed-out route is deleted

(garbage-collected) after 120 sec

Triggered update timer set for 1-5 sec Includes only changed routes Suppressed if regular update due

Address of net 2

Distance to net 2

Command Must be zero

Family of net 2 Must be zero

Family of net 1 Must be zero

Address of net 1

Distance to net 1

Version

0 8 16 31

subnet mask of net 1

subnet mask of net 2

next hop of net 1

next hop of net 2

Page 17: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-17

RIP: where does it run? RIP runs as application-level process (route-d) Updates sent as UDP message (port 520) Multicast IP address 224.0.0.9 (with TTL=1)

physical

link

network forwarding (IP) table

Transprt (UDP)

routed

physical

link

network (IP)

Transprt (UDP)

routed

forwardingtable

Page 18: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-18

Link State - OSPF

Strategy: each node learns complete topology send information about directly connected links (not

entire routing table) to entire network (not just neighbors)

Link State Advertisement (LSA) include Nodes (routers) and links (networks) Sequence number and age

Reliable flooding Store most recent LSA for each node Send LSA to all nodes except one that sent it Generate LSA periodically (with higher sequence

number) Age out each stored LSA

Page 19: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-19

A Link-State Routing Algorithm

Notation: c(x,y): link cost from node x

to y; = ∞ if not direct neighbors

D(v): current value of cost of path from source to dest. v

p(v): predecessor node along path from source to v

N': set of nodes whose least cost path definitively known

Dijkstra’s algorithm Given: all nodes know full

topology and link costs Objective: compute least

cost paths from self to all other nodes routing table

iterative: after k iterations, know least cost path to k destinations

distributed: each node computes shortest-path tree from itself

Page 20: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-20

Dijsktra’s Algorithm

1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = ∞ 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'

Page 21: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-21

Dijkstra’s algorithm: example

Step012345

N'u

uxuxy

uxyvuxyvw

uxyvwz

D(v),p(v)2,u2,u2,u

D(w),p(w)5,u4,x3,y3,y

D(x),p(x)1,u

D(y),p(y)∞

2,x

D(z),p(z)∞ ∞

4,y4,y4,y

u

yx

wv

z2

2

13

1

1

2

53

5

Page 22: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-22

Dijkstra’s algorithm, discussionAlgorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(nlogn)

Link Metric Static: link latency, link capacity, … Dynamic: based on load?

e.g.: link cost = amount of carried traffic oscillations!

A

D

C

B1 1+e

e0

e

1 1

0 0

A

D

C

B2+e 0

001+e1

A

D

C

B0 2+e

1+e10 0

A

D

C

B2+e 0

e01+e1

initially… recompute

routing… recompute … recompute

Page 23: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-23

OSPF details RFC 2328 (244 pages long!) Neighbor up/down detected using “hello” packets LSA reliable flooding over entire AS

LSA includes sequence number and age LSA integrity using checksum (excludes age)

OSPF messages directly over IP (no UDP or TCP) Hierarchical OSPF: allow scaling to larger networks 5 types of LSAs:

1. Router LSA: set of nodes2. Network LSA: set of links3. Summary LSA: inter-area networks4. Summary LSA: area-border-routers5. External LSA: external to AS

Page 24: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-24

Hierarchical OSPF

Page 25: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-25

Hierarchical OSPF

Two-level hierarchy: local area, backbone. Link-state advertisements only in area each nodes has detailed area topology; only know

direction (shortest path) to nets in other areas. Area border routers: “summarize” distances to

nets in own area, advertise to other Area Border routers.

Backbone routers: run OSPF routing limited to backbone.

Boundary routers: connect to other AS’s.

Page 26: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-26

OSPF “advanced” features (not in RIP)

Authentication: prevents malicious intrusion Hierarchy: allows larger domains Load balancing: equal-cost multi-path (ECMP) Extensions to support:

Multicast: MOSPF Traffic-engineering: OSPF-TE

Page 27: Network Layer6-1 2011 session 1 TELE3118: Network Technologies Week 6: Network Layer Intra-Domain Routing Protocols Some slides have been taken from: r

Network Layer 6-27

Comparison of LS and DV algorithms

Messaging DV: entire routing table,

but only exchanged between neighbors

LS: small messages, but flooded in whole network

Speed of Convergence DV: multiple iterations,

each requires recompute and transmit count-to-infinity

problem LS: flood and recalculate,

one shot, faster

Robustness: both LS and DV can be wrecked by one bad router.

In 1997 a bad router in a small ISP advertised a false cost, became flooded with traffic, disconnecting ISPs from most U.S. backbone providers for ~3 hours

Bottom line: No clear winner in terms of

complexity, robustness, etc LS often favored due to

faster convergence