All dynamic routing protocols serve a single purpose: to direct data traffic down the optimal path toward a destination when given the choice between multiple paths. The “dynamic” part refers to the protocol's ability to recalculate and re-route traffic when more optimal paths become available or when links along the most optimal path fail. That said, not all dynamic routing protocols are alike. Let's examine four of the most popular routing protocols used within enterprises today to see how they differ and where they are best used within network infrastructures.
RIPv2
Routing Information Protocol version 2 (RIPv2), was a common LAN routing protocol in the '90s, but is rapidly fading away in production networks. RIPv2 suffered from scalability issues due to a relatively low maximum hop count of 15 routing devices. Compared to more modern dynamic routing protocols, RIPv2's methods for selecting optimal routes and the substantial convergence time it takes to recalculate paths renders it nearly obsolete. Today, the only reason you might run across a network running RIPv2 is either that the network is very old and in serious need of an upgrade or the network is running cheaper, consumer-grade routing hardware that can only support RIP.
EIGRP
Like RIPv2, Enhanced Interior Gateway Routing Protocol (EIGRP) is a hybrid distance vector protocol. But in terms of scalability and convergence times, EIGRP blows RIPv2 out of the water. EIGRP is a popular choice for routing within campus networks both big and small. Many network engineers believe that EIGRP is the best choice for a routing protocol on private networks because it offers the best balance between speed, scalability and ease of management.
One drawback with EIGRP is that for a long time, it was a Cisco proprietary routing protocol that only ran on Cisco hardware and software. That limited deployment to networks that only ran Cisco gear. In 2013, Cisco opened EIGRP up as an IETF draft and some vendors have adopted EIGRP and offer it on their routers, switches, and associated gear. Regardless, you still need to be careful that every piece of equipment on your network that you want to run EIGRP on supports the protocol. Even Cisco's own Meraki line of layer 3 switches and security appliances offer no support for EIGRP. So this may be yet another once-popular routing protocol that will end up fading away.
OSPF
The main alternative to EIGRP for most campus LAN routing deployments is the Open Shortest Path First (OSPF) dynamic routing protocol. Unlike EIGRP, OSPF was always an open standard protocol and is an available option on virtually any modern enterprise network hardware made in the past two decades. While some say that OSPF is a bit more complicated to set up and manage compared to EIGRP, it's relatively easy to run once you get the hang of things such as autonomous system routing domains. Odds are that unless a network is very small, old or primarily Cisco, the dynamic routing protocol in use on the LAN will be OSPF.
BGP
The dynamic routing protocol that is the most different from all the others is the Border Gateway Protocol (BGP). RIP, EIGRP and OSPF are all interior gateway protocols (IGP) while BGP is an exterior gateway protocol (EGP). Basically, interior protocols are meant to dynamically route data across a network that you fully control and maintain. Exterior routing protocols are used to exchange routes between distinctly separate networks that you have no administrative control over. BGP is the routing protocol used on the internet; therefore, the most common enterprise use is to run BGP on your internet edge when connecting to your ISP.
Now, why use a dynamic routing protocol such as BGP for routing to the Internet as opposed to simply creating a static default route? The reason would be if you have multiple internet connections to multiple providers and want to provide automatic failover and load balancing capabilities. That means you have multiple paths or choices on which ISP is the best path in and out for specific destinations on the internet. BGP can be used to either dynamically fail over from one ISP link to another when the primary connection fails. BGP also can be configured to learn either full or partial routing tables to make better routing decisions based on the optimal outbound internet path to the destination router.
As you can see, routing protocols have their own pros and cons and situations where they work best. Because of this, many organizations run multiple routing protocols on the same network and use route redistribution techniques to get them to play nice with one another.