cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
16787
Views
30
Helpful
8
Replies

How BGP works ? just basic concept ..

mainodin87
Level 1
Level 1

Hi Guys,

I just want to know about how BGP works in simple terms.

Like EIGRP and OSPF uses Hello packets to discover neighbor maintains 3 table, how these terms work with BGP ?

Thank you,

Mainodin

1 Accepted Solution

Accepted Solutions

Peter Paluch
Cisco Employee
Cisco Employee

Mainodin,

You need to understand that what follows is a gross simplification of BGP so you have to take it that way.

BGP is actually very similar to RIP. In its core, just like RIP, it learns routes from different neighbors (in BGP called peers), adds its own routes, decides what path toward a particular destination is the best one, and for each known destination, sends this single best route to its peers.

Principial differences between BGP and internal routing protocols are (this list is not comprehensive):

  1. BGP uses TCP as the transport protocol, and consequently, it uses only unicast communication. Internal routing protocols (EIGRP, OSPF, RIP) use UDP or plain IP, and they use multicasts to talk to multiple directly connected neighbors at once.
  2. In BGP, every peer's address has to be specified manually. BGP does not discover its peers dynamically. A BGP session can only be created between two routers if they are both configured for mutual peering, referencing the other's address.
  3. As a consequence of the previous properties, BGP peers can be multiple hops apart. They do not need to be directly connected - as a matter of fact, very often, they aren't.
  4. BGP, as opposed to any internal routing protocol, has a concept of an autonomous system - a method of administratively defining which part of a larger network is under my control (my autonomous system) and which parts are under someone else's control (their autonomous systems).
  5. BGP operation differs depending on whether a router talks to a peer in the same autonomous system, or in a different autonomous system. One of the most important differences is the advertising of known routes: If talking to a peer in a different autonomous system (also called an external peer), the router can advertise any destination it knows about. If, however, talking to a peer in the same autonomous system (also called an internal peer), only routes learned from external peers and own routes can be advertised - in other words, a route learned from an internal peer cannot be advertised to another internal peer. This is a method of avoiding internal routing loops.
  6. BGP does not have a simple metric to decide whch path is the best. Instead, it advertises an extensive set of attributes with each route and uses a complex algorithm consisting of up to 13 steps to decide which path is the best.
  7. BGP messages are Open, Keepalive, Update, Notification, and Route-Refresh. The Open message is sent only at the beginning of the BGP session over an already established TCP connection. This Open message allows routers to compare their settings, decide what kinds of routes (IPv4, IPv6, etc.) shall be carried over this session, and negotiate their support of various BGP capabilities. The Keepalive message is sent periodically to verify whether the TCP connection is still up and running. The Update message is used to advertise and withdraw routing information. Finally, the Route-Refresh message asks the peer to send all its routes of a particular type again.
  8. It is difficult to talk about BGP tables because different sources claim that BGP maintains different sets of tables. However, what you are going to see on Cisco routers is the table of neighbors, the BGP table (also called BGP Routing Information Base, or BGP RIB - this one is similar to EIGRP's topology table), and then, of course, the router's normal routing table that receives the best paths determined by BGP's best path selection algorithm.

Would this help?

Best regards,
Peter

View solution in original post

8 Replies 8

BGP and "simple terms" ... Not sure if that's possible.

Start with the BGP-Chapter from the Cisco Technology Handbook:

http://docwiki.cisco.com/wiki/Border_Gateway_Protocol

Wikipedia has a lengthy article on BGP too:

https://en.wikipedia.org/wiki/Border_Gateway_Protocol

Peter Paluch
Cisco Employee
Cisco Employee

Mainodin,

You need to understand that what follows is a gross simplification of BGP so you have to take it that way.

BGP is actually very similar to RIP. In its core, just like RIP, it learns routes from different neighbors (in BGP called peers), adds its own routes, decides what path toward a particular destination is the best one, and for each known destination, sends this single best route to its peers.

Principial differences between BGP and internal routing protocols are (this list is not comprehensive):

  1. BGP uses TCP as the transport protocol, and consequently, it uses only unicast communication. Internal routing protocols (EIGRP, OSPF, RIP) use UDP or plain IP, and they use multicasts to talk to multiple directly connected neighbors at once.
  2. In BGP, every peer's address has to be specified manually. BGP does not discover its peers dynamically. A BGP session can only be created between two routers if they are both configured for mutual peering, referencing the other's address.
  3. As a consequence of the previous properties, BGP peers can be multiple hops apart. They do not need to be directly connected - as a matter of fact, very often, they aren't.
  4. BGP, as opposed to any internal routing protocol, has a concept of an autonomous system - a method of administratively defining which part of a larger network is under my control (my autonomous system) and which parts are under someone else's control (their autonomous systems).
  5. BGP operation differs depending on whether a router talks to a peer in the same autonomous system, or in a different autonomous system. One of the most important differences is the advertising of known routes: If talking to a peer in a different autonomous system (also called an external peer), the router can advertise any destination it knows about. If, however, talking to a peer in the same autonomous system (also called an internal peer), only routes learned from external peers and own routes can be advertised - in other words, a route learned from an internal peer cannot be advertised to another internal peer. This is a method of avoiding internal routing loops.
  6. BGP does not have a simple metric to decide whch path is the best. Instead, it advertises an extensive set of attributes with each route and uses a complex algorithm consisting of up to 13 steps to decide which path is the best.
  7. BGP messages are Open, Keepalive, Update, Notification, and Route-Refresh. The Open message is sent only at the beginning of the BGP session over an already established TCP connection. This Open message allows routers to compare their settings, decide what kinds of routes (IPv4, IPv6, etc.) shall be carried over this session, and negotiate their support of various BGP capabilities. The Keepalive message is sent periodically to verify whether the TCP connection is still up and running. The Update message is used to advertise and withdraw routing information. Finally, the Route-Refresh message asks the peer to send all its routes of a particular type again.
  8. It is difficult to talk about BGP tables because different sources claim that BGP maintains different sets of tables. However, what you are going to see on Cisco routers is the table of neighbors, the BGP table (also called BGP Routing Information Base, or BGP RIB - this one is similar to EIGRP's topology table), and then, of course, the router's normal routing table that receives the best paths determined by BGP's best path selection algorithm.

Would this help?

Best regards,
Peter

mainodin87
Level 1
Level 1

Hey Peter,

That was very well explained.

Please can you explain me some more stuff in a same way, how the packet or traffic flows from one AS to another AS if BGP is configured for communication between them.

Thank you,

Joseph W. Doherty
Hall of Fame
Hall of Fame

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

"BGP is actually very similar to RIP."  Laugh - personally, I often refer to BGP as super RIP.

Anyway, I just wanted to add a few notes to what Peter has already posted.

re: #3, BGP peers, being multiple hops apart, perhaps are more often found within the same AS, when using iBGP; directly connected BGP peers are perhaps more often found between ASs, when using eBGP.  BTW, usage rules vary between iBGP and eBGP, which is something not as much found within IGPs.  Also note, Peter's #5 is iBGP vs. eBGP.

Not mentioned by Peter, but perhaps an important part of BGP, BGP can carry user defined information, such as communities.  Often, complex routing policies are built around community attributes.  IGPs are often used just to support basic routing, but a common hallmark of BGP, is using it for supporting complex routing policies.  (NB: the other common hallmark for using BGP, is if there's need to deal with lots and lots [and lots] of routes, e.g. Internet routes.)

Hey Joseph,

Actually Peter is trying to explain it in simple terms as requested by me :p

Thanks for highlighting the main points, can you explain my next query please  ""how the packet or traffic flows from one AS to another AS if BGP is configured for communication between them""

:)

Disclaimer

The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.

Liability Disclaimer

In no event shall Author be liable for any damages wha2tsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.

Posting

"Actually Peter is trying to explain it in simple terms as requested by me :p"  Laugh - yes, I know, and in fact, I pondered whether I was going into too much additional detail, and/or whether I should add some additional disclaimer.  However, I went ahead with what I did to contrast what I thought were a couple of important operational differences of BGP vs. other IGPs, possibly important in understanding how BGP works, even for basic concepts.  ;)

As to your question "how the packet or traffic flows from one AS to another AS if BGP is configured for communication between them", actually by the point we get to traffic packet forwarding, BGP doesn't matter.  The router examines the packet's destination IP, against its route table, and determines forwarding disposition.

Where BGP comes into consideration, is regarding building the information that appears in the route table.  Now part of that, is as Peter and I already touched upon.  For example, if your AS was obtaining information from others ASs, with the same destination prefix, which AS destination is used?  Again, part of deciding what other AS destination prefix information to use is based on the Peter's point #6, but as I noted, BGP supports complex route policies, so a BGP route policy might change the "natural" result of #6.  (BTW, also don't forget, a router might be running one or more IGPs too, also containing the same destination prefix, so what's entered into the route table can depend on more than just BGP.)

Or, another example, multiple ASs provide information for the same destination prefix, but your BGP route policy is configured to "black list" that prefix.  So, the BGP prefix is dropped as received from your AS peers, so it never appears in the route table, so traffic being sent to that prefix is also dropped.  (BTW, an alternative to dropping the prefix and dropping packets, might be for the BGP policy to change the next hop for the "black listed" prefix to a null interface.  The router will forward packets to that interface, which effectively drops them.)

Hey Joseph,

That was nice and simple explanation, I think i need some more knowledge to understand it really well, so  i will go through http://docwiki.cisco.com/wiki/Border_Gateway_Protocol provided by karsten.

Will get back for any doubts.

Thank you,

And if you want to learn even more about BGP, look for a used copy of the CiscoPress Book "Internet Routing Architectures". It's old, but gives really good explanations if you already have a basic knowledge of routing.

Review Cisco Networking for a $25 gift card