Architecture Case Study: Routing with OSPF and BGP - Networking Workshop (part 2)

Table of contents

No heading

No headings in the article.

One of the most critical networking devices aside from the load balancer is the router. Without routers there would be no communication between computers in different subnets. Routers route network traffic between subnets but in order to do so they broadcast their location/routing information. These are grouped as Link State Advertisements, LSA and it means that routers broadcast the state of their links and advertise it over the network so other routers may take in that information.

Routing with LSA type 1 Architecture

The first type of advertisement routers broadcast are type 1 LSA's or a router LSA. This LSA is sent from an internal router to other routers and it shares the links it knows about. This ranges from sharing the state of the interface as up to interface down to sharing any relevant subnet information in the same area. LSAs serve as the very basis for making all routing communications possible over a network.

Screenshot 2022-04-19 8.40.50 AM.png

Routing with LSA type 2 Architecture

The second type of advertisement routers broadcast are type 2 LSA's or network LSA. This type of LSA is sent from one router to all other routers on the network. It selectively shares the different types of devices it comes across within an area. These LSAs serve as a secondary map for routers and the router is sharing this information for other routers to use. Without this LSA routers wouldn't know if one device was using BGP vs another using OSPF. This can cause serious network congestion, so it is important to know that these types of LSAs give critical information for routers to navigate.

Screenshot 2022-04-19 8.40.56 AM.png

Routing with LSA type 3 Architecture

The third type of advertisement routers broadcast are type 3 LSA's or summary of a LSA. This type of LSA is a summary of routes from another area. These routes are advertised by routers to announce the routes to other routers in a different area or network. These LSAs serve as a GPS for routers that don't know where to go outside of their respective network. This is what allows businesses to communicate with each other over different networks seamlessly. Without this LSA routers wouldn't know where to go outside of their subnet. This can cause packet loss and create other issues, so it is important to know that these types of LSAs must be enabled to give that critical information routers need to navigate.

Screenshot 2022-04-16 1.54.13 PM.png

Routes with BGP within an Architecture (Adjusting Attribute Weights)

Now that we've covered how routers communicate with each other, we can cover how we can prioritize our routes using BGP. This is important because sometimes you may have two routes and one needs to be prioritized over another. As humans we know that both of those IP addresses must be in different subnets, but a router doesn't know. To solve this, we can add weights to each route. Routers prefer the path with the largest weight. By doing this we can set up failover routing, as well as a preferred route.

Screenshot 2022-04-16 1.54.17 PM.png

Routes with BGP within an Architecture (Adjusting Local Pref)

Another way to prioritize a route is adjusting the local pref. This is another BGP attribute that determines how traffic leaves a network. Routers typically have multiple inbound and outbound routes. Sometimes attribute weights are not enough, and one still needs to prioritize one route over another. To solve this, we can add a weight to each route knowing routers prefer the path with the largest local pref. By doing this, the routers will only use the outbound routes associated with the area's local pref attributes.

Screenshot 2022-04-16 2.07.24 PM.png

Routes with BGP within an Architecture (Prepending AS path)

The final way to prioritize a route is adjusting the AS path. AS stands for autonomous system and it is used to identify an individual system or organization. This is another BGP attribute that determines how traffic leaves an autonomous system. Sometimes a local pref isn't enough, and one still needs to prioritize one route over another. To do this, we can add an AS path number to each route knowing routers prefer the path with the shortest AS path. Every system has a unique AS path number so if both AS path numbers are the same, you can double the amount on one making it heavier.

Screenshot 2022-04-16 1.54.25 PM.png

Routing with OSPF internally & BGP externally

OSPF and BGP are both routing protocols that describe and dictate how routers route traffic from one location to another. Both serve different functions and both are used within routing. OSPF is an interior gateway protocol and operates within a single autonomous system. That means it works internally within a single organization and utilizes link state advertisements. OSPF stands for Open Shortest Path First, which allows routers to route to the next router in the fastest way possible. BGP is an exterior gateway protocol designed to exchange routing and reachability information between autonomous systems. Both of these protocols can both be used in the same environment and below is an example of how it'd look.

Screenshot 2022-04-16 6.52.45 PM.png

Direct Connections with BGP

Direct Connections or Private Links are network connections that do not utilize the internet for connectivity. They are private connections that can operate without the Internet. These connections still utilize BGP because it involves two separate autonomous systems communicating with each other. Routing between these systems requires system identifiers to differentiate source from destination.

Screenshot 2022-04-16 1.54.33 PM.png

Direct Connections with Transit Gateway with BGP

Finally, there are networking scenarios that will require you to connect to other organizations in other regions within your own organization. These external partners typically utilize the same cloud as your organization and their respective CEOs would like to communicate with each other. In order to do this one must provision a transit gateway so that each autonomous system can register its number and associate it with the transit gateway. This will allow your organization, which serves as its own autonomous system, to connect to the external partners associated with the transit gateway.

Screenshot 2022-04-16 6.52.51 PM.png

NB: This architecture is a high-level representation as the full one will be more detailed and much more complex. The intended audience is the general public.

Thank you for your time, and I hope you enjoyed this architecture study case.

Dan, the Architect.

  • May the cloud be with you!