Routing – iBGP and IGP relationship

bgpospfrouting

Let's say AS100 is a multihomed AS, connected to AS200 and AS300. It has two eBGP border routers – B1 is connected to AS200, B2 to AS300. The IGP inside AS100 is OSPF.

If B1 knows about AS200, and B2 knows about AS300, and AS100 has IGP protocol running in it, why would anyone need internal BGP (iBGP)?

I thought that's the point of OSPF – it tells every router inside AS about the reachable networks and the right paths, so two hosts from any pair of networks can communicate. So if B1 knows about AS200, I thought that IGP just steps in and tell everyone else in AS100, including B2, about networks from AS100.

But for some reason, iBGP is still needed between B1 and B2 to make thigs fully work. Is it because B2 needs to know exactly the same thing as B1 and vice versa and IGP isn't telling B2 all that B1 knows (not sure why)?

I'd be grateful if you could explain it in the most straighforward way.

Best Answer

It's not true that you always need iBGP. Many networks with eBGP run fine without it.

There are two scenarios where iBGP is important.

You are a transit provider. That means you allow traffic to pass through your AS. In your example, you allow AS 200 to reach AS 300 by going through you. In this case, B1 needs to know B2's routes so it can advertise them to AS 200, and vice versa. Your internal routers running OSPF don't need to know all these routes. So B1 talks to B2 using iBGP.

You have multiple border routers and they need to determine the best path out. You many have a default route drawing traffic to your edge, but then you may have several carriers from which to chose. B1 needs to know B2's routes so it can forward traffic to B2 if that's a better path.

This earlier SE question might help you too.

There are several good books on BGP design, and you would be served well by reading them. Look for books by Halabi, Stewart or Zhang.