Information Network 1 Routing (1) - NAIST · 2. send my distance vectors to all neighbor routers 3....

Post on 23-Mar-2019

216 views 0 download

Transcript of Information Network 1 Routing (1) - NAIST · 2. send my distance vectors to all neighbor routers 3....

1

Information Network 1Routing (1)

Youki KadobayashiNAIST

©2017 Youki Kadobayashi, All rights reserved.

Image: Part of the entire Internet topology based onCAIDA dataset, using NAIST Internet viewer

2

The Routing Problem

How do I get from source to destination?

S D

©2017 Youki Kadobayashi, All rights reserved.

163.221.10.10 203.178.136.61

3

The Routing Problem: add some realistic constraints…

How do I get from source to destination?

Which path is best? In terms of:Number of hopsDelay, bandwidthPolicy constraints, cost…

Who will make decision?Router?Source?

How can we detect failures?How much the overhead will be?

S D

Rogue ISP

500ms 500ms

unreliable

©2017 Youki Kadobayashi, All rights reserved.

Routing problem can be solved in many ways

Represent network in:a graph, ora matrix

Collect information:across the network, ortoward some routers, oronly locally among neighbors

Compute route at:every router, orsome routers

… solutions are instantiated in routing systems.

4©2017 Youki Kadobayashi, All rights reserved.

Characterization of routing systems

Static routingCompute route a priori

Dynamic routingReflect dynamic state of network

Source-based routingSource node computes path to destination

Hop-by-hop routingEvery node computes next hop

5

S D

©2017 Youki Kadobayashi, All rights reserved.

Focus of this lecture: dynamic, hop-by-hop routing

Static routingCompute route a priori

Dynamic routingReflect dynamic state of network

Source-based routingSource node computes path to destination

Hop-by-hop routingEvery node computes next hop

6©2017 Youki Kadobayashi, All rights reserved.

7

Routing system has many functions

Provision end-to-end reachabilityAutomatically compute best pathDistribute traffic among multiple links

Avoid failing linksIsolate faultsReflect administrative policies

… in one system. Isn’t it awesome.

©2017 Youki Kadobayashi, All rights reserved.

Routing system can be characterized by…

Representation of networkNetwork topologyAttributes associated with each link

Exchange of informationCommunication overheadPropagation speed

Computation algorithmComputation overheadConvergence speed

Routing system: protocol + information + algorithm

8©2017 Youki Kadobayashi, All rights reserved.

9

Routing system: its structure

Routing protocoldiscovers neighbor router;exchanges topology information;exchanges link information

Routing algorithmcomputes route (result: RIB - Routing Information Base)

Integrate information from multiple routing protocolsMultiple routing protocols → Multiple RIBsConsolidate Multiple RIBs into single FIB(FIB: Forwarding Information Base)

©2017 Youki Kadobayashi, All rights reserved.

Typically, routing protocol discovers network topology

Topology: geometric configurations that are unaltered by elastic deformations

10

1

2

3

1

3

2

1 2 3

123

∞ 1 31 ∞ 23 2 ∞

Graph representation Matrix representation

©2017 Youki Kadobayashi, All rights reserved.

11

Gateway Model: a conceptual model of routing system

FIB(forwarding information base)

Input interfaces Output interfaces

Multiple RIBs(routing information base)

Routing softwareTopology info,Link status info

Topology info,Link status info

©2017 Youki Kadobayashi, All rights reserved.

12

Types of Routing Algorithm

1. Distance vector2. Link state3. Path vector

Key difference of these algorithms:Topology representationPropagation range / frequency / timing of link stateAlgorithm for computing shortest path

Design trade-offs:ScalabilityConvergence timeAlgorithm simplicity

©2017 Youki Kadobayashi, All rights reserved.

13

Questions?

©2017 Youki Kadobayashi, All rights reserved.

Distance Vector Routing

©2017 Youki Kadobayashi, All rights reserved. 14

15

Distance vector routing w/ Bellman-Ford algorithm1. assign distance vector to myself 0; for others, assign ∞2. send my distance vectors to all neighbor routers3. router calculates minimum distance vectors by 1) distance vectors advertised by neighbor routers and 2) distance from myself to individual neighbor router

Initial condition

bi(0) ← ∞ (i ≠ D)

bD(0) ← 0

Repetition

bi(m) ← minj ∈ Vi{bj

(m-1) + dij}

Terminal condition

bi(m) = bi

(m-1)

D: destination router, bi(m): distance between router “i” and “D” by m-times iterative

calculation, Vi: neighbor routers of router “i”, dij: distance of link between router “i” and j

DN p.397

©2017 Youki Kadobayashi, All rights reserved.

16

RIP: Routing Information Protocol

Distance vector routingRIP-2 (IPv4), RIPng (IPv6)Used in relatively small network

• Due to ease of implementation and operation

Textbook classics

RFC 2453, RFC 2080

©2017 Youki Kadobayashi, All rights reserved.

Informal description of RIP

Each router sends a list of distance-vectors (route, cost) to each neighbor periodicallyEvery router selects the route with smallest metricMetric: integer of 1..16, where 16 implies infinity

©2017 Youki Kadobayashi, All rights reserved. 17

A B Ccost: 2cost: 1

Router metricA 3

B 2

Router metricA 1

C 2

Router metricB 1

C 3

Hands on:

RIP in action via GNS3 software(quick demo by TA)

©2017 Youki Kadobayashi, All rights reserved. 18

Hands on task: try to expand your RIP network

Add 4th router to your RIP network and verify connectivityExample topology:

©2017 Youki Kadobayashi, All rights reserved. 19

1

2

3

1 32

4

4

20

Problems of distance vector routing

Poor scalability. For the given number of routers N,Time complexity: O(N3)Traffic: O(N2)

Slow convergence speed, as it sends distance vector periodically

Slow convergence induces inconsistent and transitional state=> Counting to infinity problem

©2017 Youki Kadobayashi, All rights reserved.

21

Counting to infinity problem

A CB

Suppose link B-C went down.B thinks: (C, inf)A says: (C, 2)B thinks: (C, 3) via AB says: (C, 3)A thinks: (C, 4) via B…

1 1 → inf

©2017 Youki Kadobayashi, All rights reserved.

22

Split Horizon

A CB

Suppose link B-C went down.B thinks: (C, inf)A says: (C, 2) to everyone except B…

1 1 → inf

Workaround for counting to infinityRouter doesn’t send learned information to source router

©2017 Youki Kadobayashi, All rights reserved.

23

Limitation of split horizon

A CB

Suppose link B-C went down.B thinks: (C, inf)A says: (C, 2) to everyone except BD thinks: (C, 3) via AD says: (C, 3)B thinks: (C, 4) via D…

1 1 → inf

D

11

©2017 Youki Kadobayashi, All rights reserved.

24

Questions?

©2017 Youki Kadobayashi, All rights reserved.

Lessons from RIP

Bellman-Ford: very simpleBut with many traps and pitfalls…

Guiding principle for using RIP: avoid loops!

Loops can be easily formed, however.Backup linksGuiding principle can be easily forgotten

• OMG!

A better alternative: link state routing.

©2017 Youki Kadobayashi, All rights reserved. 25

Link-State Routing

©2017 Youki Kadobayashi, All rights reserved. 26

27

Link-state routing

Collect router and link information→ Directed graph: router as a node, link as an arc

… then create link state database (LSDB)• A network map that collects link state information

Based on LSDB, calculate the shortest path with the Dijkstra’s shortest path algorithm

Time complexity: O(N2)• Can be further optimized by improved data structure

©2017 Youki Kadobayashi, All rights reserved.

28

A high level view of link-state routing

Router

Link

Router

Link

LSDB RIBDijkstra

directed graph shortest path tree

fragments ofdirected graph

©2017 Youki Kadobayashi, All rights reserved.

29

Graph representation of routers and links

Source: OSPF Version 2, RFC 1583©2017 Youki Kadobayashi, All rights reserved.

30

A more complexnetwork

©2017 Youki Kadobayashi, All rights reserved.

31

and its directed graphrepresentation

©2017 Youki Kadobayashi, All rights reserved.

32

Shortest path tree;rooted at RT6

©2017 Youki Kadobayashi, All rights reserved.

33

Questions?

©2017 Youki Kadobayashi, All rights reserved.

34

From directed graph to shortest-path trees:Dijkstra Algorithm

Initially,ds ← 0dj ← csj (for every j ∈ V – {s})P ← {s}

Find the next closest node:di ← minj ∈ V – P {dj}P ← P ∪ {i}

Update labels:dk ← mink ∈ V – P {dk, di + cik}

Terminal condition:P = V

V: all routers, s: starting router, cik: link cost between “i” and “k”,dj: least cost between “s” to “j”, P: router with least cost determined

©2017 Youki Kadobayashi, All rights reserved.

Interconnections p.223

35

Pros and Cons of Link-State Routing

Traffic increases in proportion to the number of links and routersStorage complexity increases in proportion to the number of links and routersTime complexity: lower than distance vector routing

Convergence time: must be short, for transient loop issueCounting to infinity doesn’t happen(read: fewer traps and pitfalls)Flexible configuration of link cost is possible(no nonsense like 16 = infinity)

©2017 Youki Kadobayashi, All rights reserved.

36

OSPF: Open Shortest Path First

The link state routing protocol for the InternetOSPFv2 (IPv4), OSPFv3 (IPv6)

FunctionsRecognize neighbor routerExchange link state information and create LSDBCalculate shortest path tree (spanning tree)+ Designated Router, Backup Designated Router+ Hierarchical structure by area+ Collaboration with EGP

RFC 2328, 5340

©2017 Youki Kadobayashi, All rights reserved.

37

Discovering neighbor routers with OSPF Hello

Discover neighbor router on the same link• send Hello packet to 224.0.0.5, ff02::5 (AllSPFRouters)

List of neighbor routers in Hello packet• check bidirectional communication

(select designated router and backup designated router)

Send Hello packet periodically to detect link downkeeps pinging, as in ICMP

©2017 Youki Kadobayashi, All rights reserved.

38

Information exchangeamong routersNeighbor → AdjacentRouters don’t exchange routing information unless they are adjacent

Formation process:Hello → NeighborSynchronize each LSDBSynchronized→ Adjacent

©2017 Youki Kadobayashi, All rights reserved.

39

Topology Representation in OSPF

LSA (Link State Advertisement)• Type 1: Router LSA• Type 2: Network LSA• Type 3: Summary LSA (network)• Type 4: Summary LSA (AS boundary)• Type 5: AS External LSA

LSA common header• Validity period and sequence number in LSA header• Helps routers to tell if given LSA is fresh

©2017 Youki Kadobayashi, All rights reserved.

40

Questions?

©2017 Youki Kadobayashi, All rights reserved.

Summary

©2017 Youki Kadobayashi, All rights reserved. 41

42

Gateway Model Revisited

FIB

Input interfaces Output interfaces

RIP

Multiple RIBs

OSPF

Routing softwareTopology info,Link status info

Topology info,Link status info

©2017 Youki Kadobayashi, All rights reserved.

43

Summary

Routing system: design space, characterization

Distance vector routingBellman-Ford algorithmRIP protocol, information modelTraps and pitfalls

Link state routingGraph and its spanning treesDijkstra algorithmOSPF protocol, algorithm, information model

©2017 Youki Kadobayashi, All rights reserved.

Assignment 4

Replicate the MANDARA network in GNS3Routers basic configuration (name, IP address…)Configure RIP between the routers located in the same graduate school or division.Configure OSPF between the main routersSave the project, compress the project folderReport format: [name]-[studentID].zipSubmit to: network1-2017 _at_ is.naist.jpDeadline: May 10, 2017 by 17:00 (Wednesday)

©2017 Youki Kadobayashi, All rights reserved. 44

Assignment 4 (Mandara Network)

©2017 Youki Kadobayashi, All rights reserved. 45