INTRODUCTION OF OSPF PROTOCOL :
OPEN SHORTEST PATH FIRST (OSPF) Is A Popular Routing Protocol For IP Networks For Several Key Reasons. It Is Classless, Offering Full CIDR And VLSM Support; It Scales Well; Converges Quickly; And Guarantees Loop-Free Routing. It Also Supports Address Summarization And The Tagging Of External Routes, Similar To EIGRP. For Networks That Require Additional Security, You Can Configure OSPF Routers To Authenticate With One Another To Ensure That Unauthorized Devices Can't Affect Routing Tables.
As The 1980s Drew To A Close, The Fundamental Limitations Of Distance-Vector Routing Were Becoming Increasingly Apparent. One Attempt To Improve The Scalability Of Networks Was To Base Routing Decisions On Link States Rather Than Hop Count Or Other Distance Vectors. A Link Is The Connection Between Two Routers In A Network. The Status Of That Link Can Include Such Attributes As Its Transmission Speed And Delay Levels.
OSPF Was First Specified In RFC 1131. This Short-Lived Specification Was Quickly Made Obsolete By RFC 1247. The Differences Between These Two Ospfs Were Substantial Enough That The RFC 1247 OSPF Was Called OSPF Version 2. OSPF Version 2 Continued To Mature And Evolve. Subsequent Modifications Were Outlined In RFCs 1583, 2178, And 2328 (Second Version, Which Is Documented In RFC 2328).
◙ Developed by IETF – RFC1247.
► Designed for Internet TCP/IP environment.
◙ OSPF v2 described in RFC2328/STD54.
◙ OSPF v3 described in RFC2740 - IPv6.
It Uses A Large, Dimensionless Metric On Every Link (Also Equivalently Called A "Cost"), With A Maximum Value Of 65535. But Unlike RIP And EIGRP, Which Use A Metric That Reflects The Cost Of The Entire Path, OSPF's Metric Is Just A Per-Link Cost. The RFC Does Not Specify A Maximum Total Path Cost. So, In Fact, Any Given Path Through An OSPF Network Can Include Many High-Cost Links, But Still Be Usable. This 16-Bit OSPF Metric, While Significantly Larger Than The Simple Hop-Count Metric Used In RIP, Is Much Smaller Than EIGRP's 32-Bit Metric.
OSPF Routers Only Start To Exchange Routing Information After They Have Established A Neighbor Relationship. However, Unlike EIGRP, OSPF Routers Don't Actually Exchange Routing Tables Directly. Instead, They Exchange Link State Advertisements (LSA), Which Describe The States Of Different Network Links. Each Router Then Obtains An Accurate Image Of The Current Topology Of The Network, Which It Uses To Build Its Routing Tables. If You Group The Routers Into Areas, As We Will Discuss In A Moment, Every Router In Each Area Sees The Same LSA Information, Which Guarantees That All Of The Routing Tables Are Compatible With One Another.
The OSPF Protocol Operates Directly At The IP Layer By Using IP Protocol Number 89, Without An Intervening Transport Layer Protocol Such As UDP Or TCP. Devices Exchange OSPF Information Using Multicast Packets That Are Confined To The Local Segment. OSPF Actually Uses Two Different Multicast IP Addresses. All OSPF Routers Use 224.0.0.5, And Designated Router (DR) Routers Use 224.0.0.6.
The DR Is Basically A Master Router For A Network Segment. This Is Only Relevant When There Are Several OSPF Routers On A Multiple Access Medium Such As An Ethernet Segment. In This Case, To Avoid The Scaling Problems Of Establishing A Mesh Of Neighbor Relationships Between All Of The Routers On The Segment, One Router Becomes The DR For The Segment. Then All Of The Other Routers Talk To The DR. Each Segment Also Elects A Backup Designated Router (BDR) In Case The DR Fails.
One Of The Most Important Features Of OSPF Is The Concept Of An Area. This Is Also Partly What Makes OSPF More Difficult To Configure. An OSPF Network Can Be Broken Up Into Areas That Are Connected By Area Border Routers (ABR). Routing Information Can Then Be Summarized At The ABR Before Being Passed Along To The Next Area. This Means That Routers In One Area Don't Need To Worry About The LSA Information From Routers In Other Areas, Which Drastically Improves Network Stability And Convergence Times, As Well As Reducing The Amount Of Resources Required To Support OSPF On The Routers.
For OSPF To Work Well, You Need To Allocate Your IP Addresses Appropriately Among The Areas. In Particular, You Want To Be Able To Summarize The Routes For An Area When You Pass This Information Along To The Next Area. The Summarization Doesn't Need To Reduce Perfectly To A Single Route For Each Area. But The Fewer Lsas You Need To Pass Between Areas, The Better OSPF Will Scale.
Each Area Has A 32-Bit Identifier Number, Which Is Often Represented In Dotted Decimal Notation, Similar To IP Addresses. Every OSPF Network Should Have An Area 0 (Or 0.0.0.0), And Every ABR Must Be A Member Of Area 0. This Enforces A Hierarchical Design Model For OSPF Networks. The One Exception To This Rule Happens In A Network With Only One Area. In This Case, You Can Actually Give This Area Any Number. We Recommend Using An Area 0, Even If It Is The Only Area In Your Network To Avoid Some Of The Problems That Will Occur If You Ever Need To Partition The Network Into Areas Later. The Only Time This Ability To Run A Single Area Network With No Area 0 Relevant Is When A Network Failure Isolates One Area From The Rest Of The Network. In This Case, The Isolated Area Can Continue Working Normally Internally.
You Can Get Around This Strict Design Requirement Of Having All Areas Connected Only Through Area 0 By Using OSPF Virtual Links. These Are Essentially Little More Than IP Tunnels. You Can Use Virtual Links To Ensure That Every ABR Connects To Area 0, Even If One Or More Of Them Are Not Physically Connected To Area 0. However, We Should Stress That We Do Not Recommend Using Virtual Links, Except As A Temporary Measure Perhaps While Migrating Your Network To A New Architecture Or While Merging Two Networks.
The OSPF Protocol Defines Several Different LSA Types. We Will Briefly Review These Different Types Before Discussing The Area Types; Because It Will Help To Understand What Is Going On In These Different Area Types.
LSA type | Name | Description |
---|---|---|
1 | Router-LSA | A Router-LSA includes information about the link states of all of a router's interfaces. These LSAs are flooded throughout the area, but not into adjacent areas. |
2 | Network-LSA | On NBMA and broadcast capable network segments, the DR originates Network-LSAs. The Network-LSA describes the routers that are connected to this broadcast or NBMA segment. Network-LSAs are flooded throughout the area, but not into adjacent areas. |
3 | Summary-LSA | ABR routers originate Summary-LSAs to describe interarea routes to networks that are outside of the area but inside of the AS. They are flooded throughout an area. Type 3 LSAs are used for routes to networks. |
4 | Summary-LSA | Type 4 LSAs are similar to Type 3 LSAs, except that they are used for routes to ASBR routers. |
5 | AS-external-LSA | ASBR routers originate Type 5 LSAs to describe routes to networks that are external to the AS. Type 5 LSAs are flooded throughout the AS. |
6 | MOSPF-LSA | Type 6 LSAs are used for carrying multicast routing information with MOSPF. Cisco routers do not currently support Type 6 LSAs. |
7 | NSSA-External-LSA | Type 7 LSAs are originated by ASBRs in an NSSA area. They are similar to Type 5 LSAs, except that they are only flooded throughout the NSSA area. When Type 7 LSAs reach the ABR, it translates them into Type 5 LSAs and distributes them to the rest of the AS. |
There Are Several Different Types Of OSPF Areas. They Are Differentiated By How They Summarize Information Into And Out Of The Area. The Other Important Difference Between Area Types Concerns Whether Or Not They Can Be Used For Transit Between Other Parts Of The Network. A Transit Area Allows Packets To Simply Pass Through The Area On Their Way To Another Area Or Another Network. Any Router That Connects OSPF To Another Network Or A Different Routing Protocol Is Called An Autonomous System Boundary Router (ASBR).
The First Important Type Of Area Is The Backbone Area, Which Is Used By Area 0. This Area Is Special Because It Can Always Act As A Transit Area, Between Other Areas, Between This OSPF Autonomous System And External Networks, Or Even Between External Networks.
The Second Area Type Is Called A Stub Area. Stub Areas See Detailed Routing Information On All Other Areas, But Only Summary Information About Networks Outside Of The AS. The ABR Sends Type 3 LSA Packets To Summarize This Information. The ABR Connecting To A Stub Area Summarizes Routes To External Networks, Outside Of The AS. All External Routes Are Reduced To A Single Summary. This Is Important Because It Means That You Cannot Make Connections To External Networks Via A Stub Area. It Also Means That If Your Network Is Essentially All One Big AS, Perhaps With A Default Route To The Internet, Then There Is No Advantage To Using A Stub Area. Stub Areas Are Most Useful When There Are Many External Routes, So Summarizing Them Saves Router Resources.
In Terms Of LSA Types, The Distinguishing Factor For A Stub Area Is That The ABR Will Not Send Any Type 5 LSAs Into This Area.
Third Is The Totally Stub Area. Totally Stub Areas, Also Called "Stub No-Summary," Summarize Not Only External Routes, But Also Routes From Other Areas (Interarea Routes). Routers In This Type Of Area Only See Routing Information Local To Their Area, Plus A Default Route Pointing To The ABR, From Which They Can Reach All Other Areas And All Other Networks. The ABR Accomplishes This By Preventing All Type 3, 4, And 5 LSA Messages, Except For The Default Summary Route, Which It Transmits As A Single Type 3 LSA Message.
As With Regular Stub Areas, You Cannot Make Connections To External Networks Through Totally Stub Areas By Using Redistribution Into OSPF.
Totally Stub Areas Are Clearly Useful In WAN Situations Where The Overhead Of Maintaining And Updating A Large Link State Database Is Both Onerous And Unnecessary. The Only Problem With Totally Stub Areas Is That This Is Essentially A Cisco Invention. Some Other Vendors Have Added Support For This Area Type, But It Is Not Universally Supported, So You Might Have Problems Implementing It In A Multivendor Network. But As Long As You Use Cisco ABR Routers, The Other Routers Inside Of A Totally Stub Area Won't Know That Anything Special Has Happened To Their Routing Information, So The Non ABR Routers Can Be Any Non-Cisco Devices.
Not So Stubby Areas (NSSA) Are Defined In RFC 1587. This Is A Variant Of The Stub Area That Is Able To Connect To External Networks. It Accomplishes This By Introducing A New LSA Type (LSA Type 7) That Is Used Within The Area To Carry External Routes That Originate With Asbrs Connected To This Area. The ABR Only Summarizes Those External Routes That Are Received From Other Areas, And Therefore Reached Through The ABR. External Routes From Asbrs Inside The Area Are Not Summarized. In Order To Pass The Internally Generated External Routes To The Rest Of The Network, The ABR Translates These Type 7 LSAs Into The More Conventional Type 5 LSA Before Relaying This Information Into Area 0.
The Result Is That You Can Use NSSA Areas To Connect To External Networks. This Is Extremely Important To Remember Because Even A Simple Redistributed Static Route Is Considered An External Route. If You Want External Routes To Be Available For The Rest Of The Network, Then NSSA Is A Good Way To Handle Them. NSSA Is An Open Standard Part Of The OSPF Protocol, So Most Of The Router Vendors Who Implement OSPF Include NSSA Support.
Finally, Another Useful Cisco Adaptation Is The Totally Stubby Not So Stubby Area Type. This Comical Sounding Name Belies An Extremely Useful Feature. This Area Type Combines The Best Of NSSA And Totally Stub Areas By Summarizing Information From All Other Areas, But Handling External Routes Like NSSA. It Allows You To Summarize Internal Routes From Other Areas While Still Allowing You To Put An ASBR Happens Inside Of The Area.
As With The Totally Stub Area, The ABR Connecting To A Totally Stubby NSSA Area Prevents All Type 3, 4, And 5 LSAS. And, Like An NSSA, It Uses Type 7 LSA Messages To Carry External Routes From ASBR Routers Inside Of The Area. So The Totally Stubby NSSA Area Can Be Used As A Transit Area To An External Network, But It Can Also Benefit From Summarization Of Inter Area Routes.
In Many Networks, The Number Of External Routes Is Relatively Small, While There Are Many Internal (Inter Area) Routes. So It Is Actually Much More Important To Summarize The Internal Routes In These Cases. But The Stub And Totally Stub Area Types That Allow This Inter Area Route Summarization Don't Allow You To Connect To External Networks. The Totally Stubby NSSA Area Type Is Ideal When You Need To Connect To An External Network Through An Area That You Would Really Prefer To Keep Stubby For Performance And Scaling Reasons.
Another Important Concept In OSPF Involves How It Exchanges Routing Information With External Autonomous Systems. Any Router That Advertises An External Route To The Rest Of The Network Must Be On The Border With Another Network, So It Is Called An Autonomous System Border Router (ASBR).
OSPF Defines Two Different Types Of External Routes. The Only Difference Between Them Is In The Way That OSPF Calculates Their Costs. The Cost Of A Type 1 External Route Is The Sum Of The External Metric Plus The Internal Cost To Reach The ASBR. The Cost Of A Type 2 External Route Is Just The External Metric Cost. For Type 2 External Routes, OSPF Does Not Add In The Cost To Reach The ASBR.
When Making Routing Decisions, OSPF Prefers Type 1 To Type 2 External Routes. So,
For Example, You Can Use Type 1 External Routes To Ensure That Every Internal Router Selects The Closest ASBR That Connects To A Particular External Network. But You Might Want To Also Set Up A Backup ASBR That Injects Type 2 Routes. Then The Internal Routers Will Prefer The Type 1 Routes, If They Are Present.
OPEN SHORTEST PATH FIRST (OSPF) SHORT NOTES :
OSPF PROTOCOL ATTRIBUTES
Protocol Type | Link-state |
---|---|
Algorithm | Dijsktra |
Metric (IOS) | Cost (bandwidth) |
Administrative Distance | 110 |
Specification | RFC 2328, RFC 2740 |
Supported Protocols | IPv4 (OSPFv2), IPv6 (OSPFv3) |
Transport | IP/89 |
Authentication | None, plain text, MD5 |
AllSPF Multicast Address | 224.0.0.5 |
AllDR Multicast Address | 224.0.0.6 |
Hello Timer | 10 seconds (broadcast), 30 seconds (nonbroadcast) |
PACKET TYPES:
- Hello - Used to establish communication with directly connected neighbors
- Database Descriptor (DBD) - Lists router IDs from which the router has an LSA and its current sequence number
- Link State Request (LSR) - Request for an LSA
- Link State Update (LSU) - Reply to an LSR with the requested information
- Link State Acknowledgment (LSAck) - Used to confirm receipt of link-state information
ADJACENCY FORMATION :
Contents of An OSPF Hello Packet:
- Router ID - 32-Bit Unique Number (IP Address)
- Hello/Dead Intervals - Timers
- Neighbor List - List Of Neighboring Router IDs
- Area ID
- Priority - Used In The DR And BDR Elections
- DR And BDR Identifiers
- Authentication (If Enabled)
- Stub Area Flag - On If This Is A Stub Area
NEIGHBOR STATES :
- Down
- Attempt - Used For Manually Configured Neighbors On An NBMA Link; Unicast Hellos Sent To Neighbor From Which Hellos Have Stopped Being Received
- Init - Hello Packet Received From Neighbor, But Without The Recipient's Router ID
- 2-Way - Bi-Directional Communication Has Been Established
- EXSTART - The DR And BDR Have Been Elected, Link-State Exchange Starting
- EXCHANGE - Exchange Of Database Descriptor (DBD) Packets
- LOADING - Exchange Of Link-State Information
- FULL - Full Adjacency Established
OSPF As Implemented In Cisco IOS Will Load Balance Over Up To Four Equal-Cost Links; Configurable Up To Six.
DESIGNATED ROUTER ELECTION :
Neighbors on a broadcast segment elect a Designated Router (DR) And Backup Designated Router (BDR), Which Peer With All Other Routers On The Segment. All Non-Designated Routers Peer Only With The DR And BDR.
MULTICAST DESTINATIONS :
224.0.0.5
- All OSPF routers224.0.0.6
- All designated OSPF routers (DR and BDR only)
DRs Are Chosen Based On Priority (0 - 255). 1 Is Default; Routers With 0 Priority Will Never Be Elected. Priority Ties Are Broken By Choosing The Higher Router ID.
By Default, DRs Are Elected On Point-To-Point Ethernet Links Even Though This Is Unnecessary (Ethernet Is Always Considered A Broadcast Medium). Interfaces Can Be Manually Configured To Operate In Point-To-Point Mode To Prevent This.
(B)DRs Are Not Preemptable. New Election Will Take Place Only When A Current (B)DR Goes Offline Or Its OSPF Process Is Administratively Restarted.
OSPF AREA TYPES :
Areas Are Defined To Logically Segment A Network And Reduce Routing Table Size And Complexity. All Routers In An Area Maintain An Identical Topological Database.
- STANDARD AREA.
- STUB AREA - Will Not Accept External Routes (Type 5 LSAS); Type 5 LSAS Are Replaced By A Default Route
- TOTALLY STUBBY AREA - Will Not Accept LSAs Of Type 3, 4, Or 5; Routes Are Replaced By The ABR With A Default Route; Cisco Proprietary
- NOT-SO-STUBBY AREA (NSSA) - Stub Areas Which Contain One Or More ASBRs; ASBRs In A NSSA Generate Type 7 LSAs Which Are Then Converted To Type 5 By The ABR
All Areas Must Be Attached To Area 0 (The Backbone Area) Through Either An ABR Or A Virtual Link.
STUB AREAS :
NORMAL STUB AREA :
- ABR Replaces All External Routes With A Default Route
- Must Be Configured On All Routers In The Area
TOTALLY STUBBY AREA :
- ABR Replaces All Inter-Area And External Routes With A Default Route
- Cisco Proprietary
- Configured On ABRs; Internal Routers Configured As Normal Stubs
NOT-SO-STUBBY AREA (NSSA):
- Is A Stub Or Totally Stubby Area With An ASBR
- Advertises External Routes With Type 7 LSAs Instead Of The Normal Type 5
- NSSA Routes Appear In The Routing Table As Type N1 Or N2 (Instead Of E1 Or E2)
- All Routers Within The Area Must Be Configured
OSPF NETWORK TYPES:
- Broadcast MultiAccess
- Point-To-Point
- Point-To-Multipoint Broadcast
- Point-To-Multipoint Nonbroadcast
- Nonbroadcast Multiaccess (NBMA)
NBMA And Point-To-Multipoint Are Standards-Compliant (RFC 2328), Whereas Point-To-Multipoint Nonbroadcast, Broadcast, And Point-To-Point Implementations Are Cisco Proprietary.
NBMA Networks Utilize Drs Like Broadcast Networks, However Neighbors Must Be Manually Defined Instead Of Being Automatically Discovered.
NBMA | Point-To-Multipoint Broadcast |
Point-To-Multipoint Nonbroadcast |
Broadcast | Point-To-Point | |
DR/BDR | Yes | No | No | Yes | No |
IDENTIFY NEIGHBOR | Yes | No | Yes | No | No |
HELLO/DEAD TIMERS | 30/120 | 30/120 | 30/120 | 10/40 | 10/40 |
STANDARD | RFC | RFC | Cisco | Cisco | Cisco |
NETWORK SUPPORTED | Full mesh | Any | Any | Full mesh | Point-to-point |
ROUTER ROLES :
- Internal - Routers Which Have All Interfaces In A Single Area
- Backbone Routers - Routers With At Least One Interface In Area 0
- Area Border Routers (ABRs) - Routers With At Least Two Interfaces In Different Areas
- Autonomous System Boundary Routers (ASBR) - Routers which Redistribute Information From An External Source
Routers Can Fill Multiple Roles Simultaneously (E.G. Act As Both A Backbone Router And An Area Border Router).
LINK-STATE ADVERTISEMENTS (LSAs) :
- Router Link (Type 1) - Lists A Router's Neighbors And Its Cost To Each; Flooded Throughout The Area
- Network Link (Type 2) - Advertisement By The DR Containing All Routers On The Segment It Is Adjacent To; Flooded Throughout The Area
- Network Summary Link (Type 3) - ABRs Generate This Type Of LSA To Send Between Areas; It Lists All Prefixes Available In An Area
- AS External ASBR Summary Link (Type 4) - Router Link LSA for ASBRs
- External Link (Type 5) - Originated By An ASBR, Contains A Route External To OSPF
- NSSA External (Type 7) - Equivalent To A Type 5 LSA, But Generated By An ASBR In A Not-So-Stubby Area (NSSA); Converted To A Type 5 By The ABR
PATH CALCULATION :
Adjacencies Within An Area Are Advertised With Type 1 And 2 Lsas, Which Are Passed To The Backbone By An ABR As Type 3 Summaries. These Summaries Are Then Injected Into Other Areas From The Backbone.
OSPF Will Choose The Path To A Destination By The Advertisement Of The Lowest LSA Type, Then By Lowest Cost.
INTERNAL ROUTES :
The Cost To Another OSPF Area Is Calculated As The Smallest Cost To An ABR Plus The Smallest Cost Across The Backbone.
EXTERNAL ROUTES :
The Cost Of An External Route Can Be Evaluated Two Ways:
- E1 = Cost To ASBR + Advertised External Cost; Internal Routing Influences Path Selection
- E2 (Default) = Only Advertised External Cost Is Considered; Internal Routing Is Not Considered In Path Selection
ROUTING TABLE CODES :
LSA Type | TABLE CODE | DESCRIPTION |
1 (ROUTER) | O | Generated By All Routers; Lists Neighbors And Costs To Them; Propagated Within An Area |
2 (NETWORK) | O | Generated By The DR On A Multiaccess Network; Propagated Within An Area |
3 (INTER-AREA SUMMARY) | O IA | Advertises Summaries From One Area To Another |
4 (ASBR SUMMARY) | O IA | Advertises The Location Of An ASBR |
5 (EXTERNAL) | O E1 or O E2 | Advertises A Route External To The AS |
Virtual Links
All OSPF Areas Must Be Connected To The Backbone Area (Area 0) Through An ABR.
Virtual Links Must Be Implemented When An Area Cannot Be Directly Connected To The Backbone.
Virtual Links Are Not Encouraged And Should Be Used Only As A Temporary Fix.
Virtual Links Cannot Use A Stub Area For Transit.
For Reference :
Differences Between OSPFv2 & OSPFv3 :
OPEN SHORTEST PATH FIRST SHORT NOTES (OSPF):
CISCO - OSPF Commands Reference :
CISCO - OSPF Configuration Examples :
CONCLUSION:
The Goal Of This Article Is To Give An Easy Way To Understand The “OSPF - Open Shortest Path First Short Notes". Hope This Article Will Help Every Beginners Who Are Going To Start Cisco Lab Practice Without Any Doubts.
Some Topics That You Might Want To Pursue On Your Own That We Did Not Cover In This Article Are Listed Here, Thank You And Best Of Luck.
DISCLAIMER:
This Document Carries No Explicit Or Implied Warranty. Nor Is There Any Guarantee That The Information Contained In This Document Is Accurate. Every Effort Has Been Made To Make All Articles As Complete And As Accurate As Possible.
It Is Offered In The Hopes Of Helping Others, But You Use It At Your Own Risk. The Author Will Not Be Liable For Any Special, Incidental, Consequential Or Indirect Any Damages Due To Loss Of Data Or Any Other Reason That Occur As A Result Of Using This Document. But No Warranty Or Fitness Is Implied. The Information Provided Is On An "As Is" Basic. All Use Is Completely At Your Own Risk.
For Home Page Of - > SCN InF4 TECH
To Send Email
Window Minimize OR Window Maximize
No comments:
Post a Comment