Mikkel Damgaard

Skip to main content
< All Topics
Print

What is BGP, and how does it work?

BGP is a dynamic routing protocol used in many networks both internally and to externally connect networks. The benefits of BGP as your dynamic routing protocol, is that its reliable, widely supported and fairly simple to set up once you understand it. 

BGP Generel information

BGP on it self is not very handy becouse it relys on the routers routing table, therefore its reccommended to run BGP with an underlaying routing protocol like OSPF. 

When speaking about BGP its important to understand the difrenses between iBGP and eBGP. iBGP is used in an internal network where as eBGP are used to connect two networks externally. A rule i use to remember the difference is i think of it as ExternalBGP and InternalBGP, but remember it by whatever you find to be the best. 

Both iBGP  and eBGP uses AS ID’s, a AS ID is essentially an ID of a netowrk it could be a netowrk consisting of possible thousends of routers under one AS ID. This makes BGP ideal for VERY large networks such as the internet becouse possibly thousends of routers can be handled logicly as just one hop. 

Difrences between iBGP and eBGP

The key difrences between eBGP and iBGP is that iBGP is used in internal networks and eBGP is used to connect networks together externally. 

BGP uses an AS ID, the AS ID descirbes a logical network. AS3450 will logicaly viewed as one hop in BGP while it can be an array of possibly thousends of routers. 

Unlike other routing protocols, BGPs neighbrs has to be staticly configured, which really makes it realiable. Because BGP is a logical overlay running TCP connections on top of the routers routing table its recommend to use loopback interfaces for connecting neighbors. This ensures redundency as the TCP connection can reestablish connection to its neighbors loopback interface as long as another route to the loopback is availiable. 

When two routers share the same AS ID in a network it means they are becomming IBGP neighbors. It means they will delegate known routes to other routers with that same AS ID. 

When configuring a neighbor with another AS means you will be using eBGP and eBGP will work by advertising the networks it knows and put itself as the nexthop to these destination rather than delegating the routes itself. The neighbor can now use this information to create routes to those networks just by pointing to the AS ID it recived the networks from. 

eBGP explained

eBGP (Exterior Border Gateway Protocol) is used when you hace to connect two AS ID together, it simply works by one AS announces to the other AS what networks it knows. The reciving AS will know it can find these networks within the AS it recived them from and creating logical routes based on that. 

iBGP explained

iBGP is used to share routes in an internal network and works similar to other dynamic routing protocols. BGP runs as a TCP connection which means it relies on a convergent netowrk with static or dynamic routing. 

IBGP neigbors will only share their own routes with each other. This means to in a full mesh network with BGP all routers would need to be neighbors with each other, which can be a problem in large networks. 

iBGP is not as smart and self manageing as OSPF or other routing protocols, but it allows you as the administrator to gain more control to the network and route paths.

Route reflectors

IBGP scales very bad. This i becouse each router needs to be neighbors with all other routers in the network to ensure convergens. In a ISP network with thousends of routers this is not possible. This is why we need route reflectors, essentially what they do is they re-advertise routes learned from other IBGP neighbors. 

BEST PRACTICE

Always configure BGP with Loopback interfaces
It will ensure that neighbors can reach each other even if a interface breaks, if there is another route to the loopback, obtained from OSPF fx. 

Tags:
Table of Contents

Leave a Reply

Your email address will not be published. Required fields are marked *