When I search for OSPF real world application or implementation, I always get the explanation of how OSPF works or how to calculate the cost. My question is, is there any real life scenarios of how OSPF works?
is there any condition where OSPF is better used than anything else (e.g EIGRP), or what kind of network is suitable using OSPF?
In a heterogeneous network, all the router vendors will support the open-standard OSPF. For EIGRP, you would need a Cisco-only network, and it would close you from using routers from any other vendors. It would also create big problems in the event you merge with another company.
RIP is also an open standard that is supported by most vendors, but it has severe limitations, such as hop count and convergence time.
IS-IS is another open standard routing protocol, and it found a niche in telecommunications companies.
Overall, OSPF is open and well understood by people in the industry, and it is trusted to do the job over a wide range of equipment and network sizes. Most shops want to use products that do not lock them into particular vendors, and their employees and prospective employees understand.
Network topology might affect the choice of a routing protocol and make one protocol more desirable than another. The most common example is a large hub and spoke topology. In that topology, EIGRP can handle routing updates more efficiently than OSPF.
The bigger difference in protocols comes down to the practical implementations of them. As others have pointed out, EIGRP is a Cisco-proprietary protocol*, so that may be important if you have a multi-vendor environment.
Another example of practical implementations is OSPF vs IS-IS. Most large ISPs use IS-IS for their internal routing, even though IS-IS and OSPF use the same algorithms and have similar performance. From an operational point of view, IS-IS has fewer features, and therefore is "simpler" than OSPF. To many ISPs, that simplicity also means reliability -- there are fewer things to go wrong, which makes it more desirable than OSPF.
*EIGRP is a defined standard (RFC 7868), but hardly anyone outside of Cisco has implemented it.
1.1 Marketing view
OSPF's advantage is made of multiple points that make it appealing:
- More efficient than RIP with large networks thanks to OSPF being a link-state protocol, and due to the problem with RIP that it's too naive (it periodically sends the full routing table, which is very inefficient). Note that RIP's limitation is not due to fundamental flaw with distance-vectors routing protocols, but rather due to specific choices made within RIP. A distance-vector protocol can still be efficient, but RIP is just not one.
- That it's an open protocol that's wide spread on routers from various vendors. This can allow you to incorporate various routers from different vendors with each other. But this is not enough by itself, since IS-IS is also an open protocol like OSFP.
- Its configuration is based on IP addresses. This makes it easier for some people like IS-IS which is based on CLNS addresses for its configuration.
- OSPF is more wide spread than IS-IS. In part because of the fact that IP addresses won against CLNS addresses. IS-IS was made by ISO for CLNS addresses and CLNS lost the battle. This battle loss is only historic, as IS-IS supports routing for IP networks, and ironically, IS-IS supported IPv6 before OSPF.
Due to those reasons, people go with OSPF. In other words, OSPF fills a point where it's more efficient than RIP for large networks for being a little harder to use (arguable) and being the most wide-spread open routing protocol after RIP.
1.2 Technical view
But is OSPF technically any better? The answer is no.
Both EIGRP and IS-IS are technically better than OSPF. OSPF has this needless requirement that all areas must connect to
area 0 (backbone). IS-IS does not have such requirement. OSPF's requirement of having all areas connect to a backbone is going to limit the way your network growth in the future, and imposes a burden on routers inside your backbone area by requiring to make them computationally more capable (since all other areas talk to each other via the backbone). This is really a bad design by OSPF.
IS-IS on the other hand, does not have the backbone concept. You can attach your areas to each other without needing to have them go through a given area. If you want to have a backbone area, then you can arrange your IS-IS areas such that they end up all going through an area of your choice. But if you don't want, then you don't! IS-IS also solves the shortest-path-first problem within an area like OSPF. As said, IS-IS is also an open protocol, but it's configurations requires selection of CLNS addresses (not IP) which confuses some people, and IS-IS is less wide spread. IS-IS is more popular with service provide where the network engineers are more knowledgeable and can purchase higher-end equipment that implement IS-IS.
But, technically, the best in terms of computational needs is really EIGRP in my view. Unlike OSPF and IS-IS (which solve the shortest-path problem for all links in a given area), EIGRP distributes such computation across all routers inside a given administrative region, such that each router does its own part and passes his work on. Eventually EIGRP routers converge to the correct solution, without needing every router to solve the shortest-path-first problem for all networks in the administrative region (or area as named in IS-IS/OSPF). Such administrative regions are also defined more flexibly by EIGRP by means of route summarisation between routers (practically you can reach an identical effect to areas).
But the major drawback of EIGRP is the fact that it's not an open protocol. This is a huge problem as it will lock you, as a company, from freely replacing your routers by non-Cisco routers. Being locked to a specific vendor is a danger. This is why, even if your routers are 100% Cisco routers, I'd suggest that you avoid EIGRP in order to give yourself room should you one day stumble upon a moment where plugging a non-Cisco router is needed.
EIGRP is a purely distance vector routing protocol and is an example that RIP's problem is not due to a fundamental flaw in open-distance-ness, but rather due to RIP being too simple to handle large networks.
- RIP can still be the most efficient protocol for stable-enough small-enough networks. If the routing table is small, then RIP's messages can be smaller than the link-state messages of OSPF/IS-IS (some of which use padding which makes their messages possibly larger than RIP's updates if RIP's routing table is small enough).
- EIGRP is often told by Cisco to be a "hybrid" routing protocol, as a marketing trick to avoid the bad reputation of some distance vector protocols such as RIP. But technically EIGRP is a distance-vector routing as it purely learns by rumour.
- The real hybrid routing protocols are actually OSPF and IS-IS, because they are link-state only within an area, and operate purely in a distance-vector manner between areas. In fact the concept of areas are made with them only because solving the shortest-path-first problem for too-large networks is too expensive. Hence the shortest-path-first is solved within an area, and the inter-area becomes the cheap distance vector method of learning by rumour from neighbouring routers of other areas. Worth nothing that OSPF and IS-IS being "hybrid" does not give them any special points. I'd argue that this hybrid-ness of OSPF/IS-IS is a downside as it implies increased complexity of protocol's implementation.
If I to rank routing protocols from purely a technical perspective, I'd say that RIP is needed since it's the most efficient choice for small-enough networks out of all of them. IS-IS is needed for being the best available interior routing protocol that is an open protocol. EIGRP is needed as the best interior routing protocol for those that swore the oath to never leave Cisco. But OSPF is just not needed from a purely technical perspective. OSPF is only needed due to the human factor (people being used to IP addressing in configs) and due to historical events that made OSPF become more wide-spread than IS-IS.
Note to new OP
Oh, and welcome to the world of computer networking! You will see confusing names due to historical reasons, more sub-optimal solution that exist today simply because people are just used to them, and people that blindly defend protocols as-if protocols are always right (which is not true by the way, protocols have mistakes). Plus some new cool tech that's being cooked in the labs.
That said, I have to say that you are doing the right thing. Your approach is logical and are asking the right questions. The world of networking has some accumulated mess due to historical reasons, and also has some real genius behind some of its protocols. This is why it is sometimes confusing as you ask yourself: why do we have X? Is X a genius that I am not foreseeing yet? Or is X an ancient mistake that we are stuck with? Or is it just some dudes that thought that everything must be in XML?
Buckle-up for the ride is gonna be fun!