CSE 30264 Computer Networks

51
CSE 30264 Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 12 – February 18, 2010

description

CSE 30264 Computer Networks. Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 12 – February 18, 2010. Today’s Lecture. Routing Distance Vector Link State Global Routing. Application. Transport. Network. Data. Physical. - PowerPoint PPT Presentation

Transcript of CSE 30264 Computer Networks

Page 1: CSE 30264 Computer Networks

CSE 30264

Computer Networks

Prof. Aaron StriegelDepartment of Computer Science & Engineering

University of Notre Dame

Lecture 12 – February 18, 2010

Page 2: CSE 30264 Computer Networks

CSE 30264 2

Today’s Lecture

• Routing– Distance Vector– Link State

• Global Routing

Spring 2010

Physical

Data

Network

Transport

Application

Page 3: CSE 30264 Computer Networks

Spring 2009 CSE30264 3

Routing (Revisited)

OutlineDistance VectorLink State

Page 4: CSE 30264 Computer Networks

Spring 2009 CSE30264 4

Overview• Forwarding vs Routing

– Forwarding: to select an output port based on destination address and routing table

– Routing: process by which routing table is built• Network as a Graph

• Problem: Find lowest cost path between two nodes– How much do you know?

• Distance vector: Just my neighbors and who they can reach• Link state: Everything on my network

Page 5: CSE 30264 Computer Networks

Spring 2009 CSE30264 5

Distance Vector• Each node maintains a set of triples

– (Destination, Cost, NextHop)

Destination Cost Next HopA 0 Local

B 2 E

C 7 B

D 2 E

.. .. ..

Exchange the vector (the table) of my current routing information

Page 6: CSE 30264 Computer Networks

CSE 30264 6

Routing Revisited

Spring 2010

A

F

EB

C D

36

11

2

1

9

4

Page 7: CSE 30264 Computer Networks

CSE 30264 7

Time t=0, Start Time

Spring 2010

A

F

EB

C D

36

11

2

1

9

4

Perspective of A

A’s Routing Table

A C=0 NH: *

Assume know our neighbors and link cost

B C=3 NH: BE C=1 NH: EF C=6 NH: F

Page 8: CSE 30264 Computer Networks

CSE 30264 8

Symmetry

Spring 2010

A

B

3 A

B

3

3

Cost in either direction is the same

Page 9: CSE 30264 Computer Networks

CSE 30264 9

A sends to its neighbors

Spring 2010

A C=0 NH: Me

B C=3 NH: BE C=1 NH: EF C=6 NH: F

Routing Table

Vector of reachability

B,3

E,1

F,1

Send this to our neighbors

A

F

EB

Page 10: CSE 30264 Computer Networks

CSE 30264 10

E broadcasts to its neighbors

Spring 2010

A

F

EB

C D

36

11

2

1

9

4A,1

B,1

D,1

F,2

Distance Vector

Vector = Here is my best cost to get to these locations if you come through me

Page 11: CSE 30264 Computer Networks

CSE 30264 11

Gather round….

• Send our distance vector– Cost to reach nodes through us– Two ways

• Cost in the vector• Let external node put in cost

• When we receive a DV– Are any routes better than our own?– Could we take the cost of using

that link and navigate via that node?

Spring 2010

Page 12: CSE 30264 Computer Networks

CSE 30264 12

What happens at A?

Spring 2010

A

F

EB

C D

36

11

2

1

9

4

Perspective of A

A’s Routing Table

A C=0 NH: *

B C=3 NH: BE C=1 NH: EF C=6 NH: F

A,1

B,1

D,1

F,2

DV from EThat’s us, duh

Compare new vs. current

3 vs. 1+1 via EInf vs. 1+1 via E6 vs. 1+2 via E

Page 13: CSE 30264 Computer Networks

CSE 30264 13

What happens at A?

Spring 2010

A

F

EB

C D

36

11

2

1

9

4

Perspective of A

A’s Routing Table

A C=0 NH: *

B C=3 NH: BE C=1 NH: EF C=6 NH: F

A C=0 NH: *

B C=2 NH: EE C=1 NH: EF C=3 NH: ED C=E NH: E

Page 14: CSE 30264 Computer Networks

CSE 30264 14

Convergence

• Convergence– Stop when no more changes– Non-convergence bad

• We’ll see that in a moment• How?

– Only send on change of local table– Stop seeing bcast, stop

Spring 2010

Page 15: CSE 30264 Computer Networks

Spring 2009 CSE30264 15

Routing Loops• Example 1

– F detects that link to G has failed– F sets distance to G to infinity and sends update t o A– A sets distance to G to infinity since it uses F to reach G– A receives periodic update from C with 2-hop path to G– A sets distance to G to 3 and sends update to F– F decides it can reach G in 4 hops via A

• Example 2– link from A to E fails– A advertises distance of infinity to E– B and C advertise a distance of 2 to E– B decides it can reach E in 3 hops; advertises this to A– A decides it can read E in 4 hops; advertises this to C– C decides that it can reach E in 5 hops…

Count to Infinity Problem

Page 16: CSE 30264 Computer Networks

Spring 2010 CSE30264 16

Loop-Breaking Heuristics

• Set infinity to 16• Split horizon• Split horizon with poison reverse

Page 17: CSE 30264 Computer Networks

CSE 30264 17

Is DV used?

• Yes– RIP – Routing Information Protocol– BGP – Border Gateway Protocol*

• Sort of, BGP is kind of a hybrid– Various mobile routing protocols

Spring 2010

Page 18: CSE 30264 Computer Networks

Spring 2009 CSE30264 18

Routing Information Protocol (RIP)

• Distributed along with BSD Unix• Straightforward implementation of DV• Updates sent every 30 seconds• Link costs constant at 1 (16 = infinity)

Page 19: CSE 30264 Computer Networks

Spring 2009 CSE30264 19

Link State• Strategy

– Two-fold• Exchange HELLO msgs

with neighbors• Broadcast changes to all

of neighbor state

• Link State Packet (LSP)– ID of the node that created the LSP– Cost of link– Sequence number – TTL

Page 20: CSE 30264 Computer Networks

Spring 2009 CSE30264 20

Link State (cont)

• Changes Reliably flood– store most recent LSP from each node– forward LSP to all nodes but one that sent it– generate new LSP periodically

• increment SEQNO– start SEQNO at 0 when reboot– decrement TTL of each LSP

• discard when TTL=0

Page 21: CSE 30264 Computer Networks

Spring 2010 CSE30264 21

Flooding

Page 22: CSE 30264 Computer Networks

Spring 2009 CSE30264 22

Route Calculation• Dijkstra’s shortest-path algorithm• Let

– N denotes set of nodes in the graph– l (i, j) denotes non-negative cost (weight) for edge (i, j)– s denotes this node– M denotes the set of nodes incorporated so far– C(n) denotes cost of the path from s to node n

M = {s}for each n in N - {s}

C(n) = l(s, n)while (N != M)

M = M union {w} such that C(w) is the minimum for all w in (N - M)

for each n in (N - M)C(n) = MIN(C(n), C (w) + l(w, n ))

Page 23: CSE 30264 Computer Networks

CSE 30264 23

Link State Example

Spring 2010

A

F

EB

C D

36

11

2

1

9

4

Assume that A gets updates from everyone else via reliably flooded updates, i.e. A knows the topology of the graph

Page 24: CSE 30264 Computer Networks

CSE 30264 24

Link State Example

Spring 2010

A

F,*

E,*B,*

C,*D,*

36

11

2

1

9

4

Step 0: Set everyone’s weight to infinity Add ourselves as the lowest cost node

Page 25: CSE 30264 Computer Networks

CSE 30264 25

Link State Example

Spring 2010

A

F,*

E,*B,*

C,*D,*

36

11

2

1

9

4

Lowest cost total reachable cost EWho has the lowest total reachable cost from our covered net?

Page 26: CSE 30264 Computer Networks

CSE 30264 26

E wins, add it to our covered graph

Spring 2010

A

F,*

E,1B,*

C,*D,*

36

11

2

1

9

4

Lowest cost total reachable cost B or D tied at 2Who has the lowest total reachable cost from our covered net?

Page 27: CSE 30264 Computer Networks

CSE 30264 27

B wins, add it to our covered graph

Spring 2010

A

F,*

E,1B,2

C,*D,*

36

11

2

1

9

4

Lowest cost total reachable cost D at 2Who has the lowest total reachable cost from our covered net?

Page 28: CSE 30264 Computer Networks

CSE 30264 28

D wins, add it to our covered graph

Spring 2010

A

F,*

E,1B,2

C,*D,2

36

11

2

1

9

4

Lowest cost total reachable cost F with a cost of 3Who has the lowest total reachable cost from our covered net?

Page 29: CSE 30264 Computer Networks

CSE 30264 29

F wins, add it to our covered graph

Spring 2010

A

F,3

E,1B,2

C,*D,2

36

11

2

1

9

4

Lowest cost total reachable cost C with a cost of 6Who has the lowest total reachable cost from our covered net?

Page 30: CSE 30264 Computer Networks

CSE 30264 30

C wins, all done

Spring 2010

A

F,3

E,1B,2

C,6D,2

36

11

2

1

9

4

Page 31: CSE 30264 Computer Networks

CSE 30264 31

What does it mean?

Spring 2010

A

F,3

E,1B,2

C,6D,2

36

11

2

1

9

4 Target Next HopB E

C E

D EE E

F E

Page 32: CSE 30264 Computer Networks

Spring 2009 CSE30264 32

OSPF

• Open Shortest Path First Protocol• Authentication• Additional hierarchy• Load balancing

Quintessential link state protocol

Page 33: CSE 30264 Computer Networks

Spring 2009 CSE30264 33

Metrics • Original ARPANET metric

– measures number of packets queued on each link– took neither latency or bandwidth into consideration

• New ARPANET metric– stamp each incoming packet with its arrival time (AT)– record departure time (DT)– when link-level ACK arrives, compute

Delay = (DT - AT) + Transmit + Latency– if timeout, reset DT to departure time for retransmission – link cost = average delay over some time period

• Revised ARPANET metric– compressed dynamic range– replaced Delay with link utilization

• Practice– static metrics (e.g., 1/bandwidth)

Why might variable weights be bad?

Page 34: CSE 30264 Computer Networks

Spring 2009 CSE30264 34

Global Internet

OutlineSubnettingSupernetting

Page 35: CSE 30264 Computer Networks

Spring 2009 CSE30264 35

How to Make Routing Scale

• Flat versus Hierarchical Addresses• Inefficient use of Hierarchical Address Space

– Class C with 2 hosts (2/254 = 0.78% efficient)– Class B with 256 hosts (256/65534 = 0.39% efficient)

• Too many networks– Routing tables do not scale– Route propagation protocols do not scale

Current routers – IPv4 – core 160k entries

Page 36: CSE 30264 Computer Networks

Spring 2009 CSE30264 36

Internet StructureRecent Past

NSFNET backboneStanford

BARRNETregional

Berkeley PARCNCAR

UA

UNM

Westnetregional

UNL KU

ISU

MidNetregional■ ■ ■

Page 37: CSE 30264 Computer Networks

Spring 2010 CSE30264 37

Internet StructureToday

Backbone service providerPeeringpoint Peering

point

Large corporation

Large corporationSmall

corporation

“Consumer” ISP

“Consumer” ISP

“Consumer” ISP

Page 38: CSE 30264 Computer Networks

CSE 30264 38

Abilene – aka Internet 2

Spring 2010

Page 39: CSE 30264 Computer Networks

Spring 2009 CSE30264 39

Subnetting• Add another level to address/routing hierarchy: subnet• Subnet masks define variable partition of host part• Subnets visible only within site

Network number Host number

Class B address

Subnet mask (255.255.255.0)

Subnetted address

11111111111111111111111100000000

Network number Host IDSubnet ID

Page 40: CSE 30264 Computer Networks

Spring 2009 CSE30264 40

Forwarding AlgorithmD = destination IP addressfor each entry (SubnetNum, SubnetMask, NextHop) D1 = SubnetMask & D if D1 = SubnetNum if NextHop is an interface deliver datagram directly to D else deliver datagram to NextHop

• Use a default router if nothing matches• Not necessary for all 1s in subnet mask to be contiguous

– More likely than not, it will be• Can put multiple subnets on one physical network• Subnets not visible from the rest of the Internet

Page 41: CSE 30264 Computer Networks

Spring 2009 CSE30264 41

Supernetting

• Assign block of contiguous network numbers to nearby networks

• Called CIDR: Classless Inter-Domain Routing• Represent blocks with a single pair (first_network_address, count)

• Restrict block sizes to powers of 2• Use a bit mask (CIDR mask) to identify block size• All routers must understand CIDR addressing

Page 42: CSE 30264 Computer Networks

Spring 2010 CSE30264 42

CIDR

Border gateway(advertises path to

11000000000001) Regional network

Corporation X

(11000000000001000001)

Corporation Y

(11000000000001000000)

Instead of advertising two networks upstream, just advertise one

Page 43: CSE 30264 Computer Networks

Spring 2009 CSE30264 43

Route Propagation• Know a smarter router

– hosts know local router– local routers know site routers– site routers know core router– core routers know everything

• Autonomous System (AS)– corresponds to an administrative domain– examples: University, company, backbone network– assign each AS a 16-bit number

• Two-level route propagation hierarchy– interior gateway protocol (each AS selects its own)– exterior gateway protocol (Internet-wide standard)

Page 44: CSE 30264 Computer Networks

Spring 2009 CSE30264 44

Inter-Domain/Intra-Domain

R1

Autonomous system 1R2

R3

Autonomous system 2R4

R5 R6

Edge router

Core router

Page 45: CSE 30264 Computer Networks

Spring 2009 CSE30264 45

Popular Interior Gateway Protocols

• RIP: Route Information Protocol– developed for XNS– distributed with Unix– distance-vector algorithm– based on hop-count

• OSPF: Open Shortest Path First– recent Internet standard– uses link-state algorithm– supports load balancing – supports authentication

Page 46: CSE 30264 Computer Networks

Spring 2009 CSE30264 46

EGP: Exterior Gateway Protocol• Overview

– designed for tree-structured Internet– concerned with reachability, not optimal routes

• Protocol messages– Neighbor acquisition: one router requests that another

be its peer; peers exchange reachability information– Neighbor reachability: one router periodically tests if

the another is still reachable; exchange HELLO/ACK messages; uses a k-out-of-n rule

– Routing updates: peers periodically exchange their routing tables (distance-vector)

Page 47: CSE 30264 Computer Networks

Spring 2009 CSE30264 47

BGP-4: Border Gateway Protocol• AS Types

– Stub AS: has a single connection to one other AS• carries local traffic only

– Multihomed AS: has connections to more than one AS• refuses to carry transit traffic

– Transit AS: has connections to more than one AS• carries both transit and local traffic

• Each AS has:– one or more border routers– one BGP speaker that advertises:

• local networks• other reachable networks (transit AS only)• gives path information

Page 48: CSE 30264 Computer Networks

Spring 2009 CSE30264 48

Multi-Backbone Internet

Backbone service providerPeeringpoint Peering

point

Large corporation

Large corporationSmall

corporation

“Consumer” ISP

“Consumer” ISP

“Consumer” ISP

Page 49: CSE 30264 Computer Networks

Spring 2009 CSE30264 49

BGP Example• Speaker for AS2 advertises reachability to P and Q

– network 128.96, 192.4.153, 192.4.32, and 192.4.3, can be reached directly from AS2

• Speaker for backbone advertises– networks 128.96, 192.4.153, 192.4.32, and 192.4.3 can be reached

along the path (AS1, AS2).• Speaker can cancel previously advertised paths

Regional provider A(AS 2)

Regional provider B(AS 3)

Customer P(AS 4)

Customer Q(AS 5)

Customer R(AS 6)

Customer S(AS 7)

128.96192.4.153

192.4.32192.4.3

192.12.69

192.4.54192.4.23

Backbone network(AS 1)

Page 50: CSE 30264 Computer Networks

Spring 2009 CSE30264 50

IP Version 6• Features

– 128-bit addresses (classless)– multicast– real-time service– authentication and security – autoconfiguration – end-to-end fragmentation– protocol extensions

• Header– 40-byte “base” header– extension headers (fixed order, mostly fixed length)

• fragmentation• source routing• authentication and security• other options

Page 51: CSE 30264 Computer Networks

Spring 2009 CSE30264 51

Addresses125- m- n- o- pponm3

SubscriberIDProviderIDRegistryID010 InterfaceIDSubnetID

Version TrafficClass FlowLabel

PayloadLen NextHeader HopLimit

SourceAddress

DestinationAddress

0 4 12 16 24 31

Next header/data

NextHeader Reserved Offset RES M

Ident

0 8 16 29 31