ospf basics

36
Open Shortest Path First Protocol (OSPF) Speaker: Martín Bratina. [email protected] Date 22/03/2013

Upload: martin-bratina

Post on 30-Nov-2014

241 views

Category:

Technology


0 download

DESCRIPTION

OSPF networking protocol basics

TRANSCRIPT

Page 1: OSPF Basics

Open Shortest Path First Protocol(OSPF)

Speaker:

Martín Bratina. [email protected]

Date 22/03/2013

Page 2: OSPF Basics

Agenda

• What is OSPF?• Why is OSPF needed?• How OSPF works?• LAB

2 © 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.

Page 3: OSPF Basics

What is OSPF?

• Open Shortest Path First• Internal routing protocol (IGP)• Open Standard. RFC 2328• Link State Protocol• Designed for IP networks

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.3

Page 4: OSPF Basics

Why is OSPF needed?

• Open standard • Link State Protocol• Scalability• Fast convergence• Supports authentication/security• Supports VLSM (Variable Length Subnet Masks)• Support IPv6 (OSPFv3)• Support load balancing• Consumes low bandwidth• Uses a hierarchical structure

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.4

Page 5: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.5

How OSPF works?

Page 6: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.6

How OSPF works?

• Uses a Link State Logic. • Neighbor discovery• Topology database exchange• Route computation

• Divides routers into areas for route optimization and segmentation

Page 7: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.7

Neighbor Discovery

• Neighbor discovery• Each router discover its neighbors routers sending hello messages• Routers from adjacencies with its neighbors

• Neighbor adjacency requirements• Interfaces in the same subnet• Different router ID between neighbors• Routers in the same area• Same authentication parameters

Page 8: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.8

Topology Database Exchange

• Topology Database Exchange• Each router generates its own network topology information (LSA

Message)• Each router flood its LSA message to its neighbors• Each router stores a LSA copy on its internal OSPF topology database

(LSDB)• Each router has the same LDSB

• Link State Advertisement (LSA) Message information• Router ID of the LSA• List of the router interfaces, IP address, subnet and mask• List of routers reachable (neighbors) on each interface

Page 9: OSPF Basics

Link State Advertisements(LSAs)

LS Age

Options LS Type

Link State ID

Advertising Router

LS Sequence Number

LS Checksum

Length

LSA Header

0 16

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.9

Page 10: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.10

Route Computation

• Route Computation• Each router analyzes its topology database and executes Shortest Path

First (SPF) algorithm• Router choses the shortest (best) route to each destination from its

perspective (SPF Tree)• Router generates entries in the routing table for those selected

destinations

Page 11: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.11

SPF Tree

BEFORE run SPF AFTER run SPF

Page 12: OSPF Basics

Communication between OSPF Routers

• OSPF packets encapsulated in IP packets• IP protocol # 89• Standard 24 byte header• OSPF packet type field• OSPF router ID of sender• Packet checksum• Authentication fields• OSPF Area ID• Uses Multicast IP address 224.0.0.5 for all OSPF routers• DR router use Multicast IP address 224.0.0.6

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.12

Page 13: OSPF Basics

The Hello Protocol

• Maintains neighbor relationships• Elects Designated Router (DR) in multi-access networks• The Hello Packet• Hello packets sent out every 10 seconds• RouterDead Interval (default 40 seconds)• Network Mask• List of neighbors• Ensures that link is bidirectional

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.13

Page 14: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.14

The Hello Protocol

Hello Hello

Hello Hello

Page 15: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.15

Designated Router (DR)

• One per multi access network• Generates Network Link Advertisements (LSA type 2)• All routers form adjacency to it• Assist in DB synchronization• Elected by priority. It tie, it is elected by the highest router ID

Adjacencies WITHOUT DR Adjacencies WITH DR

DR

Page 16: OSPF Basics

Database Synchronization

• Crucial to ensure correct and loop free routing• Must be done before 2 neighbors start

communication• Whenever new LSAs are introduced • uses reliable flooding• Each router sends LSA headers (small LSA’s) to its

neighbor when connection comes up• Requests only those LSAs which are recent

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.16

Page 17: OSPF Basics

Database Exchange

• Neighboring routers first exchange hellos• A database description packet establishes the

sequence number• The other router sends LSA headers• Sequence number incremented for every pair of

database description packets • implicit acknowledgement for the previous pair• After examining LSA headers explicit request sent

for complete LSA

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.17

Page 18: OSPF Basics

Reliable Flooding

• Starts when a router wants to update self-originated LSAs

• Neighbor installs more recent LSAs into its database

• Floods out on all interfaces except the one on which it arrived

• Reliability-retransmissions until acks received

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.18

Page 19: OSPF Basics

Reliable Flooding (cont..)

10.1.1.1 10.1.1.2 10.1.1.4 10.1.1.6

10.1.1.3 10.1.1.5

Time T1

uu

u

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.19

Page 20: OSPF Basics

Reliable Flooding (cont..)

10.1.1.1 10.1.1.2 10.1.1.4 10.1.1.6

10.1.1.3 10.1.1.5

Time T2u

uu

u

u

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.20

Page 21: OSPF Basics

Reliable Flooding (cont..)

10.1.1.1 10.1.1.2 10.1.1.4 10.1.1.6

10.1.1.3 10.1.1.5

Time T3

u

u

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.21

Page 22: OSPF Basics

Reliable Flooding (cont..)

10.1.1.1 10.1.1.2 10.1.1.4 10.1.1.6

10.1.1.3 10.1.1.5

Time T3+

ack ack ack ack

ack

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.22

Page 23: OSPF Basics

Routing Calculations

• Link costs configurable by administrator• Smaller values for more preferred links• Different costs for each link direction possible• Dijkstra’s shortest path algorithm• incrementally calculates tree of shortest paths• each link in the network examined once• computes multiple shortest paths (equal-cost multipath)

Page 24: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.24

LAB

Page 25: OSPF Basics

OSPF Areas

• Two-level hierarchical routing scheme through the use of areas

• Areas identified by 32-bit id• Each area has its own link state database which is a

collection of network-LSAs and router-LSAs• Area’s topology hidden from all other areas• All Areas connected through Backbone Area (Area 0)• Interconnection of areas through area border routers (ABRs) • ABR leaks IP addressing information to other areas through

summary LSAs

Page 26: OSPF Basics

Sample Area Configuration

AREA 0Backbone

AREA 1AREA 35

Internet

ASBRABR

ABR

Page 27: OSPF Basics

OSPF Areas (Cont…)

• Reduction in link state databases of an area• Reduction in amount of flooding traffic needed for

synchronization• Reduction in the cost of the shortest path

calculations• Increased robustness• Routing protection• Hidden prefixes

Page 28: OSPF Basics

Incorporating external routing information

• Special routers called AS boundary routers at the edge of OSPF domain

• ASBRs originate AS-External LSAs• only routes for which the choice of an ASBR makes

sense are imported• otherwise default routes are used

Page 29: OSPF Basics

Interaction with areas

• Inter Area communication• LSA type 1. Router LSA. All routers in an area• LSA type 2. Network LSA. DR generates it.

• Intra Area communication• LSA type 3. Summary ABR LSA. • LSA type 5. Summary ASBR LSA.

Page 30: OSPF Basics

OSPF Area Types

• Restrict the amount of external routing information within an area

• Used when resources especially router memory is very limited

• Many types of restricted areas• Stub Areas• Others: not covered on this training

Page 31: OSPF Basics

OSPF Area Types (cont…)

• Stub Areas• Don’t support ASBRs and hence no AS-External-LSAs• Routing to external destinations based on default routes

originated by the area’s border routers• Summary LSAs also made optional• Must lie on the edge of OSPF routing domain• Inter-area routing may also be based on default routes• Improved scaling• But not preferred due to the possibility of suboptimal

routes

Page 32: OSPF Basics

© 2012 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.32

LAB

Page 33: OSPF Basics

OSPF configuration

Normal area configuration

R1#configure terminal

R1(config)#router ospf 1

R1(config-router)# router-id 150.1.1.1

R1(config-router)# network 10.1.1.0 0.0.0.255 area 0

Stub area configuration

R1#configure terminal

R1(config)#router ospf 1

R1(config-router)# router-id 150.1.1.1

R1(config-router)# network 10.1.1.0 0.0.0.255 area 1

R1(config-router)# area 1 stub

Page 34: OSPF Basics

OSPF verification

• R1# show ip ospf neighbors• R1# show ip ospf interfaces• R1# show ip ospf database• R1# show ip route• R1# show ip interfaces brief

Page 35: OSPF Basics

Issues not covered

• OSPF Area Types• NSSA• Totally stubby• Totally NSSA• OSPF Network Types• Broadcast subnets• NBMA Subnets• OSPF in the WAN• OSPF Management• Virtual Links• OSPF and IPv6• Many others

Page 36: OSPF Basics

Thank You!