dynamic routing and ospf (part 1). ip routing zeach router or host makes its own routing decisions...

48
Dynamic Routing and OSPF (part 1)

Upload: erica-perry

Post on 01-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Dynamic Routing and OSPF (part 1)

Page 2: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

IP routingEach router or host makes its own routing

decisionsSending machine does not have to

determine the entire path to the destinationSending machine just determines the next-

hop along the path. This process is repeated until the destination is

reachedForwarding table consulted to determine

the next-hop

Page 3: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

IP routing

Classless routing route entries include

destinationnext-hopmask (prefix-length) indicating size of address space

described by the entry

Longest match for a given destination, find longest prefix

match in the routing table example: destination is 35.35.0.0/19

routing table entries are 35.0.0.0/8 and 35.35.0.0/16

Page 4: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

IP routing

Default route where to send packets if don’t have an

entry for the destination in the routing table

most machines have a single default route

often referred to as a default gateway

Page 5: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Static routing

each router manually configured with a list of destinations and the next hop to reach those destinations

ideal for small number of destinations or “stub” networks stub network - network with only one or

two paths to the rest of the network

Page 6: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Dynamic Routing

routers compute routing tables dynamically based on information provided by other routers in the network

routers communicate topology to each other via different protocols

routers then compute one or more next hops for each destination - trying to calculate the most optimal path

Page 7: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Static and Dynamic Routing

Static routing is a simplistic approachShortcomings:

Cumbersome to configure Cannot adapt to link/node failures, addition of new

nodes and links Doesn't scale to large networks

Solution: Dynamic Routing

Page 8: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Desirable Characteristics

Automatically detect and adapt to network topology changes

Optimal routingScalabilityRobustnessSimplicitySpeed of convergenceSome control of routing choices (e.g. which links

we prefer to use)

Page 9: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Convergence - Why do I care?

Convergence is when all the routers have the same routing information

When a network is not converged, there is network downtime Packets don't get to where they are supposed to be

going: routing loops, black holes Occurs when there is a change in the status of a router

or link

Page 10: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Dynamic Protocols

Metrics can be calculated based on a single characteristic of a path or by combining multiple characteristics

Metrics commonly used: Bandwidth Hop count Cost

administratively defined metrics

Page 11: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

OSPF magic exercisedelete your static routes

config t no ip route x.x.x.x y.y.y.y z.z.z.z

enter the following: router ospf 1 network x.x.x.x 0.0.0.0 area 0 x.x.x.x = ip address of your backbone

interface redistribute connected subnets

Page 12: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

OSPF magic exercise

Verify connectivity to all PCs in the network

Do not save your config

Page 13: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Dynamic Routing Protocols and OSPF (part 2)

Page 14: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Types of Routing Protocols

EGP Exterior Gateway Protocol Example: BGP

IGP Interior Gateway Protocol Example: OSPF, RIP

Page 15: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Types of Routing Protocols

Link-stateDistance-vector

Page 16: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

IGP

Used within a single Autonomous System (AS)

Within a single network

Page 17: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Other Interior Gateway Protocols (IGPs)

RIP Lots of scaling problems RIPv1 is classful and officially obsolete RIPv2 is classless

EIGRP Proprietry (Cisco only)

IS/IS The forerunner of OSPF Multiprotocol (OSPF is IP only)

Page 18: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Distance Vector Protocols

Listen to neighboring routesInstall all routes in a tableAdvertise all routes in tableVery simpleVery Stupidexample: RIP

Page 19: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

RIP

routing information protocoldistance-vector algorithmcost is hop countbroadcast information to all

neighbors every 30 seconds

Page 20: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

RIP

A B

D E

C

ROUTING TABLE for AA -B 1C 2D 3E 2

Page 21: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Why not use RIP?

Distance Vector algorithmBroadcasts everything (not scalable)Metric is hop-count onlyInfinity of 16 (not large enough)Slow convergence (routing loops)Poor robustness

Page 22: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

OSPF

Open Shortest Path FirstDynamic IGP (Interior Gateway Protocol)

Use within your own networkLink state algorithm

Page 23: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Shortest Path First

A B

C D

15

3

4 4

7

Metric: Link Cost

Page 24: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Link State Algorithm

Each router maintains a database containing map of the whole topology Links State (including cost)

All routers have the same informationAll routers calculate the best path to

every destination

Page 25: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Link State Algorithm (con)

Any link state changes are flooded across the network

"Global spread of local knowledge”

Page 26: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Link State vs. Distance vectorDistance Vector

views net topology from neighbor’s perspective

adds distance vectors from route to router

frequent, periodic updates; slow convergence

passes copies of routing table to neighbor routers

Page 27: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Link State vs. Distance vectorLink-State

gets common view of entire network topology

calculates the shortest path to other routers

event-triggered updates; faster convergence

passes link-state routing updates to other routers

Page 28: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Distance Vector and Link State ProtocolsDistance vector routers compute the

best path from information passed to them from neighbors

Link State routers each have a copy of the entire network map

Link State routers compute best routes from this local map

Page 29: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Note: Routing is not the same as Forwarding

Forwarding: passing packets along to the next hop There is only one forwarding table Just has prefix and next-hop info

Routing: populating the forwarding table You might have multiple routing databases - e.g.

both OSPF and BGP Routing databases have more information

Page 30: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Routing and Forwarding

OSPF

BGP

Static

ForwardingTable

On Cisco, if the same prefix is received from multiple protocols, the "administrative distance" is used to choose between them

Page 31: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

OSPF

open shortest path firstdynamic IGPnot distance vectorLink-State algorithm

Page 32: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

OSPF: How it works (1)

"Hello" packets sent periodically on all OSPF-enabled interfaces become "neighbors" establishes that link can carry data used to determine if neighbor is up

Adjacencies (virtual point-to-point links) formed between some neighbors

Page 33: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

How it works (2)

Once an adjacency is established, trade information with your neighbor

Topology information is packaged in a "link state announcement"

Announcements are sent ONCE, and only updated if there's a change (or every 30 minutes)

Page 34: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

How it works (3)

Each router sends Link State Announcements (LSAs) over all adjacencies LSAs describe router's links, interfaces and state

Each router receives LSAs, adds them into its database, and passes the information along to its neighbors

Page 35: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

How it works (4)

Each router builds identical link-state database

Runs SPF algorithm on the database to build SPF tree

Forwarding table built from SPF tree

Page 36: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

How it works (5)

When change occurs: Broadcast change All routers run SPF algorithm Install output into forwarding table

Page 37: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

HELLO

Broadcast* HELLO on network segmentReceive ACKEstablishes 2-way communicationRepeat periodically

Default: HELLO sent every 10 seconds Default: if no HELLO heard for 40 seconds, link is

assumed to be deadNow establish adjacencies

* Actually uses Multicast addresses (224.0.0.9, 224.0.0.10) sothat non-OSPF devices can ignore the packets

Page 38: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

The HELLO packet

Router priority Hello interval Router dead interval Network mask List of neighbors These must match

HELLO

HELLO HELLO

Page 39: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Neighbors

Bi-directional communicationResult of OSPF hello packetsNeed not exchange routing information

Page 40: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Who is adjacent?

"Adjacent" neighbors exchange routing information

Not all neighbors are adjacentOn a point-to-point link

everyoneOn broadcast medium

not everyone why?

Page 41: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Broadcast neighbors

A B

C D

Order of N^2 adjacencies

Page 42: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Broadcast medium

Select a neighbor: Designated Router (DR)All routers become adjacent to DRExchange routing information with the DRDR updates all the other neighborsScales

Adjacencies reduced from N^2 to 2NBackup Designated Router (BDR)

Page 43: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

LSAs propagate along adjacencies

DR BDR

Page 44: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Other nice features of OSPFAuthentication (optional)

Equal-cost multipath more than one "best" path - share traffic

Proper classless support (CIDR)Multiple areas

For very large networks (>150 routers) Aggregate routes across area boundaries Keep route flaps within an area Proper use of areas reduce bandwidth and CPU utilisation Backbone is Area 0

Page 45: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Cisco OSPF commands and configurationshow ip routeshow ip ospf neighborshow ip ospf database

Page 46: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

Configuring OSPF

router ospf <process-id>network x.x.x.x m.m.m.m area <area-id>m.m.m.m = wildcard mask0 = don’t care bit1 = check bit0.0.0.0 mask for exact matchnetwork 203.167.177.10 0.0.0.0 area 0network 203.167.177.0 0.0.0.255 area 0

Page 47: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

A

C

B

FE

I

G

D

H

J

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

RouterPC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

Router PC

HUB

SWITCH

Classroom Layout

Page 48: Dynamic Routing and OSPF (part 1). IP routing zEach router or host makes its own routing decisions zSending machine does not have to determine the entire

A

C

B

FE

I

G

D

H

J

133.27.162.96/28

133.27.162.128/28

133.27.162.160/28

133.27.162.192/28

133.27.162.224/28

133.27.162.112/28

133.27.162.144/28

133.27.162.176/28

133.27.162.208/28

133.27.162.240/28

Serial Links for exercise

133.

27.1

62.1

6/28

133.27.162.48/30

133.27.162.52/30

133.27.162.56/30

133.27.162.60/30

133.27.162.64/30