You want two routers to share routing information with each other using the ospf routing protocol.

Article 2 of 4

Part of: A closer look at Border Gateway Protocol

BGP and OSPF are two of the most common routing protocols. While BGP excels with dynamic routing for large networks, OSPF offers more efficient path choice and convergence speed.

Border Gateway Protocol, or BGP, and Open Shortest Path First, or OSPF, are two of the most popular, standards-based dynamic routing protocols used around the world.

Although BGP and OSPF are both dynamic routing protocols and perform similar tasks, they calculate their routing decisions and advertise routes in different ways. Thus, some situations favor BGP as a protocol, while others prefer OSPF.

Let's learn more about how each routing protocol works and when one should be used over the other.

How does BGP work?

BGP is known as an exterior gateway protocol. It was designed to share routing information between disparate networks, known as autonomous systems (ASes). When multiple BGP-derived paths exist, the protocol chooses a path to send traffic based on several criteria, including the following:

  • the highest locally derived preference number, called a weight;
  • the path with the highest local preference;
  • path origin (network or aggregate);
  • shortest AS path to the destination network;
  • lowest multiexit discriminator; and
  • preferred paths coming from intra-AS, such as internal BGP, or extra-AS, such as external BGP.

Local administrators can manipulate many of these criteria to force traffic to a preferred path. However, when routers connect to neighbors in differing ASes, the local AS routers can't control which path neighboring routers will choose for inbound traffic. Thus, BGP has less control over manipulating traffic paths when communicating with external networks.

BGP is highly efficient and requires low compute and memory resources compared with most routing protocols. Therefore, it can handle dynamic routing for the largest networks. The internet, for example, uses BGP to interconnect ISPs and organizations that own a public AS and use multiple dynamic paths to the internet. This is useful if a primary ISP link fails because BGP will dynamically shift traffic destined to the internet to the secondary ISP link.

The following diagram shows an example company's internet architecture using AS 1010, which is connected to ISPs using AS 101 and AS 201. The router in AS 1010 runs BGP and has formed neighborships between the two ISPs. Depending on the path selection to remote networks on the internet, BGP will choose to send traffic out to ISP 1 or ISP 2. Additionally, if one of the two ISP links goes down, BGP will remove the downed path from the routing table and forward all traffic to the remaining active and healthy path.

This diagram depicts how BGP can be used for redundancy when traffic travels to the internet.

BGP use cases

BGP is not only commonly deployed at the corporate internet edge, but also other network edge locations, such as the WAN or links between the corporate network and IaaS clouds. This is because BGP scales well, uses a deterministic path selection process and is the de facto standard when dynamically routing between networks that are owned and operated by separate organizations.

How does OSPF work?

Unlike BGP, OSPF is an interior gateway protocol that is most often used within a company's private LAN. OSPF is generally considered easier to deploy and manage compared with BGP and requires little manual adjustment to operate in most corporate settings.

OSPF maintains a database of locally derived and learned networks. If multiple OSPF paths to remote networks exist, OSPF chooses a path based on the lowest calculated cost or metric. The path cost to a remote network is based on the total calculated reference bandwidth divided by interface bandwidth. Reference bandwidth is a number used within OSPF to quantify the speed of a link.

The lower the number, the faster the connection. For example, a 100 Mbps link has an OSPF reference bandwidth of 10, while a 1 Gbps link has a reference bandwidth of 1. Network admins can adjust this calculation as needed.

The bottom line is that OSPF uses path bandwidth as a major factor when determining path selection. Thus, it's more likely to choose the optimal path based on network performance when compared with BGP.

OSPF use cases

Unlike BGP, OSPF is fairly CPU- and memory-intensive to operate. As such, it isn't ideal for extremely large networks. While OSPF can scale to handle large networks with hundreds of routes, administrators must take care to reduce processing and memory overhead using manual adjustments, more so than with BGP.

OSPF has faster convergence times than BGP. Network convergence is the speed at which a router can adjust the path used to a destination network if a network outage occurs. Because of its convergence speed and ability to choose paths based on network performance, OSPF is a better choice within corporate LANs and private data centers.

In some situations, OSPF can also be used for dynamically learned WAN routes and connectivity to IaaS clouds. However, the following issues lend to the idea that OSPF is best used within the confines of a singularly managed corporate LAN:

  • a lack of multicast communication;
  • higher memory and CPU needs; and
  • a general lack of intercompany dynamic routing capabilities.

Where should BGP and OSPF be used in the enterprise?

While some exceptions exist, BGP is most often used for internet redundancy, WAN and IaaS environments. OSPF is primarily used for the LAN and data center but can also occasionally work in WAN and IaaS environments.

BGP is most often used for internet redundancy, WAN and IaaS environments, while OSPF is primarily used for the LAN and data center.

Next Steps

BGP tutorial: How the routing protocol works

BGP vs. EIGRP: What's the difference?

This was last published in July 2021

Dig Deeper on Network Infrastructure

  • router

    By: Alissa Irei

  • BGP (Border Gateway Protocol)

    By: John Burke

  • Static vs. dynamic routing: What is the difference?

    By: David Jacobs

  • 12 common network protocols and their functions explained

    By: Michaela Goss

Part of: A closer look at Border Gateway Protocol

Article 2 of 4

How does OSPF share routes?

Each OSPF router distributes information about its local state (usable interfaces and reachable neighbors, and the cost of using each interface) to other routers using a Link State Advertisement (LSA) message.

How do two routers communicate with each other?

Routers tell each other routes to subnetworks; only the local routers need to be able to send to specific machines (and that's what MAC addresses and ARP are for). Routers talk to each other about routes via BGP; from time to some, some ISP messes up there and large chunks of the internet cease to work.

Which of the following does OSPF use to create and maintain routing tables?

OSPF messages are used to create and maintain three OSPF databases: the adjacency database creates the neighbor table, the link-state database (LSDB) creates the topology table, and the forwarding database creates the routing table.

What is the name of the relationship between two OSPF devices that are connected together and exchange link state information?

Adjacency An adjacency is a relationship between two OSPF routers that permits the direct exchange of route updates.

zusammenhängende Posts

Toplist

Neuester Beitrag

Stichworte