14
1 1 Smith College, CSC 249 March 8, 2017 Overview q Review of theoretical routing algorithms v Link state & Dijkstra’s algorithm v Distance vector & Bellman-Ford equation q Routing in the Internet v Implementation of Link-state and Distance- vector in actual networks v Intra-networking & Inter-networking v RIP & OSPF v Border Gateway Protocol, BGP 2

14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

1

1

Smith College, CSC 249 March 8, 2017

Overview

q Review of theoretical routing algorithms v Link state & Dijkstra’s algorithm v Distance vector & Bellman-Ford equation

q Routing in the Internet v  Implementation of Link-state and Distance-

vector in actual networks v  Intra-networking & Inter-networking v RIP & OSPF v Border Gateway Protocol, BGP

2

Page 2: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

2

3

Routing Algorithms

u

y x

w v

z 2

2 1 3

1

1 2

5 3

5

The objective of a routing algorithm is to find the least-cost, and loop-free path between all sources and all destinations (routers, not hosts)

Q: Compare & Contrast Routing

q What is the objective of routing algorithms?

q Compare and contrast Link-State and Distance-Vector v What does each do? v What does each do the same as the other

algorithm? v What do they do differently?

4

Page 3: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

3

Summary Table Comparing Link-State and Distance-Vector Name Algorithm/EquationDescription

&OverviewInitialInformation,

atStart-UpMessageComplexity

andVolume

RouterMalfunctions?Informationthatisshared?Routercalculateswhat?

LinkState

DistanceVector

OpenShortestPathFirst(OSPF)

RoutingInformationProtocol(RIP)

BorgerGatewayProtocol(BGP)

6

Overview of Routing & Recap… q  The set of routers comprise a

distributed database v Routers propagate information to other

routers q  Distribute State of Links

v Advertise information about each link to which it is connected (the ‘state’ of the link)

v Flood the network with this information q  Distribute Vectors

v Advertise a vector with information on each destination it can ‘reach’ (entire network)

v Communicates only with neighbors

Page 4: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

4

7

A Link-State Routing Algorithm Dijkstra’s algorithm q Computes the shortest paths in a graph by

using weights on edges as a measure of distance.

q Each node has global information on network topology and edge weights Ø Starts with complete information

8

w 3

4

v

x

u

5

3 7 4

y

8

z 2

7

9

Dijkstra’s algorithm: example Step

N'

D(v) p(v)

0 1 2 3 4 5

D(w) p(w)

D(x) p(x)

D(y) p(y)

D(z) p(z)

u ∞ ∞ 7,u 3,u 5,u uw ∞ 11,w 6,w 5,u

14,x 11,w 6,w uwx uwxv 14,x 10,v

uwxvy 12,y

notes: v  Construct shortest path tree

by tracing predecessor nodes v  Construct the forwarding table

by recording the next hop to the destination node

v  What is the forwarding table??

uwxvyz

Page 5: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

5

9

Distance vector algorithm q  Each node begins with Dx(y)

v  An estimate of the cost of the least-cost path from itself to node y, for all nodes in N (might be ∞)

v  (Some nodes might not be known to exist at the start) q  Each node periodically sends its own distance

vector estimate to neighbors v  è A vector of least costs from itself to all other routers

q  When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation, and sends any update to its neighbors

Dx(y) = minv{c(x,v) + Dv(y)} for each node y ∊ N

10

Distance table to forwarding table D ()

A

B

C

D

A

1

7

6

4

B

14

8

9

11

D

5

5

4

2

E cost to destination via

dest

inat

ion

A

B

C

D

A, 1

D, 5

D, 4

D, 2

Outgoing link to use, cost

dest

inat

ion

Distance table Routing table ForwardingTable

Distance Vector sent around: (A-1, B-5, C-4, D-2)

Page 6: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

6

16

Hierarchical Routing & Autonomous Systems

q  aggregate routers into regions, “autonomous systems” (AS)

q  routers in same AS run the same routing protocol v  “intra-AS” routing protocol

q  routers in different AS can run different intra-AS routing protocol

q  special routers in AS q  run intra-AS routing

protocol with all other routers in AS

q  run inter-AS routing protocol with other gateway routers v  also responsible for

routing to destinations outside AS

gateway routers

Internet structure: network of networks

access net

access net

access net

access net

access net

access net

access net

access net

access net

access net

access net

access net

access net

access net access

net

access net

… … …

ISP B

ISP A

ISP B

regional net

Page 7: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

7

18

Intra-AS and Inter-AS routing

Host h2

a

b

b

a a C

A

B d c

A.a A.c

C.b B.a

c b

Host h1

Intra-AS routing within AS A

Inter-AS routing between A and B

Intra-AS routing within AS B

19

a

b

b

a a C

A

B d

A.a A.c

C.b B.a

c b

c

Internet AS Hierarchy Inter-AS border (gateway) routers

Intra-AS interior routers

Page 8: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

8

20

Intra-AS Routing

q Also known as interior gateway protocols (IGP) q Most common intra-AS routing protocols:

v RIP: Routing Information Protocol • Distance Vector

v OSPF: Open Shortest Path First •  Link State

23

Question: RIP vs. OSPF

q  Given what we know of LS and DV algorithms, compare the advertisements used by RIP and OSPF

q  OSPF – (link state) router periodically broadcasts state of its attached links to all other routers in the AS

q  RIP – (distance vector) information is sent about all the networks in the AS; is only sent to its neighboring routers

Page 9: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

9

24

Inter-AS routing

a

b

b

a

a C

A

B

d

A.a

A.c

C.b B.a

c

b

c

25

Internet inter-AS routing: BGP

q BGP (Border Gateway Protocol): the de facto standard

q Path Vector protocol: v similar to Distance Vector protocol v each Border Gateway broadcasts to

neighbors (peers) entire path (i.e., a sequence of ASs) to destination

Page 10: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

10

26

BGP basics

AS3

AS2

3b

3c 3a

AS1

1c 1a

1d 1b

2a 2c

2b other networks

other networks

v  BGP session: two BGP routers (“peers”) exchange BGP messages: §  advertising paths to different destination network prefixes

(“path vector” protocol) §  exchanged over semi-permanent TCP connections

BGP message

27

Concepts: RIP vs. BGP

q  RIP ads announce the number of hops to various destinations while BGP updates announce the __________ to various destinations v The sequence of ASs on the routes

q  Describe how loops in paths can be detected in BGP. v Since full AS path information is available from

an AS to a destination in BGP – if a BGP peer receives a route that contains its own AS number in the AS path, then using that route would result in a loop.

Page 11: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

11

28

Different Intra- and Inter-AS routing Policy: q  Inter-AS: admin wants control over how its traffic is

routed, and who routes through its network. q  Intra-AS: single administrative staff, so no policy

decisions needed Scale: q  hierarchical routing saves table size & reduces

traffic with update packets Performance: q  Intra-AS: can focus on performance q  Inter-AS: policy may dominate over performance

29

Traceroute, Ping and ICMP

q Good discussion in text for how Traceroute and Ping work, using ICMP

Page 12: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

12

ICMP: internet control message protocol q  used by hosts & routers

to communicate network-level information v  error reporting:

unreachable host, network, port, protocol

v  echo request/reply (used by ping)

q  network-layer “above” IP: v  ICMP messages are carried

in IP datagrams

q  ICMP message: type, code plus first 8 bytes of IP datagram causing error

Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

31

Traceroute and ICMP q  source sends series of

UDP segments to dest v  first set has TTL =1 v  second set has TTL=2, etc. v  unlikely port number

q  when nth set of datagrams arrives to nth router: v  router discards datagrams v  and sends source ICMP

messages (type 11, code 0) v  ICMP messages includes

name of router & IP address

q  when ICMP messages arrives, source records RTTs

stopping criteria: v  UDP segment eventually

arrives at destination host v  destination returns ICMP “port unreachable” message (type 3, code 3)

v  source stops

3 probes

3 probes

3 probes

Page 13: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

13

32

Broadcast Routing

q Uses? → Link-state routing algorithms

q Deliver packets from source to all other nodes

Multicast Routing

q Uses? v Bulk data (software upgrade) transfer v Streaming audio-visual media v Shared data application

(teleconference) v Data feeds (stock quotes) v Interactive gaming

Page 14: 14. Routing 3 - Clark Science Centerjcardell/Courses/CSC249/slides/C14_249.pdf · 5 9 Distance vector algorithm q Each node begins with D x(y) v An estimate of the cost of the least-cost

14

34

Summary for Network Layer Forwarding: q Leads to questions of addressing

v Assignment of IP addresses (& DHCP) v NAT, IPv6 …

Routing: q Routing objectives q Routing notation q Link state v. Distance Vector q Hierarchical structure