Introduction to OSPF - PacNOG
Transcript of Introduction to OSPF - PacNOG
![Page 1: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/1.jpg)
1© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Introduction to OSPFISP/IXP WorkshopsISP/IXP Workshops
![Page 2: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/2.jpg)
222© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
OSPF
• Open ShortestPath First
• Link state or SPFtechnology
• Developed by OSPFworking group of IETF(RFC 1247)
• Designed for TCP/IPInternet environment
• Fast convergence
• Variable-lengthsubnet masks
• Discontiguous subnets• No periodic updates• Route authentication• OSPF standard
described in RFC2328
![Page 3: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/3.jpg)
333© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Link State
Topology Information IsKept in a DatabaseSeparate from the
Routing Table
AABBCC
2213131313
QQZZXX
X’s Link State
ZZ
XX
YYQQ
Z’s Link StateQ’s Link State
![Page 4: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/4.jpg)
444© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Link State Routing
• Neighbour discovery• Constructing a Link State Packet (LSP)• Distribute the LSP
(Link State Announcement – LSA)
• Compute routes• On network failure
New LSPs floodedAll routers recompute routing tables
![Page 5: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/5.jpg)
555© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Low Bandwidth Utilisation
• Only changes propagated
• Multicast on multi-access broadcast networks
LSA
XLSA
R1
![Page 6: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/6.jpg)
666© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Fast Convergence
• Detection Plus LSA/SPF
X N2
Alternate Path
Primary Path
N1
R2
R1 R3
![Page 7: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/7.jpg)
777© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Fast Convergence
• Finding a new routeLSA flooded throughout area
Acknowledgement based
Topology database synchronised
Each router derives routing tableto destination networks
LSA
XN1R1
![Page 8: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/8.jpg)
888© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
IP Multicast for Sending/Receiving Updates
• Broadcast networksAll routers must accept packets sent to AllSPFRouters(224.0.0.5)All DR and BDR routers must accept packets sent toAllDRouters (224.0.0.6)
• Hello packets sent to AllSPFRouters (Unicast onpoint-to-point and virtual links)
![Page 9: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/9.jpg)
999© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
OSPF Areas
• Group of contiguous hostsand networks
• Per area topologicaldatabase
Invisible outside the areaReduction in routing traffic
• Backbone area contiguousAll other areas must beconnected to the backbone
• Virtual Links Area 1
Area 2 Area 3
R1 R2
R3R6
Area 4R5 R4
R7R8
RaRd
RbRcArea 0
Backbone Area
![Page 10: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/10.jpg)
101010© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Classification of Routers
• Internal Router (IR)• Area Border Router (ABR)
• Backbone Router (BR)
• Autonomous SystemBorder Router (ASBR)
R1 R2
R3
R5 R4
Rd Ra
RbRc
IR
ABR/BR
IR/BRASBR
To other AS
IR
Area 1
Area 0
Area 2 Area 3
![Page 11: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/11.jpg)
111111© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
OSPF Route Types
• Intra-area Routeall routes inside an area
• Inter-area Routeroutes advertised from one areato another by an Area BorderRouter
• External Routeroutes imported into OSPF fromother protocol or static routes
R1 R2
R3
R5 R4
Rd Ra
RbRc
IR
ABR/BR
ASBR
To other AS
IR
Area 1
Area 0
Area 2 Area 3
![Page 12: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/12.jpg)
121212© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Inter-Area Route Summarisation
• Prefix or all subnets
• Prefix or all networks
• ‘Area range’ command
1.A 1.B 1.C
FDDIDual Ring
(ABR)Network1
Next HopR1
Network1.A1.B1.C
Next HopR1R1R1
With summarisation
Withoutsummarisation
BackboneArea 0
Area 1R1
R2
![Page 13: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/13.jpg)
131313© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Prefixes which are redistributed into OSPF fromother protocols
• Flooded unaltered throughout the AS
• OSPF supports two types of external metricsType 1 external metrics
Type 2 external metrics (Default)
External Routes
RIPIGRPEIGRPBGPetc.
OSPF
RedistributeR2
![Page 14: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/14.jpg)
141414© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
External Routes
• Type 1 external metric: metrics are added tothe summarised internal link cost
NetworkN1N1
Type 11110
Next HopR2R3
Cost = 10to N1
External Cost = 1
to N1 External Cost = 2Cost = 8
Selected Route
R3
R1
R2
![Page 15: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/15.jpg)
151515© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
External Routes
• Type 2 external metric: metrics are comparedwithout adding to the internal link cost
NetworkN1N1
Type 212
Next HopR2R3
Cost = 10to N1
External Cost = 1
to N1 External Cost = 2Cost = 8
Selected Route
R3
R1
R2
![Page 16: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/16.jpg)
161616© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Topology/Link State Database
• A router has a separate LS databasefor each area to which it belongs
• All routers belonging to the samearea have identical database
• SPF calculation is performed separately foreach area
• LSA flooding is bounded by area
![Page 17: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/17.jpg)
171717© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Protocol Functionality
• Bringing up adjacencies
• LSA types
• Area classification
![Page 18: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/18.jpg)
181818© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
The Hello Protocol
• Responsible for establishing andmaintainingneighbour relationships
• Elects designated router on multi-accessnetworks
FDDIDual Ring
Hello
HelloHello
![Page 19: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/19.jpg)
191919© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
The Hello Packet
• Router priority
• Hello interval
• Router deadinterval
• Network mask
• Options: T-bit, E-bit
• List of neighbours
FDDIDual Ring
Hello
HelloHello
![Page 20: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/20.jpg)
202020© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Designated Router
• There is ONE designated router per multi-access networkGenerates network link advertisementsAssists in database synchronization
Designated Router
Designated Router
BackupDesignated Router
BackupDesignated
Router
![Page 21: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/21.jpg)
212121© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Designated Router by Priority
• Configured priority (per interface)
• Else determined by highest router IDRouter ID is the loopback interface address, ifconfigured, otherwise the highest IP address
144.254.3.5
R2 Router ID = 131.108.3.3
131.108.3.2 131.108.3.3
R1 Router ID = 144.254.3.5
DR R2R1
![Page 22: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/22.jpg)
222222© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Neighbouring States
DR BDR
Full
• FullRouters are fully adjacentDatabases synchronisedRelationship to DR and BDR
![Page 23: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/23.jpg)
232323© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Neighbouring States
• 2-wayRouter sees itself in other Hello packetsDR selected from neighbours in state2-way or greater
DR BDR
2-way
![Page 24: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/24.jpg)
242424© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
When to Become Adjacent
• Underlying network is point to point
• Underlying network type is virtual link
• The router itself is the designated router
• The router itself is the backup designated router
• The neighbouring router is the designated router
• The neighbouring router is the backupdesignated router
![Page 25: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/25.jpg)
252525© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
LSAs Propagate Along Adjacencies
• LSAs acknowledged along adjacencies
DR BDR
![Page 26: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/26.jpg)
262626© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Routing Protocol Packets
• Share a common protocol header• Routing protocol packets are sent with type of
service (TOS) of 0• Five types of OSPF routing protocol packets
Hello – packet type 1Database description – packet type 2Link-state request – packet type 3Link-state update – packet type 4Link-state acknowledgement – packet type 5
![Page 27: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/27.jpg)
272727© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Different Types of LSAs
• Four distinct type of LSAsType 1 : Router LSA
Type 2 : Network LSA
Type 3 and 4: Summary LSA
Type 5 and 7: External LSA
![Page 28: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/28.jpg)
282828© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Router LSA (Type 1)
• Describes the state and cost of the router’slinks to the area
• All of the router’s links in an area must bedescribed in a single LSA
• Flooded throughout the particular area and nomore
• Router indicates whether it is an ASBR, ABR, orend point of virtual link
![Page 29: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/29.jpg)
292929© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Network LSA (Type 2)
• Generated for every transit broadcast andNBMA network
• Describes all the routers attached to thenetwork
• Only the designated router originates thisLSA
• Flooded throughout the area and no more
![Page 30: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/30.jpg)
303030© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Summary LSA (Type 3 and 4)
• Describes the destination outside the areabut still in the AS
• Flooded throughout a single area• Originated by an ABR• Only inter-area routes are advertised into
the backbone• Type 4 is the information about the ASBR
![Page 31: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/31.jpg)
313131© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
External LSA (Type 5 and 7)
• Defines routes to destination external to the AS• Default route is also sent as external• Two types of external LSA:
E1: Consider the total cost up to the external destinationE2: Considers only the cost of the outgoing interface tothe external destination
• (Type 7 LSAs used to describe external LSA forone specific OSPF area type)
![Page 32: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/32.jpg)
323232© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Specific Link LSA advertised out of each area• Link state changes propagated out of each area
No Summarisation
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
1.A1.B1.C1.D Area 0
2.A2.B2.C2.D
3.A3.B3.C3.D
ASBRExternal
links
![Page 33: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/33.jpg)
333333© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Only summary LSA advertised out of each area• Link state changes do not propagate out of the area
With Summarisation
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
1Area 0
2
3
ASBRExternal
links
![Page 34: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/34.jpg)
343434© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Specific Link LSA advertised in to each area• Link state changes propagated in to each area
No Summarisation
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
2.A 2.B2.C 2.D3.A 3.B3.C 3.D Area 0
1.A 1.B1.C 1.D3.A 3.B3.C 3.D
1.A 1.B1.C 1.D2.A 2.B2.C 2.D
ASBRExternal
links
![Page 35: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/35.jpg)
353535© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Only summary link LSA advertised in to each area• Link state changes do not propagate in to each area
With Summarisation
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
2 3 Area 0
1 3
12
ASBRExternal
links
![Page 36: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/36.jpg)
363636© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Types of Areas
• Regular
• Stub
• Totally Stubby
• Not-So-Stubby
![Page 37: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/37.jpg)
373737© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• From Area 1’s point of view, summary networks from otherareas are injected as are external networks such as X.1
Regular Area (Not a Stub)
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
2 3 Area 0
1 3
12
ASBRExternalnetworks
X.1
X.1
X.1
X.1
X.1
X.1
X.1
![Page 38: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/38.jpg)
383838© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Summary networks, default route injected• Command is area x stub
Normal Stub Area
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
2 3 Area 0
1 3
12
ASBRExternalnetworks
X.1
X.1
Default
X.1
X.1
Default
Default
![Page 39: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/39.jpg)
393939© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Only a default route injectedDefault path to closest area border router
• Command is area x stub no-summary
Totally Stubby Area
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
Area 0
1 3
1 2
ASBRExternalnetworks
X.1
X.1
Default
X.1
X.1
Default
DefaultTotallyStubby Area
![Page 40: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/40.jpg)
404040© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
• Capable of importing routes in a limited fashion• Type-7 LSA’s carry external information within an NSSA• NSSA Border routers translate selected type-7 LSAs into
type-5 external network LSAs
Not-So-Stubby Area
3.A3.B
3.C 3.D2.A2.B
2.C 2.D
1.A1.B
1.C 1.D
Area 0
1 3
1 2
ASBRExternalnetworks
X.1
X.1
Default
X.1
X.1
DefaultX.2
DefaultX.2
Not-So-Stubby Area
Externalnetworks
X.2
X.2
X.2
![Page 41: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/41.jpg)
414141© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Addressing for Areas
Area 1network 131.108.0.0subnets 0-15range 255.255.240.0
Area 2network 131.108.0.0subnets 16-31range 255.255.240.0
Area 3network 131.108.0.0subnets 32-47range 255.255.240.0
Area 0network 192.117.49.0range 255.255.255.0
Assign contiguous ranges of subnets per area to facilitate summarisation
![Page 42: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/42.jpg)
424242© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Summary
• Scalable OSPF Network DesignArea hierarchy
Stub areas
Contiguous addressing
Route summarisation
![Page 43: Introduction to OSPF - PacNOG](https://reader031.fdocuments.us/reader031/viewer/2022020705/61fb79102e268c58cd5e949a/html5/thumbnails/43.jpg)
43© 2005, Cisco Systems, Inc. All rights reserved.Cisco ISPWorkshops
Introduction to OSPFISP/IXP WorkshopsISP/IXP Workshops