95
1 Routing รศ.ดร. อนันต์ ผลเพิ 0ม Asso. Prof. Anan Phonphoem, Ph.D. [email protected] http://www.cpe.ku.ac.th/~anan Computer Engineering Department Kasetsart University, Bangkok, Thailand

Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

1

Routing

รศ.ดร. อนันต์ ผลเพิ0ม

Asso. Prof. Anan Phonphoem, [email protected]

http://www.cpe.ku.ac.th/~ananComputer Engineering Department

Kasetsart University, Bangkok, Thailand

Page 2: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Outlinen Routing Principlen Routing table calculationn Routing protocol

2

Page 3: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

3

Routing ?

l Spelling/pronouncen British: routeingn American: routing

l Definition (Goal)n “Learning how to get from here to there." n “Process of discovering, selecting, and

employing paths from one place to another (or to many others) in a network” [from David M. Piscitello, Bellcore and A. Lyman Chapin, BBN]

Page 4: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

4

Routing Process

l Finding how to get therel Actually getting to there

Page 5: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

5

Routing Methodsl Source Routing

n Source keeps all information (how to get there)n Insert the information in the packetn Intermediate nodes just read and act

l Hop-by-Hop Routingn Source only knows how to get to the next hopn Assume that Intermediate node knows how to get

to the next hopn ... until destination reach

Example: Driving a carneatorama.com

Page 6: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

6

Routing Principle

l Goal: Arriving at the destination

l Considerations:n Direct route (shortest)n Reliable routen Scenic route

(of course, not for network!)n Cheap routen Safe route

Page 7: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Exciting Route

7

Page 8: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

8

Routing Objectives

l Maximizing the network performancesn Delay ¯n Throughput ­

l Minimizing the costn Equipmentn Computation power / complexity

Page 9: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

9

Routing Constraints

l Network (Switching) Technologyl Dynamics of the networks

n Trafficn Network service available

Page 10: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

10

Routing Requirements

l Scalabilityl Multi-technology supportl Topology-change adaptability

(fast & minimum cost)l QoS supportl Secure/Private connection

Page 11: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

11

Ideal Routing Algorithml Correctl Robustl Stable (Convergence)l Efficientl Flexible (Topology change)l Scalablel Loop-Free (no deadlock)l Easy (Maintainable)l Secure

members.tripod.com

Page 12: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

12

Classic Routing Problem

St#1

St#2 St#3

St#4

Path to St#4To St#4Via St#3

To St#4Via St#1

To St#4Via St#2

Page 13: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

13

Routing Elementsl Routing protocol

n Allow End/Intermediate nodes to collect and distribute the information necessary to determine routes

l Routing database (table)n Like a directory information base

l Routing algorithmn Uses the information contained in the routing

database to derive routes

Page 14: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

14

Routing Information

Which interface should I forward this packet ?

Which is the next hop ?

I will check with Routing Table (look-up algorithm)

Packet for 158.108.2.3

Page 15: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table

frontiernet.net

15

Routing table

l The ordered list addressl Matches several entries in the list

n >1 possible pathn and may be different qualities

l Router looks up network number of destination address and sends it

l Next router will do the same, until it arrives at the right network

Page 16: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

16

Where does the Routing Table come from?

l By talking with other routersl Routing table is built by exchanging info with other

routersl The goal of this exchange is

n to “map out” the networkl Each router wants to know

n who it can talk to directlyn and who those routers can talk to

l Finallyn Send packet to the directly connected hostn Or asking other routers to act as “middle men” and deliver

packets for it

Page 17: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

17

Routing tablel Associated with each route

n A cost of the linkl Cost could be

n level of congestionn inverse of the bandwidthn budget

l In practice, this is often just a hop countor infinity

Page 18: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

18

Routers

Small RoutersStackedFor Branch Offices

19 inches (48 cm) wide

Large Routersfor Large Sites and ISPs

19 inches (48 cm) wide

Cisco 1841

Page 19: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

19

Router

Page 20: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

20

Router

CPU: MIPS Architecture (originally an acronym for Microprocessor without Interlocked Pipeline Stages)

Page 21: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

21

The Internals of a Router

Routing Information Base (RIB)

Routing Decision Engine

Route Import Policies

Route Export Policies

Configuration

Static Route Config.

Discovery

Discovery of directly attached

hostes

IGP IGP

IGP networks

EGP EGP

EGP peer routers

Forwarding Information Base (FIB)

Determine packet forwadingIGP IGP EGP EGP

IGP networks EGP peer routers

Page 22: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Outlinen Routing Principlen Routing table calculationn Routing protocol

22

Page 23: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

How to create a routing table ?

23

Internet

Manual Configure à Easy

Page 24: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

How about this ?

24

?? ??

Manual Config. ??Status changes ??

Page 25: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table Computationn Static Routingn Dynamic Routing

25

Page 26: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Static Routing n Program the routing table manually

n inflexiblen simple and low overhead

n Works for n small networkn route change infrequently

26

!@#$%*+*^

Page 27: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Dynamic Routingn Each router acts independently

n based on info. in its router forwarding tablen Allow routers to share info. in their router

forwarding tablesn Change according to network problemsn Mostly Use

27

Routing Information

Page 28: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distributed Algorithmsn Centralized control is not scalable/reliable

n Is it really true ??? n SDN (Software Defined Network)

n Nodes can only compute routing tables based on local info. n Who needs to know what? When?n Who knows what? When?

28

Page 29: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Outlinen Routing Principlen Routing table calculationn Routing protocol

29

Page 30: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Protocol

30

Page 31: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distributed Routing Information

n Calculate the lowest cost (shortest path) n Common methods

n Distance vector routingn Link state routingn Path vector routing

31

* Distance vector routing

Page 32: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-vector Routing

32

Page 33: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-vector Routingn Distributed route computation n Router computes the routing table locallyn Each node sends the results to its

neighbors periodically

33

n Each node keeps update its routing table

n Routing by rumor

howstuffworks.com

Page 34: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distributed Algorithm Issuen Convergence

n process of getting consistent routing information to all nodes

34

http://lpsa.swarthmore.edu/LaplaceXform/FwdLaplace/Funcs/img7A.gif

Page 35: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-vector Routingn Each node maintains a set of triples

n (Destination, Cost, NextHop)n Exchange updates directly connected

neighborsn periodically (on the order of several seconds)n whenever its table changes (triggered

update)(?!)

35

Page 36: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-vector Routingn Each update is a list of pairs:

n (Destination, Cost)n Update local table if receive a “Better” route

n smaller costn came from next-hop

n Refresh existing routesn delete if time out

36

Page 37: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-Vector Example

37

A

B

E

F

C D

G

Page 38: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Graph Representation

38

A

B

E

F

CD

G

A

B

E

F

CD

G

Graph: G = (V,E)

E = set of links = {(a,b), (a,e), (a,c), (a,f),

(b,c), (c,d), (f,g), (d,g)}

V = set of routers = { a, b, c, d, e, f , g}

Page 39: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table

39

A

B

E

F

CD

G

Destination Cost Next Hop

A 1 AC 1 CD 2 CE 2 AF 2 AG 3 A

Destination Cost Next Hop

Routing Table in BB

Page 40: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table @ start

40

AS

Page 41: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

A

B

E

F

CD

GF

G, 2

G, 1

Routing Update

41

G, ∞

G, 3

Page 42: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table à Update

42

AS

Page 43: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Update

43

Page 44: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table Update

44

AS

Page 45: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance-Vector Routing n Routing Information protocol (RIP)

45

Page 46: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Information protocol (RIP)

n Simplest dynamic routing protocoln Easy to configure and maintain n Each router broadcasts its entire routing

table frequently (every 30 seconds)n Broadcasting makes RIP unsuitable for

large networks

46

Page 47: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

RIPn Broadcasts go to hosts as well as to routersn RIP interrupts hosts frequently, slowing them

downn RIP routing table has a field to indicate the

number of router hops to a distant hostn The RIP maximum is 15 hops

Farther networks are ignored

47

Page 48: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

RIP Encapsulationn Carried in data field of UDP datagram

n Port number is 520n UDP is unreliable, so RIP messages do

not always get throughn A single lost RIP message does little or no

harm

48

UDPHeader

UDP Data FieldRIP Message

Page 49: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Slow Convergencen Convergence is getting correct routing

tables after a failure in a router or linkn May take minutesn During that time, many packets may be

lost

49

Page 50: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Loops

n Can happen because several nodes are updating routing tables concurrently

n Ex: The “Count to infinity” problem

50

Page 51: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Count to infinity

51

Page 52: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

1 2

3 4

3-node loop

52

Page 53: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Loop-Breaking Heuristicsn Set infinity to 16n Split horizon

n Don’t send routes learned from a given neighbor back to that neighbor

n Split horizon with poison reversen Reply to neighbor but give negative info

(such as infinite cost)n These are Hacks!

53

Page 54: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Configure RIP

54

Page 55: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table Example

BOAZ# show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area, N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2, E1 - OSPF external type 1, E2 - OSPF external type 2, E – EGP, i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area, * -candidate default, U - per-user static route, o – ODR, P - periodic downloaded static route

Gateway of last resort is not set

R 10.0.0.0/8 [120/2] via 192.168.14.1, 00:00:16, Serial0/0/0C 172.31.0.0/16 is directly connected, FastEthernet0/0R 192.168.13.0/24 [120/1] via 192.168.14.1, 00:00:16, Serial0/0/0C 192.168.14.0/24 is directly connected, Serial0/0/0 55

Page 56: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Hop count in Routing table

56

BOAZ# show ip route

R 10.0.0.0/8 [120/2] via 192.168.14.1, 00:00:16, Serial0/0/0C 172.31.0.0/16 is directly connected, FastEthernet0/0R 192.168.13.0/24 [120/1] via 192.168.14.1, 00:00:16, Serial0/0/0C 192.168.14.0/24 is directly connected, Serial0/0/0

Hopcount: from Source Router to Destination passing through number of routers

#1#2

Source Router

Page 57: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Traceroute

57

#1#2

Source Router

#3

BOAZ# traceroute to 10.0.0.15, 64 hops max, 52 byte packets

1 192.168.14.1 4.093 ms 2.410 ms 2.317 ms2 192.168.13.1 1.405 ms 1.652 ms 1.473 ms3 10.0.0.15 2.739 ms 3.025 ms 1.925 ms

Page 58: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

RIPv2n RIPv2 supports

n CIDR supernetsn VLSMn Discontiguous networks (no auto-summary)

n Improves efficiency byn defining multicast address (224.0.0.9) à route updaten some reserved fields are assigned (RIPv1 sets to zero)n Authentication

n Can coexist with RIP v1n RIPv2 use multicast must be configurable per interface n RIPv2 accept RIPv1 request/response

58

Page 59: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance Vector Summaryn Good

n Only need communicate with neighbors (so little bandwidth is wasted on protocol overhead)

n Relatively little processing of infon Bad

n Count to infinity problemn Slow convergence (the real issue)

n Despite this, RIP is popularn Because included in original BSD implementation

59

Page 60: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distributed Routing Information

n Calculate the lowest cost (shortest path) n Common methods

n Distance vector routingn Link state routingn Path vector routing

60

Page 61: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link State Routing

61

Page 62: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link State Routingn Each router is responsible for

n meeting its neighborsn learning their names

n Each router constructs a packet n called a Link State Packet (LSP) n or Link State Advertisement (LSA) n containing a list of names and cost assigned

to each neighbor

62

Page 63: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Router Discovery

63

R4 R5

R1

OSPF Hello OSPF Hello

OSPF Hello

OSPF Hello

R4 R5

R1

OSPF Hello OSPF Hello

OSPF Hello

OSPF Hello

Page 64: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link State Routingn Each router LSP is sent to all other routers

(Reliable Flooding)n Each router now has a topological map of the

network ( Link-State Database) n Apply the Shortest Path First (SPF) algorithm to

compute routes to each destinationn SPF also know as Dijkstra algorithmn Link-State algorithms advertise the state of its local

network links not distances

64

Page 65: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link State Packet (LSP)n ID of the node that created the LSPn Cost of the link to each directly connected

neighborn sequence number (SEQNO)n time-to-live (TTL) for this packet

65

Page 66: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Reliable floodingn store most recent LSP from each noden forward LSP to all nodes but one that

sent itn generate new LSP periodically

n increment SEQNOn start SEQNO at 0 when rebootn decrement TTL of each stored LSP

n discard when TTL=066

Page 67: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Flooding

67

R4 R5 R6

R1 R2 R31

2

3

1

1

1

3 2

2

2

2

3

2

R4 R5 R6

R1 R2 R31

2

3

1

1

1

3 2

2

2

2

3

2

Information !!!

Page 68: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Route Calculationn Dijkstra’s Algorithm

n Finding the shortest path from a source to other nodes in network

n Weight represents distance between two nodesn Sum of weights along the path is the total

distancen Choose the lowest total distance

68

Page 69: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link State Routing

69

Page 70: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Dijkstra Algorithm

70

Page 71: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table

71

Page 72: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Dijkstra’s Algorithm In action (I)

72

Japan: http://www-b2.is.tokushima-u.ac.jp/~ikeda/suuri/dijkstra/Dijkstra.shtml

Page 73: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

73

Dijkstra’s Algorithm In action (II)

https://visualgo.net/ja/sssp

Page 74: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing Table

74

Destination Next Hop CostR2 - 4R3 R2 10R4 - 2R5 R2 6

Final R1 Routing TableR1 R2

R4 R5

R6

R3

2

4

6

8

10

Page 75: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Network Change

75

R1 R2

R4 R5

R6

R32

4

6

8

10

R1 R2

R4 R5

R6

R32

9

7

12

15

Page 76: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Routing Protocoln Link State Protocol

n Link is connection between two routersn Routing table stores > just its hop count:

cost, reliability, etc.n Allows OSPF routers to optimize routing

based on these variables

76

Page 77: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Autonomous System

77

Page 78: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF-Autonomous System

78

Autonomous 1 Autonomous 2

Autonomous 3

OSPF

OSPF

Page 79: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Area

79

Area 0Area 1Area 2

Net 1Net 2

Net 3

Backbone AreaStub Network

Other Autonomous System

AS 9411

Page 80: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Route between Area

80

R3 R4

N4N3

R1

R2

พื#นที' 0 พื#นที' 1

R3 R4

N4N4N3N3

R1

R2

พื#นที' 0 พื#นที' 1

No Flooding across area

Page 81: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Routersn Network is Divided into Areas

n Each area has a designated router

81

Area

DesignatedRouter

Page 82: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Routersn When a router senses a link state change

n Sends this information to the designated router

82

Area

DesignatedRouter

Notice ofLink State Change

Page 83: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Routersn Designed Router Notifies all Routers

n Within its area

83

Area

DesignatedRouter

Notice ofLink State Change

Page 84: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPF Routersn Efficient

n Only routers are informed (not hosts)n Usually only updates are transmitted, not

whole tables

84Area

DesignatedRouter

Notice ofLink State Change

Page 85: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPFn Fast Convergence

n When a failure occurs, a router transmits the notice to the designated router

n Designated router sends the information back out to other routers immediately

85

Page 86: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPFn Carried in data field of IP packet

n Encapsulation Protocol value is 89n IP is unreliable, so OSPF messages do not

always get throughn A single lost OSPF message does little or

no harm

86

IPHeader

IP Data FieldOSPF Message

Page 87: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

OSPFn Typical link-state but with enhancements

n Authentication of routing messagesn Additional hierarchy (to help with scalability)n Load balancing

87

Page 88: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Configure OSPF

88

Page 89: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing table @A

89

A#sh ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksO 10.2.1.0/30 [110/65] via 10.64.0.2, 00:05:36, FastEthernet0/0C 10.64.0.0/24 is directly connected, FastEthernet0/0

Page 90: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing table @B

90

B#sh ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.2.1.0/30 is directly connected, Serial0/0/0C 10.64.0.0/24 is directly connected, FastEthernet0/0

Page 91: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Routing table @C

91

C#sh ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.2.1.0/30 is directly connected, Serial0/0/1O 10.64.0.0/24 [110/65] via 10.2.1.2, 00:00:01, Serial0/0/1

Page 92: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Link-State Summaryn Good

n Converges relatively quicklyn Bad

n Lots of information stored at each node because LSP for each node in network must be stored at each node (scalability problem)

n Flooding of LSPs uses bandwidthn Potential security issue (if false LSP

propagates) 92

Page 93: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Distance Vector VS. Link-state

n Key philosophical differencen Distance vector talks only to directly

connected neighbors and tells them what is has learned

n Link-state talks to everybody, but only tells them what it knows

93

Page 94: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Referencesn “Gregory Kesden” lecture of 20-770

Communications and Networkingn “Nina Taft”, The Basics of BGP Routing and its

Performance in Today’s Internet, Sprint.n “Anonymous”

n lecture of Addressing and Domain Name System, CS640n Telecom App2b

n Cisco CCNA Materialn “Jennifer Rexford”, Internet Routing (COS 598A)

94

Page 95: Routing - cpe.ku.ac.th · Routing Table Example BOAZ# show iproute Codes: C -connected, S -static, I -IGRP, R -RIP, M -mobile, B -BGP D -EIGRP, EX -EIGRP external, O -OSPF, IA -OSPF

Referencesn Slide from “Agilent Technologies”n Slide from “Anonymous” CS 332, Spring 2002n Panko’s Business Data Networking and

Telecommunications, 5th editionn Cisco CCNA Course Materialn สถาปัตยกรรมและโปรโตคอลทีซีพี/ไอพี สุรศกัดิ: สงวนพงษ์

95