Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥...

25
27 Oct 2019 SE 428: Advanced Computer Networks 1 Intra- and Inter-Network Routing 27 October 2019 Lecture 1 Some Slide Credits: Jennifer Rexford and Michael Schapira Some Slides Adapted From: James Kurose and Keith Ross

Transcript of Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥...

Page 1: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 1

Intra- and Inter-Network

Routing

27 October 2019

Lecture 1

Some Slide Credits: Jennifer Rexford and Michael Schapira

Some Slides Adapted From: James Kurose and Keith Ross

Page 2: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Topics for Today

• Routing Goals

• Intra-Network Routing: OSPF

• Inter-Network Routing Intro

Sources: PD 3.3.3, 4.1.2

27 Oct 2019 SE 428: Advanced Computer Networks 2

Page 3: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 3

Routing protocols on the internet

• Treated extensively in SE 331: Introduction to Computer Networks

• Routing information protocol (RIP)

– Distance vector routing

– Uses Bellman-Ford algorithm

– Outdated, suffers from count-to-infinity problem

• Open shortest path first (OSPF)

– Link state routing

– Runs over Layer 3 (over IP)

– Uses Dijkstra algorithm to determine shortest paths

• Intermediate System to Intermediate System IS-IS

– Link state routing – similar to OSPF

– Runs over Layer 2 (under IP)

• Border gateway protocol (BGP)

– Between networks (administrative domains, Autonomous Systems)

– Path-vector routing

– Consideration of business agreements

Page 4: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Routing criteria

Correctness

Every packet is delivered to its

destination

EfficiencyChoose paths with

small delay and high throughput (network

wide)

ComplexitySetting up routing

tables

Making routing decisions

Robustness

Cope with topology changes

No network reboot

Adaptiveness

Load balancing and traffic control

Fairness

All users get the same degree of

service

27 Oct 2019 SE 428: Advanced Computer Networks 4

Page 5: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Path costs, Routing metrics

Minimum hop

Number of channels traversed

Shortest pathChannels have statically

assigned weights and the cost of a path is the sum of costs of

the edges

Presumes no negative-cost cycles

Minimum delayChannels have dynamically

assigned weights based on the traffic on the channel

Routing tables are repeatedly revised such that paths with close

to minimal delays are chosen

27 Oct 2019 SE 428: Advanced Computer Networks 5

Page 6: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 6

Destination-based routing

Decision where to forward a packet depends only on the

destination of a packet (not on its source)

Optimal paths can be determined, when

1. The cost of sending a packet via a path is independent of

the amount of traffic on the path.

2. The cost of the concatenation of two paths equals the

sum of the costs of the concatenated paths.

3. The communication network does not contain cycles with

negative cost.

Page 7: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

So Far

• Routing Goals

• Intra-Network Routing: OSPF

• Inter-Network Routing

– Classless Interdomain Routing (CIDR)

– BGP

27 Oct 2019 SE 428: Advanced Computer Networks 7

Page 8: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 8

RIP Issues: Stability problem

• Loops may form and stability cannot occur without

“counting to infinity”.

• Timing of events may cause cycles of updates.

2

1

0

3

Page 9: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 9

(Partial) Solutions for Stability

• Pick small value for “infinity”– If “infinity” is 16 then at most 15 hops in network

– Distance of 16 considered unreachable

• Disallow cyclic updates– Called split horizon algorithm

– Don’t send updates learned from a neighbor back to that neighbor

– Only works for small (e.g. 2-hop) cycles

• Route Poisoning– Introduces artificial delay

Page 10: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

OSPFv2 (1998)

• RFC 2328

• IPv4

• In protocol authentication

of routers and

completeness of

messages

• Atoms are networks and

subnets

• Routers identified by

Router ID and/or IP

address

OSPFv3 (2008)

• RFC 5340

• IPv4 + IPv6

• Authentication at IP layer

(IPSec)

• Completeness at IP layer

• Atoms are links (may

have multiple subnets)

• Router IDs and IP

addresses are disjoint

27 Oct 2019 SE 428: Advanced Computer Networks 10

Open Shortest Path First (OSPF)

Page 11: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 11

Open Shortest Path First (OSPF)

• Each node sends a reliable flood of information to all other nodes– In v3, can limit the flooding scope

• These Link-State Packets (LSPs) contain– ID of the node that created the packet

– List of (neighbor, cost) pairs associated with the source node

– Sequence Number (64bits—no wrapping)

– Time To Live (ensure old info is eventually removed)

– Authentication (v2) – password or message authenticity code (MAC)

Page 12: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Reliable Flooding

• Adjacent routers reliably

send updates (ACKs)

• Source sends to all

neighbors

• Recipients

– Send to all neighbors

except the one it got the

message from

– Ignores duplicates

Local Calculations

• Once all of the link-state

info has been flooded

each node has complete

network topology

• Compute routing

information using

Dijkstra’s shortest-path

algorithm

• Periodic updates and

failure detection are like

RIP.

27 Oct 2019 SE 428: Advanced Computer Networks 12

OSPF Steps

X A

C B D

Page 13: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 13

OSPF Features

• Authentication of routing messages (v2)

– Misconfigured or malicious host could advertise bad route info (i.e.

reach anywhere in 0 hops)

– Prevent routers from accidentally joining a network

– Prevent malicious or accidental changes to route information

– (Eventually added to RIP too.)

• Additional Hierarchy

– Partitions domains into areas

– Reduces transmission & storage overhead

• Load Balancing

– Multiple routes with same cost

– Traffic evenly distributed

Page 14: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Dijkstra’s AlgorithmNode has two lists – Confirmed and Tentative - pairs of (Destination, Cost, Next-Hop)

Algorithm:1. Initialize Confirmed with an

entry for self with cost 0.

2. For the node just added to Confirmed in the previous step, (𝑁𝑒𝑥𝑡), examine its Link State Packet (LPS).

3. For each 𝑁𝑒𝑖𝑔ℎ of 𝑁𝑒𝑥𝑡, calculate the distance to 𝑁𝑒𝑖𝑔ℎ via 𝑁𝑒𝑥𝑡c𝑜𝑠𝑡 = (𝑠𝑒𝑙𝑓 → 𝑁𝑒𝑥𝑡) + (𝑁𝑒𝑥𝑡 →𝑁𝑒𝑖𝑔ℎ)a) If 𝑁𝑒𝑖𝑔ℎ isn’t on Confirmed or

Tentative, add (𝑁𝑒𝑖𝑔ℎ, 𝑐𝑜𝑠𝑡, 𝑁𝐻) to Tentative, where 𝑁𝐻 is the way to reach 𝑁𝑒𝑥𝑡 in Confirmed.

a) If 𝑁𝑒𝑖𝑔ℎ is on Tentative and 𝑐𝑜𝑠𝑡 is better than the old cost, replace it with (𝑁𝑒𝑖𝑔ℎ, 𝑐𝑜𝑠𝑡, 𝑁𝐻), where 𝑁𝐻 is the way to reach 𝑁𝑒𝑥𝑡 in Confirmed.

4. If Tentative is empty, stop.

5. Choose the node on Tentative with the lowest cost, move it to Confirmed, and go to step 2.

27 Oct 2019 SE 428: Advanced Computer Networks 14

Page 15: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 15

Dijkstra Example

A

B

D

C

2

11

10

53

Page 16: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 16

Dijkstra Example

A

B

D

C

2

11

10

53

Page 17: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 17

Dijkstra Example 2

Page 18: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

So Far

• Routing Goals

• Intra-Network Routing: OSPF

• Inter-Network Routing

– Classless Interdomain Routing (CIDR)

27 Oct 2019 SE 428: Advanced Computer Networks 18

Page 19: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Inter- versus Intra-

• Intra-Network Routing → driving within a single city

• Inter-Network Routing → driving between cities

• Different decisions:

– Traffic lights

– Narrow streets

– Speed bumps

– One way streets

• Fastest versus Shortest

• What shape is the internet?

27 Oct 2019 SE 428: Advanced Computer Networks 19

Page 20: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

The old shape (1990s)

27 Oct 2019 SE 428: Advanced Computer Networks 20

Page 21: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

A newer picture

27 Oct 2019 SE 428: Advanced Computer Networks 21

Page 22: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

27 Oct 2019 SE 428: Advanced Computer Networks 22

Page 23: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Organizations and Backbone

27 Oct 2019 SE 428: Advanced Computer Networks 23

• Key Concept: Autonomous System (AS) (aka Routing

Domain)

Page 24: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Organizations and Backbone

27 Oct 2019 SE 428: Advanced Computer Networks 24

Page 25: Intra- and Inter-Network Routing€¦ · State Packet (LPS). 3. For each 𝑁 𝑖 ℎof 𝑁 𝑥 , calculate the distance to 𝑁 𝑖 ℎvia 𝑁 𝑥 c𝑜 =( 𝑙 →𝑁 𝑥

Conclusion

• Routing Goals

• Intra-Network Routing: OSPF

• Inter-Network Routing

– Classless Interdomain Routing (CIDR)

27 Oct 2019 SE 428: Advanced Computer Networks 25